mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 14:53:26 +08:00
【优化】移除旧版自定义交易组件。
This commit is contained in:
@@ -2957,158 +2957,6 @@ namespace CoreCms.Net.Configuration
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 自定义交易组件
|
||||
|
||||
/// <summary>
|
||||
/// 售后订单状态
|
||||
/// </summary>
|
||||
public enum ShopAftersaleAddStatus
|
||||
{
|
||||
未受理 = 0,
|
||||
用户取消 = 1,
|
||||
商家受理中 = 2,
|
||||
商家逾期未处理 = 3,
|
||||
商家拒绝退款 = 4,
|
||||
商家拒绝退货退款 = 5,
|
||||
待买家退货 = 6,
|
||||
退货退款关闭 = 7,
|
||||
待商家收货 = 8,
|
||||
商家退款中 = 11,
|
||||
商家逾期未退款 = 12,
|
||||
退款完成 = 13,
|
||||
退货退款完成 = 14,
|
||||
换货完成 = 15,
|
||||
待商家发货 = 16,
|
||||
待用户确认收货 = 17,
|
||||
商家拒绝换货 = 18,
|
||||
商家已收到货 = 19
|
||||
}
|
||||
/// <summary>
|
||||
/// 售后类型
|
||||
/// </summary>
|
||||
public enum ShopAftersaleAddType
|
||||
{
|
||||
退款 = 0,
|
||||
退款退货 = 1,
|
||||
换货 = 2
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 品牌审核-认证审核类型
|
||||
/// </summary>
|
||||
public enum RegisterType
|
||||
{
|
||||
国内品牌申请R标 = 1,
|
||||
国内品牌申请TM标 = 2,
|
||||
海外品牌申请R标 = 3,
|
||||
海外品牌申请TM标 = 4
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 品牌审核-商标分类
|
||||
/// </summary>
|
||||
public enum TrademarkType
|
||||
{
|
||||
第1类 = 1,
|
||||
第2类 = 2,
|
||||
第3类 = 3,
|
||||
第4类 = 4,
|
||||
第5类 = 5,
|
||||
第6类 = 6,
|
||||
第7类 = 7,
|
||||
第8类 = 8,
|
||||
第9类 = 9,
|
||||
第10类 = 10,
|
||||
第11类 = 11,
|
||||
第12类 = 12,
|
||||
第13类 = 13,
|
||||
第14类 = 14,
|
||||
第15类 = 15,
|
||||
第16类 = 16,
|
||||
第17类 = 17,
|
||||
第18类 = 18,
|
||||
第19类 = 19,
|
||||
第20类 = 20,
|
||||
第21类 = 21,
|
||||
第22类 = 22,
|
||||
第23类 = 23,
|
||||
第24类 = 24,
|
||||
第25类 = 25,
|
||||
第26类 = 26,
|
||||
第27类 = 27,
|
||||
第28类 = 28,
|
||||
第29类 = 29,
|
||||
第30类 = 30,
|
||||
第31类 = 31,
|
||||
第32类 = 32,
|
||||
第33类 = 33,
|
||||
第34类 = 34,
|
||||
第35类 = 35,
|
||||
第36类 = 36,
|
||||
第37类 = 37,
|
||||
第38类 = 38,
|
||||
第39类 = 39,
|
||||
第40类 = 40,
|
||||
第41类 = 41,
|
||||
第42类 = 42,
|
||||
第43类 = 43,
|
||||
第44类 = 44,
|
||||
第45类 = 45,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 品牌审核-品牌经营类型
|
||||
/// </summary>
|
||||
public enum BrandManagementType
|
||||
{
|
||||
自有品牌 = 1,
|
||||
代理品牌 = 2,
|
||||
无品牌 = 3
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 品牌审核-商品产地是否进口
|
||||
/// </summary>
|
||||
public enum CommodityOriginType
|
||||
{
|
||||
是 = 1,
|
||||
否 = 2
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 下单前置检查-是否需要推单
|
||||
/// </summary>
|
||||
public enum RequireOrderType
|
||||
{
|
||||
需要 = 1,
|
||||
不需要 = 2
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 下单前置检查-商户订单类型(原则上只能是1,应为官方文档说以后只有1,所以我们也只是用1)
|
||||
/// </summary>
|
||||
public enum RequiredFundType
|
||||
{
|
||||
非二级商户号订单 = 0,
|
||||
二级商户号订单 = 1,
|
||||
两种方式皆可 = 2,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 下单前置检查-商户订单类型(原则上只能是1,应为官方文档说以后只有1,所以我们也只是用1)
|
||||
/// </summary>
|
||||
public enum PayMethodType
|
||||
{
|
||||
微信支付 = 0,
|
||||
货到付款 = 1,
|
||||
商家会员储蓄卡 = 2,
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 佣金相关
|
||||
@@ -3169,7 +3017,6 @@ namespace CoreCms.Net.Configuration
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 公众号
|
||||
/// <summary>
|
||||
/// 公众号所属类型
|
||||
|
||||
@@ -34,10 +34,6 @@ namespace CoreCms.Net.Core.Config
|
||||
typeof(OrderAutomaticDeliverySubscribe),
|
||||
typeof(OrderFinishCommandSubscribe),
|
||||
typeof(OrderPrintSubscribe),
|
||||
typeof(TCOrderAfterSaleCreateSyncSubscribe),
|
||||
typeof(TCOrderDeliveryRecieveSyncSubscribe),
|
||||
typeof(TCOrderShipSyncSubscribe),
|
||||
//typeof(TCPayOrderSyncSubscribe),
|
||||
typeof(UserSubscribe),
|
||||
typeof(WeChatPayNoticeSubscribe),
|
||||
typeof(SendWxTemplateMessageSubscribe),
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/6/29 16:22:45
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
namespace CoreCms.Net.IRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// 微信交易组件下单前置检查 工厂接口
|
||||
/// </summary>
|
||||
public interface ICoreCmsCheckBeforeAddOrderRepository : IBaseRepository<CoreCmsCheckBeforeAddOrder>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/8/1 22:53:11
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using CoreCms.Net.Model.Entities;
|
||||
|
||||
namespace CoreCms.Net.IRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// 工厂接口
|
||||
/// </summary>
|
||||
public interface
|
||||
IWeChatTransactionComponentAuditCategoryAuditLogRepository : IBaseRepository<
|
||||
WeChatTransactionComponentAuditCategoryAuditLog>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
namespace CoreCms.Net.IRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件上传类目资质 工厂接口
|
||||
/// </summary>
|
||||
public interface IWeChatTransactionComponentAuditCategoryRepository : IBaseRepository<WeChatTransactionComponentAuditCategory>
|
||||
{
|
||||
#region 重写增删改查操作===========================================================
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
Task<AdminUiCallBack> UpdateAsync(WeChatTransactionComponentAuditCategory entity);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<AdminUiCallBack> DeleteByIdAsync(object id);
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
/// <param name="predicate">判断集合</param>
|
||||
/// <param name="orderByType">排序方式</param>
|
||||
/// <param name="pageIndex">当前页面索引</param>
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
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);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
namespace CoreCms.Net.IRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件上传品牌信息审核结果日志 工厂接口
|
||||
/// </summary>
|
||||
public interface IWeChatTransactionComponentBrandAuditLogRepository : IBaseRepository<WeChatTransactionComponentBrandAuditLog>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/3/20 1:01:47
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
namespace CoreCms.Net.IRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件上传品牌信息 工厂接口
|
||||
/// </summary>
|
||||
public interface IWeChatTransactionComponentBrandAuditRepository : IBaseRepository<WeChatTransactionComponentBrandAudit>
|
||||
{
|
||||
#region 重写增删改查操作===========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
Task<AdminUiCallBack> InsertAsync(WeChatTransactionComponentBrandAudit entity);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
Task<AdminUiCallBack> UpdateAsync(WeChatTransactionComponentBrandAudit entity);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<AdminUiCallBack> DeleteByIdAsync(object id);
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
/// <param name="predicate">判断集合</param>
|
||||
/// <param name="orderByType">排序方式</param>
|
||||
/// <param name="pageIndex">当前页面索引</param>
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
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);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
namespace CoreCms.Net.IRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件快递公司 工厂接口
|
||||
/// </summary>
|
||||
public interface IWeChatTransactionComponentDeliveryCompanyRepository : IBaseRepository<WeChatTransactionComponentDeliveryCompany>
|
||||
{
|
||||
|
||||
#region 获取缓存的所有数据==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 获取缓存的所有数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<WeChatTransactionComponentDeliveryCompany>> GetCaChe();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
/// <param name="predicate">判断集合</param>
|
||||
/// <param name="orderByType">排序方式</param>
|
||||
/// <param name="pageIndex">当前页面索引</param>
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
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);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/8/1 22:18:06
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using CoreCms.Net.Model.Entities;
|
||||
|
||||
namespace CoreCms.Net.IRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件商品审核回调 工厂接口
|
||||
/// </summary>
|
||||
public interface
|
||||
IWeChatTransactionComponentGoodAuditLogRepository : IBaseRepository<WeChatTransactionComponentGoodAuditLog>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
namespace CoreCms.Net.IRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件商品列表 工厂接口
|
||||
/// </summary>
|
||||
public interface IWeChatTransactionComponentGoodRepository : IBaseRepository<WeChatTransactionComponentGood>
|
||||
{
|
||||
#region 重写增删改查操作===========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
Task<AdminUiCallBack> InsertAsync(WeChatTransactionComponentGood entity);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
Task<AdminUiCallBack> UpdateAsync(WeChatTransactionComponentGood entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<AdminUiCallBack> DeleteByIdAsync(object id);
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
/// <param name="predicate">判断集合</param>
|
||||
/// <param name="orderByType">排序方式</param>
|
||||
/// <param name="pageIndex">当前页面索引</param>
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
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);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
namespace CoreCms.Net.IRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件商品关联sku列表 工厂接口
|
||||
/// </summary>
|
||||
public interface IWeChatTransactionComponentGoodSKURepository : IBaseRepository<WeChatTransactionComponentGoodSKU>
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
Task<AdminUiCallBack> UpdateAsync(List<WeChatTransactionComponentGoodSKU> entity);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.Model.Entities;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
namespace CoreCms.Net.IRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件提交订单 工厂接口
|
||||
/// </summary>
|
||||
public interface IWeChatTransactionComponentOrderRepository : IBaseRepository<WeChatTransactionComponentOrder>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
namespace CoreCms.Net.IRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件三级类目 工厂接口
|
||||
/// </summary>
|
||||
public interface IWeChatTransactionComponentThirdCategoryRepository : IBaseRepository<WeChatTransactionComponentThirdCategory>
|
||||
{
|
||||
|
||||
/// <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>
|
||||
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);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ namespace CoreCms.Net.IServices
|
||||
/// <param name="shipAreaId">省市区id</param>
|
||||
/// <param name="shipAddress">收货地址</param>
|
||||
/// <param name="memo">发货描述</param>
|
||||
/// <param name="deliveryCompanyId">直播物流编码</param>
|
||||
/// <param name="deliveryCompanyId">第三方对接物流编码</param>
|
||||
/// <returns></returns>
|
||||
Task<WebApiCallBack> BatchShip(string[] orderId, string logiCode, string logiNo, Dictionary<int, int> items,
|
||||
int storeId = 0, string shipName = "", string shipMobile = "", int shipAreaId = 0, string shipAddress = "",
|
||||
@@ -54,7 +54,7 @@ namespace CoreCms.Net.IServices
|
||||
/// <param name="shipAreaId">省市区id</param>
|
||||
/// <param name="shipAddress">收货地址</param>
|
||||
/// <param name="memo">发货描述</param>
|
||||
/// <param name="deliveryCompanyId">直播物流编码</param>
|
||||
/// <param name="deliveryCompanyId">第三方对接物流编码</param>
|
||||
/// <returns></returns>
|
||||
Task<WebApiCallBack> Ship(string orderId, string logiCode, string logiNo, Dictionary<int, int> items,
|
||||
int storeId = 0, string shipName = "", string shipMobile = "", int shipAreaId = 0, string shipAddress = "",
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/6/29 16:22:45
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.IServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 微信交易组件下单前置检查 服务工厂接口
|
||||
/// </summary>
|
||||
public interface ICoreCmsCheckBeforeAddOrderServices : IBaseServices<CoreCmsCheckBeforeAddOrder>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -213,7 +213,7 @@ namespace CoreCms.Net.IServices
|
||||
/// <param name="memo">发货描述</param>
|
||||
/// <param name="storeId">店铺收货地址</param>
|
||||
/// <param name="shipAreaId">省市区id</param>
|
||||
/// <param name="deliveryCompanyId">直播物流编码</param>
|
||||
/// <param name="deliveryCompanyId">第三方对接物流编码</param>
|
||||
/// <returns></returns>
|
||||
Task<WebApiCallBack> BatchShip(string[] ids, string logiCode, string logiNo,
|
||||
Dictionary<int, int> items, string shipName, string shipMobile, string shipAddress, string memo,
|
||||
@@ -232,7 +232,7 @@ namespace CoreCms.Net.IServices
|
||||
/// <param name="memo">发货描述</param>
|
||||
/// <param name="storeId">店铺收货地址</param>
|
||||
/// <param name="shipAreaId">省市区id</param>
|
||||
/// <param name="deliveryCompanyId">直播物流编码</param>
|
||||
/// <param name="deliveryCompanyId">第三方对接物流编码</param>
|
||||
/// <returns></returns>
|
||||
Task<WebApiCallBack> Ship(string ids, string logiCode, string logiNo,
|
||||
Dictionary<int, int> items, string shipName, string shipMobile, string shipAddress, string memo,
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.IServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件类目审核回调 服务工厂接口
|
||||
/// </summary>
|
||||
public interface IWeChatTransactionComponentAuditCategoryAuditLogServices : IBaseServices<WeChatTransactionComponentAuditCategoryAuditLog>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.IServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件上传类目资质 服务工厂接口
|
||||
/// </summary>
|
||||
public interface IWeChatTransactionComponentAuditCategoryServices : IBaseServices<WeChatTransactionComponentAuditCategory>
|
||||
{
|
||||
#region 重写增删改查操作===========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
Task<AdminUiCallBack> InsertAsync(WeChatTransactionComponentAuditCategory entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
Task<AdminUiCallBack> UpdateAsync(WeChatTransactionComponentAuditCategory entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<AdminUiCallBack> DeleteByIdAsync(object id);
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 刷新审核状态
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
Task<AdminUiCallBack> RefreshStatus(WeChatTransactionComponentAuditCategory entity);
|
||||
|
||||
|
||||
#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>
|
||||
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);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.IServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件上传品牌信息审核结果日志 服务工厂接口
|
||||
/// </summary>
|
||||
public interface IWeChatTransactionComponentBrandAuditLogServices : IBaseServices<WeChatTransactionComponentBrandAuditLog>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/3/20 1:01:47
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.IServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件上传品牌信息 服务工厂接口
|
||||
/// </summary>
|
||||
public interface IWeChatTransactionComponentBrandAuditServices : IBaseServices<WeChatTransactionComponentBrandAudit>
|
||||
{
|
||||
#region 重写增删改查操作===========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
Task<AdminUiCallBack> InsertAsync(WeChatTransactionComponentBrandAudit entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
Task<AdminUiCallBack> UpdateAsync(WeChatTransactionComponentBrandAudit entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<AdminUiCallBack> DeleteByIdAsync(object id);
|
||||
|
||||
#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>
|
||||
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);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.IServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件快递公司 服务工厂接口
|
||||
/// </summary>
|
||||
public interface IWeChatTransactionComponentDeliveryCompanyServices : IBaseServices<WeChatTransactionComponentDeliveryCompany>
|
||||
{
|
||||
|
||||
#region 获取缓存的所有数据==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 获取缓存的所有数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<WeChatTransactionComponentDeliveryCompany>> GetCaChe();
|
||||
|
||||
#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>
|
||||
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);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.IServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件商品审核回调 服务工厂接口
|
||||
/// </summary>
|
||||
public interface IWeChatTransactionComponentGoodAuditLogServices : IBaseServices<WeChatTransactionComponentGoodAuditLog>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.IServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件商品关联sku列表 服务工厂接口
|
||||
/// </summary>
|
||||
public interface IWeChatTransactionComponentGoodSKUServices : IBaseServices<WeChatTransactionComponentGoodSKU>
|
||||
{
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
Task<AdminUiCallBack> UpdateAsync(List<WeChatTransactionComponentGoodSKU> entity);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.IServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件商品列表 服务工厂接口
|
||||
/// </summary>
|
||||
public interface IWeChatTransactionComponentGoodServices : IBaseServices<WeChatTransactionComponentGood>
|
||||
{
|
||||
#region 重写增删改查操作===========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
Task<AdminUiCallBack> InsertAsync(WeChatTransactionComponentGood entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
Task<AdminUiCallBack> UpdateAsync(WeChatTransactionComponentGood entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<AdminUiCallBack> DeleteByIdAsync(object id);
|
||||
|
||||
#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>
|
||||
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);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.Model.Entities;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.IServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件提交订单 服务工厂接口
|
||||
/// </summary>
|
||||
public interface IWeChatTransactionComponentOrderServices : IBaseServices<WeChatTransactionComponentOrder>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.IServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件三级类目 服务工厂接口
|
||||
/// </summary>
|
||||
public interface IWeChatTransactionComponentThirdCategoryServices : IBaseServices<WeChatTransactionComponentThirdCategory>
|
||||
{
|
||||
#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>
|
||||
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);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -227,12 +227,5 @@ namespace CoreCms.Net.Model.Entities
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string userNickName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 交易组件订单
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public WeChatTransactionComponentOrder tcOrder { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,200 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/7/14 23:14:23
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using SqlSugar;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CoreCms.Net.Model.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件上传类目资质
|
||||
/// </summary>
|
||||
public partial class WeChatTransactionComponentAuditCategory
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
public WeChatTransactionComponentAuditCategory()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 序列
|
||||
/// </summary>
|
||||
[Display(Name = "序列")]
|
||||
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 营业执照或组织机构代码证
|
||||
/// </summary>
|
||||
[Display(Name = "营业执照或组织机构代码证")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:255,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String licenseImage { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 一级类目
|
||||
/// </summary>
|
||||
[Display(Name = "一级类目")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 level1 { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 一级类目名称
|
||||
/// </summary>
|
||||
[Display(Name = "一级类目名称")]
|
||||
|
||||
|
||||
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String level1Name { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 二级类目
|
||||
/// </summary>
|
||||
[Display(Name = "二级类目")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 level2 { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 二级类目名称
|
||||
/// </summary>
|
||||
[Display(Name = "二级类目名称")]
|
||||
|
||||
|
||||
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String level2Name { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 三级类目
|
||||
/// </summary>
|
||||
[Display(Name = "三级类目")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 level3 { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 三级类目名称
|
||||
/// </summary>
|
||||
[Display(Name = "三级类目名称")]
|
||||
|
||||
|
||||
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String level3Name { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 资质材料
|
||||
/// </summary>
|
||||
[Display(Name = "资质材料")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.String certificateImage { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 审核单
|
||||
/// </summary>
|
||||
[Display(Name = "审核单")]
|
||||
|
||||
|
||||
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String auditId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 审核状态
|
||||
/// </summary>
|
||||
[Display(Name = "审核状态")]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.Int32? status { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 品牌id
|
||||
/// </summary>
|
||||
[Display(Name = "品牌id")]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.Int32? brandId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 拒绝原因
|
||||
/// </summary>
|
||||
[Display(Name = "拒绝原因")]
|
||||
|
||||
|
||||
[StringLength(maximumLength:255,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String rejectReason { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[Display(Name = "创建时间")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.DateTime createTime { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,104 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/8/1 22:54:37
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using SqlSugar;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CoreCms.Net.Model.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件类目审核回调
|
||||
/// </summary>
|
||||
public partial class WeChatTransactionComponentAuditCategoryAuditLog
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
public WeChatTransactionComponentAuditCategoryAuditLog()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 序列
|
||||
/// </summary>
|
||||
[Display(Name = "序列")]
|
||||
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 审核id
|
||||
/// </summary>
|
||||
[Display(Name = "审核id")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String auditId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 审核状态,1:已通过,9:拒绝
|
||||
/// </summary>
|
||||
[Display(Name = "审核状态,1:已通过,9:拒绝")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 status { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 审核类型,本接口固定为2
|
||||
/// </summary>
|
||||
[Display(Name = "审核类型,本接口固定为2")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 auditType { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 相关信息
|
||||
/// </summary>
|
||||
[Display(Name = "相关信息")]
|
||||
|
||||
|
||||
[StringLength(maximumLength:250,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String rejectReason { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 数据创建时间
|
||||
/// </summary>
|
||||
[Display(Name = "数据创建时间")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.DateTime createTime { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,308 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/3/21 3:39:55
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using SqlSugar;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CoreCms.Net.Model.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件上传品牌信息
|
||||
/// </summary>
|
||||
public partial class WeChatTransactionComponentBrandAudit
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
public WeChatTransactionComponentBrandAudit()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 序列
|
||||
/// </summary>
|
||||
[Display(Name = "序列")]
|
||||
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 营业执照或组织机构代码证
|
||||
/// </summary>
|
||||
[Display(Name = "营业执照或组织机构代码证")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:500,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String license { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 认证审核类型
|
||||
/// </summary>
|
||||
[Display(Name = "认证审核类型")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 brand_audit_type { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商标分类
|
||||
/// </summary>
|
||||
[Display(Name = "商标分类")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:10,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String trademark_type { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 经营类型
|
||||
/// </summary>
|
||||
[Display(Name = "经营类型")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 brand_management_type { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商品产地是否进口
|
||||
/// </summary>
|
||||
[Display(Name = "商品产地是否进口")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 commodity_origin_type { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商标/品牌词
|
||||
/// </summary>
|
||||
[Display(Name = "商标/品牌词")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String brand_wording { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 销售授权书
|
||||
/// </summary>
|
||||
[Display(Name = "销售授权书")]
|
||||
|
||||
|
||||
[StringLength(maximumLength:500,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String sale_authorization { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商标注册证书
|
||||
/// </summary>
|
||||
[Display(Name = "商标注册证书")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:500,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String trademark_registration_certificate { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商标变更证明
|
||||
/// </summary>
|
||||
[Display(Name = "商标变更证明")]
|
||||
|
||||
|
||||
[StringLength(maximumLength:500,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String trademark_change_certificate { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商标注册人姓名
|
||||
/// </summary>
|
||||
[Display(Name = "商标注册人姓名")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:100,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String trademark_registrant { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商标注册号/申请号
|
||||
/// </summary>
|
||||
[Display(Name = "商标注册号/申请号")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:10,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String trademark_registrant_nu { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商标有效期
|
||||
/// </summary>
|
||||
[Display(Name = "商标有效期")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.DateTime trademark_authorization_period { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商标注册申请受理通知书
|
||||
/// </summary>
|
||||
[Display(Name = "商标注册申请受理通知书")]
|
||||
|
||||
|
||||
[StringLength(maximumLength:100,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String trademark_registration_application { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商标申请人姓名
|
||||
/// </summary>
|
||||
[Display(Name = "商标申请人姓名")]
|
||||
|
||||
|
||||
[StringLength(maximumLength:100,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String trademark_applicant { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商标申请时间
|
||||
/// </summary>
|
||||
[Display(Name = "商标申请时间")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.DateTime trademark_application_time { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 中华人民共和国海关进口货物报关单
|
||||
/// </summary>
|
||||
[Display(Name = "中华人民共和国海关进口货物报关单")]
|
||||
|
||||
|
||||
[StringLength(maximumLength:500,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String imported_goods_form { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商品使用场景
|
||||
/// </summary>
|
||||
[Display(Name = "商品使用场景")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 scene_group_list { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 审核单id
|
||||
/// </summary>
|
||||
[Display(Name = "审核单id")]
|
||||
|
||||
|
||||
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String audit_id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 审核状态
|
||||
/// </summary>
|
||||
[Display(Name = "审核状态")]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.Int32? status { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 品牌id
|
||||
/// </summary>
|
||||
[Display(Name = "品牌id")]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.Int32? brandId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 拒绝原因
|
||||
/// </summary>
|
||||
[Display(Name = "拒绝原因")]
|
||||
|
||||
|
||||
[StringLength(maximumLength:255,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String rejectReason { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[Display(Name = "创建时间")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.DateTime createTime { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,116 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/3/21 3:30:18
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using SqlSugar;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CoreCms.Net.Model.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件上传品牌信息审核结果日志
|
||||
/// </summary>
|
||||
public partial class WeChatTransactionComponentBrandAuditLog
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
public WeChatTransactionComponentBrandAuditLog()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 序列
|
||||
/// </summary>
|
||||
[Display(Name = "序列")]
|
||||
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 审核Id
|
||||
/// </summary>
|
||||
[Display(Name = "审核Id")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String audit_id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 审核状态,1:已通过,9:拒绝
|
||||
/// </summary>
|
||||
[Display(Name = "审核状态,1:已通过,9:拒绝")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 status { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 审核类型,本接口固定为1
|
||||
/// </summary>
|
||||
[Display(Name = "审核类型,本接口固定为1")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 audit_type { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 相关信息
|
||||
/// </summary>
|
||||
[Display(Name = "相关信息")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:500,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String reject_reason { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 品牌id
|
||||
/// </summary>
|
||||
[Display(Name = "品牌id")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 brand_id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 回调时间
|
||||
/// </summary>
|
||||
[Display(Name = "回调时间")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.DateTime createTime { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/7/11 23:48:58
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using SqlSugar;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CoreCms.Net.Model.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件快递公司
|
||||
/// </summary>
|
||||
public partial class WeChatTransactionComponentDeliveryCompany
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
public WeChatTransactionComponentDeliveryCompany()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 快递公司id
|
||||
/// </summary>
|
||||
[Display(Name = "快递公司id")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String deliveryId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 快递公司名称
|
||||
/// </summary>
|
||||
[Display(Name = "快递公司名称")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String deliveryName { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,181 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/7/5 13:04:13
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using SqlSugar;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CoreCms.Net.Model.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件商品列表
|
||||
/// </summary>
|
||||
public partial class WeChatTransactionComponentGood
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
public WeChatTransactionComponentGood()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 序列
|
||||
/// </summary>
|
||||
[Display(Name = "序列")]
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
public System.Int32 id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 交易组件平台内部商品ID
|
||||
/// </summary>
|
||||
[Display(Name = "交易组件平台内部商品ID")]
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
public System.Int64 productId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 交易组件创建时间
|
||||
/// </summary>
|
||||
[Display(Name = "交易组件创建时间")]
|
||||
public System.DateTime? createTime { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商品序列
|
||||
/// </summary>
|
||||
[Display(Name = "商品序列")]
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength: 50, ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String outProductId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商品标题
|
||||
/// </summary>
|
||||
[Display(Name = "商品标题")]
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength: 255, ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String title { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 小程序路径
|
||||
/// </summary>
|
||||
[Display(Name = "小程序路径")]
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength: 255, ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String path { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 主图列表
|
||||
/// </summary>
|
||||
[Display(Name = "主图列表")]
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength: 500, ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String headImg { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商品资质图片列表
|
||||
/// </summary>
|
||||
[Display(Name = "商品资质图片列表")]
|
||||
[StringLength(maximumLength: 500, ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String qualificationPics { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商品详情图文
|
||||
/// </summary>
|
||||
[Display(Name = "商品详情图文")]
|
||||
public System.String descInfoDesc { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商品详情图片列表
|
||||
/// </summary>
|
||||
[Display(Name = "商品详情图片列表")]
|
||||
[StringLength(maximumLength: 500, ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String descInfoImgs { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 三级类目ID
|
||||
/// </summary>
|
||||
[Display(Name = "三级类目ID")]
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
public System.Int32 thirdCatId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 三级类目名称
|
||||
/// </summary>
|
||||
[Display(Name = "三级类目名称")]
|
||||
[StringLength(maximumLength: 50, ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String thirdCatName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 品牌id
|
||||
/// </summary>
|
||||
[Display(Name = "品牌id")]
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
public System.Int32 brandId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 预留字段
|
||||
/// </summary>
|
||||
[Display(Name = "预留字段")]
|
||||
[StringLength(maximumLength: 50, ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String infoVersion { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 最后提交时间
|
||||
/// </summary>
|
||||
[Display(Name = "最后提交时间")]
|
||||
public System.DateTime? lastPostTime { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 最后更新时间
|
||||
/// </summary>
|
||||
[Display(Name = "最后更新时间")]
|
||||
public System.DateTime? updateTime { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,104 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/8/1 22:22:12
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using SqlSugar;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CoreCms.Net.Model.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件商品审核回调
|
||||
/// </summary>
|
||||
public partial class WeChatTransactionComponentGoodAuditLog
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
public WeChatTransactionComponentGoodAuditLog()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 序列
|
||||
/// </summary>
|
||||
[Display(Name = "序列")]
|
||||
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商家自定义商品id
|
||||
/// </summary>
|
||||
[Display(Name = "商家自定义商品id")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String outProductId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 平台商品id
|
||||
/// </summary>
|
||||
[Display(Name = "平台商品id")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int64 productId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 审核状态,4:已通过,3:拒绝
|
||||
/// </summary>
|
||||
[Display(Name = "审核状态,4:已通过,3:拒绝")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 status { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 相关信息
|
||||
/// </summary>
|
||||
[Display(Name = "相关信息")]
|
||||
|
||||
|
||||
[StringLength(maximumLength:250,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String rejectReason { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[Display(Name = "创建时间")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.DateTime createTime { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/7/5 13:04:13
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using SqlSugar;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CoreCms.Net.Model.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件商品列表
|
||||
/// </summary>
|
||||
public partial class WeChatTransactionComponentGood
|
||||
{
|
||||
/// <summary>
|
||||
/// sku列表
|
||||
/// </summary>
|
||||
[Display(Name = "SKU")]
|
||||
[SqlSugar.SugarColumn(IsIgnore = true)]
|
||||
public List<WeChatTransactionComponentGoodSKU> sku { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,176 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/2/7 1:09:51
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using SqlSugar;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CoreCms.Net.Model.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件商品关联sku列表
|
||||
/// </summary>
|
||||
public partial class WeChatTransactionComponentGoodSKU
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
public WeChatTransactionComponentGoodSKU()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 序列
|
||||
/// </summary>
|
||||
[Display(Name = "序列")]
|
||||
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 交易组件平台自定义skuID
|
||||
/// </summary>
|
||||
[Display(Name = "交易组件平台自定义skuID")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int64 skuId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商家自定义商品ID
|
||||
/// </summary>
|
||||
[Display(Name = "商家自定义商品ID")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String outProductId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商家自定义skuID
|
||||
/// </summary>
|
||||
[Display(Name = "商家自定义skuID")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String outSkuId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// sku小图
|
||||
/// </summary>
|
||||
[Display(Name = "sku小图")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:255,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String thumbImg { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 成本价格
|
||||
/// </summary>
|
||||
[Display(Name = "成本价格")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Decimal costprice { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 售卖价格
|
||||
/// </summary>
|
||||
[Display(Name = "售卖价格")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Decimal salePrice { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 市场价格
|
||||
/// </summary>
|
||||
[Display(Name = "市场价格")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Decimal marketPrice { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 库存
|
||||
/// </summary>
|
||||
[Display(Name = "库存")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 stockNum { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 条形码
|
||||
/// </summary>
|
||||
[Display(Name = "条形码")]
|
||||
|
||||
|
||||
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String barCode { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商品编码
|
||||
/// </summary>
|
||||
[Display(Name = "商品编码")]
|
||||
|
||||
|
||||
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String skuCode { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 是否选择
|
||||
/// </summary>
|
||||
[Display(Name = "是否选择")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Boolean isSelect { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,104 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/6/30 12:28:17
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using SqlSugar;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CoreCms.Net.Model.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件提交订单
|
||||
/// </summary>
|
||||
public partial class WeChatTransactionComponentOrder
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
public WeChatTransactionComponentOrder()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 序列
|
||||
/// </summary>
|
||||
[Display(Name = "序列")]
|
||||
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 交易组件订单ID
|
||||
/// </summary>
|
||||
[Display(Name = "交易组件订单ID")]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.Int64? orderId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商家自定义订单ID
|
||||
/// </summary>
|
||||
[Display(Name = "商家自定义订单ID")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:20,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String outOrderId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 用户openId
|
||||
/// </summary>
|
||||
[Display(Name = "用户openId")]
|
||||
|
||||
|
||||
[StringLength(maximumLength:32,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String openid { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[Display(Name = "创建时间")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.DateTime createTime { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 支付单序列
|
||||
/// </summary>
|
||||
[Display(Name = "支付单序列")]
|
||||
|
||||
|
||||
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String paymentId { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,176 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/7/3 16:30:55
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using SqlSugar;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CoreCms.Net.Model.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件三级类目
|
||||
/// </summary>
|
||||
public partial class WeChatTransactionComponentThirdCategory
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
public WeChatTransactionComponentThirdCategory()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 序列
|
||||
/// </summary>
|
||||
[Display(Name = "序列")]
|
||||
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 类目ID
|
||||
/// </summary>
|
||||
[Display(Name = "类目ID")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 third_cat_id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 类目名称
|
||||
/// </summary>
|
||||
[Display(Name = "类目名称")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String third_cat_name { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 类目资质
|
||||
/// </summary>
|
||||
[Display(Name = "类目资质")]
|
||||
|
||||
|
||||
[StringLength(maximumLength:500,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String qualification { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 类目资质类型,0:不需要,1:必填,2:选填
|
||||
/// </summary>
|
||||
[Display(Name = "类目资质类型,0:不需要,1:必填,2:选填")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 qualification_type { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商品资质
|
||||
/// </summary>
|
||||
[Display(Name = "商品资质")]
|
||||
|
||||
|
||||
[StringLength(maximumLength:500,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String product_qualification { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商品资质类型,0:不需要,1:必填,2:选填
|
||||
/// </summary>
|
||||
[Display(Name = "商品资质类型,0:不需要,1:必填,2:选填")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 product_qualification_type { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 二级类目ID
|
||||
/// </summary>
|
||||
[Display(Name = "二级类目ID")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 second_cat_id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 二级类目名称
|
||||
/// </summary>
|
||||
[Display(Name = "二级类目名称")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String second_cat_name { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 一级类目ID
|
||||
/// </summary>
|
||||
[Display(Name = "一级类目ID")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 first_cat_id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 一级类目名称
|
||||
/// </summary>
|
||||
[Display(Name = "一级类目名称")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String first_cat_name { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[Display(Name = "创建时间")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.DateTime createTime { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -70,7 +70,7 @@ namespace CoreCms.Net.Model.FromBody
|
||||
/// </summary>
|
||||
public string logiNo { get; set; }
|
||||
/// <summary>
|
||||
/// 直播物流编码
|
||||
/// 第三方对接物流编码
|
||||
/// </summary>
|
||||
public string deliveryCompanyId { get; set; }
|
||||
public Dictionary<int, int> items { get; set; }
|
||||
|
||||
@@ -1,166 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/7/10 22:41:46
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.AccressToken;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Loging;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.WeChat.Service.Enums;
|
||||
using CoreCms.Net.WeChat.Service.HttpClients;
|
||||
using InitQ.Abstractions;
|
||||
using InitQ.Attributes;
|
||||
using Newtonsoft.Json;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api.Models;
|
||||
|
||||
namespace CoreCms.Net.RedisMQ
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件-同步创建售后单
|
||||
/// </summary>
|
||||
public class TCOrderAfterSaleCreateSyncSubscribe : IRedisSubscribe
|
||||
{
|
||||
private readonly string _wxOpenAppId = AppSettingsConstVars.WxOpenAppId;
|
||||
private readonly string _wxOpenAppSecret = AppSettingsConstVars.WxOpenAppSecret;
|
||||
|
||||
private readonly ICoreCmsOrderServices _orderServices;
|
||||
private readonly IWeChatTransactionComponentOrderServices _tcOrderServices;
|
||||
private readonly WeChat.Service.HttpClients.IWeChatApiHttpClientFactory _weChatApiHttpClientFactory;
|
||||
private readonly ICoreCmsBillAftersalesServices _billAftersalesServices;
|
||||
private readonly ICoreCmsBillAftersalesItemServices _billAftersalesItemServices;
|
||||
|
||||
|
||||
|
||||
|
||||
public TCOrderAfterSaleCreateSyncSubscribe(ICoreCmsOrderServices orderServices, IWeChatTransactionComponentOrderServices tcOrderServices, IWeChatApiHttpClientFactory weChatApiHttpClientFactory, ICoreCmsBillAftersalesServices billAftersalesServices, ICoreCmsBillAftersalesItemServices billAftersalesItemServices)
|
||||
{
|
||||
_orderServices = orderServices;
|
||||
_tcOrderServices = tcOrderServices;
|
||||
_weChatApiHttpClientFactory = weChatApiHttpClientFactory;
|
||||
_billAftersalesServices = billAftersalesServices;
|
||||
_billAftersalesItemServices = billAftersalesItemServices;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 自定义交易组件-同步创建售后单
|
||||
/// </summary>
|
||||
/// <param name="msg"></param>
|
||||
/// <returns></returns>
|
||||
[Subscribe(RedisMessageQueueKey.TransactionComponentAfterSaleCreateSync)]
|
||||
private async Task TransactionComponentAfterSaleCreateSync(string msg)
|
||||
{
|
||||
try
|
||||
{
|
||||
var orderModel = JsonConvert.DeserializeObject<CoreCmsOrder>(msg);
|
||||
if (orderModel is { scene: > 0 })
|
||||
{
|
||||
var tcOrderModel = await _tcOrderServices.QueryByClauseAsync(p => p.outOrderId == orderModel.orderId, true);
|
||||
if (tcOrderModel == null)
|
||||
{
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Error, LogType.RedisMessageQueue, "自定义交易组件-同步创建售后单", "未查询到远程订单推送记录");
|
||||
return;
|
||||
}
|
||||
|
||||
var orderInfo = await _orderServices.QueryByClauseAsync(p => p.orderId == orderModel.orderId, true);
|
||||
if (orderInfo == null)
|
||||
{
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Error, LogType.RedisMessageQueue, "自定义交易组件-同步创建售后单", "订单信息获取失败");
|
||||
return;
|
||||
}
|
||||
|
||||
//获取售后单
|
||||
var aftersale = await _billAftersalesServices.QueryByClauseAsync(p => p.aftersalesId == orderModel.billAftersalesId);
|
||||
//获取售后单详情
|
||||
var aftersaleItems = await _billAftersalesItemServices.QueryListByClauseAsync(p => p.aftersalesId == orderModel.billAftersalesId);
|
||||
|
||||
//获取小程序认证
|
||||
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
|
||||
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
|
||||
|
||||
var request = new ShopECAftersaleAddRequest();
|
||||
request.AccessToken = accessToken;
|
||||
request.OutOrderId = orderModel.orderId;
|
||||
request.OutAftersaleOrderId = orderModel.billAftersalesId;
|
||||
request.OpenId = tcOrderModel.openid;
|
||||
|
||||
//request.PagePath = "pages/member/afterSales/detail/detail?aftersalesId=" + orderModel.billAftersalesId;
|
||||
request.RefundAmount = Convert.ToInt32(aftersale.refundAmount * 100);
|
||||
|
||||
if (aftersale.refundAmount > 0 && aftersale.type == (int)GlobalEnumVars.BillAftersalesIsReceive.Refund)
|
||||
{
|
||||
request.Type = (int)AfterSalesEnum.AfterSaleType.仅退款;
|
||||
}
|
||||
else if (aftersale.refundAmount > 0 && aftersale.type == (int)GlobalEnumVars.BillAftersalesIsReceive.Reship)
|
||||
{
|
||||
request.Type = (int)AfterSalesEnum.AfterSaleType.退货退款;
|
||||
|
||||
}
|
||||
else if (Convert.ToInt32(aftersale.refundAmount) == 0 && aftersale.type == (int)GlobalEnumVars.BillAftersalesIsReceive.Reship)
|
||||
{
|
||||
request.Type = (int)AfterSalesEnum.AfterSaleType.退货退款;
|
||||
}
|
||||
else if (Convert.ToInt32(aftersale.refundAmount) == 0 && aftersale.type == (int)GlobalEnumVars.BillAftersalesIsReceive.Refund)
|
||||
{
|
||||
request.Type = (int)AfterSalesEnum.AfterSaleType.仅退款;
|
||||
}
|
||||
|
||||
request.RefundReasonType = (int)AfterSalesEnum.AfterSalesReasonType.不想要了;
|
||||
request.RefundReason = aftersale.reason;
|
||||
|
||||
//新自定义交易组件,只能申请一个商品售后。
|
||||
request.Product = new ShopECAftersaleAddRequest.Types.Product()
|
||||
{
|
||||
Count = aftersaleItems[0].nums,
|
||||
OutProductId = aftersaleItems[0].goodsId.ToString(),
|
||||
OutSKUId = aftersaleItems[0].productId.ToString()
|
||||
};
|
||||
|
||||
//aftersaleItems.ForEach(p =>
|
||||
//{
|
||||
// var product = new ShopECAftersaleAddRequest.Types.Product();
|
||||
// product.Count = p.nums;
|
||||
// product.OutProductId = p.goodsId.ToString();
|
||||
// product.OutSKUId = p.productId.ToString();
|
||||
// request.Product.Add(product);
|
||||
//});
|
||||
|
||||
var response = await client.ExecuteShopECAftersaleAddAsync(request);
|
||||
|
||||
NLogUtil.WriteAll(response.IsSuccessful() ? NLog.LogLevel.Info : NLog.LogLevel.Error,
|
||||
LogType.RedisMessageQueue, "自定义交易组件-同步创建售后单", JsonConvert.SerializeObject(response));
|
||||
}
|
||||
else
|
||||
{
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Error, LogType.RedisMessageQueue, "自定义交易组件-同步创建售后单", "订单获取失败");
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
var obj = new
|
||||
{
|
||||
wxOpenAppId = _wxOpenAppId,
|
||||
wxOpenAppSecret = _wxOpenAppSecret,
|
||||
};
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Error, LogType.RedisMessageQueue, "自定义交易组件-同步创建售后单", JsonConvert.SerializeObject(obj), ex);
|
||||
throw;
|
||||
}
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/7/10 22:41:46
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.AccressToken;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Loging;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.WeChat.Service.HttpClients;
|
||||
using InitQ.Abstractions;
|
||||
using InitQ.Attributes;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api.Models;
|
||||
|
||||
namespace CoreCms.Net.RedisMQ
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件-同步订单确认收货
|
||||
/// </summary>
|
||||
public class TCOrderDeliveryRecieveSyncSubscribe : IRedisSubscribe
|
||||
{
|
||||
private readonly ICoreCmsBillDeliveryServices _billDeliveryServices;
|
||||
private readonly ICoreCmsOrderItemServices _orderItemServices;
|
||||
private readonly ICoreCmsOrderServices _orderServices;
|
||||
private readonly IWeChatTransactionComponentOrderServices _tcOrderServices;
|
||||
|
||||
|
||||
private readonly ICoreCmsUserWeChatInfoServices _userWeChatInfoServices;
|
||||
private readonly IWeChatApiHttpClientFactory _weChatApiHttpClientFactory;
|
||||
private readonly ICoreCmsUserWeChatInfoServices _weChatInfoServices;
|
||||
|
||||
|
||||
public TCOrderDeliveryRecieveSyncSubscribe(ICoreCmsUserWeChatInfoServices userWeChatInfoServices,
|
||||
ICoreCmsBillDeliveryServices billDeliveryServices, ICoreCmsOrderServices orderServices,
|
||||
ICoreCmsUserWeChatInfoServices weChatInfoServices, IWeChatTransactionComponentOrderServices tcOrderServices,
|
||||
ICoreCmsOrderItemServices orderItemServices, IWeChatApiHttpClientFactory weChatApiHttpClientFactory)
|
||||
{
|
||||
_userWeChatInfoServices = userWeChatInfoServices;
|
||||
_billDeliveryServices = billDeliveryServices;
|
||||
_orderServices = orderServices;
|
||||
_weChatInfoServices = weChatInfoServices;
|
||||
_tcOrderServices = tcOrderServices;
|
||||
_orderItemServices = orderItemServices;
|
||||
_weChatApiHttpClientFactory = weChatApiHttpClientFactory;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 自定义交易组件-同步订单确认收货
|
||||
/// </summary>
|
||||
/// <param name="msg"></param>
|
||||
/// <returns></returns>
|
||||
[Subscribe(RedisMessageQueueKey.TransactionComponentOrderDeliveryRecieveSync)]
|
||||
private async Task TransactionComponentOrderDeliveryRecieveSync(string msg)
|
||||
{
|
||||
try
|
||||
{
|
||||
var orderModel = JsonConvert.DeserializeObject<CoreCmsOrder>(msg);
|
||||
if (orderModel is {scene: > 0})
|
||||
{
|
||||
var tcOrderModel =
|
||||
await _tcOrderServices.QueryByClauseAsync(p => p.outOrderId == orderModel.orderId, true);
|
||||
if (tcOrderModel == null)
|
||||
{
|
||||
NLogUtil.WriteAll(LogLevel.Error, LogType.RedisMessageQueue, "自定义交易组件-同步订单确认收货",
|
||||
"未查询到远程订单推送记录");
|
||||
return;
|
||||
}
|
||||
|
||||
var orderInfo = await _orderServices.QueryByClauseAsync(p => p.orderId == orderModel.orderId, true);
|
||||
if (orderInfo == null)
|
||||
{
|
||||
NLogUtil.WriteAll(LogLevel.Error, LogType.RedisMessageQueue, "自定义交易组件-同步订单确认收货", "订单信息获取失败");
|
||||
return;
|
||||
}
|
||||
|
||||
//获取小程序认证
|
||||
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
|
||||
|
||||
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
|
||||
var request = new ShopDeliveryReceiveRequest();
|
||||
request.AccessToken = accessToken;
|
||||
request.OpenId = tcOrderModel.openid;
|
||||
request.OutOrderId = orderModel.orderId;
|
||||
var response = await client.ExecuteShopDeliveryReceiveAsync(request);
|
||||
NLogUtil.WriteAll(response.IsSuccessful() ? LogLevel.Info : LogLevel.Error,
|
||||
LogType.RedisMessageQueue, "自定义交易组件-同步订单确认收货", JsonConvert.SerializeObject(response));
|
||||
}
|
||||
else
|
||||
{
|
||||
NLogUtil.WriteAll(LogLevel.Error, LogType.RedisMessageQueue, "自定义交易组件-同步订单确认收货", "订单获取失败");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
NLogUtil.WriteAll(LogLevel.Error, LogType.RedisMessageQueue, "自定义交易组件-同步订单确认收货", msg, ex);
|
||||
throw;
|
||||
}
|
||||
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,176 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/7/10 22:41:46
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.AccressToken;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Loging;
|
||||
using CoreCms.Net.WeChat.Service.HttpClients;
|
||||
using InitQ.Abstractions;
|
||||
using InitQ.Attributes;
|
||||
using Newtonsoft.Json;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api.Models;
|
||||
|
||||
namespace CoreCms.Net.RedisMQ
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件-同步发货信息
|
||||
/// </summary>
|
||||
public class TCOrderShipSyncSubscribe : IRedisSubscribe
|
||||
{
|
||||
private readonly string _wxOpenAppId = AppSettingsConstVars.WxOpenAppId;
|
||||
private readonly string _wxOpenAppSecret = AppSettingsConstVars.WxOpenAppSecret;
|
||||
|
||||
private readonly ICoreCmsBillDeliveryServices _billDeliveryServices;
|
||||
private readonly ICoreCmsBillDeliveryItemServices _billDeliveryItemServices;
|
||||
private readonly ICoreCmsOrderServices _orderServices;
|
||||
private readonly ICoreCmsOrderItemServices _orderItemServices;
|
||||
private readonly IWeChatTransactionComponentOrderServices _tcOrderServices;
|
||||
private readonly WeChat.Service.HttpClients.IWeChatApiHttpClientFactory _weChatApiHttpClientFactory;
|
||||
|
||||
|
||||
|
||||
public TCOrderShipSyncSubscribe(ICoreCmsBillDeliveryServices billDeliveryServices, ICoreCmsOrderServices orderServices, IWeChatTransactionComponentOrderServices tcOrderServices, ICoreCmsOrderItemServices orderItemServices, IWeChatApiHttpClientFactory weChatApiHttpClientFactory, ICoreCmsBillDeliveryItemServices billDeliveryItemServices)
|
||||
{
|
||||
_billDeliveryServices = billDeliveryServices;
|
||||
_orderServices = orderServices;
|
||||
_tcOrderServices = tcOrderServices;
|
||||
_orderItemServices = orderItemServices;
|
||||
_weChatApiHttpClientFactory = weChatApiHttpClientFactory;
|
||||
_billDeliveryItemServices = billDeliveryItemServices;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 自定义交易组件-同步发货信息
|
||||
/// </summary>
|
||||
/// <param name="msg"></param>
|
||||
/// <returns></returns>
|
||||
[Subscribe(RedisMessageQueueKey.TransactionComponentOrderShipSync)]
|
||||
private async Task TransactionComponentOrderShipSync(string msg)
|
||||
{
|
||||
try
|
||||
{
|
||||
var deliveryId = msg;
|
||||
if (!string.IsNullOrEmpty(deliveryId))
|
||||
{
|
||||
var billDelivery = await _billDeliveryServices.QueryByClauseAsync(p => p.deliveryId == deliveryId, true);
|
||||
if (billDelivery == null)
|
||||
{
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Error, LogType.RedisMessageQueue, "自定义交易组件-同步发货信息", "同步发货信息");
|
||||
return;
|
||||
}
|
||||
|
||||
var tcOrderModel = await _tcOrderServices.QueryByClauseAsync(p => p.outOrderId == billDelivery.orderId, true);
|
||||
if (tcOrderModel == null)
|
||||
{
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Error, LogType.RedisMessageQueue, "自定义交易组件-同步发货信息", "未查询到远程订单推送记录");
|
||||
return;
|
||||
}
|
||||
|
||||
var orderInfo = await _orderServices.QueryByClauseAsync(p => p.orderId == billDelivery.orderId, true);
|
||||
if (orderInfo == null)
|
||||
{
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Error, LogType.RedisMessageQueue, "自定义交易组件-同步发货信息", "订单信息获取失败");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var items = await _billDeliveryItemServices.QueryListByClauseAsync(p => p.deliveryId == billDelivery.deliveryId);
|
||||
|
||||
//判断是否发货发完
|
||||
var finishAllDelivery = false;
|
||||
|
||||
//总发货数量
|
||||
var allNeedSendNum = await _orderItemServices.GetSumAsync(p => p.orderId == orderInfo.orderId, p => p.nums, true);
|
||||
//已经发货数量
|
||||
var isSendNum = await _orderItemServices.GetSumAsync(p => p.orderId == orderInfo.orderId, p => p.sendNums, true);
|
||||
|
||||
finishAllDelivery = allNeedSendNum == isSendNum ? true : false;
|
||||
|
||||
//获取小程序认证
|
||||
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
|
||||
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
|
||||
var request = new ShopDeliverySendRequest();
|
||||
request.AccessToken = accessToken;
|
||||
|
||||
if (orderInfo.receiptType == (int)GlobalEnumVars.OrderReceiptType.Logistics)
|
||||
{
|
||||
request.OutOrderId = orderInfo.orderId;
|
||||
request.OpenId = tcOrderModel.openid;
|
||||
request.IsFinishAll = finishAllDelivery;
|
||||
|
||||
var delivery = new ShopDeliverySendRequest.Types.Delivery
|
||||
{
|
||||
DeliveryId = billDelivery.thirdPartylogiCode,
|
||||
WaybillId = billDelivery.logiNo,
|
||||
ProductList = new List<ShopDeliverySendRequest.Types.Delivery.Types.Product>()
|
||||
};
|
||||
|
||||
items.ForEach(p =>
|
||||
{
|
||||
delivery.ProductList.Add(new ShopDeliverySendRequest.Types.Delivery.Types.Product()
|
||||
{
|
||||
OutProductId = p.goodsId.ToString(),
|
||||
OutSKUId = p.productId.ToString(),
|
||||
Count = p.nums
|
||||
});
|
||||
});
|
||||
|
||||
request.DeliveryList = new List<ShopDeliverySendRequest.Types.Delivery>()
|
||||
{
|
||||
delivery
|
||||
};
|
||||
|
||||
request.ShipDoneTime = new DateTimeOffset(billDelivery.createTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
request.OutOrderId = orderInfo.orderId;
|
||||
request.OpenId = tcOrderModel.openid;
|
||||
request.IsFinishAll = true;
|
||||
}
|
||||
|
||||
var response = await client.ExecuteShopDeliverySendAsync(request);
|
||||
if (response.IsSuccessful())
|
||||
{
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Info, LogType.RedisMessageQueue, "自定义交易组件-同步发货信息", JsonConvert.SerializeObject(response));
|
||||
}
|
||||
else
|
||||
{
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Error, LogType.RedisMessageQueue, "自定义交易组件-同步发货信息", JsonConvert.SerializeObject(response));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Error, LogType.RedisMessageQueue, "自定义交易组件-同步发货信息", "发货单编号获取失败");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
var obj = new
|
||||
{
|
||||
wxOpenAppId = _wxOpenAppId,
|
||||
wxOpenAppSecret = _wxOpenAppSecret,
|
||||
msg
|
||||
};
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Error, LogType.RedisMessageQueue, "自定义交易组件-同步发货信息", JsonConvert.SerializeObject(obj), ex);
|
||||
throw;
|
||||
}
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/7/10 22:41:46
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.AccressToken;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Loging;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.WeChat.Service.HttpClients;
|
||||
using InitQ.Abstractions;
|
||||
using InitQ.Attributes;
|
||||
using Newtonsoft.Json;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api.Models;
|
||||
|
||||
namespace CoreCms.Net.RedisMQ
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件-同步订单状态(弃用,新版已经取消了同步)
|
||||
/// </summary>
|
||||
public class TCPayOrderSyncSubscribe : IRedisSubscribe
|
||||
{
|
||||
private readonly ICoreCmsUserWeChatInfoServices _userWeChatInfoServices;
|
||||
private readonly WeChat.Service.HttpClients.IWeChatApiHttpClientFactory _weChatApiHttpClientFactory;
|
||||
|
||||
|
||||
|
||||
|
||||
public TCPayOrderSyncSubscribe(ICoreCmsUserWeChatInfoServices userWeChatInfoServices, IWeChatApiHttpClientFactory weChatApiHttpClientFactory)
|
||||
{
|
||||
_userWeChatInfoServices = userWeChatInfoServices;
|
||||
_weChatApiHttpClientFactory = weChatApiHttpClientFactory;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 自定义交易组件-同步订单状态
|
||||
/// </summary>
|
||||
/// <param name="msg"></param>
|
||||
/// <returns></returns>
|
||||
[Subscribe(RedisMessageQueueKey.TransactionComponentPayOrderSync)]
|
||||
private async Task TransactionComponentPayOrderSync(string msg)
|
||||
{
|
||||
try
|
||||
{
|
||||
var orderModel = JsonConvert.DeserializeObject<CoreCmsOrder>(msg);
|
||||
if (orderModel is { scene: > 0 })
|
||||
{
|
||||
//获取小程序认证
|
||||
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
|
||||
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
|
||||
|
||||
var userInfo = await _userWeChatInfoServices.QueryByClauseAsync(p => p.userId == orderModel.userId);
|
||||
if (userInfo != null)
|
||||
{
|
||||
var payment = orderModel.paymentItem[0];
|
||||
|
||||
//获取同步地址接口地址
|
||||
var request = new ShopOrderPayRequest();
|
||||
request.AccessToken = accessToken;
|
||||
request.OutOrderId = orderModel.orderId;
|
||||
request.OpenId = userInfo.openid;
|
||||
request.ActionType = 1;
|
||||
request.TransactionId = payment.tradeNo;
|
||||
request.PayTime = payment.createTime;
|
||||
|
||||
var response = await client.ExecuteShopOrderPayAsync(request);
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Error, LogType.RedisMessageQueue, "自定义交易组件-同步订单状态", JsonConvert.SerializeObject(response));
|
||||
}
|
||||
else
|
||||
{
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Error, LogType.RedisMessageQueue, "自定义交易组件-同步订单状态", "微信用户数据获取失败");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Info, LogType.RedisMessageQueue, "自定义交易组件-同步订单状态", "商品获取失败");
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Error, LogType.RedisMessageQueue, "自定义交易组件-同步订单状态", msg, ex);
|
||||
throw;
|
||||
}
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/6/29 16:22:45
|
||||
* 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 CoreCmsCheckBeforeAddOrderRepository : BaseRepository<CoreCmsCheckBeforeAddOrder>, ICoreCmsCheckBeforeAddOrderRepository
|
||||
{
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
public CoreCmsCheckBeforeAddOrderRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
|
||||
{
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -251,7 +251,6 @@ namespace CoreCms.Net.Repository
|
||||
.MergeTable()
|
||||
.Mapper(sOrder => sOrder.aftersalesItem, sOrder => sOrder.aftersalesItem.First().orderId)
|
||||
.Mapper(sOrder => sOrder.items, sOrder => sOrder.items.First().orderId)
|
||||
.Mapper(sOrder => sOrder.tcOrder, sOrder => sOrder.tcOrder.outOrderId)
|
||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||
.WhereIF(predicate != null, predicate)
|
||||
.ToListAsync();
|
||||
@@ -329,7 +328,6 @@ namespace CoreCms.Net.Repository
|
||||
.MergeTable()
|
||||
.Mapper(sOrder => sOrder.aftersalesItem, sOrder => sOrder.aftersalesItem.First().orderId)
|
||||
.Mapper(sOrder => sOrder.items, sOrder => sOrder.items.First().orderId)
|
||||
.Mapper(sOrder => sOrder.tcOrder, sOrder => sOrder.tcOrder.outOrderId)
|
||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||
.WhereIF(predicate != null, predicate)
|
||||
.ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/8/1 22:53:11
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.Manual;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.Repository
|
||||
{
|
||||
/// <summary>
|
||||
/// 接口实现
|
||||
/// </summary>
|
||||
public class WeChatTransactionComponentAuditCategoryAuditLogRepository : BaseRepository<WeChatTransactionComponentAuditCategoryAuditLog>, IWeChatTransactionComponentAuditCategoryAuditLogRepository
|
||||
{
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
public WeChatTransactionComponentAuditCategoryAuditLogRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
|
||||
{
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,169 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.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 WeChatTransactionComponentAuditCategoryRepository : BaseRepository<WeChatTransactionComponentAuditCategory>, IWeChatTransactionComponentAuditCategoryRepository
|
||||
{
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
public WeChatTransactionComponentAuditCategoryRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
|
||||
{
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<AdminUiCallBack> UpdateAsync(WeChatTransactionComponentAuditCategory entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var oldModel = await DbClient.Queryable<WeChatTransactionComponentAuditCategory>().In(entity.id).SingleAsync();
|
||||
if (oldModel == null)
|
||||
{
|
||||
jm.msg = "不存在此信息";
|
||||
return jm;
|
||||
}
|
||||
//事物处理过程开始
|
||||
//oldModel.id = entity.id;
|
||||
oldModel.licenseImage = entity.licenseImage;
|
||||
oldModel.level1 = entity.level1;
|
||||
oldModel.level1Name = entity.level1Name;
|
||||
oldModel.level2 = entity.level2;
|
||||
oldModel.level2Name = entity.level2Name;
|
||||
oldModel.level3 = entity.level3;
|
||||
oldModel.level3Name = entity.level3Name;
|
||||
oldModel.certificateImage = entity.certificateImage;
|
||||
//oldModel.auditId = entity.auditId;
|
||||
//oldModel.status = entity.status;
|
||||
//oldModel.brandId = entity.brandId;
|
||||
//oldModel.rejectReason = entity.rejectReason;
|
||||
//oldModel.createTime = entity.createTime;
|
||||
|
||||
//事物处理过程结束
|
||||
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<WeChatTransactionComponentAuditCategory>(id).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 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)
|
||||
{
|
||||
RefAsync<int> totalCount = 0;
|
||||
List<WeChatTransactionComponentAuditCategory> page;
|
||||
if (blUseNoLock)
|
||||
{
|
||||
page = await DbClient.Queryable<WeChatTransactionComponentAuditCategory>()
|
||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||
.WhereIF(predicate != null, predicate).Select(p => new WeChatTransactionComponentAuditCategory
|
||||
{
|
||||
id = p.id,
|
||||
licenseImage = p.licenseImage,
|
||||
level1 = p.level1,
|
||||
level1Name = p.level1Name,
|
||||
level2 = p.level2,
|
||||
level2Name = p.level2Name,
|
||||
level3 = p.level3,
|
||||
level3Name = p.level3Name,
|
||||
certificateImage = p.certificateImage,
|
||||
auditId = p.auditId,
|
||||
status = p.status,
|
||||
brandId = p.brandId,
|
||||
rejectReason = p.rejectReason,
|
||||
createTime = p.createTime,
|
||||
|
||||
}).With(SqlWith.NoLock).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
page = await DbClient.Queryable<WeChatTransactionComponentAuditCategory>()
|
||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||
.WhereIF(predicate != null, predicate).Select(p => new WeChatTransactionComponentAuditCategory
|
||||
{
|
||||
id = p.id,
|
||||
licenseImage = p.licenseImage,
|
||||
level1 = p.level1,
|
||||
level1Name = p.level1Name,
|
||||
level2 = p.level2,
|
||||
level2Name = p.level2Name,
|
||||
level3 = p.level3,
|
||||
level3Name = p.level3Name,
|
||||
certificateImage = p.certificateImage,
|
||||
auditId = p.auditId,
|
||||
status = p.status,
|
||||
brandId = p.brandId,
|
||||
rejectReason = p.rejectReason,
|
||||
createTime = p.createTime,
|
||||
|
||||
}).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
}
|
||||
var list = new PageList<WeChatTransactionComponentAuditCategory>(page, pageIndex, pageSize, totalCount);
|
||||
return list;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,204 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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 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 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>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public 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;
|
||||
}
|
||||
|
||||
#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 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
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.Caching.Manual;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.Repository
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件快递公司 接口实现
|
||||
/// </summary>
|
||||
public class WeChatTransactionComponentDeliveryCompanyRepository : BaseRepository<WeChatTransactionComponentDeliveryCompany>, IWeChatTransactionComponentDeliveryCompanyRepository
|
||||
{
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
public WeChatTransactionComponentDeliveryCompanyRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
|
||||
{
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
|
||||
#region 获取缓存的所有数据==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 获取缓存的所有数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<WeChatTransactionComponentDeliveryCompany>> GetCaChe()
|
||||
{
|
||||
var list = await DbClient.Queryable<WeChatTransactionComponentDeliveryCompany>().With(SqlWith.NoLock).WithCache().ToListAsync();
|
||||
return list;
|
||||
}
|
||||
|
||||
#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 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)
|
||||
{
|
||||
RefAsync<int> totalCount = 0;
|
||||
List<WeChatTransactionComponentDeliveryCompany> page;
|
||||
if (blUseNoLock)
|
||||
{
|
||||
page = await DbClient.Queryable<WeChatTransactionComponentDeliveryCompany>()
|
||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||
.WhereIF(predicate != null, predicate).Select(p => new WeChatTransactionComponentDeliveryCompany
|
||||
{
|
||||
deliveryId = p.deliveryId,
|
||||
deliveryName = p.deliveryName,
|
||||
|
||||
}).With(SqlWith.NoLock).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
page = await DbClient.Queryable<WeChatTransactionComponentDeliveryCompany>()
|
||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||
.WhereIF(predicate != null, predicate).Select(p => new WeChatTransactionComponentDeliveryCompany
|
||||
{
|
||||
deliveryId = p.deliveryId,
|
||||
deliveryName = p.deliveryName,
|
||||
|
||||
}).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
}
|
||||
var list = new PageList<WeChatTransactionComponentDeliveryCompany>(page, pageIndex, pageSize, totalCount);
|
||||
return list;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.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 WeChatTransactionComponentGoodAuditLogRepository : BaseRepository<WeChatTransactionComponentGoodAuditLog>, IWeChatTransactionComponentGoodAuditLogRepository
|
||||
{
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
public WeChatTransactionComponentGoodAuditLogRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
|
||||
{
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,270 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/7/4 2:52:27
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.Manual;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.Repository
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件商品列表 接口实现
|
||||
/// </summary>
|
||||
public class WeChatTransactionComponentGoodRepository : BaseRepository<WeChatTransactionComponentGood>, IWeChatTransactionComponentGoodRepository
|
||||
{
|
||||
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
|
||||
public WeChatTransactionComponentGoodRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
|
||||
{
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public async Task<AdminUiCallBack> InsertAsync(WeChatTransactionComponentGood entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
var isHave = await DbClient.Queryable<WeChatTransactionComponentGood>()
|
||||
.AnyAsync(p => p.outProductId == entity.outProductId);
|
||||
if (isHave)
|
||||
{
|
||||
jm.msg = "已经存在相同数据";
|
||||
return jm;
|
||||
}
|
||||
if (entity.sku == null || entity.sku.Count < 0)
|
||||
{
|
||||
jm.msg = "请提交sku列表";
|
||||
return jm;
|
||||
}
|
||||
|
||||
var isSelectCount = entity.sku.Count(p => p.isSelect == true);
|
||||
if (isSelectCount <= 0)
|
||||
{
|
||||
jm.msg = "请至少勾选一个需要提交的sku";
|
||||
return jm;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
_unitOfWork.BeginTran();
|
||||
var id = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync();
|
||||
if (id <= 0)
|
||||
{
|
||||
_unitOfWork.RollbackTran();
|
||||
jm.msg = GlobalConstVars.DataHandleEx;
|
||||
return jm;
|
||||
}
|
||||
|
||||
entity.sku.ForEach(p =>
|
||||
{
|
||||
p.skuId = 0;
|
||||
p.outProductId = entity.outProductId;
|
||||
p.skuCode = p.barCode;
|
||||
});
|
||||
|
||||
await DbClient.Insertable(entity.sku).ExecuteCommandAsync();
|
||||
|
||||
_unitOfWork.CommitTran();
|
||||
|
||||
jm.code = 0;
|
||||
jm.msg = GlobalConstVars.CreateSuccess;
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_unitOfWork.RollbackTran();
|
||||
jm.msg = GlobalConstVars.DataHandleEx;
|
||||
jm.data = e;
|
||||
}
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<AdminUiCallBack> UpdateAsync(WeChatTransactionComponentGood entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var oldModel = await DbClient.Queryable<WeChatTransactionComponentGood>().In(entity.id).SingleAsync();
|
||||
if (oldModel == null)
|
||||
{
|
||||
jm.msg = "不存在此信息";
|
||||
return jm;
|
||||
}
|
||||
//事物处理过程开始
|
||||
//oldModel.id = entity.id;
|
||||
oldModel.productId = entity.productId;
|
||||
oldModel.createTime = entity.createTime;
|
||||
oldModel.outProductId = entity.outProductId;
|
||||
oldModel.title = entity.title;
|
||||
oldModel.path = entity.path;
|
||||
oldModel.headImg = entity.headImg;
|
||||
oldModel.qualificationPics = entity.qualificationPics;
|
||||
oldModel.descInfoDesc = entity.descInfoDesc;
|
||||
oldModel.descInfoImgs = entity.descInfoImgs;
|
||||
oldModel.thirdCatId = entity.thirdCatId;
|
||||
oldModel.brandId = entity.brandId;
|
||||
oldModel.infoVersion = entity.infoVersion;
|
||||
oldModel.lastPostTime = entity.lastPostTime;
|
||||
oldModel.updateTime = entity.updateTime;
|
||||
oldModel.thirdCatName = entity.thirdCatName;
|
||||
|
||||
//事物处理过程结束
|
||||
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||
|
||||
if (entity.sku == null || entity.sku.Count < 0)
|
||||
{
|
||||
jm.msg = "请提交sku列表";
|
||||
return jm;
|
||||
}
|
||||
|
||||
var isSelectCount = entity.sku.Count(p => p.isSelect == true);
|
||||
if (isSelectCount <= 0)
|
||||
{
|
||||
jm.msg = "请至少勾选一个需要提交的sku";
|
||||
return jm;
|
||||
}
|
||||
|
||||
var oldSku = await DbClient.Queryable<WeChatTransactionComponentGoodSKU>()
|
||||
.Where(p => p.outProductId == oldModel.outProductId).ToListAsync();
|
||||
oldSku.ForEach(p =>
|
||||
{
|
||||
var newSku = entity.sku.Find(o => o.outSkuId == p.outSkuId);
|
||||
if (newSku != null)
|
||||
{
|
||||
p.thumbImg = newSku.thumbImg;
|
||||
p.costprice = newSku.costprice;
|
||||
p.salePrice = newSku.salePrice;
|
||||
p.marketPrice = newSku.marketPrice;
|
||||
p.stockNum = newSku.stockNum;
|
||||
p.isSelect = newSku.isSelect;
|
||||
}
|
||||
});
|
||||
|
||||
await DbClient.Updateable(oldSku).ExecuteCommandAsync();
|
||||
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<WeChatTransactionComponentGood>(id).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 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)
|
||||
{
|
||||
RefAsync<int> totalCount = 0;
|
||||
List<WeChatTransactionComponentGood> page;
|
||||
if (blUseNoLock)
|
||||
{
|
||||
page = await DbClient.Queryable<WeChatTransactionComponentGood>()
|
||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||
.WhereIF(predicate != null, predicate).Select(p => new WeChatTransactionComponentGood
|
||||
{
|
||||
id = p.id,
|
||||
productId = p.productId,
|
||||
createTime = p.createTime,
|
||||
outProductId = p.outProductId,
|
||||
title = p.title,
|
||||
path = p.path,
|
||||
headImg = p.headImg,
|
||||
qualificationPics = p.qualificationPics,
|
||||
//descInfoDesc = p.descInfoDesc,
|
||||
descInfoImgs = p.descInfoImgs,
|
||||
thirdCatId = p.thirdCatId,
|
||||
thirdCatName = p.thirdCatName,
|
||||
brandId = p.brandId,
|
||||
infoVersion = p.infoVersion,
|
||||
lastPostTime = p.lastPostTime,
|
||||
updateTime = p.updateTime,
|
||||
|
||||
}).With(SqlWith.NoLock).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
page = await DbClient.Queryable<WeChatTransactionComponentGood>()
|
||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||
.WhereIF(predicate != null, predicate).Select(p => new WeChatTransactionComponentGood
|
||||
{
|
||||
id = p.id,
|
||||
productId = p.productId,
|
||||
createTime = p.createTime,
|
||||
outProductId = p.outProductId,
|
||||
title = p.title,
|
||||
path = p.path,
|
||||
headImg = p.headImg,
|
||||
qualificationPics = p.qualificationPics,
|
||||
//descInfoDesc = p.descInfoDesc,
|
||||
descInfoImgs = p.descInfoImgs,
|
||||
thirdCatId = p.thirdCatId,
|
||||
thirdCatName = p.thirdCatName,
|
||||
brandId = p.brandId,
|
||||
infoVersion = p.infoVersion,
|
||||
lastPostTime = p.lastPostTime,
|
||||
updateTime = p.updateTime,
|
||||
|
||||
}).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
}
|
||||
var list = new PageList<WeChatTransactionComponentGood>(page, pageIndex, pageSize, totalCount);
|
||||
return list;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.Caching.Manual;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.Repository
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件商品关联sku列表 接口实现
|
||||
/// </summary>
|
||||
public class WeChatTransactionComponentGoodSKURepository : BaseRepository<WeChatTransactionComponentGoodSKU>, IWeChatTransactionComponentGoodSKURepository
|
||||
{
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
public WeChatTransactionComponentGoodSKURepository(IUnitOfWork unitOfWork) : base(unitOfWork)
|
||||
{
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<AdminUiCallBack> UpdateAsync(List<WeChatTransactionComponentGoodSKU> 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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.Caching.Manual;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.Repository
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件提交订单 接口实现
|
||||
/// </summary>
|
||||
public class WeChatTransactionComponentOrderRepository : BaseRepository<WeChatTransactionComponentOrder>, IWeChatTransactionComponentOrderRepository
|
||||
{
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
public WeChatTransactionComponentOrderRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
|
||||
{
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.Caching.Manual;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.Repository
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件三级类目 接口实现
|
||||
/// </summary>
|
||||
public class WeChatTransactionComponentThirdCategoryRepository : BaseRepository<WeChatTransactionComponentThirdCategory>, IWeChatTransactionComponentThirdCategoryRepository
|
||||
{
|
||||
public WeChatTransactionComponentThirdCategoryRepository(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 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)
|
||||
{
|
||||
RefAsync<int> totalCount = 0;
|
||||
List<WeChatTransactionComponentThirdCategory> page;
|
||||
if (blUseNoLock)
|
||||
{
|
||||
page = await DbClient.Queryable<WeChatTransactionComponentThirdCategory>()
|
||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||
.WhereIF(predicate != null, predicate).Select(p => new WeChatTransactionComponentThirdCategory
|
||||
{
|
||||
id = p.id,
|
||||
third_cat_id = p.third_cat_id,
|
||||
third_cat_name = p.third_cat_name,
|
||||
qualification = p.qualification,
|
||||
qualification_type = p.qualification_type,
|
||||
product_qualification = p.product_qualification,
|
||||
product_qualification_type = p.product_qualification_type,
|
||||
second_cat_id = p.second_cat_id,
|
||||
second_cat_name = p.second_cat_name,
|
||||
first_cat_id = p.first_cat_id,
|
||||
first_cat_name = p.first_cat_name,
|
||||
createTime = p.createTime,
|
||||
|
||||
}).With(SqlWith.NoLock).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
page = await DbClient.Queryable<WeChatTransactionComponentThirdCategory>()
|
||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||
.WhereIF(predicate != null, predicate).Select(p => new WeChatTransactionComponentThirdCategory
|
||||
{
|
||||
id = p.id,
|
||||
third_cat_id = p.third_cat_id,
|
||||
third_cat_name = p.third_cat_name,
|
||||
qualification = p.qualification,
|
||||
qualification_type = p.qualification_type,
|
||||
product_qualification = p.product_qualification,
|
||||
product_qualification_type = p.product_qualification_type,
|
||||
second_cat_id = p.second_cat_id,
|
||||
second_cat_name = p.second_cat_name,
|
||||
first_cat_id = p.first_cat_id,
|
||||
first_cat_name = p.first_cat_name,
|
||||
createTime = p.createTime,
|
||||
|
||||
}).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
}
|
||||
var list = new PageList<WeChatTransactionComponentThirdCategory>(page, pageIndex, pageSize, totalCount);
|
||||
return list;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -82,7 +82,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="shipAreaId">省市区id</param>
|
||||
/// <param name="shipAddress">收货地址</param>
|
||||
/// <param name="memo">发货描述</param>
|
||||
/// <param name="deliveryCompanyId">直播物流编码</param>
|
||||
/// <param name="deliveryCompanyId">第三方对接物流编码</param>
|
||||
/// <returns></returns>
|
||||
public async Task<WebApiCallBack> BatchShip(string[] orderId, string logiCode, string logiNo, Dictionary<int, int> items, int storeId = 0, string shipName = "", string shipMobile = "", int shipAreaId = 0, string shipAddress = "", string memo = "", string deliveryCompanyId = "")
|
||||
{
|
||||
@@ -230,7 +230,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="shipAreaId">省市区id</param>
|
||||
/// <param name="shipAddress">收货地址</param>
|
||||
/// <param name="memo">发货描述</param>
|
||||
/// <param name="deliveryCompanyId">直播物流编码</param>
|
||||
/// <param name="deliveryCompanyId">第三方对接物流编码</param>
|
||||
/// <returns></returns>
|
||||
public async Task<WebApiCallBack> Ship(string orderId, string logiCode, string logiNo, Dictionary<int, int> items, int storeId = 0, string shipName = "", string shipMobile = "", int shipAreaId = 0, string shipAddress = "", string memo = "", string deliveryCompanyId = "")
|
||||
{
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/6/29 16:22:45
|
||||
* 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 CoreCmsCheckBeforeAddOrderServices : BaseServices<CoreCmsCheckBeforeAddOrder>, ICoreCmsCheckBeforeAddOrderServices
|
||||
{
|
||||
private readonly ICoreCmsCheckBeforeAddOrderRepository _dal;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
|
||||
public CoreCmsCheckBeforeAddOrderServices(IUnitOfWork unitOfWork, ICoreCmsCheckBeforeAddOrderRepository dal)
|
||||
{
|
||||
this._dal = dal;
|
||||
base.BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,6 @@ using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Utility.Extensions;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using CoreCms.Net.WeChat.Service.HttpClients;
|
||||
using CoreCms.Net.WeChat.Service.TransactionComponent.Enum;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
@@ -80,9 +79,6 @@ namespace CoreCms.Net.Services
|
||||
private readonly ICoreCmsPromotionRecordServices _promotionRecordServices;
|
||||
private readonly IRedisOperationRepository _redisOperationRepository;
|
||||
private readonly ICoreCmsUserWeChatInfoServices _userWeChatInfoServices;
|
||||
private readonly IWeChatTransactionComponentOrderServices _tcOrderServices;
|
||||
private readonly ICoreCmsCheckBeforeAddOrderServices _checkBeforeAddOrderServices;
|
||||
private readonly IWeChatTransactionComponentOrderServices _chatTransactionComponentOrderServices;
|
||||
private readonly WeChat.Service.HttpClients.IWeChatApiHttpClientFactory _weChatApiHttpClientFactory;
|
||||
|
||||
private IUnitOfWork _unitOfWork;
|
||||
@@ -111,7 +107,7 @@ namespace CoreCms.Net.Services
|
||||
, ICoreCmsPaymentsServices paymentsServices
|
||||
, ICoreCmsBillRefundServices billRefundServices
|
||||
, ICoreCmsBillLadingServices billLadingServices
|
||||
, ICoreCmsBillReshipServices billReshipServices, ICoreCmsMessageCenterServices messageCenterServices, ICoreCmsGoodsCommentServices goodsCommentServices, ISysTaskLogServices taskLogServices, ICoreCmsPromotionRecordServices promotionRecordServices, IRedisOperationRepository redisOperationRepository, ICoreCmsUserWeChatInfoServices userWeChatInfoServices, IWeChatTransactionComponentOrderServices tcOrderServices, ICoreCmsCheckBeforeAddOrderServices checkBeforeAddOrderServices, IWeChatApiHttpClientFactory weChatApiHttpClientFactory, IWeChatTransactionComponentOrderServices chatTransactionComponentOrderServices, IUnitOfWork unitOfWork)
|
||||
, ICoreCmsBillReshipServices billReshipServices, ICoreCmsMessageCenterServices messageCenterServices, ICoreCmsGoodsCommentServices goodsCommentServices, ISysTaskLogServices taskLogServices, ICoreCmsPromotionRecordServices promotionRecordServices, IRedisOperationRepository redisOperationRepository, ICoreCmsUserWeChatInfoServices userWeChatInfoServices, IWeChatApiHttpClientFactory weChatApiHttpClientFactory, IUnitOfWork unitOfWork)
|
||||
{
|
||||
this._dal = dal;
|
||||
base.BaseDal = dal;
|
||||
@@ -146,10 +142,7 @@ namespace CoreCms.Net.Services
|
||||
_promotionRecordServices = promotionRecordServices;
|
||||
_redisOperationRepository = redisOperationRepository;
|
||||
_userWeChatInfoServices = userWeChatInfoServices;
|
||||
_tcOrderServices = tcOrderServices;
|
||||
_checkBeforeAddOrderServices = checkBeforeAddOrderServices;
|
||||
_weChatApiHttpClientFactory = weChatApiHttpClientFactory;
|
||||
_chatTransactionComponentOrderServices = chatTransactionComponentOrderServices;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
@@ -290,17 +283,6 @@ namespace CoreCms.Net.Services
|
||||
order.createTime = DateTime.Now;
|
||||
order.scene = scene;
|
||||
|
||||
|
||||
//插入获取的下单前的微信视频号直接数据
|
||||
var check = new CoreCmsCheckBeforeAddOrder();
|
||||
check.orderId = order.orderId;
|
||||
check.requireOrder = requireOrder;
|
||||
check.requiredFundType = requiredFundType;
|
||||
check.traceId = traceId;
|
||||
check.createTime = DateTime.Now;
|
||||
|
||||
await _checkBeforeAddOrderServices.InsertAsync(check);
|
||||
|
||||
//上面保存好订单表,下面保存订单的其他信息
|
||||
if (orderItems == null)
|
||||
{
|
||||
@@ -473,102 +455,6 @@ namespace CoreCms.Net.Services
|
||||
order.taxTitle = taxName;
|
||||
order.taxCode = taxCode;
|
||||
|
||||
|
||||
if (requireOrder == (int)GlobalEnumVars.RequireOrderType.需要)
|
||||
{
|
||||
|
||||
//获取小程序认证
|
||||
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
|
||||
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
|
||||
|
||||
var orderInfo = new ShopOrderAddRequest
|
||||
{
|
||||
AccessToken = accessToken,
|
||||
Scene = scene,
|
||||
//基础
|
||||
CreateTime = new DateTimeOffset(DateTime.Now),
|
||||
//FundType = (int)GlobalEnumVars.RequiredFundType.二级商户号订单,
|
||||
FundType = (int)GlobalEnumVars.RequiredFundType.二级商户号订单, //新版自定义交易组件,必须要走二级商户订单模式
|
||||
OutOrderId = order.orderId,
|
||||
PagePath = UniAppConst.OrderPath(order.orderId)
|
||||
};
|
||||
|
||||
var weChatUserInfo = await _userWeChatInfoServices.QueryByClauseAsync(p => p.userId == order.userId, true);
|
||||
if (weChatUserInfo != null)
|
||||
{
|
||||
orderInfo.OpenId = weChatUserInfo.openid;
|
||||
}
|
||||
orderInfo.OutUserId = order.userId.ToString();
|
||||
|
||||
//收货人信息
|
||||
orderInfo.Address = new ShopOrderAddRequest.Types.Address()
|
||||
{
|
||||
ReceiverName = order.shipName,
|
||||
Detail = order.shipAddress,
|
||||
TeleNumber = order.shipMobile,
|
||||
};
|
||||
//发货方式
|
||||
orderInfo.Delivery = new ShopOrderAddRequest.Types.Delivery()
|
||||
{
|
||||
DeliveryType = (int)DeliveryTypeEnum.正常快递
|
||||
};
|
||||
|
||||
orderInfo.OrderDetail = new ShopOrderAddRequest.Types.OrderDetail();
|
||||
|
||||
//支付信息
|
||||
orderInfo.OrderDetail.Payment = new ShopOrderAddRequest.Types.OrderDetail.Types.Payment()
|
||||
{
|
||||
PayType = (int)GlobalEnumVars.PayMethodType.微信支付
|
||||
};
|
||||
//价格体系
|
||||
orderInfo.OrderDetail.Amount = new ShopOrderAddRequest.Types.OrderDetail.Types.Amount()
|
||||
{
|
||||
OrderFee = Convert.ToInt32(order.orderAmount * 100),
|
||||
FreightFee = Convert.ToInt32(order.costFreight * 100),
|
||||
DiscountedFee = Convert.ToInt32((order.pointMoney + order.orderDiscountAmount + order.goodsDiscountAmount + order.couponDiscountAmount) * 100),
|
||||
AdditionalPrice = 0,
|
||||
AdditionalRemark = "无",
|
||||
};
|
||||
|
||||
//商品信息
|
||||
orderInfo.OrderDetail.ProductList = new List<ShopOrderAddRequest.Types.OrderDetail.Types.Product>();
|
||||
|
||||
|
||||
foreach (var item in orderItems)
|
||||
{
|
||||
orderInfo.OrderDetail.ProductList.Add(new ShopOrderAddRequest.Types.OrderDetail.Types.Product()
|
||||
{
|
||||
OutProductId = item.goodsId.ToString(),
|
||||
OutSKUId = item.productId.ToString(),
|
||||
Count = item.nums,
|
||||
SalePrice = Convert.ToInt32(item.amount * 100),
|
||||
SKURealPrice = Convert.ToInt32(item.amount * 100),
|
||||
PagePath = UniAppConst.GoodDetail(item.goodsId.ToString()),
|
||||
Title = item.name,
|
||||
HeadImageUrl = item.imageUrl
|
||||
});
|
||||
}
|
||||
|
||||
var shopOrderAddResponse = await client.ExecuteShopOrderAddAsync(orderInfo);
|
||||
if (shopOrderAddResponse.IsSuccessful())
|
||||
{
|
||||
var tcOrder = new WeChatTransactionComponentOrder
|
||||
{
|
||||
orderId = shopOrderAddResponse.Data.OrderId,
|
||||
outOrderId = shopOrderAddResponse.Data.OutOrderId,
|
||||
createTime = DateTime.Now,
|
||||
openid = orderInfo.OpenId
|
||||
};
|
||||
await _chatTransactionComponentOrderServices.InsertAsync(tcOrder);
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Info, LogType.Order, "自定义交易组件", "推送自定义交易组件创建订单成功");
|
||||
}
|
||||
else
|
||||
{
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Error, LogType.Order, "自定义交易组件 ", "推送自定义交易组件创建订单失败");
|
||||
}
|
||||
jm.otherData = shopOrderAddResponse;
|
||||
}
|
||||
|
||||
//发送消息
|
||||
//0元订单记录支付成功
|
||||
if (order.orderAmount <= 0)
|
||||
@@ -1047,9 +933,6 @@ namespace CoreCms.Net.Services
|
||||
};
|
||||
}
|
||||
|
||||
order.tcOrder = await _tcOrderServices.QueryByClauseAsync(p => p.outOrderId == order.orderId);
|
||||
|
||||
|
||||
jm.status = true;
|
||||
jm.data = order;
|
||||
jm.msg = GlobalConstVars.GetDataSuccess;
|
||||
@@ -1693,9 +1576,6 @@ namespace CoreCms.Net.Services
|
||||
_goodsServices.ChangeStock(item.productId, GlobalEnumVars.OrderChangeStockType.cancel.ToString(), item.nums);
|
||||
}
|
||||
|
||||
var orderInfoIds = orderInfo.Select(p => p.orderId).ToList();
|
||||
await CloseOrder(orderInfoIds);
|
||||
|
||||
jm.status = true;
|
||||
jm.msg = "订单取消成功";
|
||||
}
|
||||
@@ -2093,7 +1973,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="memo">发货描述</param>
|
||||
/// <param name="storeId">店铺收货地址</param>
|
||||
/// <param name="shipAreaId">省市区id</param>
|
||||
/// <param name="deliveryCompanyId">直播物流编码</param>
|
||||
/// <param name="deliveryCompanyId">第三方对接物流编码</param>
|
||||
/// <returns></returns>
|
||||
public async Task<WebApiCallBack> BatchShip(string[] ids, string logiCode, string logiNo,
|
||||
Dictionary<int, int> items, string shipName, string shipMobile, string shipAddress, string memo, int storeId = 0, int shipAreaId = 0, string deliveryCompanyId = "")
|
||||
@@ -2120,7 +2000,7 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="memo">发货描述</param>
|
||||
/// <param name="storeId">店铺收货地址</param>
|
||||
/// <param name="shipAreaId">省市区id</param>
|
||||
/// <param name="deliveryCompanyId">直播物流编码</param>
|
||||
/// <param name="deliveryCompanyId">第三方对接物流编码</param>
|
||||
/// <returns></returns>
|
||||
public async Task<WebApiCallBack> Ship(string orderId, string logiCode, string logiNo,
|
||||
Dictionary<int, int> items, string shipName, string shipMobile, string shipAddress, string memo, int storeId = 0, int shipAreaId = 0, string deliveryCompanyId = "")
|
||||
@@ -2393,11 +2273,8 @@ namespace CoreCms.Net.Services
|
||||
{
|
||||
var ids = orderInfos.Select(p => p.orderId).ToArray();
|
||||
jm = await CancelOrder(ids);
|
||||
|
||||
await CloseOrder(ids.ToList());
|
||||
}
|
||||
|
||||
|
||||
//插入日志
|
||||
var model = new SysTaskLog
|
||||
{
|
||||
@@ -2645,45 +2522,5 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 自定义交易组件-关闭订单
|
||||
|
||||
private async Task CloseOrder(ICollection<string> ids)
|
||||
{
|
||||
|
||||
//判断是否是自定义交易订单
|
||||
var coreCmsCheckBeforeAddOrders = await _checkBeforeAddOrderServices.QueryListByClauseAsync(p => ids.Contains(p.orderId) && p.requireOrder == (int)GlobalEnumVars.RequireOrderType.需要);
|
||||
if (coreCmsCheckBeforeAddOrders.Any())
|
||||
{
|
||||
var dataIds = coreCmsCheckBeforeAddOrders.Select(p => p.orderId).ToList();
|
||||
var orderInfos = await _dal.QueryListByClauseAsync(p => dataIds.Contains(p.orderId), p => p.createTime, OrderByType.Asc, true);
|
||||
|
||||
//获取小程序认证
|
||||
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
|
||||
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
|
||||
|
||||
|
||||
foreach (var item in orderInfos)
|
||||
{
|
||||
var request = new ShopOrderCloseRequest();
|
||||
request.AccessToken = accessToken;
|
||||
request.OutOrderId = item.orderId;
|
||||
|
||||
var user = await _userWeChatInfoServices.QueryByClauseAsync(p => p.userId == item.userId);
|
||||
if (user == null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
request.OutOrderId = item.orderId;
|
||||
request.OpenId = user.openid;
|
||||
|
||||
var response = await client.ExecuteShopOrderCloseAsync(request);
|
||||
NLogUtil.WriteAll(response.IsSuccessful() ? NLog.LogLevel.Info : NLog.LogLevel.Error,
|
||||
LogType.Web, "自定义交易组件-关闭订单", JsonConvert.SerializeObject(response));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,241 +71,170 @@ 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 billPaymentsServices = container.ServiceProvider.GetService<ICoreCmsBillPaymentsServices>();
|
||||
var checkBeforeAddOrderServices = container.ServiceProvider.GetService<ICoreCmsCheckBeforeAddOrderServices>();
|
||||
var transactionComponentOrderServices = container.ServiceProvider.GetService<IWeChatTransactionComponentOrderServices>();
|
||||
|
||||
var jm = new WebApiCallBack();
|
||||
|
||||
var payment = await billPaymentsServices.QueryByClauseAsync(p => p.paymentId == entity.paymentId);
|
||||
var checkBeforeAddOrder = await checkBeforeAddOrderServices.QueryByClauseAsync(p => p.orderId == payment.sourceId);
|
||||
if (checkBeforeAddOrder is { requireOrder: (int)GlobalEnumVars.RequireOrderType.需要 })
|
||||
var tradeType = GlobalEnumVars.WeiChatPayTradeType.JSAPI.ToString();
|
||||
if (!string.IsNullOrEmpty(entity.parameters))
|
||||
{
|
||||
var order = await transactionComponentOrderServices.QueryByClauseAsync(p => p.outOrderId == payment.sourceId);
|
||||
var jObj = (JObject)JsonConvert.DeserializeObject(entity.parameters);
|
||||
if (jObj != null && jObj.TryGetValue("trade_type", out var value))
|
||||
tradeType = PayHelper.GetWeiChatPayTradeType(value.ObjectToString());
|
||||
}
|
||||
|
||||
//获取小程序认证
|
||||
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
|
||||
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
|
||||
var config = await _weChatPayConfigServices.QueryByClauseAsync(p => p.isDefault == true && p.isEnable == true && p.appType == tradeType);
|
||||
if (config == null)
|
||||
{
|
||||
jm.msg = "支付配置信息获取失败";
|
||||
return jm;
|
||||
}
|
||||
|
||||
var getPaymentParameters = new ShopOrderGetPaymentParametersRequest
|
||||
if (string.IsNullOrEmpty(config.notifyUrl))
|
||||
{
|
||||
jm.msg = "未获取到配置的通知地址";
|
||||
return jm;
|
||||
}
|
||||
|
||||
//构建linkPay请求配置实体
|
||||
var payOptions = new WeChatPayOptions
|
||||
{
|
||||
AppId = config.appId,
|
||||
MchId = config.mchId,
|
||||
APIKey = config.apiKey,
|
||||
APIv3Key = config.apiV3Key,
|
||||
Certificate = config.certificate,
|
||||
RsaPublicKey = config.rsaPublicKey,
|
||||
SubAppId = config.subAppId,
|
||||
SubMchId = config.subMchId
|
||||
};
|
||||
|
||||
var openId = string.Empty;
|
||||
if (tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI.ToString() || tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI_OFFICIAL.ToString())
|
||||
{
|
||||
var type = tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI.ToString()
|
||||
? (int)GlobalEnumVars.UserAccountTypes.微信小程序
|
||||
: (int)GlobalEnumVars.UserAccountTypes.微信公众号;
|
||||
|
||||
var user = await _userWeChatInfoServices.QueryByClauseAsync(p => p.userId == _user.ID && p.type == type, p => p.createTime, OrderByType.Desc);
|
||||
if (user == null)
|
||||
{
|
||||
AccessToken = accessToken,
|
||||
OpenId = order.openid,
|
||||
OrderId = order.orderId,
|
||||
OutOrderId = order.outOrderId
|
||||
};
|
||||
jm.msg = "微信用户信息获取失败";
|
||||
return jm;
|
||||
}
|
||||
|
||||
var shopOrderGetPayment = await client.ExecuteShopOrderGetPaymentParametersAsync(getPaymentParameters);
|
||||
if (shopOrderGetPayment.IsSuccessful())
|
||||
|
||||
openId = user.openid;
|
||||
}
|
||||
|
||||
var notifyUrl = config.notifyUrl.EndsWith("/") ? config.notifyUrl + "m-" + config.appId : config.notifyUrl + "/m-" + config.appId;
|
||||
|
||||
|
||||
var orderRequest = new WeChatPayUnifiedOrderRequest
|
||||
{
|
||||
Body = entity.payTitle.Length > 40 ? entity.payTitle[..40] : entity.payTitle,
|
||||
OutTradeNo = entity.paymentId,
|
||||
TotalFee = Convert.ToInt32(entity.money * 100),
|
||||
SpBillCreateIp = entity.ip,
|
||||
NotifyUrl = notifyUrl,
|
||||
TradeType = tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI_OFFICIAL.ToString() ? GlobalEnumVars.WeiChatPayTradeType.JSAPI.ToString() : tradeType,
|
||||
//OpenId = openId
|
||||
};
|
||||
|
||||
if (tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI.ToString() || tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI_OFFICIAL.ToString())
|
||||
{
|
||||
if (!string.IsNullOrEmpty(payOptions.SubMchId))
|
||||
{
|
||||
jm.data = new
|
||||
{
|
||||
shopOrderGetPayment.PaymentParameters,
|
||||
checkBeforeAddOrder,
|
||||
entity.paymentId
|
||||
};
|
||||
jm.status = true;
|
||||
await transactionComponentOrderServices.UpdateAsync(p => new WeChatTransactionComponentOrder() { paymentId = entity.paymentId },
|
||||
p => p.outOrderId == payment.sourceId);
|
||||
orderRequest.SubOpenId = openId;
|
||||
}
|
||||
else
|
||||
{
|
||||
jm.status = false;
|
||||
jm.msg = shopOrderGetPayment.ErrorMessage;
|
||||
orderRequest.OpenId = openId;
|
||||
}
|
||||
}
|
||||
|
||||
var response = await _client.ExecuteAsync(orderRequest, payOptions);
|
||||
if (response.ReturnCode == WeChatPayCode.Success && response.ResultCode == WeChatPayCode.Success)
|
||||
{
|
||||
//App微信支付
|
||||
if (tradeType == GlobalEnumVars.WeiChatPayTradeType.APP.ToString())
|
||||
{
|
||||
var reqApp = new WeChatPayAppSdkRequest()
|
||||
{
|
||||
PrepayId = response.PrepayId
|
||||
};
|
||||
var parameter = await _client.ExecuteAsync(reqApp, payOptions);
|
||||
parameter.Add("paymentId", entity.paymentId);
|
||||
jm.status = true;
|
||||
jm.msg = "创建微信APP支付环境成功";
|
||||
jm.data = parameter;
|
||||
jm.otherData = response;
|
||||
}
|
||||
//JsApi通用微信支付
|
||||
else if (tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI.ToString())
|
||||
{
|
||||
// 将参数(parameter)给 公众号前端 让他在微信内H5调起支付(https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_7&index=6)
|
||||
var req = new WeChatPayJsApiSdkRequest
|
||||
{
|
||||
Package = "prepay_id=" + response.PrepayId
|
||||
};
|
||||
var parameter = await _client.ExecuteAsync(req, payOptions);
|
||||
parameter.Add("paymentId", entity.paymentId);
|
||||
jm.status = true;
|
||||
jm.msg = "创建JSAPI支付环境成功";
|
||||
jm.data = parameter;
|
||||
jm.otherData = response;
|
||||
}
|
||||
//JsApi通用微信支付(和上一样,但是为了区分,单独编写。)
|
||||
else if (tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI_OFFICIAL.ToString())
|
||||
{
|
||||
// 将参数(parameter)给 公众号前端 让他在微信内H5调起支付(https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_7&index=6)
|
||||
var req = new WeChatPayJsApiSdkRequest
|
||||
{
|
||||
Package = "prepay_id=" + response.PrepayId
|
||||
};
|
||||
var parameter = await _client.ExecuteAsync(req, payOptions);
|
||||
parameter.Add("paymentId", entity.paymentId);
|
||||
jm.status = true;
|
||||
jm.msg = "创建微信公众号支付环境成功";
|
||||
jm.data = parameter;
|
||||
jm.otherData = response;
|
||||
}
|
||||
//扫码支付
|
||||
else if (tradeType == GlobalEnumVars.WeiChatPayTradeType.NATIVE.ToString())
|
||||
{
|
||||
jm.status = true;
|
||||
jm.msg = "创建微信扫码支付环境成功";
|
||||
jm.data = new
|
||||
{
|
||||
response,
|
||||
entity.paymentId
|
||||
};
|
||||
//确定是否存在扫码的图片,然后转成base64到前端进行扫码支付
|
||||
if (!string.IsNullOrEmpty(response.CodeUrl) && response.CodeUrl.Contains("weixin://wxpay/bizpayurl?pr="))
|
||||
{
|
||||
using var qrGenerator = new QRCodeGenerator();
|
||||
using var qrCodeData = qrGenerator.CreateQrCode(response.CodeUrl, QRCodeGenerator.ECCLevel.L);
|
||||
using var pngByteQrCode = new PngByteQRCode(qrCodeData);
|
||||
var pngBytes = pngByteQrCode.GetGraphic(20, false);
|
||||
var stringBase64Str = Convert.ToBase64String(pngBytes);
|
||||
jm.otherData = stringBase64Str;
|
||||
}
|
||||
}
|
||||
//H5支付
|
||||
else if (tradeType == GlobalEnumVars.WeiChatPayTradeType.MWEB.ToString())
|
||||
{
|
||||
jm.status = true;
|
||||
jm.msg = "创建H5支付环境成功";
|
||||
jm.data = response;
|
||||
}
|
||||
return jm;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
var tradeType = GlobalEnumVars.WeiChatPayTradeType.JSAPI.ToString();
|
||||
if (!string.IsNullOrEmpty(entity.parameters))
|
||||
{
|
||||
var jObj = (JObject)JsonConvert.DeserializeObject(entity.parameters);
|
||||
if (jObj != null && jObj.TryGetValue("trade_type", out var value))
|
||||
tradeType = PayHelper.GetWeiChatPayTradeType(value.ObjectToString());
|
||||
}
|
||||
|
||||
|
||||
var config = await _weChatPayConfigServices.QueryByClauseAsync(p =>
|
||||
p.isDefault == true && p.isEnable == true && p.appType == tradeType);
|
||||
if (config == null)
|
||||
{
|
||||
jm.msg = "支付配置信息获取失败";
|
||||
return jm;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(config.notifyUrl))
|
||||
{
|
||||
jm.msg = "未获取到配置的通知地址";
|
||||
return jm;
|
||||
}
|
||||
|
||||
//构建linkPay请求配置实体
|
||||
var payOptions = new WeChatPayOptions
|
||||
{
|
||||
AppId = config.appId,
|
||||
MchId = config.mchId,
|
||||
APIKey = config.apiKey,
|
||||
APIv3Key = config.apiV3Key,
|
||||
Certificate = config.certificate,
|
||||
RsaPublicKey = config.rsaPublicKey,
|
||||
SubAppId = config.subAppId,
|
||||
SubMchId = config.subMchId
|
||||
};
|
||||
|
||||
var openId = string.Empty;
|
||||
if (tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI.ToString() || tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI_OFFICIAL.ToString())
|
||||
{
|
||||
//var userAccount = await _userServices.QueryByIdAsync(_user.ID);
|
||||
//if (userAccount == null)
|
||||
//{
|
||||
// jm.msg = "用户账户获取失败";
|
||||
// return jm;
|
||||
//}
|
||||
|
||||
//if (userAccount.userWx <= 0)
|
||||
//{
|
||||
// jm.msg = "账户关联微信用户信息获取失败";
|
||||
// return jm;
|
||||
//}
|
||||
|
||||
//var user = await _userWeChatInfoServices.QueryByClauseAsync(p => p.id == userAccount.userWx);
|
||||
//if (user == null)
|
||||
//{
|
||||
// jm.msg = "微信用户信息获取失败";
|
||||
// return jm;
|
||||
//}
|
||||
|
||||
var type = tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI.ToString()
|
||||
? (int)GlobalEnumVars.UserAccountTypes.微信小程序
|
||||
: (int)GlobalEnumVars.UserAccountTypes.微信公众号;
|
||||
|
||||
var user = await _userWeChatInfoServices.QueryByClauseAsync(p => p.userId == _user.ID && p.type == type, p => p.createTime, OrderByType.Desc);
|
||||
if (user == null)
|
||||
{
|
||||
jm.msg = "微信用户信息获取失败";
|
||||
return jm;
|
||||
}
|
||||
|
||||
|
||||
openId = user.openid;
|
||||
}
|
||||
|
||||
var notifyUrl = config.notifyUrl.EndsWith("/") ? config.notifyUrl + "m-" + config.appId : config.notifyUrl + "/m-" + config.appId;
|
||||
|
||||
|
||||
var orderRequest = new WeChatPayUnifiedOrderRequest
|
||||
{
|
||||
Body = entity.payTitle.Length > 40 ? entity.payTitle[..40] : entity.payTitle,
|
||||
OutTradeNo = entity.paymentId,
|
||||
TotalFee = Convert.ToInt32(entity.money * 100),
|
||||
SpBillCreateIp = entity.ip,
|
||||
NotifyUrl = notifyUrl,
|
||||
TradeType = tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI_OFFICIAL.ToString() ? GlobalEnumVars.WeiChatPayTradeType.JSAPI.ToString() : tradeType,
|
||||
//OpenId = openId
|
||||
};
|
||||
|
||||
if (tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI.ToString() || tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI_OFFICIAL.ToString())
|
||||
{
|
||||
if (!string.IsNullOrEmpty(payOptions.SubMchId))
|
||||
{
|
||||
orderRequest.SubOpenId = openId;
|
||||
}
|
||||
else
|
||||
{
|
||||
orderRequest.OpenId = openId;
|
||||
}
|
||||
}
|
||||
|
||||
var response = await _client.ExecuteAsync(orderRequest, payOptions);
|
||||
if (response.ReturnCode == WeChatPayCode.Success && response.ResultCode == WeChatPayCode.Success)
|
||||
{
|
||||
//App微信支付
|
||||
if (tradeType == GlobalEnumVars.WeiChatPayTradeType.APP.ToString())
|
||||
{
|
||||
var reqApp = new WeChatPayAppSdkRequest()
|
||||
{
|
||||
PrepayId = response.PrepayId
|
||||
};
|
||||
var parameter = await _client.ExecuteAsync(reqApp, payOptions);
|
||||
parameter.Add("paymentId", entity.paymentId);
|
||||
jm.status = true;
|
||||
jm.msg = "创建微信APP支付环境成功";
|
||||
jm.data = parameter;
|
||||
jm.otherData = response;
|
||||
}
|
||||
//JsApi通用微信支付
|
||||
else if (tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI.ToString())
|
||||
{
|
||||
// 将参数(parameter)给 公众号前端 让他在微信内H5调起支付(https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_7&index=6)
|
||||
var req = new WeChatPayJsApiSdkRequest
|
||||
{
|
||||
Package = "prepay_id=" + response.PrepayId
|
||||
};
|
||||
var parameter = await _client.ExecuteAsync(req, payOptions);
|
||||
parameter.Add("paymentId", entity.paymentId);
|
||||
jm.status = true;
|
||||
jm.msg = "创建JSAPI支付环境成功";
|
||||
jm.data = parameter;
|
||||
jm.otherData = response;
|
||||
}
|
||||
//JsApi通用微信支付(和上一样,但是为了区分,单独编写。)
|
||||
else if (tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI_OFFICIAL.ToString())
|
||||
{
|
||||
// 将参数(parameter)给 公众号前端 让他在微信内H5调起支付(https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_7&index=6)
|
||||
var req = new WeChatPayJsApiSdkRequest
|
||||
{
|
||||
Package = "prepay_id=" + response.PrepayId
|
||||
};
|
||||
var parameter = await _client.ExecuteAsync(req, payOptions);
|
||||
parameter.Add("paymentId", entity.paymentId);
|
||||
jm.status = true;
|
||||
jm.msg = "创建微信公众号支付环境成功";
|
||||
jm.data = parameter;
|
||||
jm.otherData = response;
|
||||
}
|
||||
//扫码支付
|
||||
else if (tradeType == GlobalEnumVars.WeiChatPayTradeType.NATIVE.ToString())
|
||||
{
|
||||
jm.status = true;
|
||||
jm.msg = "创建微信扫码支付环境成功";
|
||||
jm.data = new
|
||||
{
|
||||
response,
|
||||
entity.paymentId
|
||||
};
|
||||
//确定是否存在扫码的图片,然后转成base64到前端进行扫码支付
|
||||
if (!string.IsNullOrEmpty(response.CodeUrl) && response.CodeUrl.Contains("weixin://wxpay/bizpayurl?pr="))
|
||||
{
|
||||
using var qrGenerator = new QRCodeGenerator();
|
||||
using var qrCodeData = qrGenerator.CreateQrCode(response.CodeUrl, QRCodeGenerator.ECCLevel.L);
|
||||
using var pngByteQrCode = new PngByteQRCode(qrCodeData);
|
||||
var pngBytes = pngByteQrCode.GetGraphic(20, false);
|
||||
var stringBase64Str = Convert.ToBase64String(pngBytes);
|
||||
jm.otherData = stringBase64Str;
|
||||
}
|
||||
}
|
||||
//H5支付
|
||||
else if (tradeType == GlobalEnumVars.WeiChatPayTradeType.MWEB.ToString())
|
||||
{
|
||||
jm.status = true;
|
||||
jm.msg = "创建H5支付环境成功";
|
||||
jm.data = response;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jm.status = false;
|
||||
jm.msg = "微信建立支付请求失败";
|
||||
jm.otherData = response;
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Error, LogType.Web, "微信支付失败", JsonConvert.SerializeObject(response));
|
||||
}
|
||||
return jm;
|
||||
jm.status = false;
|
||||
jm.msg = "微信建立支付请求失败";
|
||||
jm.otherData = response;
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Error, LogType.Web, "微信支付失败", JsonConvert.SerializeObject(response));
|
||||
}
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,189 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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 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.SecondCategoryId = entity.level2;
|
||||
request.Audit.Category.ThirdCategoryId = entity.level3;
|
||||
request.Audit.Category.CertificateUrlList = entity.certificateImage.Split(",").ToList();
|
||||
//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 async Task<AdminUiCallBack> UpdateAsync(WeChatTransactionComponentAuditCategory entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
{
|
||||
return await _dal.DeleteByIdAsync(id);
|
||||
}
|
||||
|
||||
#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 = (int)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 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
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.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 WeChatTransactionComponentBrandAuditLogServices : BaseServices<WeChatTransactionComponentBrandAuditLog>, IWeChatTransactionComponentBrandAuditLogServices
|
||||
{
|
||||
private readonly IWeChatTransactionComponentBrandAuditLogRepository _dal;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
|
||||
public WeChatTransactionComponentBrandAuditLogServices(IUnitOfWork unitOfWork, IWeChatTransactionComponentBrandAuditLogRepository dal)
|
||||
{
|
||||
this._dal = dal;
|
||||
base.BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/3/20 1:01:47
|
||||
* 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 WeChatTransactionComponentBrandAuditServices : BaseServices<WeChatTransactionComponentBrandAudit>, IWeChatTransactionComponentBrandAuditServices
|
||||
{
|
||||
private readonly IWeChatTransactionComponentBrandAuditRepository _dal;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
|
||||
public WeChatTransactionComponentBrandAuditServices(IUnitOfWork unitOfWork, IWeChatTransactionComponentBrandAuditRepository dal)
|
||||
{
|
||||
this._dal = dal;
|
||||
base.BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public async Task<AdminUiCallBack> InsertAsync(WeChatTransactionComponentBrandAudit entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<AdminUiCallBack> UpdateAsync(WeChatTransactionComponentBrandAudit entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
{
|
||||
return await _dal.DeleteByIdAsync(id);
|
||||
}
|
||||
|
||||
#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 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)
|
||||
{
|
||||
return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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();
|
||||
}
|
||||
|
||||
#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 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
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<AdminUiCallBack> UpdateAsync(List<WeChatTransactionComponentGoodSKU> entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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 async Task<AdminUiCallBack> InsertAsync(WeChatTransactionComponentGood entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<AdminUiCallBack> UpdateAsync(WeChatTransactionComponentGood entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
{
|
||||
return await _dal.DeleteByIdAsync(id);
|
||||
}
|
||||
|
||||
#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 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
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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="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 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
|
||||
|
||||
}
|
||||
}
|
||||
@@ -143,8 +143,6 @@
|
||||
*/
|
||||
console.log("支付宝支付入参app", data)
|
||||
_this.$u.api.pay(data).then(res => {
|
||||
//console.log("支付宝支付返回参数app", res)
|
||||
//console.log("支付宝app支付get提交数据", res.data)
|
||||
if (res.status) {
|
||||
uni.requestPayment({
|
||||
provider: "alipay",
|
||||
@@ -168,12 +166,9 @@
|
||||
})
|
||||
break
|
||||
case 'wechatpay':
|
||||
|
||||
// 微信app支付
|
||||
_this.$u.api.pay(data).then(res => {
|
||||
if (res.status) {
|
||||
//console.log(JSON.stringify(res));
|
||||
// 调用微信支付
|
||||
uni.requestPayment({
|
||||
provider: "wxpay",
|
||||
orderInfo: {
|
||||
|
||||
@@ -92,8 +92,6 @@
|
||||
},
|
||||
mounted() {
|
||||
this.getPayments();
|
||||
//console.log('类型:' + this.type);
|
||||
//console.log('订单号:' + this.orderId);
|
||||
},
|
||||
methods: {
|
||||
// 获取可用支付方式列表
|
||||
@@ -123,7 +121,6 @@
|
||||
},
|
||||
// 用户点击支付方式处理
|
||||
toPayHandler(e) {
|
||||
//this.popShow = true;
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
@@ -152,58 +149,30 @@
|
||||
this.$u.api.pay(data).then(res => {
|
||||
console.log(res);
|
||||
if (res.status) {
|
||||
if (res.data.checkBeforeAddOrder && res.data.checkBeforeAddOrder.requireOrder == 1) {
|
||||
console.log("自定义交易组件");
|
||||
wx.requestOrderPayment({
|
||||
timeStamp: res.data.paymentParameters.timeStamp + '',
|
||||
nonceStr: res.data.paymentParameters.nonceStr,
|
||||
package: res.data.paymentParameters.package,
|
||||
signType: res.data.paymentParameters.signType,
|
||||
paySign: res.data.paymentParameters.paySign,
|
||||
success: function (e) {
|
||||
uni.hideLoading();
|
||||
if (e.errMsg === 'requestOrderPayment:ok') {
|
||||
_this.$u.route({ type: 'redirectTo', url: '/pages/payment/result/result?id=' + res.data.paymentId });
|
||||
}
|
||||
},
|
||||
fail: function (res) {
|
||||
if (res.errMsg === 'requestPayment:fail cancel') {
|
||||
//_this.popHide();
|
||||
_this.$u.toast("您已经取消此方式支付,可继续选择其他方式支付。")
|
||||
}
|
||||
setTimeout(function () {
|
||||
uni.hideLoading();
|
||||
}, 500);
|
||||
console.log("普通订单");
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
timeStamp: res.data.timeStamp,
|
||||
nonceStr: res.data.nonceStr,
|
||||
package: res.data.package,
|
||||
signType: res.data.signType,
|
||||
paySign: res.data.paySign,
|
||||
success: function (e) {
|
||||
uni.hideLoading();
|
||||
if (e.errMsg === 'requestPayment:ok') {
|
||||
_this.$u.route({ type: 'redirectTo', url: '/pages/payment/result/result?id=' + res.data.paymentId });
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.log("普通订单");
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
timeStamp: res.data.timeStamp,
|
||||
nonceStr: res.data.nonceStr,
|
||||
package: res.data.package,
|
||||
signType: res.data.signType,
|
||||
paySign: res.data.paySign,
|
||||
success: function (e) {
|
||||
uni.hideLoading();
|
||||
if (e.errMsg === 'requestPayment:ok') {
|
||||
_this.$u.route({ type: 'redirectTo', url: '/pages/payment/result/result?id=' + res.data.paymentId });
|
||||
}
|
||||
},
|
||||
fail: function (res) {
|
||||
if (res.errMsg === 'requestPayment:fail cancel') {
|
||||
//_this.popHide();
|
||||
_this.$u.toast("您已经取消此方式支付,可继续选择其他方式支付。")
|
||||
}
|
||||
setTimeout(function () {
|
||||
uni.hideLoading();
|
||||
}, 500);
|
||||
},
|
||||
fail: function (res) {
|
||||
if (res.errMsg === 'requestPayment:fail cancel') {
|
||||
_this.$u.toast("您已经取消此方式支付,可继续选择其他方式支付。")
|
||||
}
|
||||
});
|
||||
}
|
||||
setTimeout(function () {
|
||||
uni.hideLoading();
|
||||
}, 500);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
//_this.popHide();
|
||||
setTimeout(function () {
|
||||
uni.hideLoading();
|
||||
_this.$u.toast(res.msg)
|
||||
@@ -221,7 +190,6 @@
|
||||
uni.hideLoading();
|
||||
this.$u.route({ type: 'redirectTo', url: '/pages/payment/result/result?id=' + res.data.paymentId });
|
||||
} else {
|
||||
//this.popHide();
|
||||
setTimeout(function () {
|
||||
_this.$u.toast(res.msg)
|
||||
uni.hideLoading();
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms.Net *
|
||||
* Web: https://CoreCms.Net *
|
||||
* ProjectName: 核心内容管理系统 *
|
||||
* Author: 大灰灰 *
|
||||
* Email: JianWeie@163.com *
|
||||
* CreateTime: 2020-08-13 23:57:23
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Loging;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using CoreCms.Net.WeChat.Service.HttpClients;
|
||||
using CoreCms.Net.WeChat.Service.Models;
|
||||
using MediatR;
|
||||
using Newtonsoft.Json;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api.Events;
|
||||
|
||||
namespace CoreCms.Net.WeChat.Service.Mediator
|
||||
{
|
||||
/// <summary>
|
||||
/// 表示 TEXT 事件的数据
|
||||
/// </summary>
|
||||
public class AftersaleUserCancelEventCommand : IRequest<WeChatApiCallBack>
|
||||
{
|
||||
public AftersaleUserCancelEvent EventObj { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户取消售后申请
|
||||
/// </summary>
|
||||
public class AftersaleUserCancelEventCommandHandler : IRequestHandler<AftersaleUserCancelEventCommand, WeChatApiCallBack>
|
||||
{
|
||||
private readonly ICoreCmsBillAftersalesServices _aftersalesServices;
|
||||
|
||||
|
||||
|
||||
public AftersaleUserCancelEventCommandHandler(ICoreCmsBillAftersalesServices aftersalesServices)
|
||||
{
|
||||
_aftersalesServices = aftersalesServices;
|
||||
}
|
||||
|
||||
public async Task<WeChatApiCallBack> Handle(AftersaleUserCancelEventCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
var jm = new WeChatApiCallBack() { Status = true };
|
||||
if (request.EventObj != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
await _aftersalesServices.UpdateAsync(p => new CoreCmsBillAftersales()
|
||||
{
|
||||
status = (int)GlobalEnumVars.BillAftersalesStatus.Cancel
|
||||
},
|
||||
p => p.aftersalesId == request.EventObj.AftersaleOrder.OutAftersaleOrderId);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
NLogUtil.WriteFileLog(NLog.LogLevel.Info, LogType.WxPost, "接收服务器推送", "用户取消售后申请", e);
|
||||
|
||||
}
|
||||
}
|
||||
return await Task.FromResult(jm);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms.Net *
|
||||
* Web: https://CoreCms.Net *
|
||||
* ProjectName: 核心内容管理系统 *
|
||||
* Author: 大灰灰 *
|
||||
* Email: JianWeie@163.com *
|
||||
* CreateTime: 2020-08-13 23:57:23
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using CoreCms.Net.WeChat.Service.HttpClients;
|
||||
using CoreCms.Net.WeChat.Service.Models;
|
||||
using MediatR;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api.Events;
|
||||
|
||||
namespace CoreCms.Net.WeChat.Service.Mediator
|
||||
{
|
||||
/// <summary>
|
||||
/// 表示 TEXT 事件的数据
|
||||
/// </summary>
|
||||
public class OpenProductBrandAuditEventCommand : IRequest<WeChatApiCallBack>
|
||||
{
|
||||
public OpenProductBrandAuditEvent EventObj { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 品牌审核结果
|
||||
/// </summary>
|
||||
public class OpenProductBrandAuditEventCommandHandler : IRequestHandler<OpenProductBrandAuditEventCommand, WeChatApiCallBack>
|
||||
{
|
||||
private readonly IWeChatTransactionComponentBrandAuditServices _auditServices;
|
||||
private readonly IWeChatTransactionComponentBrandAuditLogServices _logServices;
|
||||
|
||||
private readonly ICoreCmsSettingServices _settingServices;
|
||||
private readonly ICoreCmsSmsServices _smsServices;
|
||||
|
||||
|
||||
public OpenProductBrandAuditEventCommandHandler(IWeChatTransactionComponentBrandAuditServices auditServices, IWeChatTransactionComponentBrandAuditLogServices logServices, ICoreCmsSettingServices settingServices, ICoreCmsSmsServices smsServices)
|
||||
{
|
||||
_auditServices = auditServices;
|
||||
_logServices = logServices;
|
||||
_settingServices = settingServices;
|
||||
_smsServices = smsServices;
|
||||
}
|
||||
|
||||
public async Task<WeChatApiCallBack> Handle(OpenProductBrandAuditEventCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
|
||||
var jm = new WeChatApiCallBack() { Status = true };
|
||||
|
||||
if (request.EventObj != null)
|
||||
{
|
||||
var brand = await _auditServices.QueryByClauseAsync(p => p.audit_id == request.EventObj.EventData.AuditId);
|
||||
if (brand != null)
|
||||
{
|
||||
await _auditServices.UpdateAsync(p => new WeChatTransactionComponentBrandAudit()
|
||||
{
|
||||
status = request.EventObj.EventData.Status,
|
||||
rejectReason = request.EventObj.EventData.RejectReason,
|
||||
brandId = (int)request.EventObj.EventData.BrandId,
|
||||
}, p => p.audit_id == request.EventObj.EventData.AuditId);
|
||||
|
||||
var log = new WeChatTransactionComponentBrandAuditLog();
|
||||
log.audit_id = request.EventObj.EventData.AuditId;
|
||||
log.status = request.EventObj.EventData.Status;
|
||||
log.audit_type = request.EventObj.EventData.AuditType;
|
||||
log.reject_reason = request.EventObj.EventData.RejectReason;
|
||||
log.brand_id = (int)request.EventObj.EventData.BrandId;
|
||||
log.createTime = DateTime.Now;
|
||||
|
||||
var id = await _logServices.InsertAsync(log);
|
||||
if (id > 0)
|
||||
{
|
||||
var smsOptions = await _settingServices.GetSmsOptions();
|
||||
if (smsOptions.Enabled == true)
|
||||
{
|
||||
var smsBody = string.Empty;
|
||||
if (log.status == 1)
|
||||
{
|
||||
smsBody = "你提交的品牌已经通过,请登录平台查看。";
|
||||
}
|
||||
else if (log.status == 9)
|
||||
{
|
||||
smsBody = "你提交的品牌审核已被拒绝,失败原因为:" + log.reject_reason + ",请修改资料后重新提交。";
|
||||
|
||||
}
|
||||
if (!string.IsNullOrEmpty(smsBody))
|
||||
{
|
||||
var allConfigs = await _settingServices.GetConfigDictionaries();
|
||||
var shopMobile = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShopMobile);
|
||||
|
||||
await _smsServices.SendSms(shopMobile, smsBody, smsOptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return await Task.FromResult(jm);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms.Net *
|
||||
* Web: https://CoreCms.Net *
|
||||
* ProjectName: 核心内容管理系统 *
|
||||
* Author: 大灰灰 *
|
||||
* Email: JianWeie@163.com *
|
||||
* CreateTime: 2020-08-13 23:57:23
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using CoreCms.Net.WeChat.Service.HttpClients;
|
||||
using CoreCms.Net.WeChat.Service.Models;
|
||||
using MediatR;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api.Events;
|
||||
|
||||
namespace CoreCms.Net.WeChat.Service.Mediator
|
||||
{
|
||||
/// <summary>
|
||||
/// 表示 TEXT 事件的数据
|
||||
/// </summary>
|
||||
public class OpenProductCategoryAuditEventCommand : IRequest<WeChatApiCallBack>
|
||||
{
|
||||
public OpenProductCategoryAuditEvent EventObj { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 商品审核结果
|
||||
/// </summary>
|
||||
public class OpenProductCategoryAuditEventCommandHandler : IRequestHandler<OpenProductCategoryAuditEventCommand, WeChatApiCallBack>
|
||||
{
|
||||
private readonly IWeChatTransactionComponentAuditCategoryAuditLogServices _logServices;
|
||||
private readonly IWeChatTransactionComponentAuditCategoryServices _auditCategoryServices;
|
||||
private readonly ICoreCmsSettingServices _settingServices;
|
||||
private readonly ICoreCmsSmsServices _smsServices;
|
||||
|
||||
|
||||
public OpenProductCategoryAuditEventCommandHandler(IWeChatTransactionComponentAuditCategoryAuditLogServices logServices, ICoreCmsSettingServices settingServices, ICoreCmsSmsServices smsServices, IWeChatTransactionComponentAuditCategoryServices auditCategoryServices)
|
||||
{
|
||||
_logServices = logServices;
|
||||
_settingServices = settingServices;
|
||||
_smsServices = smsServices;
|
||||
_auditCategoryServices = auditCategoryServices;
|
||||
}
|
||||
|
||||
public async Task<WeChatApiCallBack> Handle(OpenProductCategoryAuditEventCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
|
||||
var jm = new WeChatApiCallBack() { Status = true };
|
||||
|
||||
if (request.EventObj != null)
|
||||
{
|
||||
var auditCategory =
|
||||
await _auditCategoryServices.QueryByClauseAsync(
|
||||
p => p.auditId == request.EventObj.EventData.AuditId);
|
||||
if (auditCategory != null)
|
||||
{
|
||||
await _auditCategoryServices.UpdateAsync(p => new WeChatTransactionComponentAuditCategory()
|
||||
{
|
||||
status = request.EventObj.EventData.Status,
|
||||
rejectReason = request.EventObj.EventData.RejectReason
|
||||
}, p => p.auditId == request.EventObj.EventData.AuditId);
|
||||
|
||||
var log = new WeChatTransactionComponentAuditCategoryAuditLog();
|
||||
log.auditId = request.EventObj.EventData.AuditId;
|
||||
log.status = request.EventObj.EventData.Status;
|
||||
log.auditType = request.EventObj.EventData.AuditType;
|
||||
log.rejectReason = request.EventObj.EventData.RejectReason;
|
||||
log.createTime = DateTime.Now;
|
||||
|
||||
var id = await _logServices.InsertAsync(log);
|
||||
if (id > 0)
|
||||
{
|
||||
var smsOptions = await _settingServices.GetSmsOptions();
|
||||
if (smsOptions.Enabled == true)
|
||||
{
|
||||
var smsBody = string.Empty;
|
||||
if (log.status == 1)
|
||||
{
|
||||
smsBody = "你提交的类目审核已经通过,请登录平台添加新商品。";
|
||||
}
|
||||
else if (log.status == 9)
|
||||
{
|
||||
smsBody = "你提交的类目审核已被拒绝,失败原因为:" + log.rejectReason + ",请修改资料后重新提交。";
|
||||
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(smsBody))
|
||||
{
|
||||
var allConfigs = await _settingServices.GetConfigDictionaries();
|
||||
var shopMobile = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShopMobile); //退货联系方式
|
||||
|
||||
await _smsServices.SendSms(shopMobile, smsBody, smsOptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return await Task.FromResult(jm);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms.Net *
|
||||
* Web: https://CoreCms.Net *
|
||||
* ProjectName: 核心内容管理系统 *
|
||||
* Author: 大灰灰 *
|
||||
* Email: JianWeie@163.com *
|
||||
* CreateTime: 2020-08-13 23:57:23
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Loging;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using CoreCms.Net.WeChat.Service.HttpClients;
|
||||
using CoreCms.Net.WeChat.Service.Models;
|
||||
using MediatR;
|
||||
using Newtonsoft.Json;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api.Events;
|
||||
|
||||
namespace CoreCms.Net.WeChat.Service.Mediator
|
||||
{
|
||||
/// <summary>
|
||||
/// 表示 TEXT 事件的数据
|
||||
/// </summary>
|
||||
public class OpenProductOrderConfirmEventCommand : IRequest<WeChatApiCallBack>
|
||||
{
|
||||
public OpenProductOrderConfirmEvent EventObj { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户确认收货事件回调。
|
||||
/// </summary>
|
||||
public class OpenProductOrderConfirmEventCommandHandler : IRequestHandler<OpenProductOrderConfirmEventCommand, WeChatApiCallBack>
|
||||
{
|
||||
private readonly ICoreCmsOrderServices _orderServices;
|
||||
|
||||
|
||||
|
||||
public OpenProductOrderConfirmEventCommandHandler(ICoreCmsOrderServices orderServices)
|
||||
{
|
||||
_orderServices = orderServices;
|
||||
}
|
||||
|
||||
public async Task<WeChatApiCallBack> Handle(OpenProductOrderConfirmEventCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
var jm = new WeChatApiCallBack() { Status = true };
|
||||
if (request.EventObj != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
await _orderServices.CompleteOrder(request.EventObj.Order.OutOrderId, 0, "微信消息推送事件", "wxpost");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
NLogUtil.WriteFileLog(NLog.LogLevel.Info, LogType.WxPost, "接收服务器推送", "用户确认收货事件回调异常", e);
|
||||
|
||||
}
|
||||
}
|
||||
return await Task.FromResult(jm);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms.Net *
|
||||
* Web: https://CoreCms.Net *
|
||||
* ProjectName: 核心内容管理系统 *
|
||||
* Author: 大灰灰 *
|
||||
* Email: JianWeie@163.com *
|
||||
* CreateTime: 2020-08-13 23:57:23
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Loging;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using CoreCms.Net.WeChat.Service.HttpClients;
|
||||
using CoreCms.Net.WeChat.Service.Models;
|
||||
using MediatR;
|
||||
using Newtonsoft.Json;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api.Events;
|
||||
|
||||
namespace CoreCms.Net.WeChat.Service.Mediator
|
||||
{
|
||||
/// <summary>
|
||||
/// 表示 TEXT 事件的数据
|
||||
/// </summary>
|
||||
public class OpenProductOrderPayEventCommand : IRequest<WeChatApiCallBack>
|
||||
{
|
||||
public OpenProductOrderPayEvent EventObj { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 订单支付回调
|
||||
/// </summary>
|
||||
public class OpenProductOrderPayEventCommandHandler : IRequestHandler<OpenProductOrderPayEventCommand, WeChatApiCallBack>
|
||||
{
|
||||
private readonly ICoreCmsOrderServices _orderServices;
|
||||
private readonly ICoreCmsBillPaymentsServices _billPaymentsServices;
|
||||
private readonly IWeChatTransactionComponentOrderServices _transactionComponentOrderServices;
|
||||
|
||||
|
||||
|
||||
public OpenProductOrderPayEventCommandHandler(ICoreCmsOrderServices orderServices, ICoreCmsBillPaymentsServices billPaymentsServices, IWeChatTransactionComponentOrderServices transactionComponentOrderServices)
|
||||
{
|
||||
_orderServices = orderServices;
|
||||
_billPaymentsServices = billPaymentsServices;
|
||||
_transactionComponentOrderServices = transactionComponentOrderServices;
|
||||
}
|
||||
|
||||
public async Task<WeChatApiCallBack> Handle(OpenProductOrderPayEventCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
var jm = new WeChatApiCallBack() { Status = true };
|
||||
if (request.EventObj != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var tcOrder = await _transactionComponentOrderServices.QueryByClauseAsync(p => p.orderId == request.EventObj.Order.OrderId && p.outOrderId == request.EventObj.Order.OutOrderId);
|
||||
var order = await _orderServices.QueryByClauseAsync(p => p.orderId == tcOrder.outOrderId);
|
||||
|
||||
await _billPaymentsServices.ToUpdate(tcOrder.paymentId,
|
||||
(int)GlobalEnumVars.BillPaymentsStatus.Payed,
|
||||
GlobalEnumVars.PaymentsTypes.wechatpay.ToString(), order.orderAmount, JsonConvert.SerializeObject(request),
|
||||
request.EventObj.Order.TransactionId);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
NLogUtil.WriteFileLog(NLog.LogLevel.Info, LogType.WxPost, "接收服务器推送", "订单支付回调异常", e);
|
||||
|
||||
}
|
||||
}
|
||||
return await Task.FromResult(jm);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms.Net *
|
||||
* Web: https://CoreCms.Net *
|
||||
* ProjectName: 核心内容管理系统 *
|
||||
* Author: 大灰灰 *
|
||||
* Email: JianWeie@163.com *
|
||||
* CreateTime: 2020-08-13 23:57:23
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using CoreCms.Net.WeChat.Service.HttpClients;
|
||||
using CoreCms.Net.WeChat.Service.Models;
|
||||
using MediatR;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api.Events;
|
||||
|
||||
namespace CoreCms.Net.WeChat.Service.Mediator
|
||||
{
|
||||
/// <summary>
|
||||
/// 表示 TEXT 事件的数据
|
||||
/// </summary>
|
||||
public class OpenProductSPUAuditEventCommand : IRequest<WeChatApiCallBack>
|
||||
{
|
||||
public OpenProductSPUAuditEvent EventObj { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 商品审核结果
|
||||
/// </summary>
|
||||
public class OpenProductSPUAuditEventCommandHandler : IRequestHandler<OpenProductSPUAuditEventCommand, WeChatApiCallBack>
|
||||
{
|
||||
private readonly WeChat.Service.HttpClients.IWeChatApiHttpClientFactory _weChatApiHttpClientFactory;
|
||||
private readonly IWeChatTransactionComponentGoodAuditLogServices _logServices;
|
||||
private readonly ICoreCmsGoodsServices _goodsServices;
|
||||
private readonly ICoreCmsSettingServices _settingServices;
|
||||
private readonly ICoreCmsSmsServices _smsServices;
|
||||
|
||||
|
||||
public OpenProductSPUAuditEventCommandHandler(IWeChatApiHttpClientFactory weChatApiHttpClientFactory, IWeChatTransactionComponentGoodAuditLogServices logServices, ICoreCmsGoodsServices goodsServices, ICoreCmsSettingServices settingServices, ICoreCmsSmsServices smsServices)
|
||||
{
|
||||
_weChatApiHttpClientFactory = weChatApiHttpClientFactory;
|
||||
_logServices = logServices;
|
||||
_goodsServices = goodsServices;
|
||||
_settingServices = settingServices;
|
||||
_smsServices = smsServices;
|
||||
}
|
||||
|
||||
public async Task<WeChatApiCallBack> Handle(OpenProductSPUAuditEventCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
|
||||
var jm = new WeChatApiCallBack() { Status = true };
|
||||
|
||||
if (request.EventObj != null)
|
||||
{
|
||||
var log = new WeChatTransactionComponentGoodAuditLog();
|
||||
log.outProductId = request.EventObj.EventData.OutProductId;
|
||||
log.productId = request.EventObj.EventData.ProductId;
|
||||
log.status = request.EventObj.EventData.Status;
|
||||
log.rejectReason = request.EventObj.EventData.RejectReason;
|
||||
log.createTime = DateTime.Now;
|
||||
|
||||
var id = await _logServices.InsertAsync(log);
|
||||
if (id > 0)
|
||||
{
|
||||
var smsOptions = await _settingServices.GetSmsOptions();
|
||||
if (smsOptions.Enabled == true)
|
||||
{
|
||||
var smsBody = string.Empty;
|
||||
if (log.status == 4)
|
||||
{
|
||||
smsBody = "你提交的商品审核已经通过,请登录平台上架商品。";
|
||||
}
|
||||
else if (log.status == 3)
|
||||
{
|
||||
smsBody = "你提交的商品审核已被拒绝,失败原因为:" + log.rejectReason + ",请修改资料后重新提交。";
|
||||
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(smsBody))
|
||||
{
|
||||
var allConfigs = await _settingServices.GetConfigDictionaries();
|
||||
var shopMobile = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShopMobile); //退货联系方式
|
||||
|
||||
await _smsServices.SendSms(shopMobile, smsBody, smsOptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return await Task.FromResult(jm);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/7/15 0:45:18
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace CoreCms.Net.WeChat.Service.TransactionComponent.Enum
|
||||
{
|
||||
/// <summary>
|
||||
/// 审核相关
|
||||
/// </summary>
|
||||
public class AuditEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询品牌和类目的审核结果状态
|
||||
/// </summary>
|
||||
public enum AuditCategoryStatus
|
||||
{
|
||||
[Description("<button type='button' class='layui-btn layui-btn-normal layui-btn-xs'>审核中</button>")]
|
||||
审核中 = 0,
|
||||
|
||||
[Description("<button type='button' class='layui-btn layui-btn-xs'>审核成功</button>")]
|
||||
审核成功 = 1,
|
||||
|
||||
[Description("<button type='button' class='layui-btn layui-btn-danger layui-btn-xs'>审核拒绝</button>")]
|
||||
审核拒绝 = 9
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/7/10 1:29:02
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace CoreCms.Net.WeChat.Service.TransactionComponent.Enum
|
||||
{
|
||||
/// <summary>
|
||||
/// 配送方式
|
||||
/// </summary>
|
||||
public enum DeliveryTypeEnum
|
||||
{
|
||||
正常快递 = 1,
|
||||
无需快递 = 2,
|
||||
线下配送 = 3,
|
||||
用户自提 = 4,
|
||||
}
|
||||
|
||||
public enum OrderStatus
|
||||
{
|
||||
[Description("待付款")]
|
||||
待付款 = 10,
|
||||
|
||||
[Description("收银台支付完成")]
|
||||
收银台支付完成 = 11,
|
||||
|
||||
[Description("待发货")]
|
||||
待发货 = 20,
|
||||
|
||||
[Description("待收货")]
|
||||
待收货 = 30,
|
||||
|
||||
[Description("完成")]
|
||||
完成 = 100,
|
||||
|
||||
[Description("全部商品售后之后订单取消")]
|
||||
售后之后取消 = 200,
|
||||
|
||||
[Description("用户主动取消/待付款超时取消/商家取消")]
|
||||
正常取消 = 4,
|
||||
}
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/7/6 1:10:15
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace CoreCms.Net.WeChat.Service.TransactionComponent.Enum
|
||||
{
|
||||
/// <summary>
|
||||
/// SPU枚举
|
||||
/// </summary>
|
||||
public class SpuEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// SPU审核状态
|
||||
/// </summary>
|
||||
public enum EditStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// 未审核
|
||||
/// </summary>
|
||||
[Description("未审核")]
|
||||
VerifyNo = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 审核中
|
||||
/// </summary>
|
||||
[Description("审核中")]
|
||||
Verifying = 2,
|
||||
|
||||
/// <summary>
|
||||
/// 审核拒绝
|
||||
/// </summary>
|
||||
[Description("审核拒绝")]
|
||||
VerifyRefuse = 3,
|
||||
|
||||
/// <summary>
|
||||
/// 审核通过
|
||||
/// </summary>
|
||||
[Description("审核通过")]
|
||||
VerifyYes = 4,
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// SPU审状态
|
||||
/// </summary>
|
||||
public enum SPUStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// 初始值
|
||||
/// </summary>
|
||||
[Description("初始值")]
|
||||
InitialValue = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 上架
|
||||
/// </summary>
|
||||
[Description("上架")]
|
||||
Added = 5,
|
||||
|
||||
/// <summary>
|
||||
/// 自主下架
|
||||
/// </summary>
|
||||
[Description("自主下架")]
|
||||
SoldOut = 11,
|
||||
|
||||
/// <summary>
|
||||
/// 违规下架/风控系统下架
|
||||
/// </summary>
|
||||
[Description("违规下架/风控系统下架")]
|
||||
SytemSoldOut = 13,
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CoreCms.Net.WeChat.Service.TransactionComponent.FromBody
|
||||
{
|
||||
/// <summary>
|
||||
/// 更新商家信息提交
|
||||
/// </summary>
|
||||
public class FMUpdateInfo
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 小程序path
|
||||
/// </summary>
|
||||
public string service_agent_path { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string service_agent_phone { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public List<int> service_agent_type { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public Default_receiving_address default_receiving_address { get; set; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 默认退货地址,退货售后超时时,会让用户将货物寄往此地址。
|
||||
/// </summary>
|
||||
public class Default_receiving_address
|
||||
{
|
||||
/// <summary>
|
||||
/// 张三
|
||||
/// </summary>
|
||||
public string receiver_name { get; set; }
|
||||
/// <summary>
|
||||
/// 详细收货地址信息
|
||||
/// </summary>
|
||||
public string detailed_address { get; set; }
|
||||
/// <summary>
|
||||
/// 收货人电话
|
||||
/// </summary>
|
||||
public string tel_number { get; set; }
|
||||
/// <summary>
|
||||
/// 国家
|
||||
/// </summary>
|
||||
public string country { get; set; }
|
||||
/// <summary>
|
||||
/// 省份
|
||||
/// </summary>
|
||||
public string province { get; set; }
|
||||
/// <summary>
|
||||
/// 城市
|
||||
/// </summary>
|
||||
public string city { get; set; }
|
||||
/// <summary>
|
||||
/// 区县
|
||||
/// </summary>
|
||||
public string town { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -28,7 +28,6 @@ using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Utility.Extensions;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using CoreCms.Net.WeChat.Service.HttpClients;
|
||||
using CoreCms.Net.WeChat.Service.TransactionComponent.Enum;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -62,9 +61,7 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
||||
private readonly ICoreCmsLogisticsServices _logisticsServices;
|
||||
private readonly ICoreCmsPaymentsServices _paymentsServices;
|
||||
private readonly ICoreCmsSettingServices _settingServices;
|
||||
private readonly IWeChatTransactionComponentOrderServices _tcOrderServices;
|
||||
private readonly ICoreCmsUserWeChatInfoServices _userWeChatInfoServices;
|
||||
private readonly IWeChatTransactionComponentDeliveryCompanyServices _tcDeliveryCompanyServices;
|
||||
private readonly IRedisOperationRepository _redisOperationRepository;
|
||||
private readonly CoreCms.Net.WeChat.Service.HttpClients.IWeChatApiHttpClientFactory _weChatApiHttpClientFactory;
|
||||
|
||||
@@ -85,7 +82,7 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
||||
, ICoreCmsLogisticsServices logisticsServices
|
||||
, ICoreCmsBillPaymentsServices billPaymentsServices
|
||||
, ICoreCmsPaymentsServices paymentsServices
|
||||
, ICoreCmsSettingServices settingServices, IWeChatTransactionComponentOrderServices tcOrderServices, ICoreCmsUserWeChatInfoServices userWeChatInfoServices, IWeChatTransactionComponentDeliveryCompanyServices tcDeliveryCompanyServices, IRedisOperationRepository redisOperationRepository, ICoreCmsBillDeliveryServices billDeliveryServices, IWeChatApiHttpClientFactory weChatApiHttpClientFactory, ICoreCmsOrderItemServices orderItemServices)
|
||||
, ICoreCmsSettingServices settingServices, ICoreCmsUserWeChatInfoServices userWeChatInfoServices, IRedisOperationRepository redisOperationRepository, ICoreCmsBillDeliveryServices billDeliveryServices, IWeChatApiHttpClientFactory weChatApiHttpClientFactory, ICoreCmsOrderItemServices orderItemServices)
|
||||
{
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
_coreCmsOrderServices = coreCmsOrderServices;
|
||||
@@ -97,9 +94,7 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
||||
_billPaymentsServices = billPaymentsServices;
|
||||
_paymentsServices = paymentsServices;
|
||||
_settingServices = settingServices;
|
||||
_tcOrderServices = tcOrderServices;
|
||||
_userWeChatInfoServices = userWeChatInfoServices;
|
||||
_tcDeliveryCompanyServices = tcDeliveryCompanyServices;
|
||||
_redisOperationRepository = redisOperationRepository;
|
||||
_billDeliveryServices = billDeliveryServices;
|
||||
_weChatApiHttpClientFactory = weChatApiHttpClientFactory;
|
||||
@@ -498,7 +493,6 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
||||
var storeList = await _storeServices.QueryAsync();
|
||||
|
||||
var logistics = await _logisticsServices.QueryListByClauseAsync(p => p.isDelete == false);
|
||||
var deliveryCompany = await _tcDeliveryCompanyServices.GetCaChe();
|
||||
|
||||
var result = await _coreCmsOrderServices.GetOrderShipInfo(entity.id);
|
||||
if (!result.status)
|
||||
@@ -525,7 +519,6 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
||||
orderModel = result.data,
|
||||
storeList,
|
||||
logistics,
|
||||
deliveryCompany
|
||||
};
|
||||
|
||||
return jm;
|
||||
@@ -1660,7 +1653,6 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 批量删除订单============================================================
|
||||
// POST: Api/CoreCmsOrder/DeleteOrder/10
|
||||
/// <summary>
|
||||
@@ -1724,8 +1716,7 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region 预览快递进度============================================================
|
||||
// POST: Api/CoreCmsOrder/GetDetails/10
|
||||
/// <summary>
|
||||
@@ -1752,99 +1743,5 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取交易组件订单信息
|
||||
// POST: Api/CoreCmsOrder/GetTcOrder/10
|
||||
/// <summary>
|
||||
/// 获取交易组件订单信息
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("获取交易组件订单信息")]
|
||||
public async Task<AdminUiCallBack> GetTcOrder([FromBody] FMStringId entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var orderModel = await _coreCmsOrderServices.QueryByClauseAsync(p => p.orderId == entity.id);
|
||||
if (orderModel == null)
|
||||
{
|
||||
jm.msg = "不存在此订单信息";
|
||||
return jm;
|
||||
}
|
||||
|
||||
var tcOrder = await _tcOrderServices.QueryByClauseAsync(p => p.outOrderId == entity.id);
|
||||
if (tcOrder == null)
|
||||
{
|
||||
jm.msg = "不存在此订单交易组件推送记录";
|
||||
return jm;
|
||||
}
|
||||
|
||||
var weChatUserInfo = await _userWeChatInfoServices.QueryByClauseAsync(p => p.userId == orderModel.userId);
|
||||
if (weChatUserInfo == null)
|
||||
{
|
||||
jm.msg = "用户微信数据拉取失败";
|
||||
return jm;
|
||||
}
|
||||
|
||||
//获取小程序认证
|
||||
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
|
||||
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
|
||||
var request = new ShopOrderGetRequest();
|
||||
request.AccessToken = accessToken;
|
||||
request.OutOrderId = orderModel.orderId;
|
||||
request.OpenId = weChatUserInfo.openid;
|
||||
|
||||
var response = await client.ExecuteShopOrderGetAsync(request);
|
||||
|
||||
var orderStatus = EnumHelper.EnumToList<OrderStatus>();
|
||||
var deliveryTypeEnum = EnumHelper.EnumToList<DeliveryTypeEnum>();
|
||||
|
||||
|
||||
jm.code = response.IsSuccessful() ? 0 : 1;
|
||||
jm.msg = response.IsSuccessful() ? "获取成功" : response.ErrorMessage;
|
||||
jm.data = new
|
||||
{
|
||||
response.Order,
|
||||
orderStatus,
|
||||
deliveryTypeEnum
|
||||
};
|
||||
jm.otherData = accessToken;
|
||||
|
||||
//更新拉取订单
|
||||
if (response.Order is { OrderId: > 0 } && tcOrder.orderId == null)
|
||||
{
|
||||
await _tcOrderServices.UpdateAsync(
|
||||
p => new WeChatTransactionComponentOrder() { orderId = response.Order.OrderId },
|
||||
p => p.id == tcOrder.id && p.outOrderId == tcOrder.outOrderId);
|
||||
}
|
||||
|
||||
if (response.Order is { OrderId: > 0 } && (response.Order.Status == 11 || response.Order.Status == 10) && (orderModel.payStatus == (int)GlobalEnumVars.OrderPayStatus.Yes || orderModel.payStatus == (int)GlobalEnumVars.OrderPayStatus.PartialYes))
|
||||
{
|
||||
var payment = await _billPaymentsServices.QueryByClauseAsync(p =>
|
||||
p.sourceId == orderModel.orderId && p.status == (int)GlobalEnumVars.BillPaymentsStatus.Payed);
|
||||
if (payment != null)
|
||||
{
|
||||
var userInfo = await _userWeChatInfoServices.QueryByClauseAsync(p => p.userId == orderModel.userId);
|
||||
//获取同步地址接口地址
|
||||
var refreshRequest = new ShopOrderPayRequest();
|
||||
refreshRequest.AccessToken = accessToken;
|
||||
refreshRequest.OutOrderId = orderModel.orderId;
|
||||
refreshRequest.OpenId = userInfo.openid;
|
||||
refreshRequest.ActionType = 1;
|
||||
refreshRequest.TransactionId = payment.tradeNo;
|
||||
refreshRequest.PayTime = payment.createTime;
|
||||
|
||||
var refreshResponse = await client.ExecuteShopOrderPayAsync(refreshRequest);
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Error, LogType.RedisMessageQueue, "自定义交易组件-手动同步", JsonConvert.SerializeObject(refreshResponse));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,129 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.AccressToken;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.WeChat.Service.HttpClients;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api.Models;
|
||||
using CoreCms.Net.WeChat.Service.TransactionComponent.FromBody;
|
||||
|
||||
namespace CoreCms.Net.Web.Admin.Controllers.WeChat
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件上传类目资质
|
||||
///</summary>
|
||||
[Description("自定义交易组件上传类目资质")]
|
||||
[Route("api/[controller]/[action]")]
|
||||
[ApiController]
|
||||
public class WeChatTransactionComponentAccountController : ControllerBase
|
||||
{
|
||||
private readonly Net.WeChat.Service.HttpClients.IWeChatApiHttpClientFactory _weChatApiHttpClientFactory;
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
/// <param name="weChatApiHttpClientFactory"></param>
|
||||
public WeChatTransactionComponentAccountController(IWeChatApiHttpClientFactory weChatApiHttpClientFactory)
|
||||
{
|
||||
_weChatApiHttpClientFactory = weChatApiHttpClientFactory;
|
||||
}
|
||||
|
||||
|
||||
#region 获取商家信息============================================================
|
||||
// POST: Api/WeChatTransactionComponentAccount/GetInfo
|
||||
/// <summary>
|
||||
/// 获取商家信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("获取商家信息")]
|
||||
public async Task<AdminUiCallBack> GetInfo()
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
try
|
||||
{
|
||||
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
|
||||
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
|
||||
var request = new ShopAccountGetInfoRequest();
|
||||
request.AccessToken = accessToken;
|
||||
|
||||
var response = await client.ExecuteShopAccountGetInfoAsync(request);
|
||||
|
||||
jm.code = response.IsSuccessful() ? 0 : 1;
|
||||
jm.msg = response.IsSuccessful() ? "获取成功" : response.ErrorMessage;
|
||||
jm.data = response.Data;
|
||||
|
||||
jm.otherData = new
|
||||
{
|
||||
service_agent_type_service = response.Data.ServiceAgentTypeList?.Contains(0) == true ? 0 : -1,
|
||||
service_agent_type_phone = response.Data.ServiceAgentTypeList?.Contains(2) == true ? 0 : -1,
|
||||
service_agent_type_path = response.Data.ServiceAgentTypeList?.Contains(1) == true ? 0 : -1,
|
||||
};
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
jm.code = 0;
|
||||
jm.msg = e.Message;
|
||||
jm.otherData = new
|
||||
{
|
||||
service_agent_type_service = -1,
|
||||
service_agent_type_phone = -1,
|
||||
service_agent_type_path = -1,
|
||||
};
|
||||
}
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 更新商家信息============================================================
|
||||
// POST: Api/WeChatTransactionComponentAccount/DoUpdateInfo
|
||||
/// <summary>
|
||||
/// 更新商家信息
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("更新商家信息")]
|
||||
public async Task<AdminUiCallBack> DoUpdateInfo([FromBody] FMUpdateInfo entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack { code = 0 };
|
||||
|
||||
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
|
||||
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
|
||||
var request = new ShopAccountUpdateInfoRequest();
|
||||
request.AccessToken = accessToken;
|
||||
|
||||
request.ServiceAgentTypeList = entity.service_agent_type;
|
||||
request.ServiceAgentPagePath = entity.service_agent_path;
|
||||
request.ServiceAgentPhoneNumber = entity.service_agent_phone;
|
||||
|
||||
request.DefaultReceivingAddress = new ShopAccountUpdateInfoRequest.Types.Address();
|
||||
request.DefaultReceivingAddress.ReceiverName = entity.default_receiving_address.receiver_name;
|
||||
request.DefaultReceivingAddress.Detail = entity.default_receiving_address.detailed_address;
|
||||
request.DefaultReceivingAddress.TeleNumber = entity.default_receiving_address.tel_number;
|
||||
request.DefaultReceivingAddress.Country = entity.default_receiving_address.country;
|
||||
request.DefaultReceivingAddress.Province = entity.default_receiving_address.province;
|
||||
request.DefaultReceivingAddress.City = entity.default_receiving_address.city;
|
||||
request.DefaultReceivingAddress.District = entity.default_receiving_address.town;
|
||||
|
||||
var response = await client.ExecuteShopAccountUpdateInfoAsync(request);
|
||||
|
||||
jm.code = response.IsSuccessful() ? 0 : 1;
|
||||
jm.msg = response.IsSuccessful() ? "更新成功" : response.ErrorMessage;
|
||||
|
||||
jm.data = entity;
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,402 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.Entities.Expression;
|
||||
using CoreCms.Net.Model.FromBody;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Filter;
|
||||
using CoreCms.Net.Loging;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using CoreCms.Net.Utility.Extensions;
|
||||
using CoreCms.Net.WeChat.Service.TransactionComponent.Enum;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NPOI.HSSF.UserModel;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.Web.Admin.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件上传类目资质
|
||||
///</summary>
|
||||
[Description("自定义交易组件上传类目资质")]
|
||||
[Route("api/[controller]/[action]")]
|
||||
[ApiController]
|
||||
[RequiredErrorForAdmin]
|
||||
[Authorize(Permissions.Name)]
|
||||
public class WeChatTransactionComponentAuditCategoryController : ControllerBase
|
||||
{
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
private readonly IWeChatTransactionComponentAuditCategoryServices _weChatTransactionComponentAuditCategoryServices;
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
///</summary>
|
||||
public WeChatTransactionComponentAuditCategoryController(IWebHostEnvironment webHostEnvironment
|
||||
, IWeChatTransactionComponentAuditCategoryServices weChatTransactionComponentAuditCategoryServices
|
||||
)
|
||||
{
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
_weChatTransactionComponentAuditCategoryServices = weChatTransactionComponentAuditCategoryServices;
|
||||
}
|
||||
|
||||
#region 获取列表============================================================
|
||||
// POST: Api/WeChatTransactionComponentAuditCategory/GetPageList
|
||||
/// <summary>
|
||||
/// 获取列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("获取列表")]
|
||||
public async Task<AdminUiCallBack> GetPageList()
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
var pageCurrent = Request.Form["page"].FirstOrDefault().ObjectToInt(1);
|
||||
var pageSize = Request.Form["limit"].FirstOrDefault().ObjectToInt(30);
|
||||
var where = PredicateBuilder.True<WeChatTransactionComponentAuditCategory>();
|
||||
//获取排序字段
|
||||
var orderField = Request.Form["orderField"].FirstOrDefault();
|
||||
|
||||
Expression<Func<WeChatTransactionComponentAuditCategory, object>> orderEx = orderField switch
|
||||
{
|
||||
"id" => p => p.id,
|
||||
"licenseImage" => p => p.licenseImage,
|
||||
"level1" => p => p.level1,
|
||||
"level1Name" => p => p.level1Name,
|
||||
"level2" => p => p.level2,
|
||||
"level2Name" => p => p.level2Name,
|
||||
"level3" => p => p.level3,
|
||||
"level3Name" => p => p.level3Name,
|
||||
"certificateImage" => p => p.certificateImage,
|
||||
"auditId" => p => p.auditId,
|
||||
"status" => p => p.status,
|
||||
"brandId" => p => p.brandId,
|
||||
"rejectReason" => p => p.rejectReason,
|
||||
"createTime" => p => p.createTime,
|
||||
_ => p => p.id
|
||||
};
|
||||
|
||||
//设置排序方式
|
||||
var orderDirection = Request.Form["orderDirection"].FirstOrDefault();
|
||||
var orderBy = orderDirection switch
|
||||
{
|
||||
"asc" => OrderByType.Asc,
|
||||
"desc" => OrderByType.Desc,
|
||||
_ => OrderByType.Desc
|
||||
};
|
||||
//查询筛选
|
||||
|
||||
//序列 int
|
||||
var id = Request.Form["id"].FirstOrDefault().ObjectToInt(0);
|
||||
if (id > 0)
|
||||
{
|
||||
where = where.And(p => p.id == id);
|
||||
}
|
||||
//营业执照或组织机构代码证 nvarchar
|
||||
var licenseImage = Request.Form["licenseImage"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(licenseImage))
|
||||
{
|
||||
where = where.And(p => p.licenseImage.Contains(licenseImage));
|
||||
}
|
||||
//一级类目 int
|
||||
var level1 = Request.Form["level1"].FirstOrDefault().ObjectToInt(0);
|
||||
if (level1 > 0)
|
||||
{
|
||||
where = where.And(p => p.level1 == level1);
|
||||
}
|
||||
//一级类目名称 nvarchar
|
||||
var level1Name = Request.Form["level1Name"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(level1Name))
|
||||
{
|
||||
where = where.And(p => p.level1Name.Contains(level1Name));
|
||||
}
|
||||
//二级类目 int
|
||||
var level2 = Request.Form["level2"].FirstOrDefault().ObjectToInt(0);
|
||||
if (level2 > 0)
|
||||
{
|
||||
where = where.And(p => p.level2 == level2);
|
||||
}
|
||||
//二级类目名称 nvarchar
|
||||
var level2Name = Request.Form["level2Name"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(level2Name))
|
||||
{
|
||||
where = where.And(p => p.level2Name.Contains(level2Name));
|
||||
}
|
||||
//三级类目 int
|
||||
var level3 = Request.Form["level3"].FirstOrDefault().ObjectToInt(0);
|
||||
if (level3 > 0)
|
||||
{
|
||||
where = where.And(p => p.level3 == level3);
|
||||
}
|
||||
//三级类目名称 nvarchar
|
||||
var level3Name = Request.Form["level3Name"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(level3Name))
|
||||
{
|
||||
where = where.And(p => p.level3Name.Contains(level3Name));
|
||||
}
|
||||
//资质材料 nvarchar
|
||||
var certificateImage = Request.Form["certificateImage"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(certificateImage))
|
||||
{
|
||||
where = where.And(p => p.certificateImage.Contains(certificateImage));
|
||||
}
|
||||
//审核单 nvarchar
|
||||
var auditId = Request.Form["auditId"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(auditId))
|
||||
{
|
||||
where = where.And(p => p.auditId.Contains(auditId));
|
||||
}
|
||||
//审核状态 int
|
||||
var status = Request.Form["status"].FirstOrDefault().ObjectToInt(0);
|
||||
if (status > 0)
|
||||
{
|
||||
where = where.And(p => p.status == status);
|
||||
}
|
||||
//品牌id int
|
||||
var brandId = Request.Form["brandId"].FirstOrDefault().ObjectToInt(0);
|
||||
if (brandId > 0)
|
||||
{
|
||||
where = where.And(p => p.brandId == brandId);
|
||||
}
|
||||
//拒绝原因 nvarchar
|
||||
var rejectReason = Request.Form["rejectReason"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(rejectReason))
|
||||
{
|
||||
where = where.And(p => p.rejectReason.Contains(rejectReason));
|
||||
}
|
||||
//创建时间 datetime
|
||||
var createTime = Request.Form["createTime"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(createTime))
|
||||
{
|
||||
if (createTime.Contains("到"))
|
||||
{
|
||||
var dts = createTime.Split("到");
|
||||
var dtStart = dts[0].Trim().ObjectToDate();
|
||||
where = where.And(p => p.createTime > dtStart);
|
||||
var dtEnd = dts[1].Trim().ObjectToDate();
|
||||
where = where.And(p => p.createTime < dtEnd);
|
||||
}
|
||||
else
|
||||
{
|
||||
var dt = createTime.ObjectToDate();
|
||||
where = where.And(p => p.createTime > dt);
|
||||
}
|
||||
}
|
||||
//获取数据
|
||||
var list = await _weChatTransactionComponentAuditCategoryServices.QueryPageAsync(where, orderEx, orderBy, pageCurrent, pageSize, true);
|
||||
//返回数据
|
||||
jm.data = list;
|
||||
jm.code = 0;
|
||||
jm.count = list.TotalCount;
|
||||
jm.msg = "数据调用成功!";
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 首页数据============================================================
|
||||
// POST: Api/WeChatTransactionComponentAuditCategory/GetIndex
|
||||
/// <summary>
|
||||
/// 首页数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("首页数据")]
|
||||
public AdminUiCallBack GetIndex()
|
||||
{
|
||||
//返回数据
|
||||
var jm = new AdminUiCallBack { code = 0 };
|
||||
|
||||
var auditCategoryStatus = EnumHelper.EnumToList<AuditEnum.AuditCategoryStatus>();
|
||||
|
||||
jm.data = new
|
||||
{
|
||||
auditCategoryStatus
|
||||
};
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 创建数据============================================================
|
||||
// POST: Api/WeChatTransactionComponentAuditCategory/GetCreate
|
||||
/// <summary>
|
||||
/// 创建数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("创建数据")]
|
||||
public AdminUiCallBack GetCreate()
|
||||
{
|
||||
//返回数据
|
||||
var jm = new AdminUiCallBack { code = 0 };
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 创建提交============================================================
|
||||
// POST: Api/WeChatTransactionComponentAuditCategory/DoCreate
|
||||
/// <summary>
|
||||
/// 创建提交
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("创建提交")]
|
||||
public async Task<AdminUiCallBack> DoCreate([FromBody] WeChatTransactionComponentAuditCategory entity)
|
||||
{
|
||||
var jm = await _weChatTransactionComponentAuditCategoryServices.InsertAsync(entity);
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 编辑数据============================================================
|
||||
// POST: Api/WeChatTransactionComponentAuditCategory/GetEdit
|
||||
/// <summary>
|
||||
/// 编辑数据
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("编辑数据")]
|
||||
public async Task<AdminUiCallBack> GetEdit([FromBody] FMIntId entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var model = await _weChatTransactionComponentAuditCategoryServices.QueryByIdAsync(entity.id, false);
|
||||
if (model == null)
|
||||
{
|
||||
jm.msg = "不存在此信息";
|
||||
return jm;
|
||||
}
|
||||
jm.code = 0;
|
||||
jm.data = model;
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 编辑提交============================================================
|
||||
// POST: Api/WeChatTransactionComponentAuditCategory/Edit
|
||||
/// <summary>
|
||||
/// 编辑提交
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("编辑提交")]
|
||||
public async Task<AdminUiCallBack> DoEdit([FromBody] WeChatTransactionComponentAuditCategory entity)
|
||||
{
|
||||
var jm = await _weChatTransactionComponentAuditCategoryServices.UpdateAsync(entity);
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除数据============================================================
|
||||
// POST: Api/WeChatTransactionComponentAuditCategory/DoDelete/10
|
||||
/// <summary>
|
||||
/// 单选删除
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("单选删除")]
|
||||
public async Task<AdminUiCallBack> DoDelete([FromBody] FMIntId entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var model = await _weChatTransactionComponentAuditCategoryServices.ExistsAsync(p => p.id == entity.id, true);
|
||||
if (!model)
|
||||
{
|
||||
jm.msg = GlobalConstVars.DataisNo;
|
||||
return jm;
|
||||
}
|
||||
jm = await _weChatTransactionComponentAuditCategoryServices.DeleteByIdAsync(entity.id);
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 预览数据============================================================
|
||||
// POST: Api/WeChatTransactionComponentAuditCategory/GetDetails/10
|
||||
/// <summary>
|
||||
/// 预览数据
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("预览数据")]
|
||||
public async Task<AdminUiCallBack> GetDetails([FromBody] FMIntId entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var model = await _weChatTransactionComponentAuditCategoryServices.QueryByIdAsync(entity.id, false);
|
||||
if (model == null)
|
||||
{
|
||||
jm.msg = "不存在此信息";
|
||||
return jm;
|
||||
}
|
||||
jm.code = 0;
|
||||
|
||||
var auditCategoryStatus = EnumHelper.EnumToList<AuditEnum.AuditCategoryStatus>();
|
||||
jm.data = new
|
||||
{
|
||||
model,
|
||||
auditCategoryStatus,
|
||||
imagesArr = model.certificateImage.Split(",")
|
||||
};
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 同步审核状态============================================================
|
||||
// POST: Api/WeChatTransactionComponentAuditCategory/DoDelete/10
|
||||
/// <summary>
|
||||
/// 同步审核状态
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("同步审核状态")]
|
||||
public async Task<AdminUiCallBack> DoRefresh([FromBody] FMIntId entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var model = await _weChatTransactionComponentAuditCategoryServices.QueryByClauseAsync(p => p.id == entity.id, true);
|
||||
if (model == null)
|
||||
{
|
||||
jm.msg = GlobalConstVars.DataisNo;
|
||||
return jm;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(model.auditId))
|
||||
{
|
||||
jm.msg = "审核单获取失败,请重新提交";
|
||||
return jm;
|
||||
}
|
||||
|
||||
jm = await _weChatTransactionComponentAuditCategoryServices.RefreshStatus(model);
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,585 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.AccressToken;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.Entities.Expression;
|
||||
using CoreCms.Net.Model.FromBody;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Filter;
|
||||
using CoreCms.Net.Loging;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using CoreCms.Net.Utility.Extensions;
|
||||
using CoreCms.Net.WeChat.Service.HttpClients;
|
||||
using CoreCms.Net.WeChat.Service.TransactionComponent.Enum;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NPOI.HSSF.UserModel;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api.Models;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.Web.Admin.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件上传品牌信息
|
||||
///</summary>
|
||||
[Description("自定义交易组件上传品牌信息")]
|
||||
[Route("api/[controller]/[action]")]
|
||||
[ApiController]
|
||||
[RequiredErrorForAdmin]
|
||||
[Authorize(Permissions.Name)]
|
||||
public class WeChatTransactionComponentBrandAuditController : ControllerBase
|
||||
{
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
private readonly IWeChatTransactionComponentBrandAuditServices _weChatTransactionComponentBrandAuditServices;
|
||||
private readonly CoreCms.Net.WeChat.Service.HttpClients.IWeChatApiHttpClientFactory _weChatApiHttpClientFactory;
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
///</summary>
|
||||
public WeChatTransactionComponentBrandAuditController(IWebHostEnvironment webHostEnvironment
|
||||
, IWeChatTransactionComponentBrandAuditServices weChatTransactionComponentBrandAuditServices, IWeChatApiHttpClientFactory weChatApiHttpClientFactory)
|
||||
{
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
_weChatTransactionComponentBrandAuditServices = weChatTransactionComponentBrandAuditServices;
|
||||
_weChatApiHttpClientFactory = weChatApiHttpClientFactory;
|
||||
}
|
||||
|
||||
#region 获取列表============================================================
|
||||
// POST: Api/WeChatTransactionComponentBrandAudit/GetPageList
|
||||
/// <summary>
|
||||
/// 获取列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("获取列表")]
|
||||
public async Task<AdminUiCallBack> GetPageList()
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
var pageCurrent = Request.Form["page"].FirstOrDefault().ObjectToInt(1);
|
||||
var pageSize = Request.Form["limit"].FirstOrDefault().ObjectToInt(30);
|
||||
var where = PredicateBuilder.True<WeChatTransactionComponentBrandAudit>();
|
||||
//获取排序字段
|
||||
var orderField = Request.Form["orderField"].FirstOrDefault();
|
||||
|
||||
Expression<Func<WeChatTransactionComponentBrandAudit, object>> orderEx = orderField switch
|
||||
{
|
||||
"id" => p => p.id,
|
||||
"license" => p => p.license,
|
||||
"brand_audit_type" => p => p.brand_audit_type,
|
||||
"trademark_type" => p => p.trademark_type,
|
||||
"brand_management_type" => p => p.brand_management_type,
|
||||
"commodity_origin_type" => p => p.commodity_origin_type,
|
||||
"brand_wording" => p => p.brand_wording,
|
||||
"sale_authorization" => p => p.sale_authorization,
|
||||
"trademark_registration_certificate" => p => p.trademark_registration_certificate,
|
||||
"trademark_change_certificate" => p => p.trademark_change_certificate,
|
||||
"trademark_registrant" => p => p.trademark_registrant,
|
||||
"trademark_registrant_nu" => p => p.trademark_registrant_nu,
|
||||
"trademark_authorization_period" => p => p.trademark_authorization_period,
|
||||
"trademark_registration_application" => p => p.trademark_registration_application,
|
||||
"trademark_applicant" => p => p.trademark_applicant,
|
||||
"trademark_application_time" => p => p.trademark_application_time,
|
||||
"imported_goods_form" => p => p.imported_goods_form,
|
||||
"scene_group_list" => p => p.scene_group_list,
|
||||
"audit_id" => p => p.audit_id,
|
||||
"status" => p => p.status,
|
||||
"brandId" => p => p.brandId,
|
||||
"rejectReason" => p => p.rejectReason,
|
||||
"createTime" => p => p.createTime,
|
||||
_ => p => p.id
|
||||
};
|
||||
|
||||
//设置排序方式
|
||||
var orderDirection = Request.Form["orderDirection"].FirstOrDefault();
|
||||
var orderBy = orderDirection switch
|
||||
{
|
||||
"asc" => OrderByType.Asc,
|
||||
"desc" => OrderByType.Desc,
|
||||
_ => OrderByType.Desc
|
||||
};
|
||||
//查询筛选
|
||||
|
||||
//序列 int
|
||||
var id = Request.Form["id"].FirstOrDefault().ObjectToInt(0);
|
||||
if (id > 0)
|
||||
{
|
||||
where = where.And(p => p.id == id);
|
||||
}
|
||||
//营业执照或组织机构代码证 nvarchar
|
||||
var license = Request.Form["license"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(license))
|
||||
{
|
||||
where = where.And(p => p.license.Contains(license));
|
||||
}
|
||||
//认证审核类型 int
|
||||
var brand_audit_type = Request.Form["brand_audit_type"].FirstOrDefault().ObjectToInt(0);
|
||||
if (brand_audit_type > 0)
|
||||
{
|
||||
where = where.And(p => p.brand_audit_type == brand_audit_type);
|
||||
}
|
||||
//商标分类 nvarchar
|
||||
var trademark_type = Request.Form["trademark_type"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(trademark_type))
|
||||
{
|
||||
where = where.And(p => p.trademark_type.Contains(trademark_type));
|
||||
}
|
||||
//经营类型 int
|
||||
var brand_management_type = Request.Form["brand_management_type"].FirstOrDefault().ObjectToInt(0);
|
||||
if (brand_management_type > 0)
|
||||
{
|
||||
where = where.And(p => p.brand_management_type == brand_management_type);
|
||||
}
|
||||
//商品产地是否进口 int
|
||||
var commodity_origin_type = Request.Form["commodity_origin_type"].FirstOrDefault().ObjectToInt(0);
|
||||
if (commodity_origin_type > 0)
|
||||
{
|
||||
where = where.And(p => p.commodity_origin_type == commodity_origin_type);
|
||||
}
|
||||
//商标/品牌词 nvarchar
|
||||
var brand_wording = Request.Form["brand_wording"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(brand_wording))
|
||||
{
|
||||
where = where.And(p => p.brand_wording.Contains(brand_wording));
|
||||
}
|
||||
//销售授权书 nvarchar
|
||||
var sale_authorization = Request.Form["sale_authorization"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(sale_authorization))
|
||||
{
|
||||
where = where.And(p => p.sale_authorization.Contains(sale_authorization));
|
||||
}
|
||||
//商标注册证书 nvarchar
|
||||
var trademark_registration_certificate = Request.Form["trademark_registration_certificate"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(trademark_registration_certificate))
|
||||
{
|
||||
where = where.And(p => p.trademark_registration_certificate.Contains(trademark_registration_certificate));
|
||||
}
|
||||
//商标变更证明 nvarchar
|
||||
var trademark_change_certificate = Request.Form["trademark_change_certificate"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(trademark_change_certificate))
|
||||
{
|
||||
where = where.And(p => p.trademark_change_certificate.Contains(trademark_change_certificate));
|
||||
}
|
||||
//商标注册人姓名 nvarchar
|
||||
var trademark_registrant = Request.Form["trademark_registrant"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(trademark_registrant))
|
||||
{
|
||||
where = where.And(p => p.trademark_registrant.Contains(trademark_registrant));
|
||||
}
|
||||
//商标注册号/申请号 nvarchar
|
||||
var trademark_registrant_nu = Request.Form["trademark_registrant_nu"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(trademark_registrant_nu))
|
||||
{
|
||||
where = where.And(p => p.trademark_registrant_nu.Contains(trademark_registrant_nu));
|
||||
}
|
||||
//商标有效期 datetime
|
||||
var trademark_authorization_period = Request.Form["trademark_authorization_period"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(trademark_authorization_period))
|
||||
{
|
||||
if (trademark_authorization_period.Contains("到"))
|
||||
{
|
||||
var dts = trademark_authorization_period.Split("到");
|
||||
var dtStart = dts[0].Trim().ObjectToDate();
|
||||
where = where.And(p => p.trademark_authorization_period > dtStart);
|
||||
var dtEnd = dts[1].Trim().ObjectToDate();
|
||||
where = where.And(p => p.trademark_authorization_period < dtEnd);
|
||||
}
|
||||
else
|
||||
{
|
||||
var dt = trademark_authorization_period.ObjectToDate();
|
||||
where = where.And(p => p.trademark_authorization_period > dt);
|
||||
}
|
||||
}
|
||||
//商标注册申请受理通知书 nvarchar
|
||||
var trademark_registration_application = Request.Form["trademark_registration_application"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(trademark_registration_application))
|
||||
{
|
||||
where = where.And(p => p.trademark_registration_application.Contains(trademark_registration_application));
|
||||
}
|
||||
//商标申请人姓名 nvarchar
|
||||
var trademark_applicant = Request.Form["trademark_applicant"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(trademark_applicant))
|
||||
{
|
||||
where = where.And(p => p.trademark_applicant.Contains(trademark_applicant));
|
||||
}
|
||||
//商标申请时间 datetime
|
||||
var trademark_application_time = Request.Form["trademark_application_time"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(trademark_application_time))
|
||||
{
|
||||
if (trademark_application_time.Contains("到"))
|
||||
{
|
||||
var dts = trademark_application_time.Split("到");
|
||||
var dtStart = dts[0].Trim().ObjectToDate();
|
||||
where = where.And(p => p.trademark_application_time > dtStart);
|
||||
var dtEnd = dts[1].Trim().ObjectToDate();
|
||||
where = where.And(p => p.trademark_application_time < dtEnd);
|
||||
}
|
||||
else
|
||||
{
|
||||
var dt = trademark_application_time.ObjectToDate();
|
||||
where = where.And(p => p.trademark_application_time > dt);
|
||||
}
|
||||
}
|
||||
//中华人民共和国海关进口货物报关单 nvarchar
|
||||
var imported_goods_form = Request.Form["imported_goods_form"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(imported_goods_form))
|
||||
{
|
||||
where = where.And(p => p.imported_goods_form.Contains(imported_goods_form));
|
||||
}
|
||||
//商品使用场景 int
|
||||
var scene_group_list = Request.Form["scene_group_list"].FirstOrDefault().ObjectToInt(0);
|
||||
if (scene_group_list > 0)
|
||||
{
|
||||
where = where.And(p => p.scene_group_list == scene_group_list);
|
||||
}
|
||||
//审核单id nvarchar
|
||||
var audit_id = Request.Form["audit_id"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(audit_id))
|
||||
{
|
||||
where = where.And(p => p.audit_id.Contains(audit_id));
|
||||
}
|
||||
//审核状态 int
|
||||
var status = Request.Form["status"].FirstOrDefault().ObjectToInt(0);
|
||||
if (status > 0)
|
||||
{
|
||||
where = where.And(p => p.status == status);
|
||||
}
|
||||
//品牌id int
|
||||
var brandId = Request.Form["brandId"].FirstOrDefault().ObjectToInt(0);
|
||||
if (brandId > 0)
|
||||
{
|
||||
where = where.And(p => p.brandId == brandId);
|
||||
}
|
||||
//拒绝原因 nvarchar
|
||||
var rejectReason = Request.Form["rejectReason"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(rejectReason))
|
||||
{
|
||||
where = where.And(p => p.rejectReason.Contains(rejectReason));
|
||||
}
|
||||
//创建时间 datetime
|
||||
var createTime = Request.Form["createTime"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(createTime))
|
||||
{
|
||||
if (createTime.Contains("到"))
|
||||
{
|
||||
var dts = createTime.Split("到");
|
||||
var dtStart = dts[0].Trim().ObjectToDate();
|
||||
where = where.And(p => p.createTime > dtStart);
|
||||
var dtEnd = dts[1].Trim().ObjectToDate();
|
||||
where = where.And(p => p.createTime < dtEnd);
|
||||
}
|
||||
else
|
||||
{
|
||||
var dt = createTime.ObjectToDate();
|
||||
where = where.And(p => p.createTime > dt);
|
||||
}
|
||||
}
|
||||
//获取数据
|
||||
var list = await _weChatTransactionComponentBrandAuditServices.QueryPageAsync(where, orderEx, orderBy, pageCurrent, pageSize, true);
|
||||
//返回数据
|
||||
jm.data = list;
|
||||
jm.code = 0;
|
||||
jm.count = list.TotalCount;
|
||||
jm.msg = "数据调用成功!";
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 首页数据============================================================
|
||||
// POST: Api/WeChatTransactionComponentBrandAudit/GetIndex
|
||||
/// <summary>
|
||||
/// 首页数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("首页数据")]
|
||||
public AdminUiCallBack GetIndex()
|
||||
{
|
||||
//返回数据
|
||||
var jm = new AdminUiCallBack { code = 0 };
|
||||
|
||||
//认证审核类型
|
||||
var registerType = EnumHelper.EnumToList<GlobalEnumVars.RegisterType>();
|
||||
//商标分类
|
||||
var trademarkType = EnumHelper.EnumToList<GlobalEnumVars.TrademarkType>();
|
||||
//品牌经营类型
|
||||
var brandManagementType = EnumHelper.EnumToList<GlobalEnumVars.BrandManagementType>();
|
||||
//商品产地是否进口
|
||||
var commodityOriginType = EnumHelper.EnumToList<GlobalEnumVars.CommodityOriginType>();
|
||||
|
||||
var auditCategoryStatus = EnumHelper.EnumToList<AuditEnum.AuditCategoryStatus>();
|
||||
|
||||
|
||||
jm.data = new
|
||||
{
|
||||
registerType,
|
||||
trademarkType,
|
||||
brandManagementType,
|
||||
commodityOriginType,
|
||||
auditCategoryStatus
|
||||
};
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 创建数据============================================================
|
||||
// POST: Api/WeChatTransactionComponentBrandAudit/GetCreate
|
||||
/// <summary>
|
||||
/// 创建数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("创建数据")]
|
||||
public AdminUiCallBack GetCreate()
|
||||
{
|
||||
//返回数据
|
||||
var jm = new AdminUiCallBack { code = 0 };
|
||||
|
||||
//认证审核类型
|
||||
var registerType = EnumHelper.EnumToList<GlobalEnumVars.RegisterType>();
|
||||
//商标分类
|
||||
var trademarkType = EnumHelper.EnumToList<GlobalEnumVars.TrademarkType>();
|
||||
//品牌经营类型
|
||||
var brandManagementType = EnumHelper.EnumToList<GlobalEnumVars.BrandManagementType>();
|
||||
//商品产地是否进口
|
||||
var commodityOriginType = EnumHelper.EnumToList<GlobalEnumVars.CommodityOriginType>();
|
||||
|
||||
jm.data = new
|
||||
{
|
||||
registerType,
|
||||
trademarkType,
|
||||
brandManagementType,
|
||||
commodityOriginType,
|
||||
};
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 创建提交============================================================
|
||||
// POST: Api/WeChatTransactionComponentBrandAudit/DoCreate
|
||||
/// <summary>
|
||||
/// 创建提交
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("创建提交")]
|
||||
public async Task<AdminUiCallBack> DoCreate([FromBody] WeChatTransactionComponentBrandAudit entity)
|
||||
{
|
||||
var jm = await _weChatTransactionComponentBrandAuditServices.InsertAsync(entity);
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 编辑数据============================================================
|
||||
// POST: Api/WeChatTransactionComponentBrandAudit/GetEdit
|
||||
/// <summary>
|
||||
/// 编辑数据
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("编辑数据")]
|
||||
public async Task<AdminUiCallBack> GetEdit([FromBody] FMIntId entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var model = await _weChatTransactionComponentBrandAuditServices.QueryByIdAsync(entity.id, false);
|
||||
if (model == null)
|
||||
{
|
||||
jm.msg = "不存在此信息";
|
||||
return jm;
|
||||
}
|
||||
jm.code = 0;
|
||||
|
||||
//认证审核类型
|
||||
var registerType = EnumHelper.EnumToList<GlobalEnumVars.RegisterType>();
|
||||
//商标分类
|
||||
var trademarkType = EnumHelper.EnumToList<GlobalEnumVars.TrademarkType>();
|
||||
//品牌经营类型
|
||||
var brandManagementType = EnumHelper.EnumToList<GlobalEnumVars.BrandManagementType>();
|
||||
//商品产地是否进口
|
||||
var commodityOriginType = EnumHelper.EnumToList<GlobalEnumVars.CommodityOriginType>();
|
||||
|
||||
jm.data = new
|
||||
{
|
||||
model,
|
||||
registerType,
|
||||
trademarkType,
|
||||
brandManagementType,
|
||||
commodityOriginType,
|
||||
};
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 编辑提交============================================================
|
||||
// POST: Api/WeChatTransactionComponentBrandAudit/Edit
|
||||
/// <summary>
|
||||
/// 编辑提交
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("编辑提交")]
|
||||
public async Task<AdminUiCallBack> DoEdit([FromBody] WeChatTransactionComponentBrandAudit entity)
|
||||
{
|
||||
var jm = await _weChatTransactionComponentBrandAuditServices.UpdateAsync(entity);
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除数据============================================================
|
||||
// POST: Api/WeChatTransactionComponentBrandAudit/DoDelete/10
|
||||
/// <summary>
|
||||
/// 单选删除
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("单选删除")]
|
||||
public async Task<AdminUiCallBack> DoDelete([FromBody] FMIntId entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var model = await _weChatTransactionComponentBrandAuditServices.ExistsAsync(p => p.id == entity.id, true);
|
||||
if (!model)
|
||||
{
|
||||
jm.msg = GlobalConstVars.DataisNo;
|
||||
return jm;
|
||||
}
|
||||
jm = await _weChatTransactionComponentBrandAuditServices.DeleteByIdAsync(entity.id);
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 预览数据============================================================
|
||||
// POST: Api/WeChatTransactionComponentBrandAudit/GetDetails/10
|
||||
/// <summary>
|
||||
/// 预览数据
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("预览数据")]
|
||||
public async Task<AdminUiCallBack> GetDetails([FromBody] FMIntId entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var model = await _weChatTransactionComponentBrandAuditServices.QueryByIdAsync(entity.id, false);
|
||||
if (model == null)
|
||||
{
|
||||
jm.msg = "不存在此信息";
|
||||
return jm;
|
||||
}
|
||||
jm.code = 0;
|
||||
jm.data = model;
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 提交审核============================================================
|
||||
// POST: Api/WeChatTransactionComponentBrandAudit/DoAudit/10
|
||||
/// <summary>
|
||||
/// 提交审核
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("提交审核")]
|
||||
public async Task<AdminUiCallBack> DoAudit([FromBody] FMIntId entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var model = await _weChatTransactionComponentBrandAuditServices.QueryByIdAsync(entity.id, false);
|
||||
if (model == null)
|
||||
{
|
||||
jm.msg = GlobalConstVars.DataisNo;
|
||||
return jm;
|
||||
}
|
||||
|
||||
//获取小程序认证
|
||||
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
|
||||
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
|
||||
var request = new ShopAuditAuditBrandRequest();
|
||||
|
||||
request.AccessToken = accessToken;
|
||||
|
||||
request.Audit.LicenseUrl = model.license;
|
||||
request.Audit.Brand.BrandAuditType = model.brand_audit_type;
|
||||
request.Audit.Brand.TrademarkType = model.trademark_type;
|
||||
request.Audit.Brand.BrandManagementType = model.brand_management_type;
|
||||
request.Audit.Brand.CommodityOriginType = model.commodity_origin_type;
|
||||
request.Audit.Brand.BrandWording = model.brand_wording;
|
||||
|
||||
request.Audit.Brand.SaleAuthorizationUrlList = !string.IsNullOrEmpty(model.sale_authorization)
|
||||
? new List<string>(model.sale_authorization.Split(",")) : new List<string>();
|
||||
|
||||
request.Audit.Brand.TrademarkRegistrationCertificateUrlList = !string.IsNullOrEmpty(model.trademark_registration_certificate)
|
||||
? new List<string>(model.trademark_registration_certificate.Split(",")) : new List<string>();
|
||||
|
||||
request.Audit.Brand.TrademarkChangeCertificateUrlList = !string.IsNullOrEmpty(model.trademark_change_certificate)
|
||||
? new List<string>(model.trademark_change_certificate.Split(",")) : new List<string>();
|
||||
|
||||
request.Audit.Brand.TrademarkRegistrant = model.trademark_registrant;
|
||||
request.Audit.Brand.TrademarkRegistrantNumber = model.trademark_registrant_nu;
|
||||
|
||||
request.Audit.Brand.TrademarkAuthorizationTime = model.trademark_authorization_period;
|
||||
|
||||
request.Audit.Brand.TrademarkRegistrationApplicationUrlList = !string.IsNullOrEmpty(model.trademark_registration_application)
|
||||
? new List<string>(model.trademark_registration_application.Split(",")) : new List<string>();
|
||||
|
||||
|
||||
request.Audit.Brand.TrademarkApplicant = model.trademark_applicant;
|
||||
request.Audit.Brand.TrademarkAuthorizationTime = model.trademark_application_time;
|
||||
|
||||
request.Audit.Brand.ImportedGoodsFormUrlList = !string.IsNullOrEmpty(model.imported_goods_form)
|
||||
? new List<string>(model.imported_goods_form.Split(",")) : new List<string>();
|
||||
|
||||
var response = await client.ExecuteShopAuditAuditBrandAsync(request);
|
||||
|
||||
if (response.IsSuccessful())
|
||||
{
|
||||
var bl = await _weChatTransactionComponentBrandAuditServices.UpdateAsync(
|
||||
p => new WeChatTransactionComponentBrandAudit() { audit_id = response.AuditId },
|
||||
p => p.id == model.id);
|
||||
|
||||
jm.code = 0;
|
||||
jm.msg = "提交审核成功";
|
||||
}
|
||||
else
|
||||
{
|
||||
jm.code = 1;
|
||||
jm.data = response.ErrorCode;
|
||||
jm.msg = response.ErrorMessage;
|
||||
jm.otherData = accessToken;
|
||||
}
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,194 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.AccressToken;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.Entities.Expression;
|
||||
using CoreCms.Net.Filter;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Utility.Extensions;
|
||||
using CoreCms.Net.WeChat.Service.HttpClients;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api.Models;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.Web.Admin.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件快递公司
|
||||
///</summary>
|
||||
[Description("自定义交易组件快递公司")]
|
||||
[Route("api/[controller]/[action]")]
|
||||
[ApiController]
|
||||
[RequiredErrorForAdmin]
|
||||
[Authorize(Permissions.Name)]
|
||||
public class WeChatTransactionComponentDeliveryCompanyController : ControllerBase
|
||||
{
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
private readonly IWeChatTransactionComponentDeliveryCompanyServices _weChatTransactionComponentDeliveryCompanyServices;
|
||||
private readonly CoreCms.Net.WeChat.Service.HttpClients.IWeChatApiHttpClientFactory _weChatApiHttpClientFactory;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
///</summary>
|
||||
public WeChatTransactionComponentDeliveryCompanyController(IWebHostEnvironment webHostEnvironment
|
||||
, IWeChatTransactionComponentDeliveryCompanyServices weChatTransactionComponentDeliveryCompanyServices, IWeChatApiHttpClientFactory weChatApiHttpClientFactory)
|
||||
{
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
_weChatTransactionComponentDeliveryCompanyServices = weChatTransactionComponentDeliveryCompanyServices;
|
||||
_weChatApiHttpClientFactory = weChatApiHttpClientFactory;
|
||||
}
|
||||
|
||||
#region 获取列表============================================================
|
||||
// POST: Api/WeChatTransactionComponentDeliveryCompany/GetPageList
|
||||
/// <summary>
|
||||
/// 获取列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("获取列表")]
|
||||
public async Task<AdminUiCallBack> GetPageList()
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
var pageCurrent = Request.Form["page"].FirstOrDefault().ObjectToInt(1);
|
||||
var pageSize = Request.Form["limit"].FirstOrDefault().ObjectToInt(30);
|
||||
var where = PredicateBuilder.True<WeChatTransactionComponentDeliveryCompany>();
|
||||
//获取排序字段
|
||||
var orderField = Request.Form["orderField"].FirstOrDefault();
|
||||
|
||||
Expression<Func<WeChatTransactionComponentDeliveryCompany, object>> orderEx = orderField switch
|
||||
{
|
||||
"deliveryId" => p => p.deliveryId,
|
||||
"deliveryName" => p => p.deliveryName,
|
||||
_ => p => p.deliveryId
|
||||
};
|
||||
|
||||
//设置排序方式
|
||||
var orderDirection = Request.Form["orderDirection"].FirstOrDefault();
|
||||
var orderBy = orderDirection switch
|
||||
{
|
||||
"asc" => OrderByType.Asc,
|
||||
"desc" => OrderByType.Desc,
|
||||
_ => OrderByType.Desc
|
||||
};
|
||||
//查询筛选
|
||||
|
||||
//快递公司id nvarchar
|
||||
var deliveryId = Request.Form["deliveryId"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(deliveryId))
|
||||
{
|
||||
where = where.And(p => p.deliveryId.Contains(deliveryId));
|
||||
}
|
||||
//快递公司名称 nvarchar
|
||||
var deliveryName = Request.Form["deliveryName"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(deliveryName))
|
||||
{
|
||||
where = where.And(p => p.deliveryName.Contains(deliveryName));
|
||||
}
|
||||
//获取数据
|
||||
var list = await _weChatTransactionComponentDeliveryCompanyServices.QueryPageAsync(where, orderEx, orderBy, pageCurrent, pageSize, true);
|
||||
//返回数据
|
||||
jm.data = list;
|
||||
jm.code = 0;
|
||||
jm.count = list.TotalCount;
|
||||
jm.msg = "数据调用成功!";
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 首页数据============================================================
|
||||
// POST: Api/WeChatTransactionComponentDeliveryCompany/GetIndex
|
||||
/// <summary>
|
||||
/// 首页数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("首页数据")]
|
||||
public AdminUiCallBack GetIndex()
|
||||
{
|
||||
//返回数据
|
||||
var jm = new AdminUiCallBack { code = 0 };
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取快递公司列表============================================================
|
||||
// POST: Api/WeChatTransactionComponentDeliveryCompany/DoGetCompanyList/10
|
||||
/// <summary>
|
||||
/// 获取快递公司列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("获取快递公司列表")]
|
||||
public async Task<AdminUiCallBack> DoGetCompanyList()
|
||||
{
|
||||
var jm = new AdminUiCallBack { code = 0 };
|
||||
var bl = false;
|
||||
try
|
||||
{
|
||||
//获取小程序认证
|
||||
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
|
||||
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
|
||||
var request = new ShopDeliveryGetCompanyListRequest();
|
||||
request.AccessToken = accessToken;
|
||||
|
||||
var response = await client.ExecuteShopDeliveryGetCompanyListAsync(request);
|
||||
if (response.IsSuccessful())
|
||||
{
|
||||
var company = new List<WeChatTransactionComponentDeliveryCompany>();
|
||||
|
||||
foreach (var item in response.DeliveryCompanyList)
|
||||
{
|
||||
company.Add(new WeChatTransactionComponentDeliveryCompany()
|
||||
{
|
||||
deliveryId = item.DeliveryId,
|
||||
deliveryName = item.DeliveryName
|
||||
});
|
||||
}
|
||||
|
||||
await _weChatTransactionComponentDeliveryCompanyServices.DeleteAsync(p => p.deliveryId != "");
|
||||
bl = await _weChatTransactionComponentDeliveryCompanyServices.InsertAsync(company) > 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
jm.msg = response.ErrorMessage;
|
||||
}
|
||||
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? "更新成功" : "更新失败";
|
||||
jm.otherData = response;
|
||||
return jm;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
jm.code = 1;
|
||||
jm.msg = e.ToString();
|
||||
return jm;
|
||||
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,930 +0,0 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/7/4 2:52:27
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.AccressToken;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.Entities.Expression;
|
||||
using CoreCms.Net.Model.FromBody;
|
||||
using CoreCms.Net.Filter;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using CoreCms.Net.Utility.Extensions;
|
||||
using CoreCms.Net.WeChat.Service.HttpClients;
|
||||
using CoreCms.Net.WeChat.Service.TransactionComponent.Enum;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api.Models;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.Web.Admin.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件商品列表
|
||||
///</summary>
|
||||
[Description("自定义交易组件商品列表")]
|
||||
[Route("api/[controller]/[action]")]
|
||||
[ApiController]
|
||||
[RequiredErrorForAdmin]
|
||||
[Authorize(Permissions.Name)]
|
||||
public class WeChatTransactionComponentGoodController : ControllerBase
|
||||
{
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
private readonly IWeChatTransactionComponentGoodServices _weChatTransactionComponentGoodsServices;
|
||||
private readonly IWeChatTransactionComponentGoodSKUServices _weChatTransactionComponentGoodSkuServices;
|
||||
|
||||
private readonly IWeChatTransactionComponentAuditCategoryServices
|
||||
_weChatTransactionComponentAuditCategoryServices;
|
||||
private readonly ICoreCmsProductsServices _productsServices;
|
||||
private readonly CoreCms.Net.WeChat.Service.HttpClients.IWeChatApiHttpClientFactory _weChatApiHttpClientFactory;
|
||||
|
||||
private readonly IWeChatTransactionComponentBrandAuditServices _weChatTransactionComponentBrandAuditServices;
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
///</summary>
|
||||
public WeChatTransactionComponentGoodController(IWebHostEnvironment webHostEnvironment
|
||||
, IWeChatTransactionComponentGoodServices weChatTransactionComponentGoodsServices, IWeChatTransactionComponentGoodSKUServices weChatTransactionComponentGoodSkuServices, ICoreCmsProductsServices productsServices, IWeChatApiHttpClientFactory weChatApiHttpClientFactory, IWeChatTransactionComponentAuditCategoryServices weChatTransactionComponentAuditCategoryServices, IWeChatTransactionComponentBrandAuditServices weChatTransactionComponentBrandAuditServices)
|
||||
{
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
_weChatTransactionComponentGoodsServices = weChatTransactionComponentGoodsServices;
|
||||
_weChatTransactionComponentGoodSkuServices = weChatTransactionComponentGoodSkuServices;
|
||||
_productsServices = productsServices;
|
||||
_weChatApiHttpClientFactory = weChatApiHttpClientFactory;
|
||||
_weChatTransactionComponentAuditCategoryServices = weChatTransactionComponentAuditCategoryServices;
|
||||
_weChatTransactionComponentBrandAuditServices = weChatTransactionComponentBrandAuditServices;
|
||||
}
|
||||
|
||||
#region 获取列表============================================================
|
||||
// POST: Api/WeChatTransactionComponentGood/GetPageList
|
||||
/// <summary>
|
||||
/// 获取列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("获取列表")]
|
||||
public async Task<AdminUiCallBack> GetPageList()
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
var pageCurrent = Request.Form["page"].FirstOrDefault().ObjectToInt(1);
|
||||
var pageSize = Request.Form["limit"].FirstOrDefault().ObjectToInt(30);
|
||||
var where = PredicateBuilder.True<WeChatTransactionComponentGood>();
|
||||
//获取排序字段
|
||||
var orderField = Request.Form["orderField"].FirstOrDefault();
|
||||
|
||||
Expression<Func<WeChatTransactionComponentGood, object>> orderEx = orderField switch
|
||||
{
|
||||
"id" => p => p.id,
|
||||
"productId" => p => p.productId,
|
||||
"createTime" => p => p.createTime,
|
||||
"outProductId" => p => p.outProductId,
|
||||
"title" => p => p.title,
|
||||
"path" => p => p.path,
|
||||
"headImg" => p => p.headImg,
|
||||
"qualificationPics" => p => p.qualificationPics,
|
||||
"descInfoDesc" => p => p.descInfoDesc,
|
||||
"descInfoImgs" => p => p.descInfoImgs,
|
||||
"thirdCatId" => p => p.thirdCatId,
|
||||
"brandId" => p => p.brandId,
|
||||
"infoVersion" => p => p.infoVersion,
|
||||
"lastPostTime" => p => p.lastPostTime,
|
||||
"updateTime" => p => p.updateTime,
|
||||
_ => p => p.id
|
||||
};
|
||||
|
||||
//设置排序方式
|
||||
var orderDirection = Request.Form["orderDirection"].FirstOrDefault();
|
||||
var orderBy = orderDirection switch
|
||||
{
|
||||
"asc" => OrderByType.Asc,
|
||||
"desc" => OrderByType.Desc,
|
||||
_ => OrderByType.Desc
|
||||
};
|
||||
//查询筛选
|
||||
|
||||
//序列 int
|
||||
var id = Request.Form["id"].FirstOrDefault().ObjectToInt(0);
|
||||
if (id > 0)
|
||||
{
|
||||
where = where.And(p => p.id == id);
|
||||
}
|
||||
//交易组件平台内部商品ID bigint
|
||||
var productId = Request.Form["productId"].FirstOrDefault().ObjectToInt(0);
|
||||
if (productId > 0)
|
||||
{
|
||||
where = where.And(p => p.productId == productId);
|
||||
}
|
||||
//交易组件创建时间 datetime
|
||||
var createTime = Request.Form["createTime"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(createTime))
|
||||
{
|
||||
if (createTime.Contains("到"))
|
||||
{
|
||||
var dts = createTime.Split("到");
|
||||
var dtStart = dts[0].Trim().ObjectToDate();
|
||||
where = where.And(p => p.createTime > dtStart);
|
||||
var dtEnd = dts[1].Trim().ObjectToDate();
|
||||
where = where.And(p => p.createTime < dtEnd);
|
||||
}
|
||||
else
|
||||
{
|
||||
var dt = createTime.ObjectToDate();
|
||||
where = where.And(p => p.createTime > dt);
|
||||
}
|
||||
}
|
||||
//商品序列 nvarchar
|
||||
var outProductId = Request.Form["outProductId"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(outProductId))
|
||||
{
|
||||
where = where.And(p => p.outProductId.Contains(outProductId));
|
||||
}
|
||||
//商品标题 nvarchar
|
||||
var title = Request.Form["title"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(title))
|
||||
{
|
||||
where = where.And(p => p.title.Contains(title));
|
||||
}
|
||||
//小程序路径 nvarchar
|
||||
var path = Request.Form["path"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
where = where.And(p => p.path.Contains(path));
|
||||
}
|
||||
//主图列表 nvarchar
|
||||
var headImg = Request.Form["headImg"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(headImg))
|
||||
{
|
||||
where = where.And(p => p.headImg.Contains(headImg));
|
||||
}
|
||||
//商品资质图片列表 nvarchar
|
||||
var qualificationPics = Request.Form["qualificationPics"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(qualificationPics))
|
||||
{
|
||||
where = where.And(p => p.qualificationPics.Contains(qualificationPics));
|
||||
}
|
||||
//商品详情图文 nvarchar
|
||||
var descInfoDesc = Request.Form["descInfoDesc"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(descInfoDesc))
|
||||
{
|
||||
where = where.And(p => p.descInfoDesc.Contains(descInfoDesc));
|
||||
}
|
||||
//商品详情图片列表 nvarchar
|
||||
var descInfoImgs = Request.Form["descInfoImgs"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(descInfoImgs))
|
||||
{
|
||||
where = where.And(p => p.descInfoImgs.Contains(descInfoImgs));
|
||||
}
|
||||
//第三级类目ID int
|
||||
var thirdCatId = Request.Form["thirdCatId"].FirstOrDefault().ObjectToInt(0);
|
||||
if (thirdCatId > 0)
|
||||
{
|
||||
where = where.And(p => p.thirdCatId == thirdCatId);
|
||||
}
|
||||
//品牌id int
|
||||
var brandId = Request.Form["brandId"].FirstOrDefault().ObjectToInt(0);
|
||||
if (brandId > 0)
|
||||
{
|
||||
where = where.And(p => p.brandId == brandId);
|
||||
}
|
||||
//预留字段 nvarchar
|
||||
var infoVersion = Request.Form["infoVersion"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(infoVersion))
|
||||
{
|
||||
where = where.And(p => p.infoVersion.Contains(infoVersion));
|
||||
}
|
||||
//最后提交时间 datetime
|
||||
var lastPostTime = Request.Form["lastPostTime"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(lastPostTime))
|
||||
{
|
||||
if (lastPostTime.Contains("到"))
|
||||
{
|
||||
var dts = lastPostTime.Split("到");
|
||||
var dtStart = dts[0].Trim().ObjectToDate();
|
||||
where = where.And(p => p.lastPostTime > dtStart);
|
||||
var dtEnd = dts[1].Trim().ObjectToDate();
|
||||
where = where.And(p => p.lastPostTime < dtEnd);
|
||||
}
|
||||
else
|
||||
{
|
||||
var dt = lastPostTime.ObjectToDate();
|
||||
where = where.And(p => p.lastPostTime > dt);
|
||||
}
|
||||
}
|
||||
//最后更新时间 datetime
|
||||
var updateTime = Request.Form["updateTime"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(updateTime))
|
||||
{
|
||||
if (updateTime.Contains("到"))
|
||||
{
|
||||
var dts = updateTime.Split("到");
|
||||
var dtStart = dts[0].Trim().ObjectToDate();
|
||||
where = where.And(p => p.updateTime > dtStart);
|
||||
var dtEnd = dts[1].Trim().ObjectToDate();
|
||||
where = where.And(p => p.updateTime < dtEnd);
|
||||
}
|
||||
else
|
||||
{
|
||||
var dt = updateTime.ObjectToDate();
|
||||
where = where.And(p => p.updateTime > dt);
|
||||
}
|
||||
}
|
||||
//获取数据
|
||||
var list = await _weChatTransactionComponentGoodsServices.QueryPageAsync(where, orderEx, orderBy, pageCurrent, pageSize, true);
|
||||
//返回数据
|
||||
jm.data = list;
|
||||
jm.code = 0;
|
||||
jm.count = list.TotalCount;
|
||||
jm.msg = "数据调用成功!";
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 首页数据============================================================
|
||||
// POST: Api/WeChatTransactionComponentGood/GetIndex
|
||||
/// <summary>
|
||||
/// 首页数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("首页数据")]
|
||||
public AdminUiCallBack GetIndex()
|
||||
{
|
||||
//返回数据
|
||||
var jm = new AdminUiCallBack { code = 0 };
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 创建数据============================================================
|
||||
// POST: Api/WeChatTransactionComponentGood/GetCreate
|
||||
/// <summary>
|
||||
/// 创建数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("创建数据")]
|
||||
public async Task<AdminUiCallBack> GetCreate()
|
||||
{
|
||||
//返回数据
|
||||
var jm = new AdminUiCallBack { code = 0 };
|
||||
|
||||
var brand = await _weChatTransactionComponentBrandAuditServices.QueryListByClauseAsync(p => p.brandId > 0 && p.status == (int)AuditEnum.AuditCategoryStatus.审核成功);
|
||||
|
||||
jm.data = new
|
||||
{
|
||||
brand
|
||||
};
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 创建提交============================================================
|
||||
// POST: Api/WeChatTransactionComponentGood/DoCreate
|
||||
/// <summary>
|
||||
/// 创建提交
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("创建提交")]
|
||||
public async Task<AdminUiCallBack> DoCreate([FromBody] WeChatTransactionComponentGood entity)
|
||||
{
|
||||
var jm = await _weChatTransactionComponentGoodsServices.InsertAsync(entity);
|
||||
jm.otherData = entity;
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 编辑数据============================================================
|
||||
// POST: Api/WeChatTransactionComponentGood/GetEdit
|
||||
/// <summary>
|
||||
/// 编辑数据
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("编辑数据")]
|
||||
public async Task<AdminUiCallBack> GetEdit([FromBody] FMIntId entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var model = await _weChatTransactionComponentGoodsServices.QueryByIdAsync(entity.id, false);
|
||||
if (model == null)
|
||||
{
|
||||
jm.msg = "不存在此信息";
|
||||
return jm;
|
||||
}
|
||||
|
||||
var goodId = Convert.ToInt32(model.outProductId);
|
||||
var products = await _productsServices.QueryListByClauseAsync(p => p.goodsId == goodId && p.isDel == false, p => p.id, OrderByType.Asc, true);
|
||||
var sku = await _weChatTransactionComponentGoodSkuServices.QueryListByClauseAsync(p => p.outProductId == model.outProductId, p => p.id, OrderByType.Asc, true);
|
||||
|
||||
var brand = await _weChatTransactionComponentBrandAuditServices.QueryListByClauseAsync(p => p.brandId > 0 && p.status == (int)AuditEnum.AuditCategoryStatus.审核成功);
|
||||
|
||||
jm.code = 0;
|
||||
jm.data = new
|
||||
{
|
||||
model,
|
||||
products,
|
||||
sku,
|
||||
brand
|
||||
};
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 编辑提交============================================================
|
||||
// POST: Api/WeChatTransactionComponentGood/Edit
|
||||
/// <summary>
|
||||
/// 编辑提交
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("编辑提交")]
|
||||
public async Task<AdminUiCallBack> DoEdit([FromBody] WeChatTransactionComponentGood entity)
|
||||
{
|
||||
var jm = await _weChatTransactionComponentGoodsServices.UpdateAsync(entity);
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除数据============================================================
|
||||
// POST: Api/WeChatTransactionComponentGood/DoDelete/10
|
||||
/// <summary>
|
||||
/// 单选删除
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("单选删除")]
|
||||
public async Task<AdminUiCallBack> DoDelete([FromBody] FMIntId entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var model = await _weChatTransactionComponentGoodsServices.ExistsAsync(p => p.id == entity.id, true);
|
||||
if (!model)
|
||||
{
|
||||
jm.msg = GlobalConstVars.DataisNo;
|
||||
return jm;
|
||||
}
|
||||
jm = await _weChatTransactionComponentGoodsServices.DeleteByIdAsync(entity.id);
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 提交审核============================================================
|
||||
// POST: Api/WeChatTransactionComponentGood/DoAudit/10
|
||||
/// <summary>
|
||||
/// 提交审核
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("提交审核")]
|
||||
public async Task<AdminUiCallBack> DoAudit([FromBody] FMIntId entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var model = await _weChatTransactionComponentGoodsServices.QueryByClauseAsync(p => p.id == entity.id, true);
|
||||
if (model == null)
|
||||
{
|
||||
jm.msg = GlobalConstVars.DataisNo;
|
||||
return jm;
|
||||
}
|
||||
|
||||
var sku = await _weChatTransactionComponentGoodSkuServices.QueryListByClauseAsync(p => p.isSelect == true && p.outProductId == model.outProductId);
|
||||
|
||||
|
||||
//获取小程序认证
|
||||
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
|
||||
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
|
||||
var request = new ShopSPUAddRequest();
|
||||
|
||||
request.AccessToken = accessToken;
|
||||
|
||||
request.OutProductId = model.outProductId;
|
||||
request.Title = model.title;
|
||||
request.PagePath = model.path;
|
||||
request.HeadImageUrlList = new List<string>(model.headImg.Split(","));
|
||||
|
||||
var category = await _weChatTransactionComponentAuditCategoryServices.QueryByClauseAsync(p => p.level3 == model.thirdCatId, true);
|
||||
if (category != null && !string.IsNullOrEmpty(category.certificateImage))
|
||||
{
|
||||
request.QualificationPictureUrlList = new List<string>(category.certificateImage.Split(","));
|
||||
}
|
||||
else
|
||||
{
|
||||
request.QualificationPictureUrlList = new List<string>();
|
||||
}
|
||||
|
||||
|
||||
request.Detail = new ShopSPUAddRequest.Types.Detail();
|
||||
|
||||
request.Detail.Description = model.descInfoDesc;
|
||||
request.Detail.ImageUrlList = new List<string>();
|
||||
|
||||
request.CategoryId = model.thirdCatId;
|
||||
request.BrandId = model.brandId;
|
||||
request.InfoVersion = model.infoVersion;
|
||||
|
||||
request.SKUList = new List<ShopSPUAddRequest.Types.SKU>();
|
||||
sku.ForEach(p =>
|
||||
{
|
||||
var item = new ShopSPUAddRequest.Types.SKU();
|
||||
item.OutProductId = p.outProductId;
|
||||
item.OutSKUId = p.outSkuId;
|
||||
item.ThumbnailUrl = p.thumbImg;
|
||||
item.SalePrice = Convert.ToInt32(p.salePrice * 100);
|
||||
item.MarketPrice = Convert.ToInt32(p.marketPrice * 100);
|
||||
item.Stock = p.stockNum;
|
||||
item.BarCode = p.barCode;
|
||||
item.SKUCode = p.skuCode;
|
||||
|
||||
request.SKUList.Add(item);
|
||||
});
|
||||
|
||||
var response = await client.ExecuteShopSPUAddAsync(request);
|
||||
|
||||
if (response.IsSuccessful())
|
||||
{
|
||||
var createTime = new DateTime(response.Data.CreateTime.Year, response.Data.CreateTime.Month,
|
||||
response.Data.CreateTime.Day, response.Data.CreateTime.Hour, response.Data.CreateTime.Minute,
|
||||
response.Data.CreateTime.Second);
|
||||
|
||||
model.productId = response.Data.ProductId;
|
||||
model.createTime = createTime;
|
||||
model.lastPostTime = createTime;
|
||||
|
||||
await _weChatTransactionComponentGoodsServices.UpdateAsync(model);
|
||||
|
||||
if (response.Data.SKUList.Length > 0)
|
||||
{
|
||||
foreach (var item in response.Data.SKUList)
|
||||
{
|
||||
foreach (var o in sku)
|
||||
{
|
||||
if (o.outSkuId == item.OutSKUId)
|
||||
{
|
||||
o.skuId = item.SKUId;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await _weChatTransactionComponentGoodSkuServices.UpdateAsync(sku);
|
||||
}
|
||||
|
||||
jm.code = 0;
|
||||
jm.msg = "提交成功";
|
||||
}
|
||||
else
|
||||
{
|
||||
jm.code = 1;
|
||||
jm.data = response.ErrorCode;
|
||||
jm.msg = response.ErrorMessage;
|
||||
jm.otherData = accessToken;
|
||||
}
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 提交更新============================================================
|
||||
// POST: Api/WeChatTransactionComponentGood/DoUpdateSpu/10
|
||||
/// <summary>
|
||||
/// 提交更新
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("提交更新")]
|
||||
public async Task<AdminUiCallBack> DoUpdateSpu([FromBody] FMIntId entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var model = await _weChatTransactionComponentGoodsServices.QueryByClauseAsync(p => p.id == entity.id, true);
|
||||
if (model == null)
|
||||
{
|
||||
jm.msg = GlobalConstVars.DataisNo;
|
||||
return jm;
|
||||
}
|
||||
|
||||
var sku = await _weChatTransactionComponentGoodSkuServices.QueryListByClauseAsync(p =>
|
||||
p.isSelect == true && p.outProductId == model.outProductId);
|
||||
|
||||
|
||||
|
||||
//获取小程序认证
|
||||
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
|
||||
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
|
||||
var request = new ShopSPUUpdateRequest();
|
||||
|
||||
request.AccessToken = accessToken;
|
||||
|
||||
request.OutProductId = model.outProductId;
|
||||
request.ProductId = model.productId;
|
||||
request.Title = model.title;
|
||||
request.PagePath = model.path;
|
||||
request.HeadImageUrlList = new List<string>(model.headImg.Split(","));
|
||||
|
||||
var category = await _weChatTransactionComponentAuditCategoryServices.QueryByClauseAsync(p => p.level3 == model.thirdCatId, true);
|
||||
if (category != null && !string.IsNullOrEmpty(category.certificateImage))
|
||||
{
|
||||
request.QualificationPictureUrlList = new List<string>(category.certificateImage.Split(","));
|
||||
}
|
||||
else
|
||||
{
|
||||
request.QualificationPictureUrlList = new List<string>();
|
||||
}
|
||||
|
||||
request.Detail = new ShopSPUUpdateRequest.Types.Detail();
|
||||
|
||||
request.Detail.Description = model.descInfoDesc;
|
||||
request.Detail.ImageUrlList = new List<string>();
|
||||
request.CategoryId = model.thirdCatId;
|
||||
request.BrandId = model.brandId;
|
||||
|
||||
request.SKUList = new List<ShopSPUUpdateRequest.Types.SKU>();
|
||||
|
||||
sku.ForEach(p =>
|
||||
{
|
||||
var item = new ShopSPUUpdateRequest.Types.SKU();
|
||||
item.OutProductId = p.outProductId;
|
||||
item.OutSKUId = p.outSkuId;
|
||||
item.ThumbnailUrl = p.thumbImg;
|
||||
item.SalePrice = Convert.ToInt32(p.salePrice * 100);
|
||||
item.MarketPrice = Convert.ToInt32(p.marketPrice * 100);
|
||||
item.Stock = p.stockNum;
|
||||
item.BarCode = p.barCode;
|
||||
item.SKUCode = p.skuCode;
|
||||
|
||||
request.SKUList.Add(item);
|
||||
});
|
||||
|
||||
var response = await client.ExecuteShopSPUUpdateAsync(request);
|
||||
|
||||
|
||||
if (response.IsSuccessful())
|
||||
{
|
||||
model.productId = response.Data.ProductId;
|
||||
model.updateTime = DateTime.Now;
|
||||
|
||||
await _weChatTransactionComponentGoodsServices.UpdateAsync(model);
|
||||
|
||||
if (response.Data.SKUList.Length > 0)
|
||||
{
|
||||
foreach (var item in response.Data.SKUList)
|
||||
{
|
||||
foreach (var o in sku)
|
||||
{
|
||||
if (o.outSkuId == item.OutSKUId)
|
||||
{
|
||||
o.skuId = item.SKUId;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
await _weChatTransactionComponentGoodSkuServices.UpdateAsync(sku);
|
||||
}
|
||||
|
||||
jm.code = 0;
|
||||
jm.msg = "提交成功";
|
||||
}
|
||||
else
|
||||
{
|
||||
jm.code = 1;
|
||||
jm.data = response.ErrorCode;
|
||||
jm.msg = response.ErrorMessage;
|
||||
}
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取商品及状态============================================================
|
||||
// POST: Api/WeChatTransactionComponentGood/GetSKU/10
|
||||
/// <summary>
|
||||
/// 获取商品及状态
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("获取商品及状态")]
|
||||
public async Task<AdminUiCallBack> GetSKU([FromBody] FMIntId entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var model = await _weChatTransactionComponentGoodsServices.QueryByClauseAsync(p => p.id == entity.id, true);
|
||||
if (model == null)
|
||||
{
|
||||
jm.msg = GlobalConstVars.DataisNo;
|
||||
return jm;
|
||||
}
|
||||
|
||||
var editStatus = EnumHelper.EnumToList<SpuEnum.EditStatus>();
|
||||
var spuStatus = EnumHelper.EnumToList<SpuEnum.EditStatus>();
|
||||
|
||||
|
||||
//获取小程序认证
|
||||
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
|
||||
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
|
||||
var request = new ShopSPUGetRequest();
|
||||
request.AccessToken = accessToken;
|
||||
|
||||
//默认0:获取线上数据, 1:获取草稿数据
|
||||
var needEditSpu = Convert.ToInt32(entity.data);
|
||||
|
||||
request.OutProductId = model.outProductId;
|
||||
request.RequireEdittingSPU = needEditSpu == 1 ? true : false;
|
||||
|
||||
var response = await client.ExecuteShopSPUGetAsync(request);
|
||||
|
||||
|
||||
if (response.IsSuccessful())
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
jm.code = response.IsSuccessful() ? 0 : 1;
|
||||
jm.msg = response.IsSuccessful() ? "操作成功" : response.ErrorMessage;
|
||||
jm.data = new
|
||||
{
|
||||
result = response,
|
||||
editStatus,
|
||||
spuStatus
|
||||
};
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 撤回商品审核============================================================
|
||||
// POST: Api/WeChatTransactionComponentGood/DoCountermand/10
|
||||
/// <summary>
|
||||
/// 撤回商品审核
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("撤回商品审核")]
|
||||
public async Task<AdminUiCallBack> DeleteSpuAudit([FromBody] FMIntId entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var model = await _weChatTransactionComponentGoodsServices.QueryByClauseAsync(p => p.id == entity.id, true);
|
||||
if (model == null)
|
||||
{
|
||||
jm.msg = GlobalConstVars.DataisNo;
|
||||
return jm;
|
||||
}
|
||||
|
||||
//获取小程序认证
|
||||
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
|
||||
|
||||
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
|
||||
var request = new ShopSPUDeleteAuditRequest();
|
||||
request.AccessToken = accessToken;
|
||||
request.OutProductId = model.outProductId;
|
||||
|
||||
var response = await client.ExecuteShopSPUDeleteAuditAsync(request);
|
||||
|
||||
|
||||
jm.code = response.IsSuccessful() ? 0 : 1;
|
||||
jm.msg = response.IsSuccessful() ? "撤回成功" : response.ErrorMessage;
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除商品============================================================
|
||||
// POST: Api/WeChatTransactionComponentGood/DeleteSpu/10
|
||||
/// <summary>
|
||||
/// 删除商品
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("删除商品")]
|
||||
public async Task<AdminUiCallBack> DeleteSpu([FromBody] FMIntId entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var model = await _weChatTransactionComponentGoodsServices.QueryByClauseAsync(p => p.id == entity.id, true);
|
||||
if (model == null)
|
||||
{
|
||||
jm.msg = GlobalConstVars.DataisNo;
|
||||
return jm;
|
||||
}
|
||||
|
||||
//获取小程序认证
|
||||
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
|
||||
|
||||
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
|
||||
var request = new ShopSPUDeleteRequest();
|
||||
request.AccessToken = accessToken;
|
||||
request.OutProductId = model.outProductId;
|
||||
|
||||
var response = await client.ExecuteShopSPUDeleteAsync(request);
|
||||
|
||||
jm.code = response.IsSuccessful() ? 0 : 1;
|
||||
jm.msg = response.IsSuccessful() ? "删除成功" : response.ErrorMessage;
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 上架商品============================================================
|
||||
// POST: Api/WeChatTransactionComponentGood/DoListing/10
|
||||
/// <summary>
|
||||
/// 上架商品
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("上架商品")]
|
||||
public async Task<AdminUiCallBack> DoListing([FromBody] FMIntId entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var model = await _weChatTransactionComponentGoodsServices.QueryByClauseAsync(p => p.id == entity.id, true);
|
||||
if (model == null)
|
||||
{
|
||||
jm.msg = GlobalConstVars.DataisNo;
|
||||
return jm;
|
||||
}
|
||||
|
||||
//获取小程序认证
|
||||
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
|
||||
|
||||
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
|
||||
var request = new ShopSPUListingRequest();
|
||||
request.AccessToken = accessToken;
|
||||
request.OutProductId = model.outProductId;
|
||||
|
||||
var response = await client.ExecuteShopSPUListingAsync(request);
|
||||
|
||||
jm.code = response.IsSuccessful() ? 0 : 1;
|
||||
jm.msg = response.IsSuccessful() ? "上架成功" : response.ErrorMessage;
|
||||
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 下架商品============================================================
|
||||
// POST: Api/WeChatTransactionComponentGood/DoDelistingPpu/10
|
||||
/// <summary>
|
||||
/// 下架商品
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("下架商品")]
|
||||
public async Task<AdminUiCallBack> DoDelistingSpu([FromBody] FMIntId entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var model = await _weChatTransactionComponentGoodsServices.QueryByClauseAsync(p => p.id == entity.id, true);
|
||||
if (model == null)
|
||||
{
|
||||
jm.msg = GlobalConstVars.DataisNo;
|
||||
return jm;
|
||||
}
|
||||
|
||||
|
||||
//获取小程序认证
|
||||
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
|
||||
|
||||
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
|
||||
var request = new ShopSPUDelistingRequest();
|
||||
request.AccessToken = accessToken;
|
||||
request.OutProductId = model.outProductId;
|
||||
|
||||
var response = await client.ExecuteShopSPUDelistingAsync(request);
|
||||
|
||||
jm.code = response.IsSuccessful() ? 0 : 1;
|
||||
jm.msg = response.IsSuccessful() ? "下架成功" : response.ErrorMessage;
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 预览数据============================================================
|
||||
// POST: Api/WeChatTransactionComponentGood/GetDetails/10
|
||||
/// <summary>
|
||||
/// 预览数据
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("预览数据")]
|
||||
public async Task<AdminUiCallBack> GetDetails([FromBody] FMIntId entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var model = await _weChatTransactionComponentGoodsServices.QueryByIdAsync(entity.id, false);
|
||||
if (model == null)
|
||||
{
|
||||
jm.msg = "不存在此信息";
|
||||
return jm;
|
||||
}
|
||||
jm.code = 0;
|
||||
jm.data = model;
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 免审更新============================================================
|
||||
// POST: Api/WeChatTransactionComponentGood/WithoutAuditUpdateSKU/10
|
||||
/// <summary>
|
||||
/// 提交更新
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("免审更新")]
|
||||
public async Task<AdminUiCallBack> WithoutAuditUpdateSKU([FromBody] FMIntId entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var model = await _weChatTransactionComponentGoodsServices.QueryByClauseAsync(p => p.id == entity.id, true);
|
||||
if (model == null)
|
||||
{
|
||||
jm.msg = GlobalConstVars.DataisNo;
|
||||
return jm;
|
||||
}
|
||||
|
||||
var sku = await _weChatTransactionComponentGoodSkuServices.QueryListByClauseAsync(p =>
|
||||
p.isSelect == true && p.outProductId == model.outProductId);
|
||||
|
||||
//获取小程序认证
|
||||
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
|
||||
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
|
||||
var request = new ShopSPUUpdateWithoutAuditRequest();
|
||||
|
||||
request.AccessToken = accessToken;
|
||||
|
||||
request.OutProductId = model.outProductId;
|
||||
request.ProductId = model.productId;
|
||||
|
||||
request.PagePath = model.path;
|
||||
|
||||
request.SKUList = new List<ShopSPUUpdateWithoutAuditRequest.Types.SKU>();
|
||||
|
||||
sku.ForEach(p =>
|
||||
{
|
||||
var item = new ShopSPUUpdateWithoutAuditRequest.Types.SKU();
|
||||
|
||||
item.OutSKUId = p.outSkuId;
|
||||
|
||||
item.SalePrice = Convert.ToInt32(p.salePrice * 100);
|
||||
item.MarketPrice = Convert.ToInt32(p.marketPrice * 100);
|
||||
item.Stock = p.stockNum;
|
||||
item.BarCode = p.barCode;
|
||||
item.SKUCode = p.skuCode;
|
||||
|
||||
request.SKUList.Add(item);
|
||||
});
|
||||
|
||||
var response = await client.ExecuteShopSPUUpdateWithoutAuditAsync(request);
|
||||
|
||||
if (response.IsSuccessful())
|
||||
{
|
||||
|
||||
jm.code = 0;
|
||||
jm.msg = "更新成功";
|
||||
}
|
||||
else
|
||||
{
|
||||
jm.code = 1;
|
||||
jm.data = response.ErrorCode;
|
||||
jm.msg = response.ErrorMessage;
|
||||
}
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,792 +0,0 @@
|
||||
/***********************************************************************
|
||||
* 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.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.AccressToken;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.Entities.Expression;
|
||||
using CoreCms.Net.Model.FromBody;
|
||||
using CoreCms.Net.Filter;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using CoreCms.Net.Utility.Extensions;
|
||||
using CoreCms.Net.WeChat.Service.HttpClients;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NPOI.HSSF.UserModel;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api.Models;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.Web.Admin.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义交易组件三级类目
|
||||
///</summary>
|
||||
[Description("自定义交易组件三级类目")]
|
||||
[Route("api/[controller]/[action]")]
|
||||
[ApiController]
|
||||
[RequiredErrorForAdmin]
|
||||
[Authorize(Permissions.Name)]
|
||||
public class WeChatTransactionComponentThirdCategoryController : ControllerBase
|
||||
{
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
private readonly IWeChatTransactionComponentThirdCategoryServices _weChatTcThirdCatListServices;
|
||||
private readonly CoreCms.Net.WeChat.Service.HttpClients.IWeChatApiHttpClientFactory _weChatApiHttpClientFactory;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
///</summary>
|
||||
public WeChatTransactionComponentThirdCategoryController(IWebHostEnvironment webHostEnvironment
|
||||
, IWeChatTransactionComponentThirdCategoryServices weChatTcThirdCatListServices, IWeChatApiHttpClientFactory weChatApiHttpClientFactory)
|
||||
{
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
_weChatTcThirdCatListServices = weChatTcThirdCatListServices;
|
||||
_weChatApiHttpClientFactory = weChatApiHttpClientFactory;
|
||||
}
|
||||
|
||||
#region 获取列表============================================================
|
||||
// POST: Api/WeChatTCThirdCatList/GetPageList
|
||||
/// <summary>
|
||||
/// 获取列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("获取列表")]
|
||||
public async Task<AdminUiCallBack> GetPageList()
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
var pageCurrent = Request.Form["page"].FirstOrDefault().ObjectToInt(1);
|
||||
var pageSize = Request.Form["limit"].FirstOrDefault().ObjectToInt(30);
|
||||
var where = PredicateBuilder.True<WeChatTransactionComponentThirdCategory>();
|
||||
//获取排序字段
|
||||
var orderField = Request.Form["orderField"].FirstOrDefault();
|
||||
|
||||
Expression<Func<WeChatTransactionComponentThirdCategory, object>> orderEx = orderField switch
|
||||
{
|
||||
"id" => p => p.id,
|
||||
"third_cat_id" => p => p.third_cat_id,
|
||||
"third_cat_name" => p => p.third_cat_name,
|
||||
"qualification" => p => p.qualification,
|
||||
"qualification_type" => p => p.qualification_type,
|
||||
"product_qualification" => p => p.product_qualification,
|
||||
"product_qualification_type" => p => p.product_qualification_type,
|
||||
"second_cat_id" => p => p.second_cat_id,
|
||||
"second_cat_name" => p => p.second_cat_name,
|
||||
"first_cat_id" => p => p.first_cat_id,
|
||||
"first_cat_name" => p => p.first_cat_name,
|
||||
"createTime" => p => p.createTime,
|
||||
_ => p => p.id
|
||||
};
|
||||
|
||||
//设置排序方式
|
||||
var orderDirection = Request.Form["orderDirection"].FirstOrDefault();
|
||||
var orderBy = orderDirection switch
|
||||
{
|
||||
"asc" => OrderByType.Asc,
|
||||
"desc" => OrderByType.Desc,
|
||||
_ => OrderByType.Desc
|
||||
};
|
||||
//查询筛选
|
||||
|
||||
//序列 int
|
||||
var id = Request.Form["id"].FirstOrDefault().ObjectToInt(0);
|
||||
if (id > 0)
|
||||
{
|
||||
where = where.And(p => p.id == id);
|
||||
}
|
||||
//类目ID int
|
||||
var third_cat_id = Request.Form["third_cat_id"].FirstOrDefault().ObjectToInt(0);
|
||||
if (third_cat_id > 0)
|
||||
{
|
||||
where = where.And(p => p.third_cat_id == third_cat_id);
|
||||
}
|
||||
//类目名称 nvarchar
|
||||
var third_cat_name = Request.Form["third_cat_name"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(third_cat_name))
|
||||
{
|
||||
where = where.And(p => p.third_cat_name.Contains(third_cat_name));
|
||||
}
|
||||
//类目资质 nvarchar
|
||||
var qualification = Request.Form["qualification"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(qualification))
|
||||
{
|
||||
where = where.And(p => p.qualification.Contains(qualification));
|
||||
}
|
||||
//类目资质类型,0:不需要,1:必填,2:选填 int
|
||||
var qualification_type = Request.Form["qualification_type"].FirstOrDefault().ObjectToInt(0);
|
||||
if (qualification_type > 0)
|
||||
{
|
||||
where = where.And(p => p.qualification_type == qualification_type);
|
||||
}
|
||||
//商品资质 nvarchar
|
||||
var product_qualification = Request.Form["product_qualification"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(product_qualification))
|
||||
{
|
||||
where = where.And(p => p.product_qualification.Contains(product_qualification));
|
||||
}
|
||||
//商品资质类型,0:不需要,1:必填,2:选填 int
|
||||
var product_qualification_type = Request.Form["product_qualification_type"].FirstOrDefault().ObjectToInt(0);
|
||||
if (product_qualification_type > 0)
|
||||
{
|
||||
where = where.And(p => p.product_qualification_type == product_qualification_type);
|
||||
}
|
||||
//二级类目ID int
|
||||
var second_cat_id = Request.Form["second_cat_id"].FirstOrDefault().ObjectToInt(0);
|
||||
if (second_cat_id > 0)
|
||||
{
|
||||
where = where.And(p => p.second_cat_id == second_cat_id);
|
||||
}
|
||||
//二级类目名称 nvarchar
|
||||
var second_cat_name = Request.Form["second_cat_name"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(second_cat_name))
|
||||
{
|
||||
where = where.And(p => p.second_cat_name.Contains(second_cat_name));
|
||||
}
|
||||
//一级类目ID int
|
||||
var first_cat_id = Request.Form["first_cat_id"].FirstOrDefault().ObjectToInt(0);
|
||||
if (first_cat_id > 0)
|
||||
{
|
||||
where = where.And(p => p.first_cat_id == first_cat_id);
|
||||
}
|
||||
//一级类目名称 nvarchar
|
||||
var first_cat_name = Request.Form["first_cat_name"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(first_cat_name))
|
||||
{
|
||||
where = where.And(p => p.first_cat_name.Contains(first_cat_name));
|
||||
}
|
||||
//创建时间 datetime
|
||||
var createTime = Request.Form["createTime"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(createTime))
|
||||
{
|
||||
if (createTime.Contains("到"))
|
||||
{
|
||||
var dts = createTime.Split("到");
|
||||
var dtStart = dts[0].Trim().ObjectToDate();
|
||||
where = where.And(p => p.createTime > dtStart);
|
||||
var dtEnd = dts[1].Trim().ObjectToDate();
|
||||
where = where.And(p => p.createTime < dtEnd);
|
||||
}
|
||||
else
|
||||
{
|
||||
var dt = createTime.ObjectToDate();
|
||||
where = where.And(p => p.createTime > dt);
|
||||
}
|
||||
}
|
||||
//获取数据
|
||||
var list = await _weChatTcThirdCatListServices.QueryPageAsync(where, " first_cat_id asc, second_cat_id asc , third_cat_id asc ", pageCurrent, pageSize, false);
|
||||
//返回数据
|
||||
jm.data = list;
|
||||
jm.code = 0;
|
||||
jm.count = list.TotalCount;
|
||||
jm.msg = "数据调用成功!";
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 首页数据============================================================
|
||||
// POST: Api/WeChatTCThirdCatList/GetIndex
|
||||
/// <summary>
|
||||
/// 首页数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("首页数据")]
|
||||
public AdminUiCallBack GetIndex()
|
||||
{
|
||||
//返回数据
|
||||
var jm = new AdminUiCallBack { code = 0 };
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 刷新数据============================================================
|
||||
// POST: Api/CoreCmsMiNiStoreThirdCatList/DoBatchDelete/10,11,20
|
||||
/// <summary>
|
||||
/// 刷新数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("刷新数据")]
|
||||
public async Task<AdminUiCallBack> DoRefresh()
|
||||
{
|
||||
var jm = new AdminUiCallBack { code = 0 };
|
||||
var bl = false;
|
||||
try
|
||||
{
|
||||
var dt = DateTime.Now;
|
||||
var stime = new DateTime(dt.Year, dt.Month, dt.Day, 0, 0, 0);
|
||||
var etime = new DateTime(dt.Year, dt.Month, dt.Day, 23, 59, 59);
|
||||
|
||||
var isHave = await _weChatTcThirdCatListServices.ExistsAsync(p => p.createTime > stime && p.createTime < etime);
|
||||
if (isHave)
|
||||
{
|
||||
jm.code = 1;
|
||||
jm.msg = "今日已经更新,不要频繁调用";
|
||||
return jm;
|
||||
}
|
||||
|
||||
|
||||
//获取小程序认证
|
||||
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
|
||||
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
|
||||
var request = new ShopCategoryGetRequest { AccessToken = accessToken };
|
||||
|
||||
var response = await client.ExecuteShopCategoryGetAsync(request);
|
||||
if (response.IsSuccessful())
|
||||
{
|
||||
if (response.CategoryList.Length > 0)
|
||||
{
|
||||
var list = new List<WeChatTransactionComponentThirdCategory>();
|
||||
|
||||
foreach (var item in response.CategoryList)
|
||||
{
|
||||
list.Add(new WeChatTransactionComponentThirdCategory()
|
||||
{
|
||||
third_cat_id = item.ThirdCategoryId,
|
||||
third_cat_name = item.ThirdCategoryName,
|
||||
qualification = item.Qualification,
|
||||
qualification_type = item.QualificationType,
|
||||
product_qualification = item.ProductQualification,
|
||||
product_qualification_type = item.ProductQualificationType,
|
||||
second_cat_id = item.SecondCategoryId,
|
||||
second_cat_name = item.SecondCategoryName,
|
||||
first_cat_id = item.FirstCategoryId,
|
||||
first_cat_name = item.FirstCategoryName,
|
||||
createTime = DateTime.Now
|
||||
|
||||
});
|
||||
}
|
||||
await _weChatTcThirdCatListServices.DeleteAsync(p => p.id > 0);
|
||||
bl = await _weChatTcThirdCatListServices.InsertAsync(list) > 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jm.code = 1;
|
||||
jm.msg = response.ErrorMessage;
|
||||
jm.otherData = response;
|
||||
return jm;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
jm.code = 1;
|
||||
jm.msg = e.ToString();
|
||||
return jm;
|
||||
}
|
||||
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? "更新成功" : "更新失败";
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 预览数据============================================================
|
||||
// POST: Api/WeChatTCThirdCatList/GetDetails/10
|
||||
/// <summary>
|
||||
/// 预览数据
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("预览数据")]
|
||||
public async Task<AdminUiCallBack> GetDetails([FromBody] FMIntId entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var model = await _weChatTcThirdCatListServices.QueryByIdAsync(entity.id, false);
|
||||
if (model == null)
|
||||
{
|
||||
jm.msg = "不存在此信息";
|
||||
return jm;
|
||||
}
|
||||
jm.code = 0;
|
||||
jm.data = model;
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 选择导出============================================================
|
||||
// POST: Api/WeChatTCThirdCatList/SelectExportExcel/10
|
||||
/// <summary>
|
||||
/// 选择导出
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("选择导出")]
|
||||
public async Task<AdminUiCallBack> SelectExportExcel([FromBody] FMArrayIntIds entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
//创建Excel文件的对象
|
||||
var book = new HSSFWorkbook();
|
||||
//添加一个sheet
|
||||
var mySheet = book.CreateSheet("Sheet1");
|
||||
//获取list数据
|
||||
var listModel = await _weChatTcThirdCatListServices.QueryListByClauseAsync(p => entity.id.Contains(p.id), p => p.id, OrderByType.Asc, true);
|
||||
//给sheet1添加第一行的头部标题
|
||||
var headerRow = mySheet.CreateRow(0);
|
||||
var headerStyle = ExcelHelper.GetHeaderStyle(book);
|
||||
|
||||
var cell0 = headerRow.CreateCell(0);
|
||||
cell0.SetCellValue("序列");
|
||||
cell0.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(0, 10 * 256);
|
||||
|
||||
var cell1 = headerRow.CreateCell(1);
|
||||
cell1.SetCellValue("类目ID");
|
||||
cell1.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(1, 10 * 256);
|
||||
|
||||
var cell2 = headerRow.CreateCell(2);
|
||||
cell2.SetCellValue("类目名称");
|
||||
cell2.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(2, 10 * 256);
|
||||
|
||||
var cell3 = headerRow.CreateCell(3);
|
||||
cell3.SetCellValue("类目资质");
|
||||
cell3.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(3, 10 * 256);
|
||||
|
||||
var cell4 = headerRow.CreateCell(4);
|
||||
cell4.SetCellValue("类目资质类型,0:不需要,1:必填,2:选填");
|
||||
cell4.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(4, 10 * 256);
|
||||
|
||||
var cell5 = headerRow.CreateCell(5);
|
||||
cell5.SetCellValue("商品资质");
|
||||
cell5.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(5, 10 * 256);
|
||||
|
||||
var cell6 = headerRow.CreateCell(6);
|
||||
cell6.SetCellValue("商品资质类型,0:不需要,1:必填,2:选填");
|
||||
cell6.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(6, 10 * 256);
|
||||
|
||||
var cell7 = headerRow.CreateCell(7);
|
||||
cell7.SetCellValue("二级类目ID");
|
||||
cell7.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(7, 10 * 256);
|
||||
|
||||
var cell8 = headerRow.CreateCell(8);
|
||||
cell8.SetCellValue("二级类目名称");
|
||||
cell8.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(8, 10 * 256);
|
||||
|
||||
var cell9 = headerRow.CreateCell(9);
|
||||
cell9.SetCellValue("一级类目ID");
|
||||
cell9.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(9, 10 * 256);
|
||||
|
||||
var cell10 = headerRow.CreateCell(10);
|
||||
cell10.SetCellValue("一级类目名称");
|
||||
cell10.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(10, 10 * 256);
|
||||
|
||||
var cell11 = headerRow.CreateCell(11);
|
||||
cell11.SetCellValue("创建时间");
|
||||
cell11.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(11, 10 * 256);
|
||||
|
||||
headerRow.Height = 30 * 20;
|
||||
var commonCellStyle = ExcelHelper.GetCommonStyle(book);
|
||||
|
||||
//将数据逐步写入sheet1各个行
|
||||
for (var i = 0; i < listModel.Count; i++)
|
||||
{
|
||||
var rowTemp = mySheet.CreateRow(i + 1);
|
||||
|
||||
var rowTemp0 = rowTemp.CreateCell(0);
|
||||
rowTemp0.SetCellValue(listModel[i].id.ToString());
|
||||
rowTemp0.CellStyle = commonCellStyle;
|
||||
|
||||
var rowTemp1 = rowTemp.CreateCell(1);
|
||||
rowTemp1.SetCellValue(listModel[i].third_cat_id.ToString());
|
||||
rowTemp1.CellStyle = commonCellStyle;
|
||||
|
||||
var rowTemp2 = rowTemp.CreateCell(2);
|
||||
rowTemp2.SetCellValue(listModel[i].third_cat_name.ToString());
|
||||
rowTemp2.CellStyle = commonCellStyle;
|
||||
|
||||
var rowTemp3 = rowTemp.CreateCell(3);
|
||||
rowTemp3.SetCellValue(listModel[i].qualification.ToString());
|
||||
rowTemp3.CellStyle = commonCellStyle;
|
||||
|
||||
var rowTemp4 = rowTemp.CreateCell(4);
|
||||
rowTemp4.SetCellValue(listModel[i].qualification_type.ToString());
|
||||
rowTemp4.CellStyle = commonCellStyle;
|
||||
|
||||
var rowTemp5 = rowTemp.CreateCell(5);
|
||||
rowTemp5.SetCellValue(listModel[i].product_qualification.ToString());
|
||||
rowTemp5.CellStyle = commonCellStyle;
|
||||
|
||||
var rowTemp6 = rowTemp.CreateCell(6);
|
||||
rowTemp6.SetCellValue(listModel[i].product_qualification_type.ToString());
|
||||
rowTemp6.CellStyle = commonCellStyle;
|
||||
|
||||
var rowTemp7 = rowTemp.CreateCell(7);
|
||||
rowTemp7.SetCellValue(listModel[i].second_cat_id.ToString());
|
||||
rowTemp7.CellStyle = commonCellStyle;
|
||||
|
||||
var rowTemp8 = rowTemp.CreateCell(8);
|
||||
rowTemp8.SetCellValue(listModel[i].second_cat_name.ToString());
|
||||
rowTemp8.CellStyle = commonCellStyle;
|
||||
|
||||
var rowTemp9 = rowTemp.CreateCell(9);
|
||||
rowTemp9.SetCellValue(listModel[i].first_cat_id.ToString());
|
||||
rowTemp9.CellStyle = commonCellStyle;
|
||||
|
||||
var rowTemp10 = rowTemp.CreateCell(10);
|
||||
rowTemp10.SetCellValue(listModel[i].first_cat_name.ToString());
|
||||
rowTemp10.CellStyle = commonCellStyle;
|
||||
|
||||
var rowTemp11 = rowTemp.CreateCell(11);
|
||||
rowTemp11.SetCellValue(listModel[i].createTime.ToString());
|
||||
rowTemp11.CellStyle = commonCellStyle;
|
||||
|
||||
}
|
||||
// 导出excel
|
||||
string webRootPath = _webHostEnvironment.WebRootPath;
|
||||
string tpath = "/files/" + DateTime.Now.ToString("yyyy-MM-dd") + "/";
|
||||
string fileName = DateTime.Now.ToString("yyyyMMddHHmmssfff") + "-WeChatTCThirdCatList导出(选择结果).xls";
|
||||
string filePath = webRootPath + tpath;
|
||||
DirectoryInfo di = new DirectoryInfo(filePath);
|
||||
if (!di.Exists)
|
||||
{
|
||||
di.Create();
|
||||
}
|
||||
FileStream fileHssf = new FileStream(filePath + fileName, FileMode.Create);
|
||||
book.Write(fileHssf);
|
||||
fileHssf.Close();
|
||||
|
||||
jm.code = 0;
|
||||
jm.msg = GlobalConstVars.ExcelExportSuccess;
|
||||
jm.data = tpath + fileName;
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查询导出============================================================
|
||||
// POST: Api/WeChatTCThirdCatList/QueryExportExcel/10
|
||||
/// <summary>
|
||||
/// 查询导出
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("查询导出")]
|
||||
public async Task<AdminUiCallBack> QueryExportExcel()
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var where = PredicateBuilder.True<WeChatTransactionComponentThirdCategory>();
|
||||
//查询筛选
|
||||
|
||||
//序列 int
|
||||
var id = Request.Form["id"].FirstOrDefault().ObjectToInt(0);
|
||||
if (id > 0)
|
||||
{
|
||||
where = where.And(p => p.id == id);
|
||||
}
|
||||
//类目ID int
|
||||
var third_cat_id = Request.Form["third_cat_id"].FirstOrDefault().ObjectToInt(0);
|
||||
if (third_cat_id > 0)
|
||||
{
|
||||
where = where.And(p => p.third_cat_id == third_cat_id);
|
||||
}
|
||||
//类目名称 nvarchar
|
||||
var third_cat_name = Request.Form["third_cat_name"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(third_cat_name))
|
||||
{
|
||||
where = where.And(p => p.third_cat_name.Contains(third_cat_name));
|
||||
}
|
||||
//类目资质 nvarchar
|
||||
var qualification = Request.Form["qualification"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(qualification))
|
||||
{
|
||||
where = where.And(p => p.qualification.Contains(qualification));
|
||||
}
|
||||
//类目资质类型,0:不需要,1:必填,2:选填 int
|
||||
var qualification_type = Request.Form["qualification_type"].FirstOrDefault().ObjectToInt(0);
|
||||
if (qualification_type > 0)
|
||||
{
|
||||
where = where.And(p => p.qualification_type == qualification_type);
|
||||
}
|
||||
//商品资质 nvarchar
|
||||
var product_qualification = Request.Form["product_qualification"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(product_qualification))
|
||||
{
|
||||
where = where.And(p => p.product_qualification.Contains(product_qualification));
|
||||
}
|
||||
//商品资质类型,0:不需要,1:必填,2:选填 int
|
||||
var product_qualification_type = Request.Form["product_qualification_type"].FirstOrDefault().ObjectToInt(0);
|
||||
if (product_qualification_type > 0)
|
||||
{
|
||||
where = where.And(p => p.product_qualification_type == product_qualification_type);
|
||||
}
|
||||
//二级类目ID int
|
||||
var second_cat_id = Request.Form["second_cat_id"].FirstOrDefault().ObjectToInt(0);
|
||||
if (second_cat_id > 0)
|
||||
{
|
||||
where = where.And(p => p.second_cat_id == second_cat_id);
|
||||
}
|
||||
//二级类目名称 nvarchar
|
||||
var second_cat_name = Request.Form["second_cat_name"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(second_cat_name))
|
||||
{
|
||||
where = where.And(p => p.second_cat_name.Contains(second_cat_name));
|
||||
}
|
||||
//一级类目ID int
|
||||
var first_cat_id = Request.Form["first_cat_id"].FirstOrDefault().ObjectToInt(0);
|
||||
if (first_cat_id > 0)
|
||||
{
|
||||
where = where.And(p => p.first_cat_id == first_cat_id);
|
||||
}
|
||||
//一级类目名称 nvarchar
|
||||
var first_cat_name = Request.Form["first_cat_name"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(first_cat_name))
|
||||
{
|
||||
where = where.And(p => p.first_cat_name.Contains(first_cat_name));
|
||||
}
|
||||
//创建时间 datetime
|
||||
var createTime = Request.Form["createTime"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(createTime))
|
||||
{
|
||||
var dt = createTime.ObjectToDate();
|
||||
where = where.And(p => p.createTime > dt);
|
||||
}
|
||||
//获取数据
|
||||
//创建Excel文件的对象
|
||||
var book = new HSSFWorkbook();
|
||||
//添加一个sheet
|
||||
var mySheet = book.CreateSheet("Sheet1");
|
||||
//获取list数据
|
||||
var listModel = await _weChatTcThirdCatListServices.QueryListByClauseAsync(where, p => p.id, OrderByType.Asc, true);
|
||||
//给sheet1添加第一行的头部标题
|
||||
var headerRow = mySheet.CreateRow(0);
|
||||
var headerStyle = ExcelHelper.GetHeaderStyle(book);
|
||||
|
||||
var cell0 = headerRow.CreateCell(0);
|
||||
cell0.SetCellValue("序列");
|
||||
cell0.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(0, 10 * 256);
|
||||
|
||||
var cell1 = headerRow.CreateCell(1);
|
||||
cell1.SetCellValue("类目ID");
|
||||
cell1.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(1, 10 * 256);
|
||||
|
||||
var cell2 = headerRow.CreateCell(2);
|
||||
cell2.SetCellValue("类目名称");
|
||||
cell2.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(2, 10 * 256);
|
||||
|
||||
var cell3 = headerRow.CreateCell(3);
|
||||
cell3.SetCellValue("类目资质");
|
||||
cell3.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(3, 10 * 256);
|
||||
|
||||
var cell4 = headerRow.CreateCell(4);
|
||||
cell4.SetCellValue("类目资质类型,0:不需要,1:必填,2:选填");
|
||||
cell4.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(4, 10 * 256);
|
||||
|
||||
var cell5 = headerRow.CreateCell(5);
|
||||
cell5.SetCellValue("商品资质");
|
||||
cell5.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(5, 10 * 256);
|
||||
|
||||
var cell6 = headerRow.CreateCell(6);
|
||||
cell6.SetCellValue("商品资质类型,0:不需要,1:必填,2:选填");
|
||||
cell6.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(6, 10 * 256);
|
||||
|
||||
var cell7 = headerRow.CreateCell(7);
|
||||
cell7.SetCellValue("二级类目ID");
|
||||
cell7.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(7, 10 * 256);
|
||||
|
||||
var cell8 = headerRow.CreateCell(8);
|
||||
cell8.SetCellValue("二级类目名称");
|
||||
cell8.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(8, 10 * 256);
|
||||
|
||||
var cell9 = headerRow.CreateCell(9);
|
||||
cell9.SetCellValue("一级类目ID");
|
||||
cell9.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(9, 10 * 256);
|
||||
|
||||
var cell10 = headerRow.CreateCell(10);
|
||||
cell10.SetCellValue("一级类目名称");
|
||||
cell10.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(10, 10 * 256);
|
||||
|
||||
var cell11 = headerRow.CreateCell(11);
|
||||
cell11.SetCellValue("创建时间");
|
||||
cell11.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(11, 10 * 256);
|
||||
|
||||
|
||||
headerRow.Height = 30 * 20;
|
||||
var commonCellStyle = ExcelHelper.GetCommonStyle(book);
|
||||
|
||||
//将数据逐步写入sheet1各个行
|
||||
for (var i = 0; i < listModel.Count; i++)
|
||||
{
|
||||
var rowTemp = mySheet.CreateRow(i + 1);
|
||||
|
||||
|
||||
var rowTemp0 = rowTemp.CreateCell(0);
|
||||
rowTemp0.SetCellValue(listModel[i].id.ToString());
|
||||
rowTemp0.CellStyle = commonCellStyle;
|
||||
|
||||
|
||||
|
||||
var rowTemp1 = rowTemp.CreateCell(1);
|
||||
rowTemp1.SetCellValue(listModel[i].third_cat_id.ToString());
|
||||
rowTemp1.CellStyle = commonCellStyle;
|
||||
|
||||
|
||||
|
||||
var rowTemp2 = rowTemp.CreateCell(2);
|
||||
rowTemp2.SetCellValue(listModel[i].third_cat_name.ToString());
|
||||
rowTemp2.CellStyle = commonCellStyle;
|
||||
|
||||
|
||||
|
||||
var rowTemp3 = rowTemp.CreateCell(3);
|
||||
rowTemp3.SetCellValue(listModel[i].qualification.ToString());
|
||||
rowTemp3.CellStyle = commonCellStyle;
|
||||
|
||||
|
||||
|
||||
var rowTemp4 = rowTemp.CreateCell(4);
|
||||
rowTemp4.SetCellValue(listModel[i].qualification_type.ToString());
|
||||
rowTemp4.CellStyle = commonCellStyle;
|
||||
|
||||
|
||||
|
||||
var rowTemp5 = rowTemp.CreateCell(5);
|
||||
rowTemp5.SetCellValue(listModel[i].product_qualification.ToString());
|
||||
rowTemp5.CellStyle = commonCellStyle;
|
||||
|
||||
|
||||
|
||||
var rowTemp6 = rowTemp.CreateCell(6);
|
||||
rowTemp6.SetCellValue(listModel[i].product_qualification_type.ToString());
|
||||
rowTemp6.CellStyle = commonCellStyle;
|
||||
|
||||
|
||||
|
||||
var rowTemp7 = rowTemp.CreateCell(7);
|
||||
rowTemp7.SetCellValue(listModel[i].second_cat_id.ToString());
|
||||
rowTemp7.CellStyle = commonCellStyle;
|
||||
|
||||
|
||||
|
||||
var rowTemp8 = rowTemp.CreateCell(8);
|
||||
rowTemp8.SetCellValue(listModel[i].second_cat_name.ToString());
|
||||
rowTemp8.CellStyle = commonCellStyle;
|
||||
|
||||
|
||||
|
||||
var rowTemp9 = rowTemp.CreateCell(9);
|
||||
rowTemp9.SetCellValue(listModel[i].first_cat_id.ToString());
|
||||
rowTemp9.CellStyle = commonCellStyle;
|
||||
|
||||
|
||||
|
||||
var rowTemp10 = rowTemp.CreateCell(10);
|
||||
rowTemp10.SetCellValue(listModel[i].first_cat_name.ToString());
|
||||
rowTemp10.CellStyle = commonCellStyle;
|
||||
|
||||
|
||||
|
||||
var rowTemp11 = rowTemp.CreateCell(11);
|
||||
rowTemp11.SetCellValue(listModel[i].createTime.ToString());
|
||||
rowTemp11.CellStyle = commonCellStyle;
|
||||
|
||||
|
||||
}
|
||||
// 写入到excel
|
||||
string webRootPath = _webHostEnvironment.WebRootPath;
|
||||
string tpath = "/files/" + DateTime.Now.ToString("yyyy-MM-dd") + "/";
|
||||
string fileName = DateTime.Now.ToString("yyyyMMddHHmmssfff") + "-WeChatTCThirdCatList导出(查询结果).xls";
|
||||
string filePath = webRootPath + tpath;
|
||||
DirectoryInfo di = new DirectoryInfo(filePath);
|
||||
if (!di.Exists)
|
||||
{
|
||||
di.Create();
|
||||
}
|
||||
FileStream fileHssf = new FileStream(filePath + fileName, FileMode.Create);
|
||||
book.Write(fileHssf);
|
||||
fileHssf.Close();
|
||||
|
||||
jm.code = 0;
|
||||
jm.msg = GlobalConstVars.ExcelExportSuccess;
|
||||
jm.data = tpath + fileName;
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取交易组件三级类目====================================================
|
||||
|
||||
// POST: Api/Tools/GetGoods
|
||||
/// <summary>
|
||||
/// 获取商品列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("获取三级类目")]
|
||||
public async Task<AdminUiCallBack> GetThirdCategories()
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
var pageCurrent = Request.Form["page"].FirstOrDefault().ObjectToInt(1);
|
||||
var pageSize = Request.Form["limit"].FirstOrDefault().ObjectToInt(30);
|
||||
var where = PredicateBuilder.True<WeChatTransactionComponentThirdCategory>();
|
||||
|
||||
//商品名称 nvarchar
|
||||
var name = Request.Form["name"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(name)) where = where.And(p => p.third_cat_name.Contains(name));
|
||||
|
||||
//获取数据
|
||||
var list = await _weChatTcThirdCatListServices.QueryPageAsync(where, p => p.createTime, OrderByType.Desc,
|
||||
pageCurrent, pageSize);
|
||||
//返回数据
|
||||
|
||||
jm.data = list;
|
||||
jm.code = 0;
|
||||
jm.count = list.TotalCount;
|
||||
jm.msg = "数据调用成功!";
|
||||
return jm;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -345,9 +345,6 @@
|
||||
html += d.data.orderStatus[i].description;
|
||||
}
|
||||
}
|
||||
if (data.tcOrder) {
|
||||
html += '<button type="button" class="layui-btn layui-btn-warm layui-btn-xs" data-id="' + data.orderId + '" lay-active="showTcOrder" style="margin-left: 0px">直播订单</button>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
},
|
||||
@@ -530,11 +527,6 @@
|
||||
printExpress(id)
|
||||
},
|
||||
//通过接口获取远端交易组件订单信息
|
||||
showTcOrder: function () {
|
||||
var id = $(this).attr('data-id');
|
||||
showTcOrder(id);
|
||||
},
|
||||
//通过接口获取远端交易组件订单信息
|
||||
refreshDelivery: function () {
|
||||
var id = $(this).attr('data-deliveryId');
|
||||
refreshDelivery(id);
|
||||
@@ -989,28 +981,6 @@
|
||||
layer.msg("打印快递单" + orderId);
|
||||
};
|
||||
|
||||
|
||||
//通过接口获取远端交易组件订单信息
|
||||
function showTcOrder(ids) {
|
||||
coreHelper.Post("Api/CoreCmsOrder/GetTcOrder", { id: ids }, function (e) {
|
||||
if (e.code === 0) {
|
||||
admin.popup({
|
||||
shadeClose: false,
|
||||
title: '查看详情',
|
||||
area: ['1200px', '90%'],
|
||||
id: 'LAY-popup-CoreCmsOrder-tcorderdetails',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('order/orders/tcorderdetails', { data: e.data }).done(function () {
|
||||
//监听提交
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.msg(e.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//查看订单
|
||||
function viewOrder(ids) {
|
||||
coreHelper.Post("Api/CoreCmsOrder/GetDetails", { id: ids }, function (e) {
|
||||
|
||||
@@ -1,226 +0,0 @@
|
||||
<script type="text/html" template lay-type="Post" lay-url="{{ layui.setter.apiUrl }}Api/WeChatTransactionComponentAccount/GetInfo" lay-done="layui.data.done(d);">
|
||||
|
||||
<div class="layui-fluid">
|
||||
<div class="layui-row layui-col-space15">
|
||||
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<!--<div class="layui-card-header">
|
||||
分销设置
|
||||
</div>-->
|
||||
|
||||
<div class="layui-card-body">
|
||||
|
||||
<div class="layui-tab layui-tab-card" lay-filter="setting">
|
||||
<ul class="layui-tab-title">
|
||||
<li lay-id="distributionSet" class="layui-this">商家信息</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
<div class="layui-tab-item layui-show">
|
||||
<div class="layui-form coreshop-form transactioncomponent" lay-filter="LAY-app-WeChatTransactionComponentAuditCategory-createForm" id="LAY-app-WeChatTransactionComponentAuditCategory-createForm">
|
||||
<div class="layui-form-item">
|
||||
<label for="licenseImage" class="layui-form-label">客服地址</label>
|
||||
<div class="layui-input-inline layui-inline-12">
|
||||
<input name="service_agent_path" class="layui-input" placeholder="请输入客服地址" lay-reqText="请输入客服地址" value="{{d.data && d.data.service_agent_path ? d.data.service_agent_path:''}}" />
|
||||
</div>
|
||||
<div class="layui-form-mid">
|
||||
输入小程序的客服自定义地址,如:/pages/member/customerService/index
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label for="licenseImage" class="layui-form-label">联系方式</label>
|
||||
<div class="layui-input-inline layui-inline-12">
|
||||
<input name="service_agent_phone" class="layui-input" placeholder="请输入客服地址" lay-reqText="请输入客服地址" value="{{d.data && d.data.service_agent_phone ? d.data.service_agent_phone:''}}" />
|
||||
</div>
|
||||
<div class="layui-form-mid">
|
||||
如:020-888888
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label for="licenseImage" class="layui-form-label layui-form-required">客服类型</label>
|
||||
<div class="layui-input-inline layui-inline-12">
|
||||
<input type="checkbox" name="service_agent_type_service" title="小程序官方客服" {{d.otherData.service_agent_type_service===0?'checked':''}}>
|
||||
<input type="checkbox" name="service_agent_type_phone" title="联系电话" {{d.otherData.service_agent_type_phone===0?'checked':''}}>
|
||||
<input type="checkbox" name="service_agent_type_path" title="自定义客服path" {{d.otherData.service_agent_type_path===0?'checked':''}}>
|
||||
</div>
|
||||
</div>
|
||||
<fieldset class="layui-elem-field layui-field-title site-title"><legend><a name="compress">默认退货地址</a></legend></fieldset>
|
||||
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="licenseImage" class="layui-form-label layui-form-required">收货人姓名</label>
|
||||
<div class="layui-input-inline layui-inline-8">
|
||||
<input name="receiver_name" lay-verify="required" class="layui-input" placeholder="请输入收货人姓名" lay-reqText="请输入收货人姓名" value="{{d.data && d.data.default_receiving_address ? d.data.default_receiving_address.receiver_name:''}}" />
|
||||
</div>
|
||||
<div class="layui-form-mid">
|
||||
如:张三
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="licenseImage" class="layui-form-label layui-form-required">收货地址</label>
|
||||
<div class="layui-input-inline layui-inline-8">
|
||||
<input name="detailed_address" lay-verify="required" class="layui-input" placeholder="请输入详细收货地址信息" lay-reqText="请输入详细收货地址信息" value="{{d.data && d.data.default_receiving_address ? d.data.default_receiving_address.detailed_address:''}}" />
|
||||
</div>
|
||||
<div class="layui-form-mid">
|
||||
如:详细收货地址信息
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label for="licenseImage" class="layui-form-label layui-form-required">手机号码</label>
|
||||
<div class="layui-input-inline layui-inline-8">
|
||||
<input name="tel_number" lay-verify="required|phone" class="layui-input" placeholder="请输入手机号码" lay-reqText="请输入手机号码" value="{{d.data && d.data.default_receiving_address ? d.data.default_receiving_address.tel_number:''}}" />
|
||||
</div>
|
||||
<div class="layui-form-mid">
|
||||
如:19145919666
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="licenseImage" class="layui-form-label">国家</label>
|
||||
<div class="layui-input-inline layui-inline-8">
|
||||
<input name="country" class="layui-input" placeholder="请输入手机号码" lay-reqText="请输入手机号码" value="{{d.data && d.data.default_receiving_address ? d.data.default_receiving_address.country:''}}" />
|
||||
</div>
|
||||
<div class="layui-form-mid">
|
||||
选填,如:中国
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="licenseImage" class="layui-form-label layui-form-required">省份</label>
|
||||
<div class="layui-input-inline layui-inline-8">
|
||||
<input name="province" class="layui-input" lay-verify="required" placeholder="请输入手机号码" lay-reqText="请输入手机号码" value="{{d.data && d.data.default_receiving_address ? d.data.default_receiving_address.province:''}}" />
|
||||
</div>
|
||||
<div class="layui-form-mid">
|
||||
选填,如:湖南省
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="licenseImage" class="layui-form-label layui-form-required">市</label>
|
||||
<div class="layui-input-inline layui-inline-8">
|
||||
<input name="city" class="layui-input" lay-verify="required" placeholder="请输入城市" lay-reqText="请输入城市" value="{{d.data && d.data.default_receiving_address ? d.data.default_receiving_address.city:''}}" />
|
||||
</div>
|
||||
<div class="layui-form-mid">
|
||||
选填,如:怀化市
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="licenseImage" class="layui-form-label layui-form-required">区</label>
|
||||
<div class="layui-input-inline layui-inline-8">
|
||||
<input name="town" class="layui-input" lay-verify="required" placeholder="请输入乡镇" lay-reqText="请输入乡镇" value="{{d.data && d.data.default_receiving_address ? d.data.default_receiving_address.town:''}}" />
|
||||
</div>
|
||||
<div class="layui-form-mid">
|
||||
选填,如:鹤城区
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="licenseImage" class="layui-form-label"></label>
|
||||
<input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-WeChatTransactionComponentAuditCategory-updateInfo-submit" id="LAY-app-WeChatTransactionComponentAuditCategory-updateInfo-submit" value="确认修改">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
var $;
|
||||
var imgs = [];
|
||||
var debug = layui.setter.debug;
|
||||
layui.data.done = function (d) {
|
||||
//开启调试情况下获取接口赋值数据
|
||||
if (debug) { console.log(d); }
|
||||
layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg', 'util', 'view', 'laytpl'],
|
||||
function () {
|
||||
$ = layui.$;
|
||||
var form = layui.form
|
||||
, admin = layui.admin
|
||||
, laydate = layui.laydate
|
||||
, upload = layui.upload
|
||||
, cropperImg = layui.cropperImg
|
||||
, util = layui.util
|
||||
, view = layui.view
|
||||
, laytpl = layui.laytpl
|
||||
, coreHelper = layui.coreHelper;
|
||||
|
||||
form.verify({
|
||||
verifylicenseImage: [/^.{0,255}$/, '最大只允许输入255位字符'],
|
||||
});
|
||||
|
||||
if (!d.data) {
|
||||
layer.msg(d.msg, { icon: 5 });
|
||||
}
|
||||
|
||||
//保存数据
|
||||
form.on('submit(LAY-app-WeChatTransactionComponentAuditCategory-updateInfo-submit)', function (data) {
|
||||
formData = data.field;
|
||||
if (!formData) {
|
||||
layer.msg('请先完善数据', {
|
||||
time: 1300
|
||||
});
|
||||
return false;
|
||||
}
|
||||
var field = data.field;
|
||||
|
||||
var postData = {};
|
||||
postData.service_agent_path = field.service_agent_path;
|
||||
postData.service_agent_phone = field.service_agent_phone;
|
||||
postData.service_agent_type = [];
|
||||
|
||||
if (field.service_agent_type_service == 'on') {
|
||||
postData.service_agent_type.push(0);
|
||||
}
|
||||
if (field.service_agent_type_phone == 'on') {
|
||||
postData.service_agent_type.push(2);
|
||||
}
|
||||
if (field.service_agent_type_path == 'on') {
|
||||
postData.service_agent_type.push(1);
|
||||
}
|
||||
|
||||
if (postData.service_agent_type.length == 0) {
|
||||
layer.msg('请选择客服类型', {
|
||||
time: 1300
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
let default_receiving_address = {};
|
||||
default_receiving_address.receiver_name = field.receiver_name;
|
||||
default_receiving_address.detailed_address = field.detailed_address;
|
||||
default_receiving_address.tel_number = field.tel_number;
|
||||
default_receiving_address.country = field.country;
|
||||
default_receiving_address.province = field.province;
|
||||
default_receiving_address.city = field.city;
|
||||
default_receiving_address.town = field.town;
|
||||
|
||||
postData.default_receiving_address = default_receiving_address;
|
||||
|
||||
console.log(postData);
|
||||
|
||||
coreHelper.Post("Api/WeChatTransactionComponentAccount/DoUpdateInfo", postData, function (e) {
|
||||
if (debug) { console.log(e); } //开启调试返回数据
|
||||
layer.msg(e.msg);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
//重载form
|
||||
form.render(null, 'LAY-app-WeChatTransactionComponentAuditCategory-createForm');
|
||||
})
|
||||
};
|
||||
|
||||
</script>
|
||||
@@ -1,251 +0,0 @@
|
||||
<script type="text/html" template lay-done="layui.data.done(d);">
|
||||
<div class="layui-form coreshop-form transactioncomponent" lay-filter="LAY-app-WeChatTransactionComponentAuditCategory-createForm" id="LAY-app-WeChatTransactionComponentAuditCategory-createForm">
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="licenseImage" class="layui-form-label layui-form-required">营业执照</label>
|
||||
<div class="layui-input-inline layui-inline-12">
|
||||
<input name="licenseImage" id="licenseImageInput" lay-verify="required" class="layui-input" placeholder="请上传营业执照或组织机构代码证" lay-reqText="请上传营业执照或组织机构代码证" />
|
||||
</div>
|
||||
<div class="layui-input-block">
|
||||
<img class="coreshop-upload-img" id="viewImgBoxlicenseImage" src="{{ layui.setter.noImagePicUrl }}">
|
||||
<button type="button" class="layui-btn" id="upBtnlicenseImage">点击上传营业执照或组织机构代码证</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<fieldset class="layui-elem-field layui-field-title site-title"><legend><a name="compress">三级类目(直接选择)</a></legend></fieldset>
|
||||
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="level1" class="layui-form-label layui-form-required">一级类目</label>
|
||||
<div class="layui-input-inline layui-inline-3">
|
||||
<input type="number" min="0" max="999999" name="level1" id="level1" readonly="readonly" lay-verify="required|number" class="layui-input" placeholder="请输入一级类目" lay-reqText="请输入一级类目并为数字" />
|
||||
</div>
|
||||
<label for="level1Name" class="layui-form-label layui-form-required">类目名称</label>
|
||||
<div class="layui-input-inline layui-inline-3">
|
||||
<input name="level1Name" id="level1Name" lay-verify="required|verifylevel1Name" readonly="readonly" class="layui-input" lay-reqText="请输入一级类目名称" placeholder="请输入一级类目名称" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="level2" class="layui-form-label layui-form-required">二级类目</label>
|
||||
<div class="layui-input-inline layui-inline-3">
|
||||
<input type="number" min="0" max="999999" name="level2" id="level2" readonly="readonly" lay-verify="required|number" class="layui-input" placeholder="请输入二级类目" lay-reqText="请输入二级类目并为数字" />
|
||||
</div>
|
||||
<label for="level2Name" class="layui-form-label layui-form-required">类目名称</label>
|
||||
<div class="layui-input-inline layui-inline-3">
|
||||
<input name="level2Name" id="level2Name" lay-verify="required|verifylevel2Name" readonly="readonly" class="layui-input" lay-reqText="请输入二级类目名称" placeholder="请输入二级类目名称" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="level3" class="layui-form-label layui-form-required">三级类目</label>
|
||||
<div class="layui-input-inline layui-inline-3">
|
||||
<input type="number" min="0" max="999999" name="level3" id="level3" readonly="readonly" lay-verify="required|number" class="layui-input" placeholder="请输入三级类目" lay-reqText="请输入三级类目并为数字" />
|
||||
</div>
|
||||
<label for="level3Name" class="layui-form-label layui-form-required">类目名称</label>
|
||||
<div class="layui-input-inline layui-inline-3">
|
||||
<input name="level3Name" id="level3Name" lay-verify="required|verifylevel3Name" readonly="readonly" class="layui-input" lay-reqText="请输入三级类目名称" placeholder="请输入三级类目名称" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label for="level3Name" class="layui-form-label"> </label>
|
||||
|
||||
<div class="layui-input-inline">
|
||||
<button class="layui-btn layui-btn-normal" lay-active="getThirdCategories"><i class="layui-icon layui-icon-ok"></i>选择三级分类</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<fieldset class="layui-elem-field layui-field-title site-title"><legend><a name="compress">资质材料</a></legend></fieldset>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline layui-inline-2">
|
||||
<input type="hidden" name="certificateImage" id="certificateImage" class="layui-input" placeholder="请上传资质材料" lay-reqText="请上传资质材料" />
|
||||
<button type="button" class="layui-btn layui-btn-sm" id="upBtnimageIds"><i class="layui-icon"></i>上传资质材料</button>
|
||||
</div>
|
||||
<div class="layui-form-mid">
|
||||
资质材料:[建议按照三级分类需求上传]:
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item ">
|
||||
<blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
|
||||
<div class="layui-upload-list" id="upload-more-list"></div>
|
||||
</blockquote>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-item text-right core-hidden">
|
||||
<input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-WeChatTransactionComponentAuditCategory-createForm-submit" id="LAY-app-WeChatTransactionComponentAuditCategory-createForm-submit" value="确认添加">
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
|
||||
<script id="image_tpl" type="text/html">
|
||||
{{# layui.each(d, function(index, item){ }}
|
||||
<div class="imgdiv">
|
||||
<img src="{{ item }}" class="layui-upload-img" onclick='layui.coreHelper.viewImage("{{ item }}")' style="width: 100px;height:100px;">
|
||||
<div id="operate">
|
||||
<div><a class="del" onclick="delImg(this,'{{ item }}')">删除</a>|<a class="setmain" onclick="setDefault(this,'{{ item }}')">设为主图</a></div>
|
||||
</div>
|
||||
</div>
|
||||
{{# }); }}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
var $;
|
||||
var imgs = [];
|
||||
var debug = layui.setter.debug;
|
||||
layui.data.done = function (d) {
|
||||
//开启调试情况下获取接口赋值数据
|
||||
if (debug) { console.log(d.params.data); }
|
||||
layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg', 'util', 'view', 'laytpl'],
|
||||
function () {
|
||||
$ = layui.$;
|
||||
var form = layui.form
|
||||
, admin = layui.admin
|
||||
, laydate = layui.laydate
|
||||
, upload = layui.upload
|
||||
, cropperImg = layui.cropperImg
|
||||
, util = layui.util
|
||||
, view = layui.view
|
||||
, laytpl = layui.laytpl
|
||||
, coreHelper = layui.coreHelper;
|
||||
|
||||
|
||||
//处理属性 为 lay-active 的所有元素事件
|
||||
util.event('lay-active', {
|
||||
getThirdCategories: function () {
|
||||
admin.popup({
|
||||
shadeClose: false,
|
||||
title: '选择三级分类',
|
||||
area: ['1000px', '600px'],
|
||||
id: 'LAY-app-GetThirdCategories',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('wechat/transactioncomponent/goods/getThirdCategories', null).done(function () {
|
||||
form.render();
|
||||
//监听商品列表页工具条
|
||||
var obj_goodsIds = {};
|
||||
form.on('submit(LAY-app-GetThirdCategories-getData)',
|
||||
function (data) {
|
||||
console.log(ids);
|
||||
if (!!!ids) {
|
||||
layer.msg("请先选择三级分类");
|
||||
return;
|
||||
}
|
||||
|
||||
$('#level1').val(ids.first_cat_id);
|
||||
$('#level1Name').val(ids.first_cat_name);
|
||||
$('#level2').val(ids.second_cat_id);
|
||||
$('#level2Name').val(ids.second_cat_name);
|
||||
$('#level3').val(ids.third_cat_id);
|
||||
$('#level3Name').val(ids.third_cat_name);
|
||||
|
||||
form.render();
|
||||
layer.close(index);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//普通图片上传
|
||||
var uploadInst = upload.render({
|
||||
elem: '#upBtnlicenseImage'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/MiNiShopOpenComponent2_UploadImg'
|
||||
, before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
layer.msg('上传中', { icon: 16, shade: 0.4 });
|
||||
});
|
||||
}
|
||||
, done: function (res) {
|
||||
layer.closeAll('loading'); //关闭加载层
|
||||
if (res.code > 0) {
|
||||
return layer.msg('上传失败');
|
||||
}
|
||||
layer.msg('上传成功');
|
||||
$('#viewImgBoxlicenseImage').attr('src', res.data.fileUrl);
|
||||
$("#licenseImageInput").val(res.data.fileUrl);
|
||||
}
|
||||
, error: function () {
|
||||
var viewTextBox = $('#viewTextBox');
|
||||
viewTextBox.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
|
||||
viewTextBox.find('.demo-reload').on('click', function () {
|
||||
uploadInst.upload();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
upload.render({
|
||||
elem: '#upBtnimageIds'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/MiNiShopOpenComponent2_UploadImg'
|
||||
, before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
layer.msg('上传中', { icon: 16, shade: 0.4 });
|
||||
});
|
||||
}
|
||||
, done: function (res) {
|
||||
layer.closeAll('loading'); //关闭加载层
|
||||
if (res.code > 0) {
|
||||
return layer.msg('上传失败');
|
||||
}
|
||||
layer.msg('上传成功');
|
||||
imgs.push(res.data.fileUrl);
|
||||
$('#certificateImage').val(imgs);
|
||||
var getTpl = image_tpl.innerHTML, view = document.getElementById('upload-more-list');
|
||||
laytpl(getTpl).render(imgs, function (html) {
|
||||
view.innerHTML = html;
|
||||
});
|
||||
}
|
||||
, error: function () {
|
||||
var viewTextBox = $('#viewTextBox');
|
||||
viewTextBox.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
|
||||
viewTextBox.find('.demo-reload').on('click', function () {
|
||||
uploadInst.upload();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
form.verify({
|
||||
|
||||
verifylicenseImage: [/^.{0,255}$/, '营业执照或组织机构代码证最大只允许输入255位字符'],
|
||||
verifylevel1Name: [/^.{0,50}$/, '一级类目名称最大只允许输入50位字符'],
|
||||
verifylevel2Name: [/^.{0,50}$/, '二级类目名称最大只允许输入50位字符'],
|
||||
verifylevel3Name: [/^.{0,50}$/, '三级类目名称最大只允许输入50位字符'],
|
||||
verifyauditId: [/^.{0,50}$/, '审核单最大只允许输入50位字符'],
|
||||
verifyrejectReason: [/^.{0,255}$/, '拒绝原因最大只允许输入255位字符'],
|
||||
});
|
||||
//重载form
|
||||
form.render(null, 'LAY-app-WeChatTransactionComponentAuditCategory-createForm');
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
//删除图片
|
||||
function delImg(obj, imageUrl) {
|
||||
var imgDiv = $(obj).parent().parent().parent();
|
||||
imgDiv.remove();
|
||||
var index = imgs.indexOf(imageUrl);
|
||||
if (index > -1) {
|
||||
imgs.splice(index, 1);
|
||||
}
|
||||
$('#certificateImage').val(imgs);
|
||||
}
|
||||
//设为默认图
|
||||
function setDefault(obj, imageUrl) {
|
||||
var imgDiv = $(obj).parent().parent().parent();
|
||||
$("#upload-more-list").prepend(imgDiv);
|
||||
var index = imgs.indexOf(imageUrl);
|
||||
if (index > -1) {
|
||||
imgs.unshift(imgs.splice(index, 1)[0]);
|
||||
}
|
||||
$('#certificateImage').val(imgs);
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
@@ -1,129 +0,0 @@
|
||||
<script type="text/html" template lay-done="layui.data.done(d);">
|
||||
<table class="layui-table layui-form" lay-filter="LAY-app-WeChatTransactionComponentAuditCategory-detailsForm" id="LAY-app-WeChatTransactionComponentAuditCategory-detailsForm">
|
||||
<colgroup>
|
||||
<col width="200">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="licenseImage">营业执照或组织机构代码证</label>
|
||||
</td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" onclick="layui.coreHelper.viewImage('{{ d.params.data.model.licenseImage || setter.noImagePicUrl }}')"><image style="max-width: 128px; max-height: 128px;" src="{{d.params.data.model.licenseImage }}" /></a>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="level1Name">一级类目</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.model.level1Name || '' }}【{{ d.params.data.model.level1 || '' }}】
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="level2Name">二级类目</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.model.level2Name || '' }}【{{ d.params.data.model.level2 || '' }}】
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="level3Name">三级类目名称</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.model.level3Name || '' }}【{{ d.params.data.model.level3 || '' }}】
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="certificateImage">资质材料</label>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
{{# layui.each(d.params.data.imagesArr, function(index, item){ }}
|
||||
<a href="javascript:void(0);" onclick="layui.coreHelper.viewImage('{{ item || '' }}')"><image style="max-width:128px;max-height:128px;" src="{{item || '' }}" /></a>
|
||||
{{# }); }}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="auditId">审核单</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.model.auditId || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="status">审核状态</label>
|
||||
</td>
|
||||
<td>
|
||||
{{# layui.each(d.params.data.auditCategoryStatus, function(index, item){ }}
|
||||
{{# if(d.params.data.model.status == item.value){ }}
|
||||
{{item.description}}
|
||||
{{# } }}
|
||||
{{# }); }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="brandId">品牌id</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.model.brandId || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="rejectReason">拒绝原因</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.model.rejectReason || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="createTime">创建时间</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.model.createTime || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</script>
|
||||
<script>
|
||||
var debug = layui.setter.debug;
|
||||
layui.data.done = function (d) {
|
||||
//开启调试情况下获取接口赋值数据
|
||||
if (debug) { console.log(d.params.data); }
|
||||
|
||||
layui.use(['admin', 'form', 'coreHelper'], function () {
|
||||
var $ = layui.$
|
||||
, setter = layui.setter
|
||||
, admin = layui.admin
|
||||
, coreHelper = layui.coreHelper
|
||||
, form = layui.form;
|
||||
form.render(null, 'LAY-app-WeChatTransactionComponentAuditCategory-detailsForm');
|
||||
});
|
||||
};
|
||||
</script>
|
||||
@@ -1,260 +0,0 @@
|
||||
<script type="text/html" template lay-done="layui.data.sendParams(d);">
|
||||
<div class="layui-form coreshop-form transactioncomponent" lay-filter="LAY-app-WeChatTransactionComponentAuditCategory-editForm" id="LAY-app-WeChatTransactionComponentAuditCategory-editForm">
|
||||
<input type="hidden" name="id" value="{{d.params.data.id || '' }}" />
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="licenseImage" class="layui-form-label layui-form-required">营业执照</label>
|
||||
<div class="layui-input-inline layui-inline-12">
|
||||
<input name="licenseImage" id="licenseImageInput" lay-verify="required" class="layui-input" placeholder="请上传营业执照或组织机构代码证" lay-reqText="请上传营业执照或组织机构代码证" value="{{d.params.data.licenseImage || '' }}" />
|
||||
</div>
|
||||
<div class="layui-input-block">
|
||||
<img class="coreshop-upload-img" id="viewImgBoxlicenseImage" src="{{d.params.data.licenseImage || layui.setter.noImagePicUrl }}">
|
||||
<button type="button" class="layui-btn" id="upBtnlicenseImage">点击上传营业执照或组织机构代码证</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<fieldset class="layui-elem-field layui-field-title site-title"><legend><a name="compress">三级类目(直接选择)</a></legend></fieldset>
|
||||
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="level1" class="layui-form-label layui-form-required">一级类目</label>
|
||||
<div class="layui-input-inline layui-inline-3">
|
||||
<input type="number" min="0" max="999999" name="level1" id="level1" readonly="readonly" value="{{d.params.data.level1 || '' }}" lay-verify="required|number" class="layui-input" placeholder="请输入一级类目" lay-reqText="请输入一级类目并为数字" />
|
||||
</div>
|
||||
<label for="level1Name" class="layui-form-label layui-form-required">类目名称</label>
|
||||
<div class="layui-input-inline layui-inline-3">
|
||||
<input name="level1Name" id="level1Name" lay-verify="required|verifylevel1Name" readonly="readonly" value="{{d.params.data.level1Name || '' }}" class="layui-input" lay-reqText="请输入一级类目名称" placeholder="请输入一级类目名称" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="level2" class="layui-form-label layui-form-required">二级类目</label>
|
||||
<div class="layui-input-inline layui-inline-3">
|
||||
<input type="number" min="0" max="999999" name="level2" id="level2" readonly="readonly" lay-verify="required|number" value="{{d.params.data.level2 || '' }}" class="layui-input" placeholder="请输入二级类目" lay-reqText="请输入二级类目并为数字" />
|
||||
</div>
|
||||
<label for="level2Name" class="layui-form-label layui-form-required">类目名称</label>
|
||||
<div class="layui-input-inline layui-inline-3">
|
||||
<input name="level2Name" id="level2Name" lay-verify="required|verifylevel2Name" readonly="readonly" value="{{d.params.data.level2Name || '' }}" class="layui-input" lay-reqText="请输入二级类目名称" placeholder="请输入二级类目名称" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="level3" class="layui-form-label layui-form-required">三级类目</label>
|
||||
<div class="layui-input-inline layui-inline-3">
|
||||
<input type="number" min="0" max="999999" name="level3" id="level3" readonly="readonly" value="{{d.params.data.level3 || '' }}" lay-verify="required|number" class="layui-input" placeholder="请输入三级类目" lay-reqText="请输入三级类目并为数字" />
|
||||
</div>
|
||||
<label for="level3Name" class="layui-form-label layui-form-required">类目名称</label>
|
||||
<div class="layui-input-inline layui-inline-3">
|
||||
<input name="level3Name" id="level3Name" lay-verify="required|verifylevel3Name" readonly="readonly" value="{{d.params.data.level3Name || '' }}" class="layui-input" lay-reqText="请输入三级类目名称" placeholder="请输入三级类目名称" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label for="level3Name" class="layui-form-label">选择 </label>
|
||||
<div class="layui-input-inline">
|
||||
<button class="layui-btn layui-btn-normal" lay-active="getThirdCategories"><i class="layui-icon layui-icon-ok"></i>选择三级分类</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<fieldset class="layui-elem-field layui-field-title site-title"><legend><a name="compress">资质材料</a></legend></fieldset>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline layui-inline-2">
|
||||
<input type="hidden" name="certificateImage" id="certificateImage" value="{{d.params.data.certificateImage || '' }}" class="layui-input" placeholder="请上传资质材料" lay-reqText="请上传资质材料" />
|
||||
<button type="button" class="layui-btn layui-btn-sm" id="upBtnimageIds"><i class="layui-icon"></i>上传资质材料</button>
|
||||
</div>
|
||||
<div class="layui-form-mid">
|
||||
资质材料:[建议按照三级分类需求上传]:
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item ">
|
||||
<blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
|
||||
<div class="layui-upload-list" id="upload-more-list"></div>
|
||||
</blockquote>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item text-right core-hidden">
|
||||
<input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-WeChatTransactionComponentAuditCategory-editForm-submit" id="LAY-app-WeChatTransactionComponentAuditCategory-editForm-submit" value="确认编辑">
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
|
||||
<script id="image_tpl" type="text/html">
|
||||
{{# layui.each(d, function(index, item){ }}
|
||||
<div class="imgdiv">
|
||||
<img src="{{ item }}" class="layui-upload-img" onclick='layui.coreHelper.viewImage("{{ item }}")' style="width: 100px;height:100px;">
|
||||
<div id="operate">
|
||||
<div><a class="del" onclick="delImg(this,'{{ item }}')">删除</a>|<a class="setmain" onclick="setDefault(this,'{{ item }}')">设为主图</a></div>
|
||||
</div>
|
||||
</div>
|
||||
{{# }); }}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
var $;
|
||||
var imgs = [];
|
||||
var debug = layui.setter.debug;
|
||||
layui.data.sendParams = function (d) {
|
||||
//开启调试情况下获取接口赋值数据
|
||||
if (debug) { console.log(d.params.data); }
|
||||
layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg', 'util', 'view', 'laytpl'],
|
||||
function () {
|
||||
$ = layui.$;
|
||||
var form = layui.form
|
||||
, admin = layui.admin
|
||||
, laydate = layui.laydate
|
||||
, upload = layui.upload
|
||||
, cropperImg = layui.cropperImg
|
||||
, util = layui.util
|
||||
, view = layui.view
|
||||
, laytpl = layui.laytpl
|
||||
, coreHelper = layui.coreHelper;
|
||||
|
||||
|
||||
imgs = d.params.data.certificateImage.split(',');
|
||||
|
||||
if (imgs.length > 0) {
|
||||
var getTpl = image_tpl.innerHTML, view = document.getElementById('upload-more-list');
|
||||
laytpl(getTpl).render(imgs, function (html) {
|
||||
view.innerHTML = html;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//处理属性 为 lay-active 的所有元素事件
|
||||
util.event('lay-active', {
|
||||
getThirdCategories: function () {
|
||||
admin.popup({
|
||||
shadeClose: false,
|
||||
title: '选择三级分类',
|
||||
area: ['1000px', '600px'],
|
||||
id: 'LAY-app-GetThirdCategories',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('wechat/transactioncomponent/goods/getThirdCategories', null).done(function () {
|
||||
form.render();
|
||||
//监听商品列表页工具条
|
||||
var obj_goodsIds = {};
|
||||
form.on('submit(LAY-app-GetThirdCategories-getData)',
|
||||
function (data) {
|
||||
console.log(ids);
|
||||
if (!!!ids) {
|
||||
layer.msg("请先选择三级分类");
|
||||
return;
|
||||
}
|
||||
|
||||
$('#level1').val(ids.first_cat_id);
|
||||
$('#level1Name').val(ids.first_cat_name);
|
||||
$('#level2').val(ids.second_cat_id);
|
||||
$('#level2Name').val(ids.second_cat_name);
|
||||
$('#level3').val(ids.third_cat_id);
|
||||
$('#level3Name').val(ids.third_cat_name);
|
||||
|
||||
form.render();
|
||||
layer.close(index);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//普通图片上传
|
||||
var uploadInst = upload.render({
|
||||
elem: '#upBtnlicenseImage'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/MiNiShopOpenComponent2_UploadImg'
|
||||
, before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
layer.msg('上传中', { icon: 16, shade: 0.4 });
|
||||
});
|
||||
}
|
||||
, done: function (res) {
|
||||
layer.closeAll('loading'); //关闭加载层
|
||||
if (res.code > 0) {
|
||||
return layer.msg('上传失败');
|
||||
}
|
||||
layer.msg('上传成功');
|
||||
$('#viewImgBoxlicenseImage').attr('src', res.data.fileUrl);
|
||||
$("#licenseImageInput").val(res.data.fileUrl);
|
||||
}
|
||||
, error: function () {
|
||||
var viewTextBox = $('#viewTextBox');
|
||||
viewTextBox.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
|
||||
viewTextBox.find('.demo-reload').on('click', function () {
|
||||
uploadInst.upload();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
upload.render({
|
||||
elem: '#upBtnimageIds'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/MiNiShopOpenComponent2_UploadImg'
|
||||
, before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
layer.msg('上传中', { icon: 16, shade: 0.4 });
|
||||
});
|
||||
}
|
||||
, done: function (res) {
|
||||
layer.closeAll('loading'); //关闭加载层
|
||||
if (res.code > 0) {
|
||||
return layer.msg('上传失败');
|
||||
}
|
||||
layer.msg('上传成功');
|
||||
imgs.push(res.data.fileUrl);
|
||||
$('#certificateImage').val(imgs);
|
||||
var getTpl = image_tpl.innerHTML, view = document.getElementById('upload-more-list');
|
||||
laytpl(getTpl).render(imgs, function (html) {
|
||||
view.innerHTML = html;
|
||||
});
|
||||
}
|
||||
, error: function () {
|
||||
var viewTextBox = $('#viewTextBox');
|
||||
viewTextBox.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
|
||||
viewTextBox.find('.demo-reload').on('click', function () {
|
||||
uploadInst.upload();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
form.verify({
|
||||
|
||||
verifylicenseImage: [/^.{0,255}$/, '营业执照或组织机构代码证最大只允许输入255位字符'],
|
||||
verifylevel1Name: [/^.{0,50}$/, '一级类目名称最大只允许输入50位字符'],
|
||||
verifylevel2Name: [/^.{0,50}$/, '二级类目名称最大只允许输入50位字符'],
|
||||
verifylevel3Name: [/^.{0,50}$/, '三级类目名称最大只允许输入50位字符'],
|
||||
verifyauditId: [/^.{0,50}$/, '审核单最大只允许输入50位字符'],
|
||||
verifyrejectReason: [/^.{0,255}$/, '拒绝原因最大只允许输入255位字符'],
|
||||
});
|
||||
//重载form
|
||||
form.render(null, 'LAY-app-WeChatTransactionComponentAuditCategory-editForm');
|
||||
})
|
||||
};
|
||||
|
||||
//删除图片
|
||||
function delImg(obj, imageUrl) {
|
||||
var imgDiv = $(obj).parent().parent().parent();
|
||||
imgDiv.remove();
|
||||
var index = imgs.indexOf(imageUrl);
|
||||
if (index > -1) {
|
||||
imgs.splice(index, 1);
|
||||
}
|
||||
$('#certificateImage').val(imgs);
|
||||
}
|
||||
//设为默认图
|
||||
function setDefault(obj, imageUrl) {
|
||||
var imgDiv = $(obj).parent().parent().parent();
|
||||
$("#upload-more-list").prepend(imgDiv);
|
||||
var index = imgs.indexOf(imageUrl);
|
||||
if (index > -1) {
|
||||
imgs.unshift(imgs.splice(index, 1)[0]);
|
||||
}
|
||||
$('#certificateImage').val(imgs);
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
@@ -1,347 +0,0 @@
|
||||
<title>自定义交易组件上传类目资质</title>
|
||||
<!--当前位置开始-->
|
||||
<div class="layui-card layadmin-header">
|
||||
<div class="layui-breadcrumb" lay-filter="breadcrumb">
|
||||
<script type="text/html" template lay-done="layui.data.updateMainBreadcrumb();">
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<!--当前位置结束-->
|
||||
<style>
|
||||
/* 重写样式 */
|
||||
</style>
|
||||
<script type="text/html" template lay-type="Post" lay-url="{{ layui.setter.apiUrl }}Api/WeChatTransactionComponentAuditCategory/GetIndex" lay-done="layui.data.done(d);">
|
||||
|
||||
</script>
|
||||
<div class="table-body">
|
||||
<table id="LAY-app-WeChatTransactionComponentAuditCategory-tableBox" lay-filter="LAY-app-WeChatTransactionComponentAuditCategory-tableBox"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="LAY-app-WeChatTransactionComponentAuditCategory-toolbar">
|
||||
<div class="layui-form coreshop-toolbar-search-form">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="level1Name" placeholder="请输入一级类目名称" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="level2Name" placeholder="请输入二级类目名称" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="level3Name" placeholder="请输入三级类目名称" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline">
|
||||
<button class="layui-btn layui-btn-sm" lay-submit lay-filter="LAY-app-WeChatTransactionComponentAuditCategory-search"><i class="layui-icon layui-icon-search"></i>筛选</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="LAY-app-WeChatTransactionComponentAuditCategory-pagebar">
|
||||
<div class="layui-btn-container">
|
||||
<button class="layui-btn layui-btn-sm" lay-event="addData"><i class="layui-icon layui-icon-add-1"></i>添加数据</button>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="LAY-app-WeChatTransactionComponentAuditCategory-tableBox-bar">
|
||||
<a class="layui-btn layui-btn-xs" lay-event="refresh">同步</a>
|
||||
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
|
||||
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" data-dropdown="#WeChatTransactionComponentAuditCategoryTbDelDrop{{d.LAY_NUM}}" no-shade="true">删除</a>
|
||||
<div class="dropdown-menu-nav dropdown-popconfirm dropdown-top-right layui-hide" id="WeChatTransactionComponentAuditCategoryTbDelDrop{{d.LAY_NUM}}"
|
||||
style="max-width: 200px;white-space: normal;min-width: auto;margin-left: 10px;">
|
||||
<div class="dropdown-anchor"></div>
|
||||
<div class="dropdown-popconfirm-title">
|
||||
<i class="layui-icon layui-icon-help"></i>
|
||||
确定要删除吗?
|
||||
</div>
|
||||
<div class="dropdown-popconfirm-btn">
|
||||
<a class="layui-btn layui-btn-primary cursor" btn-cancel>取消</a>
|
||||
<a class="layui-btn layui-btn-normal cursor" lay-event="del">确定</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var indexData;
|
||||
var debug = layui.setter.debug;
|
||||
layui.data.done = function (d) {
|
||||
//开启调试情况下获取接口赋值数据
|
||||
if (debug) { console.log(d); }
|
||||
|
||||
indexData = d.data;
|
||||
layui.use(['index', 'table', 'laydate', 'util', 'coredropdown', 'coreHelper'],
|
||||
function () {
|
||||
var $ = layui.$
|
||||
, admin = layui.admin
|
||||
, table = layui.table
|
||||
, form = layui.form
|
||||
, laydate = layui.laydate
|
||||
, setter = layui.setter
|
||||
, coreHelper = layui.coreHelper
|
||||
, util = layui.util
|
||||
, view = layui.view;
|
||||
|
||||
|
||||
var searchwhere;
|
||||
//监听搜索
|
||||
form.on('submit(LAY-app-WeChatTransactionComponentAuditCategory-search)',
|
||||
function (data) {
|
||||
var field = data.field;
|
||||
searchwhere = field;
|
||||
//执行重载
|
||||
table.reloadData('LAY-app-WeChatTransactionComponentAuditCategory-tableBox', { where: field });
|
||||
});
|
||||
//数据绑定
|
||||
table.render({
|
||||
elem: '#LAY-app-WeChatTransactionComponentAuditCategory-tableBox',
|
||||
url: layui.setter.apiUrl + 'Api/WeChatTransactionComponentAuditCategory/GetPageList',
|
||||
method: 'POST',
|
||||
toolbar: '#LAY-app-WeChatTransactionComponentAuditCategory-toolbar',
|
||||
pagebar: '#LAY-app-WeChatTransactionComponentAuditCategory-pagebar',
|
||||
className: 'pagebarbox',
|
||||
defaultToolbar: ['filter', 'print', 'exports'],
|
||||
height: 'full-127',//面包屑142px,搜索框4行172,3行137,2行102,1行67
|
||||
page: true,
|
||||
limit: 30,
|
||||
limits: [10, 15, 20, 25, 30, 50, 100, 200],
|
||||
text: { none: '暂无相关数据' },
|
||||
cols: [
|
||||
[
|
||||
{ type: "checkbox", fixed: "left" },
|
||||
{ field: 'id', title: '序列', width: 60, sort: false },
|
||||
{
|
||||
field: 'licenseImage', title: '营业执照', width: 80, sort: false,
|
||||
templet: function (d) {
|
||||
if (d.licenseImage) {
|
||||
return '<a href="javascript:void(0);" onclick=layui.coreHelper.viewImage("' + d.licenseImage + '")><image style="max-width:28px;max-height:28px;" src="' + d.licenseImage + '"/></a>';
|
||||
} else {
|
||||
return '<a href="javascript:void(0);" onclick=layui.coreHelper.viewImage("' + setter.noImagePicUrl + '")><image style="max-width:30px;max-height:30px;" src="' + setter.noImagePicUrl + '"/></a>';
|
||||
}
|
||||
}
|
||||
},
|
||||
//{ field: 'level1', title: '一级类目', sort: false, width: 105 },
|
||||
{ field: 'level1Name', title: '一级类目名称', sort: false, width: 105 },
|
||||
//{ field: 'level2', title: '二级类目', sort: false, width: 105 },
|
||||
{ field: 'level2Name', title: '二级类目名称', sort: false, width: 105 },
|
||||
//{ field: 'level3', title: '三级类目', sort: false, width: 105 },
|
||||
{ field: 'level3Name', title: '三级类目名称', sort: false, width: 105 },
|
||||
{
|
||||
field: 'certificateImage', title: '资质材料', width: 180, sort: false,
|
||||
templet: function (d) {
|
||||
if (d.certificateImage) {
|
||||
var arr = d.certificateImage.split(',');
|
||||
if (Array.isArray(arr) && arr.length) {
|
||||
var html = '';
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
html += '<a href="javascript:void(0);" onclick=layui.coreHelper.viewImage("' + arr[i] + '")><image style="max-width:28px;max-height:28px;" src="' + arr[i] + '?x-oss-process=image/resize,m_lfit,h_200,w_200"/></a> '
|
||||
}
|
||||
return html;
|
||||
} else {
|
||||
return '<a href="javascript:void(0);" onclick=layui.coreHelper.viewImage("' + setter.noImagePicUrl + '")><image style="max-width:30px;max-height:30px;" src="' + setter.noImagePicUrl + '"/></a>';
|
||||
}
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
//{ field: 'auditId', title: '审核单', sort: false, width: 180 },
|
||||
{
|
||||
field: 'status', title: '审核状态', sort: false, width: 105, templet: function (data) {
|
||||
for (var i = 0; i < d.data.auditCategoryStatus.length; i++) {
|
||||
if (data.status == d.data.auditCategoryStatus[i].value) {
|
||||
return d.data.auditCategoryStatus[i].description;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
},
|
||||
//{ field: 'brandId', title: '品牌id', sort: false, width: 105 },
|
||||
{ field: 'rejectReason', title: '拒绝原因', sort: false },
|
||||
{ field: 'createTime', title: '创建时间', width: 130, sort: false },
|
||||
{ width: 200, align: 'center', title: '操作', fixed: 'right', toolbar: '#LAY-app-WeChatTransactionComponentAuditCategory-tableBox-bar' }
|
||||
]
|
||||
]
|
||||
});
|
||||
//监听排序事件
|
||||
table.on('sort(LAY-app-WeChatTransactionComponentAuditCategory-tableBox)', function (obj) {
|
||||
table.reloadData('LAY-app-WeChatTransactionComponentAuditCategory-tableBox', {
|
||||
initSort: obj, //记录初始排序,如果不设的话,将无法标记表头的排序状态。
|
||||
where: { //请求参数(注意:这里面的参数可任意定义,并非下面固定的格式)
|
||||
orderField: obj.field, //排序字段
|
||||
orderDirection: obj.type //排序方式
|
||||
}
|
||||
});
|
||||
});
|
||||
//监听行双击事件
|
||||
table.on('rowDouble(LAY-app-WeChatTransactionComponentAuditCategory-tableBox)', function (obj) {
|
||||
//查看详情
|
||||
doDetails(obj);
|
||||
});
|
||||
//头工具栏事件
|
||||
table.on('pagebar(LAY-app-WeChatTransactionComponentAuditCategory-tableBox)', function (obj) {
|
||||
var checkStatus = table.checkStatus(obj.config.id);
|
||||
switch (obj.event) {
|
||||
case 'addData':
|
||||
doCreate();
|
||||
break;
|
||||
};
|
||||
});
|
||||
//监听工具条
|
||||
table.on('tool(LAY-app-WeChatTransactionComponentAuditCategory-tableBox)',
|
||||
function (obj) {
|
||||
if (obj.event === 'detail') {
|
||||
doDetails(obj);
|
||||
} else if (obj.event === 'del') {
|
||||
doDelete(obj);
|
||||
} else if (obj.event === 'edit') {
|
||||
doEdit(obj)
|
||||
} else if (obj.event === 'refresh') {
|
||||
doRefresh(obj)
|
||||
}
|
||||
});
|
||||
//执行创建操作
|
||||
function doCreate() {
|
||||
coreHelper.Post("Api/WeChatTransactionComponentAuditCategory/GetCreate", null, function (e) {
|
||||
if (e.code === 0) {
|
||||
admin.popup({
|
||||
shadeClose: false,
|
||||
title: '创建数据',
|
||||
area: ['1200px', '90%'],
|
||||
id: 'LAY-popup-WeChatTransactionComponentAuditCategory-create',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('wechat/transactioncomponent/auditcategory/create', { data: e.data }).done(function () {
|
||||
//监听提交
|
||||
form.on('submit(LAY-app-WeChatTransactionComponentAuditCategory-createForm-submit)',
|
||||
function (data) {
|
||||
var field = data.field; //获取提交的字段
|
||||
|
||||
|
||||
if (debug) { console.log(field); } //开启调试返回数据
|
||||
//提交 Ajax 成功后,关闭当前弹层并重载表格
|
||||
coreHelper.Post("Api/WeChatTransactionComponentAuditCategory/DoCreate", field, function (e) {
|
||||
console.log(e)
|
||||
if (e.code === 0) {
|
||||
layui.table.reloadData('LAY-app-WeChatTransactionComponentAuditCategory-tableBox'); //重载表格
|
||||
layer.close(index); //再执行关闭
|
||||
layer.msg(e.msg);
|
||||
} else {
|
||||
layer.msg(e.msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
// 禁止弹窗出现滚动条
|
||||
//$(layero).children('.layui-layer-content').css('overflow', 'visible');
|
||||
}
|
||||
, btn: ['确定', '取消']
|
||||
, yes: function (index, layero) {
|
||||
layero.contents().find("#LAY-app-WeChatTransactionComponentAuditCategory-createForm-submit").click();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.msg(e.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
//执行编辑操作
|
||||
function doEdit(obj) {
|
||||
coreHelper.Post("Api/WeChatTransactionComponentAuditCategory/GetEdit", { id: obj.data.id }, function (e) {
|
||||
if (e.code === 0) {
|
||||
admin.popup({
|
||||
shadeClose: false,
|
||||
title: '编辑数据',
|
||||
area: ['1200px', '90%'],
|
||||
id: 'LAY-popup-WeChatTransactionComponentAuditCategory-edit',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('wechat/transactioncomponent/auditcategory/edit', { data: e.data }).done(function () {
|
||||
//监听提交
|
||||
form.on('submit(LAY-app-WeChatTransactionComponentAuditCategory-editForm-submit)',
|
||||
function (data) {
|
||||
var field = data.field; //获取提交的字段
|
||||
|
||||
|
||||
if (debug) { console.log(field); } //开启调试返回数据
|
||||
//提交 Ajax 成功后,关闭当前弹层并重载表格
|
||||
coreHelper.Post("Api/WeChatTransactionComponentAuditCategory/DoEdit", field, function (e) {
|
||||
console.log(e)
|
||||
if (e.code === 0) {
|
||||
layui.table.reloadData('LAY-app-WeChatTransactionComponentAuditCategory-tableBox'); //重载表格
|
||||
layer.close(index); //再执行关闭
|
||||
layer.msg(e.msg);
|
||||
} else {
|
||||
layer.msg(e.msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
// 禁止弹窗出现滚动条
|
||||
//$(layero).children('.layui-layer-content').css('overflow', 'visible');
|
||||
}
|
||||
, btn: ['确定', '取消']
|
||||
, yes: function (index, layero) {
|
||||
layero.contents().find("#LAY-app-WeChatTransactionComponentAuditCategory-editForm-submit").click();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.msg(e.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
//执行预览操作
|
||||
function doDetails(obj) {
|
||||
coreHelper.Post("Api/WeChatTransactionComponentAuditCategory/GetDetails", { id: obj.data.id }, function (e) {
|
||||
if (e.code === 0) {
|
||||
admin.popup({
|
||||
shadeClose: false,
|
||||
title: '查看详情',
|
||||
area: ['1200px', '90%'],
|
||||
id: 'LAY-popup-WeChatTransactionComponentAuditCategory-details',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('wechat/transactioncomponent/auditcategory/details', { data: e.data }).done(function () {
|
||||
form.render();
|
||||
});
|
||||
// 禁止弹窗出现滚动条
|
||||
$(layero).children('.layui-layer-content').css('overflow', 'visible');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.msg(e.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
//执行单个删除
|
||||
function doDelete(obj) {
|
||||
coreHelper.Post("Api/WeChatTransactionComponentAuditCategory/DoDelete", { id: obj.data.id }, function (e) {
|
||||
if (debug) { console.log(e); } //开启调试返回数据
|
||||
table.reloadData('LAY-app-WeChatTransactionComponentAuditCategory-tableBox');
|
||||
layer.msg(e.msg);
|
||||
});
|
||||
}
|
||||
//执行同步状态
|
||||
function doRefresh(obj) {
|
||||
coreHelper.Post("Api/WeChatTransactionComponentAuditCategory/DoRefresh", { id: obj.data.id }, function (e) {
|
||||
if (debug) { console.log(e); } //开启调试返回数据
|
||||
table.reloadData('LAY-app-WeChatTransactionComponentAuditCategory-tableBox');
|
||||
layer.msg(e.msg);
|
||||
});
|
||||
}
|
||||
|
||||
//监听 表格复选框操作
|
||||
laydate.render({
|
||||
elem: '#searchTime-WeChatTransactionComponentAuditCategory-createTime',
|
||||
type: 'datetime',
|
||||
range: '到',
|
||||
});
|
||||
//重载form
|
||||
form.render();
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -1,478 +0,0 @@
|
||||
<style>
|
||||
.layui-upload-list { min-height: 120px; border: 1px solid #e6e6fa; padding: 10px; }
|
||||
</style>
|
||||
<script type="text/html" template lay-done="layui.data.done(d);">
|
||||
<div class="layui-form coreshop-form transactioncomponent layui-form-pane" lay-filter="LAY-app-WeChatTransactionComponentBrandAudit-createForm" id="LAY-app-WeChatTransactionComponentBrandAudit-createForm">
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="license" class="layui-form-label layui-form-required">营业执照</label>
|
||||
<div class="layui-input-inline layui-inline-12">
|
||||
<input name="license" id="license" lay-verify="required|verifylicense" class="layui-input" lay-reqText="点击上传营业执照或组织机构代码证" placeholder="点击上传营业执照或组织机构代码证" />
|
||||
</div>
|
||||
<div class="layui-input-block">
|
||||
<img class="coreshop-upload-img" id="viewImgBoxlicense" src="{{ layui.setter.noImagePicUrl }}">
|
||||
<button type="button" class="layui-btn" id="upBtnlicense">点击上传营业执照或组织机构代码证</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="brand_audit_type" class="layui-form-label layui-form-required">认证审核类型</label>
|
||||
<div class="layui-input-inline layui-inline-3">
|
||||
<select name="brand_audit_type" lay-verify="required|number" lay-reqText="请选择证审核类型">
|
||||
<option value="">请选择证审核类型</option>
|
||||
{{# layui.each(indexData.registerType, function(index, item){ }}
|
||||
<option value="{{ item.value }}">{{ item.title }}</option>
|
||||
{{# }); }}
|
||||
</select>
|
||||
</div>
|
||||
<label for="trademark_type" class="layui-form-label layui-form-required">商标分类</label>
|
||||
<div class="layui-input-inline layui-inline-3">
|
||||
<select name="trademark_type" lay-verify="required|number" lay-reqText="请选择商标分类">
|
||||
<option value="">请选择商标分类</option>
|
||||
{{# layui.each(indexData.trademarkType, function(index, item){ }}
|
||||
<option value="{{ item.value }}">{{ item.title }}</option>
|
||||
{{# }); }}
|
||||
</select>
|
||||
</div>
|
||||
<label for="brand_management_type" class="layui-form-label layui-form-required">经营类型</label>
|
||||
<div class="layui-input-inline layui-inline-3">
|
||||
<select name="brand_management_type" lay-reqText="请选择经营类型" lay-verify="required|number">
|
||||
<option value="">请选择经营类型</option>
|
||||
{{# layui.each(indexData.brandManagementType, function(index, item){ }}
|
||||
<option value="{{ item.value }}">{{ item.title }}</option>
|
||||
{{# }); }}
|
||||
</select>
|
||||
</div>
|
||||
<label for="commodity_origin_type" class="layui-form-label layui-form-required">是否进口</label>
|
||||
<div class="layui-input-inline layui-inline-3">
|
||||
<select name="commodity_origin_type" lay-reqText="请选择商品是否进口" lay-verify="required|number">
|
||||
<option value="">请选择商品是否进口</option>
|
||||
{{# layui.each(indexData.commodityOriginType, function(index, item){ }}
|
||||
<option value="{{ item.value }}">{{ item.title }}</option>
|
||||
{{# }); }}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="brand_wording" class="layui-form-label layui-form-required">商标/品牌词</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="brand_wording" lay-verify="required|verifybrand_wording" class="layui-input" lay-reqText="请输入商标/品牌词" placeholder="请输入商标/品牌词" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--<div class="layui-form-item">
|
||||
<label for="sale_authorization" class="layui-form-label">销售授权书</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="sale_authorization" lay-verify="required|verifysale_authorization" class="layui-input" lay-reqText="请输入销售授权书" placeholder="请输入销售授权书" />
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<fieldset class="layui-elem-field layui-field-title site-title"><legend><a name="compress">销售授权书(如商持人为自然人,还需提供有其签名的身份证正反面扫描件,最多不超过10张) <button type="button" class="layui-btn layui-btn-xs" id="upBtnSaleAuthorization"><i class="layui-icon"></i>上传图片</button></a></legend></fieldset>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline layui-inline-2">
|
||||
<input type="hidden" name="sale_authorization" id="sale_authorization" class="layui-input" placeholder="请上传缩略图" lay-reqText="请上传缩略图" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-upload-list" id="sale_authorization_list"></div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="trademark_registration_certificate" class="layui-form-label layui-form-required">商标注册证书</label>
|
||||
<div class="layui-input-inline layui-inline-12">
|
||||
<input name="trademark_registration_certificate" id="trademark_registration_certificate" lay-verify="required|verifytrademark_registration_certificate" class="layui-input" lay-reqText="请输入商标注册证书" placeholder="请输入商标注册证书" />
|
||||
</div>
|
||||
<div class="layui-input-block">
|
||||
<img class="coreshop-upload-img" id="viewImgBoxtrademark_registration_certificate" src="{{ layui.setter.noImagePicUrl }}">
|
||||
<button type="button" class="layui-btn" id="upBtntrademark_registration_certificate">点击上传商标注册证书</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--<div class="layui-form-item">
|
||||
<label for="trademark_change_certificate" class="layui-form-label">商标变更证明</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="trademark_change_certificate" lay-verify="required|verifytrademark_change_certificate" class="layui-input" lay-reqText="请输入商标变更证明" placeholder="请输入商标变更证明" />
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<fieldset class="layui-elem-field layui-field-title site-title"><legend><a name="compress">商标变更证明(最多不超过5张) <button type="button" class="layui-btn layui-btn-xs" id="upBtnTrademarkChangeCertificate"><i class="layui-icon"></i>上传图片</button></a></legend></fieldset>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline layui-inline-2">
|
||||
<input type="hidden" name="trademark_change_certificate" id="trademark_change_certificate" class="layui-input" placeholder="请上传缩略图" lay-reqText="请上传缩略图" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-upload-list" id="trademark_change_certificate_list"></div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="trademark_registrant" class="layui-form-label layui-form-required">商标注册人姓名</label>
|
||||
<div class="layui-input-inline layui-inline-6">
|
||||
<input name="trademark_registrant" lay-verify="required|verifytrademark_registrant" class="layui-input" lay-reqText="请输入商标注册人姓名" placeholder="请输入商标注册人姓名" />
|
||||
</div>
|
||||
<label for="trademark_registrant_nu" class="layui-form-label layui-form-required">商标注册号</label>
|
||||
<div class="layui-input-inline layui-inline-6">
|
||||
<input name="trademark_registrant_nu" lay-verify="required|verifytrademark_registrant_nu" class="layui-input" lay-reqText="请输入商标注册号/申请号" placeholder="请输入商标注册号/申请号" />
|
||||
</div>
|
||||
<div class="layui-form-mid">可提交商标注册号/申请号</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="trademark_authorization_period" class="layui-form-label layui-form-required">商标有效期</label>
|
||||
<div class="layui-input-inline layui-inline-6">
|
||||
<input name="trademark_authorization_period" id="createTime-WeChatTransactionComponentBrandAudit-trademark_authorization_period" type="text" lay-verify="required|datetime" class="layui-input" placeholder="请输入商标有效期" lay-reqText="请输入商标有效期" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="trademark_registration_application" class="layui-form-label">商标受理通知书</label>
|
||||
<div class="layui-input-inline layui-inline-12">
|
||||
<input name="trademark_registration_application" id="trademark_registration_application" lay-verify="required|verifytrademark_registration_application" class="layui-input" lay-reqText="请输入商标注册申请受理通知书" placeholder="请输入商标注册申请受理通知书" />
|
||||
</div>
|
||||
|
||||
<div class="layui-input-block">
|
||||
<img class="coreshop-upload-img" id="viewImgBoxTrademarkRegistrationApplication" src="{{ layui.setter.noImagePicUrl }}">
|
||||
<button type="button" class="layui-btn" id="upBtnTrademarkRegistrationApplication">点击上传商标受理通知书</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="trademark_applicant" class="layui-form-label">商标申请人姓名</label>
|
||||
<div class="layui-input-inline layui-inline-6">
|
||||
<input name="trademark_applicant" lay-verify="required|verifytrademark_applicant" class="layui-input" lay-reqText="请输入商标申请人姓名" placeholder="请输入商标申请人姓名" />
|
||||
</div>
|
||||
<label for="trademark_application_time" class="layui-form-label">商标申请时间</label>
|
||||
<div class="layui-input-inline layui-inline-6">
|
||||
<input name="trademark_application_time" id="createTime-WeChatTransactionComponentBrandAudit-trademark_application_time" type="text" lay-verify="required|datetime" class="layui-input" placeholder="请输入商标申请时间" lay-reqText="请输入商标申请时间" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--<div class="layui-form-item">
|
||||
<label for="imported_goods_form" class="layui-form-label">海关报关单</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="imported_goods_form" lay-verify="required|verifyimported_goods_form" class="layui-input" lay-reqText="请输入中华人民共和国海关进口货物报关单" placeholder="请输入中华人民共和国海关进口货物报关单" />
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<fieldset class="layui-elem-field layui-field-title site-title"><legend><a name="compress">海关报关单(最多不超过5张) <button type="button" class="layui-btn layui-btn-xs" id="upBtnImportedGoodsForm"><i class="layui-icon"></i>上传图片</button></a></legend></fieldset>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline layui-inline-2">
|
||||
<input type="hidden" name="imported_goods_form" id="imported_goods_form" class="layui-input" placeholder="请上传缩略图" lay-reqText="请上传缩略图" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-upload-list" id="imported_goods_form_list"></div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="scene_group_list" class="layui-form-label">商品使用场景</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="scene_group_list" lay-reqText="请选择商品使用场景" lay-verify="required|number">
|
||||
<option value="1">视频号</option>
|
||||
<option value="3">订单中心</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item text-right core-hidden">
|
||||
<input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-WeChatTransactionComponentBrandAudit-createForm-submit" id="LAY-app-WeChatTransactionComponentBrandAudit-createForm-submit" value="确认添加">
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script id="image_tpl" type="text/html">
|
||||
{{# layui.each(d, function(index, item){ }}
|
||||
<div class="imgdiv">
|
||||
<img src="{{ item }}" class="layui-upload-img" onclick='layui.coreHelper.viewImage("{{ item }}")' style="width: 100px;height:100px;">
|
||||
<div id="operate">
|
||||
<div><a class="del" onclick="delImg(this,'{{ item }}')">删除</a>|<a class="setmain" onclick="setDefault(this,'{{ item }}')">设为首图</a></div>
|
||||
</div>
|
||||
</div>
|
||||
{{# }); }}
|
||||
</script>
|
||||
|
||||
<script id="image_hg_tpl" type="text/html">
|
||||
{{# layui.each(d, function(index, item){ }}
|
||||
<div class="imgdiv">
|
||||
<img src="{{ item }}" class="layui-upload-img" onclick='layui.coreHelper.viewImage("{{ item }}")' style="width: 100px;height:100px;">
|
||||
<div id="operate">
|
||||
<div><a class="del" onclick="delHGImg(this,'{{ item }}')">删除</a>|<a class="setmain" onclick="setHGDefault(this,'{{ item }}')">设为首图</a></div>
|
||||
</div>
|
||||
</div>
|
||||
{{# }); }}
|
||||
</script>
|
||||
|
||||
<script id="image_xs_tpl" type="text/html">
|
||||
{{# layui.each(d, function(index, item){ }}
|
||||
<div class="imgdiv">
|
||||
<img src="{{ item }}" class="layui-upload-img" onclick='layui.coreHelper.viewImage("{{ item }}")' style="width: 100px;height:100px;">
|
||||
<div id="operate">
|
||||
<div><a class="del" onclick="delXSImg(this,'{{ item }}')">删除</a>|<a class="setmain" onclick="setXSDefault(this,'{{ item }}')">设为首图</a></div>
|
||||
</div>
|
||||
</div>
|
||||
{{# }); }}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var $;
|
||||
var trademark_change_certificate_imgs = [];
|
||||
var imported_goods_form_imgs = [];
|
||||
var sale_authorization_imgs = [];
|
||||
var debug = layui.setter.debug;
|
||||
layui.data.done = function (d) {
|
||||
//开启调试情况下获取接口赋值数据
|
||||
if (debug) { console.log(d.params.data); }
|
||||
layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'laytpl'],
|
||||
function () {
|
||||
$ = layui.$; var form = layui.form, admin = layui.admin, laydate = layui.laydate, upload = layui.upload, coreHelper = layui.coreHelper, laytpl = layui.laytpl;
|
||||
|
||||
//营业执照上传
|
||||
upload.render({
|
||||
elem: '#upBtnlicense'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/MiNiShopOpenComponent2_UploadImg'
|
||||
, before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
layer.msg('上传中', { icon: 16, shade: 0.4 });
|
||||
});
|
||||
}
|
||||
, done: function (res) {
|
||||
layer.closeAll('loading'); //关闭加载层
|
||||
if (res.code > 0) {
|
||||
return layer.msg('上传失败');
|
||||
}
|
||||
layer.msg('上传成功');
|
||||
$('#viewImgBoxlicense').attr('src', res.data.fileUrl);
|
||||
$("#license").val(res.data.fileUrl);
|
||||
}
|
||||
, error: function (res) {
|
||||
layer.msg('上传失败,请重试');
|
||||
console.log(res);
|
||||
}
|
||||
});
|
||||
|
||||
//商标注册证书
|
||||
upload.render({
|
||||
elem: '#upBtntrademark_registration_certificate'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/MiNiShopOpenComponent2_UploadImg'
|
||||
, before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
layer.msg('上传中', { icon: 16, shade: 0.4 });
|
||||
});
|
||||
}
|
||||
, done: function (res) {
|
||||
layer.closeAll('loading'); //关闭加载层
|
||||
if (res.code > 0) {
|
||||
return layer.msg('上传失败');
|
||||
}
|
||||
layer.msg('上传成功');
|
||||
$('#viewImgBoxtrademark_registration_certificate').attr('src', res.data.fileUrl);
|
||||
$("#trademark_registration_certificate").val(res.data.fileUrl);
|
||||
}
|
||||
, error: function (res) {
|
||||
layer.msg('上传失败,请重试');
|
||||
console.log(res);
|
||||
}
|
||||
});
|
||||
|
||||
//商标变更证明
|
||||
upload.render({
|
||||
elem: '#upBtnTrademarkChangeCertificate'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/MiNiShopOpenComponent2_UploadImg'
|
||||
, before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
layer.msg('上传中', { icon: 16, shade: 0.4 });
|
||||
});
|
||||
}
|
||||
, done: function (res) {
|
||||
layer.closeAll('loading'); //关闭加载层
|
||||
if (res.code > 0) {
|
||||
return layer.msg('上传失败');
|
||||
}
|
||||
layer.msg('上传成功');
|
||||
trademark_change_certificate_imgs.push(res.data.fileUrl);
|
||||
$('#trademark_change_certificate').val(trademark_change_certificate_imgs);
|
||||
var getTpl = image_tpl.innerHTML, view = document.getElementById('trademark_change_certificate_list');
|
||||
laytpl(getTpl).render(trademark_change_certificate_imgs, function (html) {
|
||||
view.innerHTML = html;
|
||||
});
|
||||
}
|
||||
, error: function (res) {
|
||||
layer.msg('上传失败,请重试');
|
||||
console.log(res);
|
||||
}
|
||||
});
|
||||
|
||||
//商标受理通知书
|
||||
upload.render({
|
||||
elem: '#upBtnTrademarkRegistrationApplication'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/MiNiShopOpenComponent2_UploadImg'
|
||||
, before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
layer.msg('上传中', { icon: 16, shade: 0.4 });
|
||||
});
|
||||
}
|
||||
, done: function (res) {
|
||||
layer.closeAll('loading'); //关闭加载层
|
||||
if (res.code > 0) {
|
||||
return layer.msg('上传失败');
|
||||
}
|
||||
layer.msg('上传成功');
|
||||
$('#viewImgBoxTrademarkRegistrationApplication').attr('src', res.data.fileUrl);
|
||||
$("#trademark_registration_application").val(res.data.fileUrl);
|
||||
}
|
||||
, error: function (res) {
|
||||
layer.msg('上传失败,请重试');
|
||||
console.log(res);
|
||||
}
|
||||
});
|
||||
|
||||
//海关报关单
|
||||
upload.render({
|
||||
elem: '#upBtnImportedGoodsForm'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/MiNiShopOpenComponent2_UploadImg'
|
||||
, before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
layer.msg('上传中', { icon: 16, shade: 0.4 });
|
||||
});
|
||||
}
|
||||
, done: function (res) {
|
||||
layer.closeAll('loading'); //关闭加载层
|
||||
if (res.code > 0) {
|
||||
return layer.msg('上传失败');
|
||||
}
|
||||
layer.msg('上传成功');
|
||||
imported_goods_form_imgs.push(res.data.fileUrl);
|
||||
$('#imported_goods_form').val(imported_goods_form_imgs);
|
||||
var getTpl = image_hg_tpl.innerHTML, view = document.getElementById('imported_goods_form_list');
|
||||
laytpl(getTpl).render(imported_goods_form_imgs, function (html) {
|
||||
view.innerHTML = html;
|
||||
});
|
||||
}
|
||||
, error: function (res) {
|
||||
layer.msg('上传失败,请重试');
|
||||
console.log(res);
|
||||
}
|
||||
});
|
||||
|
||||
//销售授权书
|
||||
upload.render({
|
||||
elem: '#upBtnSaleAuthorization'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/MiNiShopOpenComponent2_UploadImg'
|
||||
, before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
layer.msg('上传中', { icon: 16, shade: 0.4 });
|
||||
});
|
||||
}
|
||||
, done: function (res) {
|
||||
layer.closeAll('loading'); //关闭加载层
|
||||
if (res.code > 0) {
|
||||
return layer.msg('上传失败');
|
||||
}
|
||||
layer.msg('上传成功');
|
||||
sale_authorization_imgs.push(res.data.fileUrl);
|
||||
$('#sale_authorization').val(sale_authorization_imgs);
|
||||
var getTpl = image_xs_tpl.innerHTML, view = document.getElementById('sale_authorization_list');
|
||||
laytpl(getTpl).render(sale_authorization_imgs, function (html) {
|
||||
view.innerHTML = html;
|
||||
});
|
||||
}
|
||||
, error: function (res) {
|
||||
layer.msg('上传失败,请重试');
|
||||
console.log(res);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
laydate.render({
|
||||
elem: '#createTime-WeChatTransactionComponentBrandAudit-trademark_authorization_period',
|
||||
type: 'datetime'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#createTime-WeChatTransactionComponentBrandAudit-trademark_application_time',
|
||||
type: 'datetime'
|
||||
});
|
||||
form.verify({
|
||||
|
||||
verifylicense: [/^.{0,500}$/, '营业执照或组织机构代码证最大只允许输入500位字符'],
|
||||
verifytrademark_type: [/^.{0,10}$/, '商标分类最大只允许输入10位字符'],
|
||||
verifybrand_wording: [/^.{0,50}$/, '商标/品牌词最大只允许输入50位字符'],
|
||||
verifysale_authorization: [/^.{0,500}$/, '销售授权书最大只允许输入500位字符'],
|
||||
verifytrademark_registration_certificate: [/^.{0,500}$/, '商标注册证书最大只允许输入500位字符'],
|
||||
verifytrademark_change_certificate: [/^.{0,500}$/, '商标变更证明最大只允许输入500位字符'],
|
||||
verifytrademark_registrant: [/^.{0,100}$/, '商标注册人姓名最大只允许输入100位字符'],
|
||||
verifytrademark_registrant_nu: [/^.{0,10}$/, '商标注册号/申请号最大只允许输入10位字符'],
|
||||
verifytrademark_registration_application: [/^.{0,100}$/, '商标注册申请受理通知书最大只允许输入100位字符'],
|
||||
verifytrademark_applicant: [/^.{0,100}$/, '商标申请人姓名最大只允许输入100位字符'],
|
||||
verifyimported_goods_form: [/^.{0,500}$/, '中华人民共和国海关进口货物报关单最大只允许输入500位字符'],
|
||||
});
|
||||
//重载form
|
||||
form.render(null, 'LAY-app-WeChatTransactionComponentBrandAudit-createForm');
|
||||
})
|
||||
};
|
||||
|
||||
//删除图片
|
||||
function delImg(obj, imageUrl) {
|
||||
var imgDiv = $(obj).parent().parent().parent();
|
||||
imgDiv.remove();
|
||||
var index = trademark_change_certificate_imgs.indexOf(imageUrl);
|
||||
if (index > -1) {
|
||||
trademark_change_certificate_imgs.splice(index, 1);
|
||||
}
|
||||
$('#trademark_change_certificate').val(trademark_change_certificate_imgs);
|
||||
}
|
||||
//设为默认图
|
||||
function setDefault(obj, imageUrl) {
|
||||
var imgDiv = $(obj).parent().parent().parent();
|
||||
$("#trademark_change_certificate_list").prepend(imgDiv);
|
||||
var index = trademark_change_certificate_imgs.indexOf(imageUrl);
|
||||
if (index > -1) {
|
||||
trademark_change_certificate_imgs.unshift(trademark_change_certificate_imgs.splice(index, 1)[0]);
|
||||
}
|
||||
$('#trademark_change_certificate').val(trademark_change_certificate_imgs);
|
||||
}
|
||||
|
||||
|
||||
//删除图片
|
||||
function delHGImg(obj, imageUrl) {
|
||||
var imgDiv = $(obj).parent().parent().parent();
|
||||
imgDiv.remove();
|
||||
var index = imported_goods_form_imgs.indexOf(imageUrl);
|
||||
if (index > -1) {
|
||||
imported_goods_form_imgs.splice(index, 1);
|
||||
}
|
||||
$('#imported_goods_form').val(imported_goods_form_imgs);
|
||||
}
|
||||
//设为默认图
|
||||
function setHGDefault(obj, imageUrl) {
|
||||
var imgDiv = $(obj).parent().parent().parent();
|
||||
$("#imported_goods_form_list").prepend(imgDiv);
|
||||
var index = imported_goods_form_imgs.indexOf(imageUrl);
|
||||
if (index > -1) {
|
||||
imported_goods_form_imgs.unshift(imported_goods_form_imgs.splice(index, 1)[0]);
|
||||
}
|
||||
$('#imported_goods_form').val(imported_goods_form_imgs);
|
||||
}
|
||||
|
||||
//删除图片
|
||||
function delXSImg(obj, imageUrl) {
|
||||
var imgDiv = $(obj).parent().parent().parent();
|
||||
imgDiv.remove();
|
||||
var index = sale_authorization_imgs.indexOf(imageUrl);
|
||||
if (index > -1) {
|
||||
sale_authorization_imgs.splice(index, 1);
|
||||
}
|
||||
$('#sale_authorization').val(sale_authorization_imgs);
|
||||
}
|
||||
//设为默认图
|
||||
function setXSDefault(obj, imageUrl) {
|
||||
var imgDiv = $(obj).parent().parent().parent();
|
||||
$("#sale_authorization_list").prepend(imgDiv);
|
||||
var index = sale_authorization_imgs.indexOf(imageUrl);
|
||||
if (index > -1) {
|
||||
sale_authorization_imgs.unshift(sale_authorization_imgs.splice(index, 1)[0]);
|
||||
}
|
||||
$('#sale_authorization').val(sale_authorization_imgs);
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -1,189 +0,0 @@
|
||||
<script type="text/html" template lay-done="layui.data.done(d);">
|
||||
<table class="layui-table layui-form" lay-filter="LAY-app-WeChatTransactionComponentBrandAudit-detailsForm" id="LAY-app-WeChatTransactionComponentBrandAudit-detailsForm">
|
||||
<colgroup>
|
||||
<col width="100">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="id">序列</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.id || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="license">营业执照或组织机构代码证</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.license || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="brand_audit_type">认证审核类型</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.brand_audit_type || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="trademark_type">商标分类</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.trademark_type || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="brand_management_type">经营类型</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.brand_management_type || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="commodity_origin_type">商品产地是否进口</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.commodity_origin_type || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="brand_wording">商标/品牌词</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.brand_wording || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="sale_authorization">销售授权书</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.sale_authorization || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="trademark_registration_certificate">商标注册证书</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.trademark_registration_certificate || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="trademark_change_certificate">商标变更证明</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.trademark_change_certificate || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="trademark_registrant">商标注册人姓名</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.trademark_registrant || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="trademark_registrant_nu">商标注册号/申请号</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.trademark_registrant_nu || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="trademark_authorization_period">商标有效期</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.trademark_authorization_period || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="trademark_registration_application">商标注册申请受理通知书</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.trademark_registration_application || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="trademark_applicant">商标申请人姓名</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.trademark_applicant || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="trademark_application_time">商标申请时间</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.trademark_application_time || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="imported_goods_form">中华人民共和国海关进口货物报关单</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.imported_goods_form || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="scene_group_list">商品使用场景</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.scene_group_list || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</script>
|
||||
<script>
|
||||
var debug= layui.setter.debug;
|
||||
layui.data.done = function (d) {
|
||||
//开启调试情况下获取接口赋值数据
|
||||
if (debug) { console.log(d.params.data); }
|
||||
|
||||
layui.use(['admin', 'form', 'coreHelper'], function () {
|
||||
var $ = layui.$
|
||||
, setter = layui.setter
|
||||
, admin = layui.admin
|
||||
, coreHelper = layui.coreHelper
|
||||
, form = layui.form;
|
||||
form.render(null, 'LAY-app-WeChatTransactionComponentBrandAudit-detailsForm');
|
||||
});
|
||||
};
|
||||
</script>
|
||||
@@ -1,515 +0,0 @@
|
||||
<style>
|
||||
.layui-upload-list { min-height: 120px; border: 1px solid #e6e6fa; padding: 10px; }
|
||||
</style>
|
||||
<script type="text/html" template lay-done="layui.data.sendParams(d);">
|
||||
<div class="layui-form coreshop-form transactioncomponent layui-form-pane" lay-filter="LAY-app-WeChatTransactionComponentBrandAudit-editForm" id="LAY-app-WeChatTransactionComponentBrandAudit-editForm">
|
||||
<input type="hidden" name="id" value="{{d.params.data.model.id || '' }}" />
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="license" class="layui-form-label layui-form-required">营业执照</label>
|
||||
<div class="layui-input-inline layui-inline-12">
|
||||
<input name="license" id="license" lay-verify="required|verifylicense" class="layui-input" lay-reqText="点击上传营业执照或组织机构代码证" placeholder="点击上传营业执照或组织机构代码证" value="{{d.params.data.model.license || '' }}" />
|
||||
</div>
|
||||
<div class="layui-input-block">
|
||||
<img class="coreshop-upload-img" id="viewImgBoxlicense" src="{{ d.params.data.model.license || layui.setter.noImagePicUrl }}">
|
||||
<button type="button" class="layui-btn" id="upBtnlicense">点击上传营业执照或组织机构代码证</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="brand_audit_type" class="layui-form-label layui-form-required">认证审核类型</label>
|
||||
<div class="layui-input-inline layui-inline-3">
|
||||
<select name="brand_audit_type" lay-verify="required|number" lay-reqText="请选择证审核类型">
|
||||
<option value="">请选择证审核类型</option>
|
||||
{{# layui.each(indexData.registerType, function(index, item){ }}
|
||||
<option value="{{ item.value }}" {{d.params.data.model.brand_audit_type == item.value ? 'selected="selected"' :''}}>{{ item.title }}</option>
|
||||
{{# }); }}
|
||||
</select>
|
||||
</div>
|
||||
<label for="trademark_type" class="layui-form-label layui-form-required">商标分类</label>
|
||||
<div class="layui-input-inline layui-inline-3">
|
||||
<select name="trademark_type" lay-verify="required|number" lay-reqText="请选择商标分类">
|
||||
<option value="">请选择商标分类</option>
|
||||
{{# layui.each(indexData.trademarkType, function(index, item){ }}
|
||||
<option value="{{ item.value }}" {{d.params.data.model.trademark_type ==item.value ? 'selected="selected"' :''}}>{{ item.title }}</option>
|
||||
{{# }); }}
|
||||
</select>
|
||||
</div>
|
||||
<label for="brand_management_type" class="layui-form-label layui-form-required">经营类型</label>
|
||||
<div class="layui-input-inline layui-inline-3">
|
||||
<select name="brand_management_type" lay-reqText="请选择经营类型" lay-verify="required|number">
|
||||
<option value="">请选择经营类型</option>
|
||||
{{# layui.each(indexData.brandManagementType, function(index, item){ }}
|
||||
<option value="{{ item.value }}" {{d.params.data.model.brand_management_type ==item.value ? 'selected="selected"' :''}}>{{ item.title }}</option>
|
||||
{{# }); }}
|
||||
</select>
|
||||
</div>
|
||||
<label for="commodity_origin_type" class="layui-form-label layui-form-required">是否进口</label>
|
||||
<div class="layui-input-inline layui-inline-3">
|
||||
<select name="commodity_origin_type" lay-reqText="请选择商品是否进口" lay-verify="required|number">
|
||||
<option value="">请选择商品是否进口</option>
|
||||
{{# layui.each(indexData.commodityOriginType, function(index, item){ }}
|
||||
<option value="{{ item.value }}" {{d.params.data.model.commodity_origin_type ==item.value ? 'selected="selected"' :''}}>{{ item.title }}</option>
|
||||
{{# }); }}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="brand_wording" class="layui-form-label layui-form-required">商标/品牌词</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="brand_wording" lay-verType="tips" lay-verify="required|verifybrand_wording" class="layui-input" placeholder="请输入商标/品牌词" lay-reqText="请输入商标/品牌词" value="{{d.params.data.model.brand_wording || '' }}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--<div class="layui-form-item">
|
||||
<label for="sale_authorization" class="layui-form-label layui-form-required">销售授权书</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="sale_authorization" lay-verType="tips" lay-verify="required|verifysale_authorization" class="layui-input" placeholder="请输入销售授权书" lay-reqText="请输入销售授权书" value="{{d.params.data.model.sale_authorization || '' }}" />
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<fieldset class="layui-elem-field layui-field-title site-title"><legend><a name="compress">销售授权书(如商持人为自然人,还需提供有其签名的身份证正反面扫描件,最多不超过10张) <button type="button" class="layui-btn layui-btn-xs" id="upBtnSaleAuthorization"><i class="layui-icon"></i>上传图片</button></a></legend></fieldset>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline layui-inline-2">
|
||||
<input type="hidden" name="sale_authorization" id="sale_authorization" value="{{d.params.data.model.sale_authorization || '' }}" class="layui-input" placeholder="请上传缩略图" lay-reqText="请上传缩略图" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-upload-list" id="sale_authorization_list"></div>
|
||||
</div>
|
||||
|
||||
<!--<div class="layui-form-item">
|
||||
<label for="trademark_registration_certificate" class="layui-form-label layui-form-required">商标注册证书</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="trademark_registration_certificate" lay-verType="tips" lay-verify="required|verifytrademark_registration_certificate" class="layui-input" placeholder="请输入商标注册证书" lay-reqText="请输入商标注册证书" value="{{d.params.data.model.trademark_registration_certificate || '' }}" />
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="trademark_registration_certificate" class="layui-form-label layui-form-required">商标注册证书</label>
|
||||
<div class="layui-input-inline layui-inline-12">
|
||||
<input name="trademark_registration_certificate" id="trademark_registration_certificate" lay-verify="required|verifytrademark_registration_certificate" class="layui-input" lay-reqText="请输入商标注册证书" placeholder="请输入商标注册证书" value="{{d.params.data.model.trademark_registration_certificate || '' }}" />
|
||||
</div>
|
||||
<div class="layui-input-block">
|
||||
<img class="coreshop-upload-img" id="viewImgBoxtrademark_registration_certificate" src="{{ d.params.data.model.trademark_registration_certificate ||layui.setter.noImagePicUrl }}">
|
||||
<button type="button" class="layui-btn" id="upBtntrademark_registration_certificate">点击上传商标注册证书</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--<div class="layui-form-item">
|
||||
<label for="trademark_change_certificate" class="layui-form-label layui-form-required">商标变更证明</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="trademark_change_certificate" lay-verType="tips" lay-verify="required|verifytrademark_change_certificate" class="layui-input" placeholder="请输入商标变更证明" lay-reqText="请输入商标变更证明" value="{{d.params.data.model.trademark_change_certificate || '' }}" />
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<fieldset class="layui-elem-field layui-field-title site-title"><legend><a name="compress">商标变更证明(最多不超过5张) <button type="button" class="layui-btn layui-btn-xs" id="upBtnTrademarkChangeCertificate"><i class="layui-icon"></i>上传图片</button></a></legend></fieldset>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline layui-inline-2">
|
||||
<input type="hidden" name="trademark_change_certificate" id="trademark_change_certificate" value="{{d.params.data.model.trademark_change_certificate || '' }}" class="layui-input" placeholder="请上传缩略图" lay-reqText="请上传缩略图" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-upload-list" id="trademark_change_certificate_list"></div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="trademark_registrant" class="layui-form-label layui-form-required">商标注册人姓名</label>
|
||||
<div class="layui-input-inline layui-inline-6">
|
||||
<input name="trademark_registrant" lay-verType="tips" lay-verify="required|verifytrademark_registrant" class="layui-input" placeholder="请输入商标注册人姓名" lay-reqText="请输入商标注册人姓名" value="{{d.params.data.model.trademark_registrant || '' }}" />
|
||||
</div>
|
||||
<label for="trademark_registrant_nu" class="layui-form-label layui-form-required">商标注册号/申请号</label>
|
||||
<div class="layui-input-inline layui-inline-6">
|
||||
<input name="trademark_registrant_nu" lay-verType="tips" lay-verify="required|verifytrademark_registrant_nu" class="layui-input" placeholder="请输入商标注册号/申请号" lay-reqText="请输入商标注册号/申请号" value="{{d.params.data.model.trademark_registrant_nu || '' }}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="trademark_authorization_period" class="layui-form-label layui-form-required">商标有效期</label>
|
||||
<div class="layui-input-inline layui-inline-6">
|
||||
<input name="trademark_authorization_period" id="editTime-WeChatTransactionComponentBrandAudit-trademark_authorization_period" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入商标有效期" lay-reqText="请输入商标有效期" value="{{d.params.data.model.trademark_authorization_period || '' }}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--<div class="layui-form-item">
|
||||
<label for="trademark_registration_application" class="layui-form-label layui-form-required">商标注册申请受理通知书</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="trademark_registration_application" lay-verType="tips" lay-verify="required|verifytrademark_registration_application" class="layui-input" placeholder="请输入商标注册申请受理通知书" lay-reqText="请输入商标注册申请受理通知书" value="{{d.params.data.model.trademark_registration_application || '' }}" />
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="trademark_registration_application" class="layui-form-label">商标受理通知书</label>
|
||||
<div class="layui-input-inline layui-inline-12">
|
||||
<input name="trademark_registration_application" id="trademark_registration_application" lay-verify="required|verifytrademark_registration_application" class="layui-input" lay-reqText="请输入商标注册申请受理通知书" placeholder="请输入商标注册申请受理通知书" value="{{d.params.data.model.trademark_registration_application || '' }}" />
|
||||
</div>
|
||||
<div class="layui-input-block">
|
||||
<img class="coreshop-upload-img" id="viewImgBoxTrademarkRegistrationApplication" src="{{ d.params.data.model.trademark_registration_application || layui.setter.noImagePicUrl }}">
|
||||
<button type="button" class="layui-btn" id="upBtnTrademarkRegistrationApplication">点击上传商标受理通知书</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="trademark_applicant" class="layui-form-label layui-form-required">商标申请人姓名</label>
|
||||
<div class="layui-input-inline layui-inline-6">
|
||||
<input name="trademark_applicant" lay-verType="tips" lay-verify="required|verifytrademark_applicant" class="layui-input" placeholder="请输入商标申请人姓名" lay-reqText="请输入商标申请人姓名" value="{{d.params.data.model.trademark_applicant || '' }}" />
|
||||
</div>
|
||||
<label for="trademark_application_time" class="layui-form-label layui-form-required">商标申请时间</label>
|
||||
<div class="layui-input-inline layui-inline-6">
|
||||
<input name="trademark_application_time" id="editTime-WeChatTransactionComponentBrandAudit-trademark_application_time" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入商标申请时间" lay-reqText="请输入商标申请时间" value="{{d.params.data.model.trademark_application_time || '' }}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--<div class="layui-form-item">
|
||||
<label for="imported_goods_form" class="layui-form-label layui-form-required">中华人民共和国海关进口货物报关单</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="imported_goods_form" lay-verType="tips" lay-verify="required|verifyimported_goods_form" class="layui-input" placeholder="请输入中华人民共和国海关进口货物报关单" lay-reqText="请输入中华人民共和国海关进口货物报关单" value="{{d.params.data.model.imported_goods_form || '' }}" />
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<fieldset class="layui-elem-field layui-field-title site-title"><legend><a name="compress">海关报关单(最多不超过5张) <button type="button" class="layui-btn layui-btn-xs" id="upBtnImportedGoodsForm"><i class="layui-icon"></i>上传图片</button></a></legend></fieldset>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline layui-inline-2">
|
||||
<input type="hidden" name="imported_goods_form" id="imported_goods_form" value="{{d.params.data.model.imported_goods_form || '' }}" class="layui-input" placeholder="请上传缩略图" lay-reqText="请上传缩略图" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-upload-list" id="imported_goods_form_list"></div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="scene_group_list" class="layui-form-label layui-form-required">商品使用场景</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="scene_group_list" lay-reqText="请选择商品使用场景" lay-verify="required|number">
|
||||
<option value="1" {{d.params.data.model.scene_group_list ===1 ? 'selected="selected"' :''}}>视频号</option>
|
||||
<option value="3" {{d.params.data.model.scene_group_list ===3 ? 'selected="selected"' :''}}>订单中心</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item text-right core-hidden">
|
||||
<input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-WeChatTransactionComponentBrandAudit-editForm-submit" id="LAY-app-WeChatTransactionComponentBrandAudit-editForm-submit" value="确认编辑">
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script id="image_tpl" type="text/html">
|
||||
{{# layui.each(d, function(index, item){ }}
|
||||
<div class="imgdiv">
|
||||
<img src="{{ item }}" class="layui-upload-img" onclick='layui.coreHelper.viewImage("{{ item }}")' style="width: 100px;height:100px;">
|
||||
<div id="operate">
|
||||
<div><a class="del" onclick="delImg(this,'{{ item }}')">删除</a>|<a class="setmain" onclick="setDefault(this,'{{ item }}')">设为首图</a></div>
|
||||
</div>
|
||||
</div>
|
||||
{{# }); }}
|
||||
</script>
|
||||
|
||||
<script id="image_hg_tpl" type="text/html">
|
||||
{{# layui.each(d, function(index, item){ }}
|
||||
<div class="imgdiv">
|
||||
<img src="{{ item }}" class="layui-upload-img" onclick='layui.coreHelper.viewImage("{{ item }}")' style="width: 100px;height:100px;">
|
||||
<div id="operate">
|
||||
<div><a class="del" onclick="delHGImg(this,'{{ item }}')">删除</a>|<a class="setmain" onclick="setHGDefault(this,'{{ item }}')">设为首图</a></div>
|
||||
</div>
|
||||
</div>
|
||||
{{# }); }}
|
||||
</script>
|
||||
|
||||
<script id="image_xs_tpl" type="text/html">
|
||||
{{# layui.each(d, function(index, item){ }}
|
||||
<div class="imgdiv">
|
||||
<img src="{{ item }}" class="layui-upload-img" onclick='layui.coreHelper.viewImage("{{ item }}")' style="width: 100px;height:100px;">
|
||||
<div id="operate">
|
||||
<div><a class="del" onclick="delXSImg(this,'{{ item }}')">删除</a>|<a class="setmain" onclick="setXSDefault(this,'{{ item }}')">设为首图</a></div>
|
||||
</div>
|
||||
</div>
|
||||
{{# }); }}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var $;
|
||||
var trademark_change_certificate_imgs = [];
|
||||
var imported_goods_form_imgs = [];
|
||||
var sale_authorization_imgs = [];
|
||||
var debug = layui.setter.debug;
|
||||
layui.data.sendParams = function (d) {
|
||||
//开启调试情况下获取接口赋值数据
|
||||
if (debug) { console.log(d.params.data); }
|
||||
layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg'],
|
||||
function () {
|
||||
$ = layui.$; var form = layui.form, admin = layui.admin, laydate = layui.laydate, upload = layui.upload, coreHelper = layui.coreHelper, laytpl = layui.laytpl;
|
||||
|
||||
if (d.params.data.model.sale_authorization) {
|
||||
sale_authorization_imgs = d.params.data.model.sale_authorization.split(',');
|
||||
var getTpl = image_xs_tpl.innerHTML, view = document.getElementById('sale_authorization_list');
|
||||
laytpl(getTpl).render(sale_authorization_imgs, function (html) {
|
||||
view.innerHTML = html;
|
||||
});
|
||||
}
|
||||
|
||||
if (d.params.data.model.trademark_change_certificate) {
|
||||
trademark_change_certificate_imgs = d.params.data.model.trademark_change_certificate.split(',');
|
||||
var getTpl = image_tpl.innerHTML, view = document.getElementById('trademark_change_certificate_list');
|
||||
laytpl(getTpl).render(trademark_change_certificate_imgs, function (html) {
|
||||
view.innerHTML = html;
|
||||
});
|
||||
}
|
||||
|
||||
if (d.params.data.model.imported_goods_form) {
|
||||
imported_goods_form_imgs = d.params.data.model.imported_goods_form.split(',');
|
||||
var getTpl = image_hg_tpl.innerHTML, view = document.getElementById('imported_goods_form_list');
|
||||
laytpl(getTpl).render(imported_goods_form_imgs, function (html) {
|
||||
view.innerHTML = html;
|
||||
});
|
||||
}
|
||||
|
||||
//营业执照上传
|
||||
upload.render({
|
||||
elem: '#upBtnlicense'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/MiNiShopOpenComponent2_UploadImg'
|
||||
, before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
layer.msg('上传中', { icon: 16, shade: 0.4 });
|
||||
});
|
||||
}
|
||||
, done: function (res) {
|
||||
layer.closeAll('loading'); //关闭加载层
|
||||
if (res.code > 0) {
|
||||
return layer.msg('上传失败');
|
||||
}
|
||||
layer.msg('上传成功');
|
||||
$('#viewImgBoxlicense').attr('src', res.data.fileUrl);
|
||||
$("#license").val(res.data.fileUrl);
|
||||
}
|
||||
, error: function (res) {
|
||||
layer.msg('上传失败,请重试');
|
||||
console.log(res);
|
||||
}
|
||||
});
|
||||
|
||||
//商标注册证书
|
||||
upload.render({
|
||||
elem: '#upBtntrademark_registration_certificate'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/MiNiShopOpenComponent2_UploadImg'
|
||||
, before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
layer.msg('上传中', { icon: 16, shade: 0.4 });
|
||||
});
|
||||
}
|
||||
, done: function (res) {
|
||||
layer.closeAll('loading'); //关闭加载层
|
||||
if (res.code > 0) {
|
||||
return layer.msg('上传失败');
|
||||
}
|
||||
layer.msg('上传成功');
|
||||
$('#viewImgBoxtrademark_registration_certificate').attr('src', res.data.fileUrl);
|
||||
$("#trademark_registration_certificate").val(res.data.fileUrl);
|
||||
}
|
||||
, error: function (res) {
|
||||
layer.msg('上传失败,请重试');
|
||||
console.log(res);
|
||||
}
|
||||
});
|
||||
|
||||
//商标变更证明
|
||||
upload.render({
|
||||
elem: '#upBtnTrademarkChangeCertificate'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/MiNiShopOpenComponent2_UploadImg'
|
||||
, before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
layer.msg('上传中', { icon: 16, shade: 0.4 });
|
||||
});
|
||||
}
|
||||
, done: function (res) {
|
||||
layer.closeAll('loading'); //关闭加载层
|
||||
if (res.code > 0) {
|
||||
return layer.msg('上传失败');
|
||||
}
|
||||
layer.msg('上传成功');
|
||||
trademark_change_certificate_imgs.push(res.data.fileUrl);
|
||||
$('#trademark_change_certificate').val(trademark_change_certificate_imgs);
|
||||
var getTpl = image_tpl.innerHTML, view = document.getElementById('trademark_change_certificate_list');
|
||||
laytpl(getTpl).render(trademark_change_certificate_imgs, function (html) {
|
||||
view.innerHTML = html;
|
||||
});
|
||||
}
|
||||
, error: function (res) {
|
||||
layer.msg('上传失败,请重试');
|
||||
console.log(res);
|
||||
}
|
||||
});
|
||||
|
||||
//商标受理通知书
|
||||
upload.render({
|
||||
elem: '#upBtnTrademarkRegistrationApplication'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/MiNiShopOpenComponent2_UploadImg'
|
||||
, before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
layer.msg('上传中', { icon: 16, shade: 0.4 });
|
||||
});
|
||||
}
|
||||
, done: function (res) {
|
||||
layer.closeAll('loading'); //关闭加载层
|
||||
if (res.code > 0) {
|
||||
return layer.msg('上传失败');
|
||||
}
|
||||
layer.msg('上传成功');
|
||||
$('#viewImgBoxTrademarkRegistrationApplication').attr('src', res.data.fileUrl);
|
||||
$("#trademark_registration_application").val(res.data.fileUrl);
|
||||
}
|
||||
, error: function (res) {
|
||||
layer.msg('上传失败,请重试');
|
||||
console.log(res);
|
||||
}
|
||||
});
|
||||
|
||||
//海关报关单
|
||||
upload.render({
|
||||
elem: '#upBtnImportedGoodsForm'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/MiNiShopOpenComponent2_UploadImg'
|
||||
, before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
layer.msg('上传中', { icon: 16, shade: 0.4 });
|
||||
});
|
||||
}
|
||||
, done: function (res) {
|
||||
layer.closeAll('loading'); //关闭加载层
|
||||
if (res.code > 0) {
|
||||
return layer.msg('上传失败');
|
||||
}
|
||||
layer.msg('上传成功');
|
||||
imported_goods_form_imgs.push(res.data.fileUrl);
|
||||
$('#imported_goods_form').val(imported_goods_form_imgs);
|
||||
var getTpl = image_hg_tpl.innerHTML, view = document.getElementById('imported_goods_form_list');
|
||||
laytpl(getTpl).render(imported_goods_form_imgs, function (html) {
|
||||
view.innerHTML = html;
|
||||
});
|
||||
}
|
||||
, error: function (res) {
|
||||
layer.msg('上传失败,请重试');
|
||||
console.log(res);
|
||||
}
|
||||
});
|
||||
|
||||
//销售授权书
|
||||
upload.render({
|
||||
elem: '#upBtnSaleAuthorization'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/MiNiShopOpenComponent2_UploadImg'
|
||||
, before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
layer.msg('上传中', { icon: 16, shade: 0.4 });
|
||||
});
|
||||
}
|
||||
, done: function (res) {
|
||||
layer.closeAll('loading'); //关闭加载层
|
||||
if (res.code > 0) {
|
||||
return layer.msg('上传失败');
|
||||
}
|
||||
layer.msg('上传成功');
|
||||
sale_authorization_imgs.push(res.data.fileUrl);
|
||||
$('#sale_authorization').val(sale_authorization_imgs);
|
||||
var getTpl = image_xs_tpl.innerHTML, view = document.getElementById('sale_authorization_list');
|
||||
laytpl(getTpl).render(sale_authorization_imgs, function (html) {
|
||||
view.innerHTML = html;
|
||||
});
|
||||
}
|
||||
, error: function (res) {
|
||||
layer.msg('上传失败,请重试');
|
||||
console.log(res);
|
||||
}
|
||||
});
|
||||
|
||||
laydate.render({
|
||||
elem: '#editTime-WeChatTransactionComponentBrandAudit-trademark_authorization_period',
|
||||
type: 'datetime'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#editTime-WeChatTransactionComponentBrandAudit-trademark_application_time',
|
||||
type: 'datetime'
|
||||
});
|
||||
form.verify({
|
||||
|
||||
verifylicense: [/^.{0,500}$/, '营业执照或组织机构代码证最大只允许输入500位字符'],
|
||||
verifytrademark_type: [/^.{0,10}$/, '商标分类最大只允许输入10位字符'],
|
||||
verifybrand_wording: [/^.{0,50}$/, '商标/品牌词最大只允许输入50位字符'],
|
||||
verifysale_authorization: [/^.{0,500}$/, '销售授权书最大只允许输入500位字符'],
|
||||
verifytrademark_registration_certificate: [/^.{0,500}$/, '商标注册证书最大只允许输入500位字符'],
|
||||
verifytrademark_change_certificate: [/^.{0,500}$/, '商标变更证明最大只允许输入500位字符'],
|
||||
verifytrademark_registrant: [/^.{0,100}$/, '商标注册人姓名最大只允许输入100位字符'],
|
||||
verifytrademark_registrant_nu: [/^.{0,10}$/, '商标注册号/申请号最大只允许输入10位字符'],
|
||||
verifytrademark_registration_application: [/^.{0,100}$/, '商标注册申请受理通知书最大只允许输入100位字符'],
|
||||
verifytrademark_applicant: [/^.{0,100}$/, '商标申请人姓名最大只允许输入100位字符'],
|
||||
verifyimported_goods_form: [/^.{0,500}$/, '中华人民共和国海关进口货物报关单最大只允许输入500位字符'],
|
||||
});
|
||||
//重载form
|
||||
form.render(null, 'LAY-app-WeChatTransactionComponentBrandAudit-editForm');
|
||||
})
|
||||
};
|
||||
|
||||
//删除图片
|
||||
function delImg(obj, imageUrl) {
|
||||
var imgDiv = $(obj).parent().parent().parent();
|
||||
imgDiv.remove();
|
||||
var index = trademark_change_certificate_imgs.indexOf(imageUrl);
|
||||
if (index > -1) {
|
||||
trademark_change_certificate_imgs.splice(index, 1);
|
||||
}
|
||||
$('#trademark_change_certificate').val(trademark_change_certificate_imgs);
|
||||
}
|
||||
//设为默认图
|
||||
function setDefault(obj, imageUrl) {
|
||||
var imgDiv = $(obj).parent().parent().parent();
|
||||
$("#trademark_change_certificate_list").prepend(imgDiv);
|
||||
var index = trademark_change_certificate_imgs.indexOf(imageUrl);
|
||||
if (index > -1) {
|
||||
trademark_change_certificate_imgs.unshift(trademark_change_certificate_imgs.splice(index, 1)[0]);
|
||||
}
|
||||
$('#trademark_change_certificate').val(trademark_change_certificate_imgs);
|
||||
}
|
||||
|
||||
|
||||
//删除图片
|
||||
function delHGImg(obj, imageUrl) {
|
||||
var imgDiv = $(obj).parent().parent().parent();
|
||||
imgDiv.remove();
|
||||
var index = imported_goods_form_imgs.indexOf(imageUrl);
|
||||
if (index > -1) {
|
||||
imported_goods_form_imgs.splice(index, 1);
|
||||
}
|
||||
$('#imported_goods_form').val(imported_goods_form_imgs);
|
||||
}
|
||||
//设为默认图
|
||||
function setHGDefault(obj, imageUrl) {
|
||||
var imgDiv = $(obj).parent().parent().parent();
|
||||
$("#imported_goods_form_list").prepend(imgDiv);
|
||||
var index = imported_goods_form_imgs.indexOf(imageUrl);
|
||||
if (index > -1) {
|
||||
imported_goods_form_imgs.unshift(imported_goods_form_imgs.splice(index, 1)[0]);
|
||||
}
|
||||
$('#imported_goods_form').val(imported_goods_form_imgs);
|
||||
}
|
||||
|
||||
//删除图片
|
||||
function delXSImg(obj, imageUrl) {
|
||||
var imgDiv = $(obj).parent().parent().parent();
|
||||
imgDiv.remove();
|
||||
var index = sale_authorization_imgs.indexOf(imageUrl);
|
||||
if (index > -1) {
|
||||
sale_authorization_imgs.splice(index, 1);
|
||||
}
|
||||
$('#sale_authorization').val(sale_authorization_imgs);
|
||||
}
|
||||
//设为默认图
|
||||
function setXSDefault(obj, imageUrl) {
|
||||
var imgDiv = $(obj).parent().parent().parent();
|
||||
$("#sale_authorization_list").prepend(imgDiv);
|
||||
var index = sale_authorization_imgs.indexOf(imageUrl);
|
||||
if (index > -1) {
|
||||
sale_authorization_imgs.unshift(sale_authorization_imgs.splice(index, 1)[0]);
|
||||
}
|
||||
$('#sale_authorization').val(sale_authorization_imgs);
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
@@ -1,430 +0,0 @@
|
||||
<title>自定义交易组件上传品牌信息</title>
|
||||
<!--当前位置开始-->
|
||||
<div class="layui-card layadmin-header">
|
||||
<div class="layui-breadcrumb" lay-filter="breadcrumb">
|
||||
<script type="text/html" template lay-done="layui.data.updateMainBreadcrumb();">
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<!--当前位置结束-->
|
||||
<style>
|
||||
/* 重写样式 */
|
||||
</style>
|
||||
<script type="text/html" template lay-type="Post" lay-url="Api/WeChatTransactionComponentBrandAudit/GetIndex" lay-done="layui.data.done(d);">
|
||||
|
||||
</script>
|
||||
<div class="table-body">
|
||||
<table id="LAY-app-WeChatTransactionComponentBrandAudit-tableBox" lay-filter="LAY-app-WeChatTransactionComponentBrandAudit-tableBox"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="LAY-app-WeChatTransactionComponentBrandAudit-toolbar">
|
||||
<div class="layui-form coreshop-toolbar-search-form">
|
||||
<div class="layui-form-item">
|
||||
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label" for="brand_audit_type">认证审核类型</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="brand_audit_type">
|
||||
<option value="">请选择证审核类型</option>
|
||||
{{# layui.each(indexData.registerType, function(index, item){ }}
|
||||
<option value="{{ item.value }}">{{ item.title }}</option>
|
||||
{{# }); }}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label" for="trademark_type">商标分类</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="trademark_type">
|
||||
<option value="">请选择商标分类</option>
|
||||
{{# layui.each(indexData.trademarkType, function(index, item){ }}
|
||||
<option value="{{ item.value }}">{{ item.title }}</option>
|
||||
{{# }); }}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label" for="brand_management_type">经营类型</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="brand_management_type">
|
||||
<option value="">请选择经营类型</option>
|
||||
{{# layui.each(indexData.brandManagementType, function(index, item){ }}
|
||||
<option value="{{ item.value }}">{{ item.title }}</option>
|
||||
{{# }); }}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label" for="commodity_origin_type">商品产地是否进口</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="commodity_origin_type">
|
||||
<option value="">请选择商品产地是否进口</option>
|
||||
{{# layui.each(indexData.commodityOriginType, function(index, item){ }}
|
||||
<option value="{{ item.value }}">{{ item.title }}</option>
|
||||
{{# }); }}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button class="layui-btn layui-btn-sm" lay-submit lay-filter="LAY-app-WeChatTransactionComponentBrandAudit-search"><i class="layui-icon layui-icon-search"></i>筛选</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="LAY-app-WeChatTransactionComponentBrandAudit-pagebar">
|
||||
<div class="layui-btn-container">
|
||||
<button class="layui-btn layui-btn-sm" lay-event="addData"><i class="layui-icon layui-icon-add-1"></i>添加数据</button>
|
||||
<button class="layui-btn layui-btn-sm" lay-event="batchDelete"><i class="layui-icon layui-icon-delete"></i>批量删除</button>
|
||||
<a class="layui-btn layui-btn-sm" data-id="{{d.id}}" lay-event="audit"><i class="layui-icon layui-icon-time"></i>提交审核</a>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="LAY-app-WeChatTransactionComponentBrandAudit-tableBox-bar">
|
||||
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
|
||||
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" data-dropdown="#WeChatTransactionComponentBrandAuditTbDelDrop{{d.LAY_NUM}}" no-shade="true">删除</a>
|
||||
<div class="dropdown-menu-nav dropdown-popconfirm dropdown-top-right layui-hide" id="WeChatTransactionComponentBrandAuditTbDelDrop{{d.LAY_NUM}}"
|
||||
style="max-width: 200px;white-space: normal;min-width: auto;margin-left: 10px;">
|
||||
<div class="dropdown-anchor"></div>
|
||||
<div class="dropdown-popconfirm-title">
|
||||
<i class="layui-icon layui-icon-help"></i>
|
||||
确定要删除吗?
|
||||
</div>
|
||||
<div class="dropdown-popconfirm-btn">
|
||||
<a class="layui-btn layui-btn-primary cursor" btn-cancel>取消</a>
|
||||
<a class="layui-btn layui-btn-normal cursor" lay-event="del">确定</a>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var indexData;
|
||||
var debug = layui.setter.debug;
|
||||
layui.data.done = function (d) {
|
||||
//开启调试情况下获取接口赋值数据
|
||||
if (debug) { console.log(d); }
|
||||
|
||||
indexData = d.data;
|
||||
layui.use(['index', 'table', 'laydate', 'util', 'coredropdown', 'coreHelper'],
|
||||
function () {
|
||||
var $ = layui.$
|
||||
, admin = layui.admin
|
||||
, table = layui.table
|
||||
, form = layui.form
|
||||
, laydate = layui.laydate
|
||||
, setter = layui.setter
|
||||
, coreHelper = layui.coreHelper
|
||||
, util = layui.util
|
||||
, view = layui.view;
|
||||
|
||||
var searchwhere;
|
||||
//监听搜索
|
||||
form.on('submit(LAY-app-WeChatTransactionComponentBrandAudit-search)',
|
||||
function (data) {
|
||||
var field = data.field;
|
||||
searchwhere = field;
|
||||
//执行重载
|
||||
table.reloadData('LAY-app-WeChatTransactionComponentBrandAudit-tableBox', { where: field });
|
||||
});
|
||||
//数据绑定
|
||||
table.render({
|
||||
elem: '#LAY-app-WeChatTransactionComponentBrandAudit-tableBox',
|
||||
url: layui.setter.apiUrl + 'Api/WeChatTransactionComponentBrandAudit/GetPageList',
|
||||
method: 'POST',
|
||||
toolbar: '#LAY-app-WeChatTransactionComponentBrandAudit-toolbar',
|
||||
pagebar: '#LAY-app-WeChatTransactionComponentBrandAudit-pagebar',
|
||||
className: 'pagebarbox',
|
||||
defaultToolbar: ['filter', 'print', 'exports'],
|
||||
height: 'full-127',//面包屑142px,搜索框4行172,3行137,2行102,1行67
|
||||
page: true,
|
||||
limit: 30,
|
||||
limits: [10, 15, 20, 25, 30, 50, 100, 200],
|
||||
text: { none: '暂无相关数据' },
|
||||
cols: [
|
||||
[
|
||||
{ type: "radio", fixed: "left" },
|
||||
{ field: 'id', title: '序列', width: 60, sort: false },
|
||||
//{ field: 'license', title: '营业执照或组织机构代码证', sort: false, width: 105 },
|
||||
{
|
||||
field: 'license', title: '营业执照', width: 80, sort: false,
|
||||
templet: function (d) {
|
||||
if (d.license) {
|
||||
return '<a href="javascript:void(0);" onclick=layui.coreHelper.viewImage("' + d.license + '")><image style="max-width:28px;max-height:28px;" src="' + d.license + '"/></a>';
|
||||
} else {
|
||||
return '<a href="javascript:void(0);" onclick=layui.coreHelper.viewImage("' + setter.noImagePicUrl + '")><image style="max-width:30px;max-height:30px;" src="' + setter.noImagePicUrl + '"/></a>';
|
||||
}
|
||||
}
|
||||
},
|
||||
//{ field: 'brand_audit_type', title: '认证审核类型', sort: false, width: 105 },
|
||||
{
|
||||
field: 'brand_audit_type', title: '认证审核类型', sort: false, width: 130, templet: function (data) {
|
||||
for (var i = 0; i < d.data.registerType.length; i++) {
|
||||
if (data.brand_audit_type == d.data.registerType[i].value) {
|
||||
return d.data.registerType[i].title;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
},
|
||||
//{ field: 'trademark_type', title: '商标分类', sort: false, width: 105 },
|
||||
{
|
||||
field: 'trademark_type', title: '商标分类', sort: false, width: 100, templet: function (data) {
|
||||
for (var i = 0; i < d.data.trademarkType.length; i++) {
|
||||
if (data.trademark_type == d.data.trademarkType[i].value) {
|
||||
return d.data.trademarkType[i].title;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
},
|
||||
//{ field: 'brand_management_type', title: '经营类型', sort: false, width: 105 },
|
||||
{
|
||||
field: 'brand_management_type', title: '经营类型', sort: false, width: 100, templet: function (data) {
|
||||
for (var i = 0; i < d.data.brandManagementType.length; i++) {
|
||||
if (data.brand_management_type == d.data.brandManagementType[i].value) {
|
||||
return d.data.brandManagementType[i].title;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
},
|
||||
//{ field: 'commodity_origin_type', title: '商品产地是否进口', sort: false, width: 130 },
|
||||
{
|
||||
field: 'commodity_origin_type', title: '商品产地是否进口', sort: false, width: 130, templet: function (data) {
|
||||
for (var i = 0; i < d.data.commodityOriginType.length; i++) {
|
||||
if (data.commodity_origin_type == d.data.commodityOriginType[i].value) {
|
||||
return d.data.commodityOriginType[i].title;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
},
|
||||
{ field: 'brand_wording', title: '商标/品牌词', sort: false },
|
||||
//{ field: 'sale_authorization', title: '销售授权书', sort: false, width: 105 },
|
||||
//{ field: 'trademark_registration_certificate', title: '商标注册证书', sort: false, width: 105 },
|
||||
//{ field: 'trademark_change_certificate', title: '商标变更证明', sort: false, width: 105 },
|
||||
{ field: 'trademark_registrant', title: '商标注册人姓名', sort: false },
|
||||
//{ field: 'trademark_registrant_nu', title: '商标注册号/申请号', sort: false, width: 105 },
|
||||
{ field: 'trademark_authorization_period', title: '商标有效期', width: 130, sort: false },
|
||||
//{ field: 'trademark_registration_application', title: '商标注册申请受理通知书', sort: false, width: 105 },
|
||||
//{ field: 'trademark_applicant', title: '商标申请人姓名', sort: false, width: 105 },
|
||||
//{ field: 'trademark_application_time', title: '商标申请时间', width: 130, sort: false },
|
||||
//{ field: 'imported_goods_form', title: '中华人民共和国海关进口货物报关单', sort: false, width: 105 },
|
||||
//{ field: 'scene_group_list', title: '商品使用场景', sort: false, width: 105 },
|
||||
{ field: 'audit_id', title: '审核单', sort: false, width: 105 },
|
||||
{
|
||||
field: 'status', title: '审核状态', sort: false, width: 105, templet: function (data) {
|
||||
for (var i = 0; i < d.data.auditCategoryStatus.length; i++) {
|
||||
if (data.status == d.data.auditCategoryStatus[i].value) {
|
||||
return d.data.auditCategoryStatus[i].description;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
},
|
||||
{ field: 'rejectReason', title: '拒绝原因', sort: false },
|
||||
{ field: 'createTime', title: '创建时间', width: 130, sort: false },
|
||||
{ width: 162, align: 'center', title: '操作', fixed: 'right', toolbar: '#LAY-app-WeChatTransactionComponentBrandAudit-tableBox-bar' }
|
||||
]
|
||||
]
|
||||
});
|
||||
//监听排序事件
|
||||
table.on('sort(LAY-app-WeChatTransactionComponentBrandAudit-tableBox)', function (obj) {
|
||||
table.reloadData('LAY-app-WeChatTransactionComponentBrandAudit-tableBox', {
|
||||
initSort: obj, //记录初始排序,如果不设的话,将无法标记表头的排序状态。
|
||||
where: { //请求参数(注意:这里面的参数可任意定义,并非下面固定的格式)
|
||||
orderField: obj.field, //排序字段
|
||||
orderDirection: obj.type //排序方式
|
||||
}
|
||||
});
|
||||
});
|
||||
//监听行双击事件
|
||||
table.on('rowDouble(LAY-app-WeChatTransactionComponentBrandAudit-tableBox)', function (obj) {
|
||||
//查看详情
|
||||
doDetails(obj);
|
||||
});
|
||||
//头工具栏事件
|
||||
table.on('pagebar(LAY-app-WeChatTransactionComponentBrandAudit-tableBox)', function (obj) {
|
||||
var checkStatus = table.checkStatus(obj.config.id);
|
||||
switch (obj.event) {
|
||||
case 'addData':
|
||||
doCreate();
|
||||
break;
|
||||
case 'batchDelete':
|
||||
doBatchDelete(checkStatus);
|
||||
break;
|
||||
case 'audit':
|
||||
doAudit(checkStatus)
|
||||
break;
|
||||
};
|
||||
});
|
||||
//监听工具条
|
||||
table.on('tool(LAY-app-WeChatTransactionComponentBrandAudit-tableBox)',
|
||||
function (obj) {
|
||||
if (obj.event === 'detail') {
|
||||
doDetails(obj);
|
||||
} else if (obj.event === 'del') {
|
||||
doDelete(obj);
|
||||
} else if (obj.event === 'edit') {
|
||||
doEdit(obj)
|
||||
}
|
||||
});
|
||||
//执行创建操作
|
||||
function doCreate() {
|
||||
coreHelper.Post("Api/WeChatTransactionComponentBrandAudit/GetCreate", null, function (e) {
|
||||
if (e.code === 0) {
|
||||
admin.popup({
|
||||
shadeClose: false,
|
||||
title: '创建数据',
|
||||
area: ['1200px', '90%'],
|
||||
id: 'LAY-popup-WeChatTransactionComponentBrandAudit-create',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('wechat/transactioncomponent/brandaudit/create', { data: e.data }).done(function () {
|
||||
//监听提交
|
||||
form.on('submit(LAY-app-WeChatTransactionComponentBrandAudit-createForm-submit)',
|
||||
function (data) {
|
||||
var field = data.field; //获取提交的字段
|
||||
|
||||
|
||||
if (debug) { console.log(field); } //开启调试返回数据
|
||||
//提交 Ajax 成功后,关闭当前弹层并重载表格
|
||||
coreHelper.Post("Api/WeChatTransactionComponentBrandAudit/DoCreate", field, function (e) {
|
||||
console.log(e)
|
||||
if (e.code === 0) {
|
||||
layui.table.reloadData('LAY-app-WeChatTransactionComponentBrandAudit-tableBox'); //重载表格
|
||||
layer.close(index); //再执行关闭
|
||||
layer.msg(e.msg);
|
||||
} else {
|
||||
layer.msg(e.msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
// 禁止弹窗出现滚动条
|
||||
//$(layero).children('.layui-layer-content').css('overflow', 'visible');
|
||||
}
|
||||
, btn: ['确定', '取消']
|
||||
, yes: function (index, layero) {
|
||||
layero.contents().find("#LAY-app-WeChatTransactionComponentBrandAudit-createForm-submit").click();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.msg(e.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
//执行编辑操作
|
||||
function doEdit(obj) {
|
||||
coreHelper.Post("Api/WeChatTransactionComponentBrandAudit/GetEdit", { id: obj.data.id }, function (e) {
|
||||
if (e.code === 0) {
|
||||
admin.popup({
|
||||
shadeClose: false,
|
||||
title: '编辑数据',
|
||||
area: ['1200px', '90%'],
|
||||
id: 'LAY-popup-WeChatTransactionComponentBrandAudit-edit',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('wechat/transactioncomponent/brandaudit/edit', { data: e.data }).done(function () {
|
||||
//监听提交
|
||||
form.on('submit(LAY-app-WeChatTransactionComponentBrandAudit-editForm-submit)',
|
||||
function (data) {
|
||||
var field = data.field; //获取提交的字段
|
||||
|
||||
|
||||
if (debug) { console.log(field); } //开启调试返回数据
|
||||
//提交 Ajax 成功后,关闭当前弹层并重载表格
|
||||
coreHelper.Post("Api/WeChatTransactionComponentBrandAudit/DoEdit", field, function (e) {
|
||||
console.log(e)
|
||||
if (e.code === 0) {
|
||||
layui.table.reloadData('LAY-app-WeChatTransactionComponentBrandAudit-tableBox'); //重载表格
|
||||
layer.close(index); //再执行关闭
|
||||
layer.msg(e.msg);
|
||||
} else {
|
||||
layer.msg(e.msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
// 禁止弹窗出现滚动条
|
||||
//$(layero).children('.layui-layer-content').css('overflow', 'visible');
|
||||
}
|
||||
, btn: ['确定', '取消']
|
||||
, yes: function (index, layero) {
|
||||
layero.contents().find("#LAY-app-WeChatTransactionComponentBrandAudit-editForm-submit").click();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.msg(e.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
//执行预览操作
|
||||
function doDetails(obj) {
|
||||
coreHelper.Post("Api/WeChatTransactionComponentBrandAudit/GetDetails", { id: obj.data.id }, function (e) {
|
||||
if (e.code === 0) {
|
||||
admin.popup({
|
||||
shadeClose: false,
|
||||
title: '查看详情',
|
||||
area: ['1200px', '90%'],
|
||||
id: 'LAY-popup-WeChatTransactionComponentBrandAudit-details',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('wechat/transactioncomponent/brandaudit/details', { data: e.data }).done(function () {
|
||||
form.render();
|
||||
});
|
||||
// 禁止弹窗出现滚动条
|
||||
//$(layero).children('.layui-layer-content').css('overflow', 'visible');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.msg(e.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
//执行单个删除
|
||||
function doDelete(obj) {
|
||||
coreHelper.Post("Api/WeChatTransactionComponentBrandAudit/DoDelete", { id: obj.data.id }, function (e) {
|
||||
if (debug) { console.log(e); } //开启调试返回数据
|
||||
table.reloadData('LAY-app-WeChatTransactionComponentBrandAudit-tableBox');
|
||||
layer.msg(e.msg);
|
||||
});
|
||||
}
|
||||
//执行批量删除
|
||||
function doBatchDelete(checkStatus) {
|
||||
var checkData = checkStatus.data;
|
||||
if (checkData.length === 0) {
|
||||
return layer.msg('请选择要删除的数据');
|
||||
}
|
||||
layer.confirm('确定删除吗?删除后将无法恢复。',
|
||||
function (index) {
|
||||
var delidsStr = [];
|
||||
layui.each(checkData,
|
||||
function (index, item) {
|
||||
delidsStr.push(item.id);
|
||||
});
|
||||
coreHelper.Post("Api/WeChatTransactionComponentBrandAudit/DoBatchDelete", { id: delidsStr }, function (e) {
|
||||
if (debug) { console.log(e); } //开启调试返回数据
|
||||
table.reloadData('LAY-app-WeChatTransactionComponentBrandAudit-tableBox');
|
||||
layer.msg(e.msg);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//执行提交审核操作
|
||||
function doAudit(checkStatus) {
|
||||
var checkData = checkStatus.data;
|
||||
if (checkData.length === 0) {
|
||||
return layer.msg('请选择您要处理的数据');
|
||||
}
|
||||
coreHelper.Post("Api/WeChatTransactionComponentBrandAudit/DoAudit", { id: checkData[0].id }, function (e) {
|
||||
if (debug) { console.log(e); } //开启调试返回数据
|
||||
table.reloadData('LAY-app-WeChatTransactionComponentBrandAudit-tableBox');
|
||||
layer.msg(e.msg);
|
||||
});
|
||||
}
|
||||
|
||||
//重载form
|
||||
form.render();
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
<title>自定义交易组件快递公司</title>
|
||||
<!--当前位置开始-->
|
||||
<div class="layui-card layadmin-header">
|
||||
<div class="layui-breadcrumb" lay-filter="breadcrumb">
|
||||
<script type="text/html" template lay-done="layui.data.updateMainBreadcrumb();">
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<!--当前位置结束-->
|
||||
<style>
|
||||
/* 重写样式 */
|
||||
</style>
|
||||
<script type="text/html" template lay-type="Post" lay-url="{{ layui.setter.apiUrl }}Api/WeChatTransactionComponentDeliveryCompany/GetIndex" lay-done="layui.data.done(d);">
|
||||
|
||||
</script>
|
||||
<div class="table-body">
|
||||
<table id="LAY-app-WeChatTransactionComponentDeliveryCompany-tableBox" lay-filter="LAY-app-WeChatTransactionComponentDeliveryCompany-tableBox"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="LAY-app-WeChatTransactionComponentDeliveryCompany-toolbar">
|
||||
<div class="layui-form coreshop-toolbar-search-form">
|
||||
<div class="layui-form-item">
|
||||
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="deliveryId" placeholder="请输入快递公司编码" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="deliveryName" placeholder="请输入快递公司名称" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button class="layui-btn layui-btn-sm" lay-submit lay-filter="LAY-app-WeChatTransactionComponentDeliveryCompany-search"><i class="layui-icon layui-icon-search"></i>筛选</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="LAY-app-WeChatTransactionComponentDeliveryCompany-pagebar">
|
||||
<div class="layui-btn-container">
|
||||
<button class="layui-btn layui-btn-sm" lay-event="addData"><i class="layui-icon layui-icon-add-1"></i>更新数据</button>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var indexData;
|
||||
var debug = layui.setter.debug;
|
||||
layui.data.done = function (d) {
|
||||
//开启调试情况下获取接口赋值数据
|
||||
if (debug) { console.log(d); }
|
||||
|
||||
indexData = d.data;
|
||||
layui.use(['index', 'table', 'laydate', 'util', 'coredropdown', 'coreHelper'],
|
||||
function () {
|
||||
var $ = layui.$
|
||||
, admin = layui.admin
|
||||
, table = layui.table
|
||||
, form = layui.form
|
||||
, laydate = layui.laydate
|
||||
, setter = layui.setter
|
||||
, coreHelper = layui.coreHelper
|
||||
, util = layui.util
|
||||
, view = layui.view;
|
||||
|
||||
//重载form
|
||||
form.render();
|
||||
var searchwhere;
|
||||
//监听搜索
|
||||
form.on('submit(LAY-app-WeChatTransactionComponentDeliveryCompany-search)',
|
||||
function (data) {
|
||||
var field = data.field;
|
||||
searchwhere = field;
|
||||
//执行重载
|
||||
table.reloadData('LAY-app-WeChatTransactionComponentDeliveryCompany-tableBox', { where: field });
|
||||
});
|
||||
//数据绑定
|
||||
table.render({
|
||||
elem: '#LAY-app-WeChatTransactionComponentDeliveryCompany-tableBox',
|
||||
url: layui.setter.apiUrl + 'Api/WeChatTransactionComponentDeliveryCompany/GetPageList',
|
||||
method: 'POST',
|
||||
toolbar: '#LAY-app-WeChatTransactionComponentDeliveryCompany-toolbar',
|
||||
pagebar: '#LAY-app-WeChatTransactionComponentDeliveryCompany-pagebar',
|
||||
className: 'pagebarbox',
|
||||
defaultToolbar: ['filter', 'print', 'exports'],
|
||||
height: 'full-127',//面包屑142px,搜索框4行172,3行137,2行102,1行67
|
||||
page: true,
|
||||
limit: 30,
|
||||
limits: [10, 15, 20, 25, 30, 50, 100, 200],
|
||||
text: { none: '暂无相关数据' },
|
||||
cols: [
|
||||
[
|
||||
{ type: "checkbox", fixed: "left" },
|
||||
{ field: 'deliveryId', title: '快递公司编码', sort: false, width: 205 },
|
||||
{ field: 'deliveryName', title: '快递公司名称', sort: false, width: 205 },
|
||||
]
|
||||
]
|
||||
});
|
||||
//监听排序事件
|
||||
table.on('sort(LAY-app-WeChatTransactionComponentDeliveryCompany-tableBox)', function (obj) {
|
||||
table.reloadData('LAY-app-WeChatTransactionComponentDeliveryCompany-tableBox', {
|
||||
initSort: obj, //记录初始排序,如果不设的话,将无法标记表头的排序状态。
|
||||
where: { //请求参数(注意:这里面的参数可任意定义,并非下面固定的格式)
|
||||
orderField: obj.field, //排序字段
|
||||
orderDirection: obj.type //排序方式
|
||||
}
|
||||
});
|
||||
});
|
||||
//监听行双击事件
|
||||
table.on('rowDouble(LAY-app-WeChatTransactionComponentDeliveryCompany-tableBox)', function (obj) {
|
||||
//查看详情
|
||||
doDetails(obj);
|
||||
});
|
||||
//头工具栏事件
|
||||
table.on('pagebar(LAY-app-WeChatTransactionComponentDeliveryCompany-tableBox)', function (obj) {
|
||||
var checkStatus = table.checkStatus(obj.config.id);
|
||||
switch (obj.event) {
|
||||
case 'addData':
|
||||
doCreate();
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
//执行单个删除
|
||||
function doCreate() {
|
||||
coreHelper.Post("Api/WeChatTransactionComponentDeliveryCompany/DoGetCompanyList", null, function (e) {
|
||||
if (debug) { console.log(e); } //开启调试返回数据
|
||||
table.reloadData('LAY-app-WeChatTransactionComponentDeliveryCompany-tableBox');
|
||||
layer.msg(e.msg);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -1,418 +0,0 @@
|
||||
<script type="text/html" template lay-done="layui.data.done(d);">
|
||||
<div class="layui-form coreshop-form layui-form-pane transactioncomponent" lay-filter="LAY-app-WeChatTransactionComponentGood-createForm" id="LAY-app-WeChatTransactionComponentGood-createForm">
|
||||
|
||||
<input type="hidden" name="productId" value="0" />
|
||||
<input type="hidden" name="outProductId" id="outProductId" value="0" />
|
||||
<input type="hidden" name="skuCount" id="skuCount" value="0" />
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="title" class="layui-form-label layui-form-required">选择商品</label>
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn" style="margin-left: 10px;" lay-active="goods_show"><i class="layui-icon layui-icon-ok"></i>选择商品</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="title" class="layui-form-label layui-form-required">商品标题</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="title" id="title" lay-verify="required|verifytitle" class="layui-input" lay-reqText="请输入商品标题" placeholder="请输入商品标题" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="path" class="layui-form-label layui-form-required">小程序路径</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="path" id="path" lay-verify="required|verifypath" class="layui-input" lay-reqText="请输入小程序路径" placeholder="请输入小程序路径" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="brand_id" class="layui-form-label layui-form-required">品牌id</label>
|
||||
<div class="layui-input-inline layui-inline-4">
|
||||
<select name="brandId">
|
||||
<option value="0" selected="selected">无品牌</option>
|
||||
{{# layui.each(d.params.data.brand, function(index, item){ }}
|
||||
<option value="{{ item.brandId }}" {{d.params.data.model.brandId == item.brandId ? 'selected="selected"' :''}}>{{ item.brand_wording }}</option>
|
||||
{{# }); }}
|
||||
</select>
|
||||
</div>
|
||||
<label for="thirdCatId" class="layui-form-label layui-form-required">所属类目</label>
|
||||
<div class="layui-input-inline layui-inline-1">
|
||||
<input type="number" min="0" max="999999" name="thirdCatId" id="thirdCatId" lay-verify="required|number" class="layui-input" value="0" placeholder="请选择类目名称ID" lay-reqText="请选择类目名称" readonly="readonly" />
|
||||
</div>
|
||||
<div class="layui-input-inline layui-inline-3">
|
||||
<input type="text" name="thirdCatName" id="thirdCatName" lay-verify="required" class="layui-input" placeholder="请选择类目名称" lay-reqText="请选择类目名称" readonly="readonly" />
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<button class="layui-btn layui-btn-normal" lay-active="getThirdCategories"><i class="layui-icon layui-icon-ok"></i>选择三级分类</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<fieldset class="layui-elem-field layui-field-title site-title"><legend><a name="compress">图集</a></legend></fieldset>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline layui-inline-2">
|
||||
<input type="hidden" name="headImg" id="headImg" class="layui-input" placeholder="请上传缩略图" lay-reqText="请上传缩略图" />
|
||||
<button type="button" class="layui-btn layui-btn-sm" id="upBtnimageIds"><i class="layui-icon"></i>上传图片</button>
|
||||
</div>
|
||||
<div class="layui-input-inline layui-inline-5">
|
||||
<button type="button" class="layui-btn layui-btn-sm" lay-active="doSycnWeChatProductImages"><i class="layui-icon"></i>同步商城图片到微信云服务器</button>
|
||||
</div>
|
||||
<div class="layui-input-inline layui-inline-12">
|
||||
请保证图集地址域名为:【store.mp.video.tencent-cloud.com】【mmbizurl.cn】【mmecimage.cn/p/】中某个
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-upload-list" id="upload-more-list"></div>
|
||||
</div>
|
||||
|
||||
<fieldset class="layui-elem-field layui-field-title site-title"><legend><a name="products">货品</a></legend></fieldset>
|
||||
|
||||
<div id="products">
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label for="descInfoDesc" class="layui-form-label layui-form-required">商品详情图文</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="document-editor">
|
||||
<div class="toolbar-container" id="toolbar-container"></div>
|
||||
<div class="content-container">
|
||||
<div id="editor"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item text-right core-hidden">
|
||||
<input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-WeChatTransactionComponentGood-createForm-submit" id="LAY-app-WeChatTransactionComponentGood-createForm-submit" value="确认添加">
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script id="image_tpl" type="text/html">
|
||||
<table class="layui-table" lay-size="sm">
|
||||
<colgroup>
|
||||
<col width="110">
|
||||
<col>
|
||||
<col width="150">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>图片</th>
|
||||
<th>地址</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="productsTbody">
|
||||
{{# layui.each(d, function(index, item){ }}
|
||||
<tr data-index="{{ index }}">
|
||||
<td>
|
||||
<img src="{{ item }}" id="img{{ index }}" class="layui-upload-img" onclick='layui.coreHelper.viewImage("{{ item }}")' style="width: 100px; height: 100px;">
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" value="{{ item }}" class="layui-input" readonly="readonly" />
|
||||
</td>
|
||||
<td>
|
||||
<a class="layui-btn layui-btn-xs" lay-active="delImg">删除</a>
|
||||
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-active="setDefault">设为主图</a>
|
||||
</td>
|
||||
</tr>
|
||||
{{# }); }}
|
||||
</tbody>
|
||||
</table>
|
||||
</script>
|
||||
|
||||
<script id="getSpec_tpl" type="text/html">
|
||||
<table class="layui-table" lay-size="sm">
|
||||
<colgroup>
|
||||
<col width="80">
|
||||
<col width="80">
|
||||
<col width="150">
|
||||
<col>
|
||||
<col width="80">
|
||||
<col width="80">
|
||||
<col width="80">
|
||||
<col width="80">
|
||||
<col width="80">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>默认货品</th>
|
||||
<th>图片</th>
|
||||
<th>货号</th>
|
||||
<th>规格</th>
|
||||
<th>库存</th>
|
||||
<th>销售价</th>
|
||||
<th>成本价</th>
|
||||
<th>市场价</th>
|
||||
<th>是否选择</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="productsTbody">
|
||||
{{# layui.each(d, function(index, item){ }}
|
||||
<tr>
|
||||
<td rowspan="2">
|
||||
<input type="hidden" value="{{item.id}}" name="product[outProductId][]" />
|
||||
<input type="hidden" value="{{item.id}}" name="product[outSkuId][]" />
|
||||
<input type="checkbox" name="product[isDefalut][]" {{item.isDefalut? 'checked="true"':''}} value="{{item.isDefalut? '1':'0'}}" lay-skin="switch" lay-text="是|否" disabled>
|
||||
</td>
|
||||
<td class="spec-td" rowspan="2" style="text-align: center;">
|
||||
<img src="{{ item.images && item.images !='null'? item.images : layui.setter.noImagePicUrl }}" style="width:80px;height:80px">
|
||||
<button type="button" class="layui-btn layui-btn-xs" style="margin-top: 10px;" lay-active="doSycnWeChatProductImagesSingle"><i class="layui-icon"></i>同步图片</button>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="product[barCode][]" value="{{item.sn}}" readonly="readonly" placeholder="货号" class="layui-input layui-inline-3">
|
||||
</td>
|
||||
<td>
|
||||
<input type="hidden" name="product[spesDesc][]" value="{{item.spesDesc}}" placeholder="规格" class="layui-input">
|
||||
{{item.spesDesc}}
|
||||
</td>
|
||||
<td class="have-add-td">
|
||||
<input type="number" name="product[stockNum][]" value="{{item.stock}}" placeholder="库存" class="layui-input layui-inline-1 goods-stock">
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="product[salePrice][]" value="{{item.price}}" placeholder="销售价" class="layui-input layui-inline-1">
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="product[costprice][]" value="{{item.costprice}}" placeholder="成本价" class="layui-input layui-inline-1">
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="product[marketPrice][]" value="{{item.mktprice}}" placeholder="市场价" class="layui-input layui-inline-1">
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" name="product[isSelect][]" checked="checked" lay-skin="primary">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<input type="text" name="product[thumbImg][]" value="{{ item.images && item.images !='null'? item.images : layui.setter.noImagePicUrl }}" class="layui-input layui-inline-14" readonly="readonly" />
|
||||
</td>
|
||||
</tr>
|
||||
{{# }); }}
|
||||
</tbody>
|
||||
</table>
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var $;
|
||||
var imgs = [];
|
||||
var debug = layui.setter.debug;
|
||||
layui.data.done = function (d) {
|
||||
//开启调试情况下获取接口赋值数据
|
||||
if (debug) { console.log(d.params.data); }
|
||||
layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg', 'util', 'laytpl', 'view'],
|
||||
function () {
|
||||
$ = layui.$;
|
||||
var form = layui.form
|
||||
, admin = layui.admin
|
||||
, laydate = layui.laydate
|
||||
, upload = layui.upload
|
||||
, cropperImg = layui.cropperImg
|
||||
, util = layui.util
|
||||
, view = layui.view
|
||||
, laytpl = layui.laytpl
|
||||
, coreHelper = layui.coreHelper;
|
||||
|
||||
//加载编辑器
|
||||
var Authorization = layui.data(layui.setter.tableName)[layui.setter.request.tokenName];
|
||||
editor = CKEDITOR.replace('editor', {
|
||||
fileTools_requestHeaders: {
|
||||
'Authorization': Authorization
|
||||
}
|
||||
});
|
||||
|
||||
//处理属性 为 lay-active 的所有元素事件
|
||||
util.event('lay-active', {
|
||||
goods_show: function () {
|
||||
admin.popup({
|
||||
shadeClose: false,
|
||||
title: '选择商品',
|
||||
area: ['750px', '600px'],
|
||||
id: 'LAY-app-CoreCmsPinTuanRule-createForm-GetGoodsList',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('common/getGoodAndSku', null).done(function () {
|
||||
form.render();
|
||||
//监听商品列表页工具条
|
||||
var obj_goodsIds = {};
|
||||
form.on('submit(LAY-app-CoreCmsGoods-getData)',
|
||||
function (data) {
|
||||
console.log(ids);
|
||||
if (!!!ids) {
|
||||
layer.msg("请先选择商品");
|
||||
return;
|
||||
}
|
||||
|
||||
$('#outProductId').val(ids.id);
|
||||
$('#title').val(ids.name);
|
||||
$('#path').val('pages/goods/goodDetails/goodDetails?id=' + ids.id);
|
||||
window.editor.setData(ids.intro);
|
||||
|
||||
|
||||
if (ids.images) {
|
||||
imgs = ids.images.split(',');
|
||||
$('#headImg').val(imgs);
|
||||
var getTpl = image_tpl.innerHTML, viewBox = document.getElementById('upload-more-list');
|
||||
laytpl(getTpl).render(imgs, function (html) {
|
||||
viewBox.innerHTML = html;
|
||||
});
|
||||
}
|
||||
|
||||
$('#skuCount').val(ids.sku.length);
|
||||
|
||||
//初始化商品信息
|
||||
var getTpl = getSpec_tpl.innerHTML, viewBox = document.getElementById('products');
|
||||
var tmpData = ids.sku;
|
||||
laytpl(getTpl).render(tmpData, function (html) {
|
||||
viewBox.innerHTML = html;
|
||||
});
|
||||
form.render();
|
||||
layer.close(index);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}, getThirdCategories: function () {
|
||||
admin.popup({
|
||||
shadeClose: false,
|
||||
title: '选择三级分类',
|
||||
area: ['1000px', '600px'],
|
||||
id: 'LAY-app-GetThirdCategories',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('wechat/transactioncomponent/goods/getThirdCategories', null).done(function () {
|
||||
form.render();
|
||||
//监听商品列表页工具条
|
||||
var obj_goodsIds = {};
|
||||
form.on('submit(LAY-app-GetThirdCategories-getData)',
|
||||
function (data) {
|
||||
console.log(ids);
|
||||
if (!!!ids) {
|
||||
layer.msg("请先选择三级分类");
|
||||
return;
|
||||
}
|
||||
|
||||
$('#thirdCatId').val(ids.third_cat_id);
|
||||
$('#thirdCatName').val(ids.third_cat_name);
|
||||
|
||||
form.render();
|
||||
layer.close(index);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
upLoadImage: function (othis) {
|
||||
var imgDiv = $(othis).parent().parent();
|
||||
var imageUrl = imgDiv.find('img').attr("src");
|
||||
},
|
||||
delImg: function (othis) {
|
||||
var imgDiv = $(othis).parent().parent();
|
||||
imgDiv.remove();
|
||||
var imageUrl = imgDiv.find('img').attr("src");
|
||||
var index = imgs.indexOf(imageUrl);
|
||||
if (index > -1) {
|
||||
imgs.splice(index, 1);
|
||||
}
|
||||
$('#headImg').val(imgs);
|
||||
console.log(imgs);
|
||||
refreshImages();
|
||||
},
|
||||
setDefault: function (othis) {
|
||||
var imgDiv = $(othis).parent().parent();
|
||||
$("#upload-more-list").prepend(imgDiv);
|
||||
var imageUrl = imgDiv.find('img').attr("src");
|
||||
var index = imgs.indexOf(imageUrl);
|
||||
if (index > -1) {
|
||||
imgs.unshift(imgs.splice(index, 1)[0]);
|
||||
}
|
||||
$('#headImg').val(imgs);
|
||||
console.log(imgs);
|
||||
refreshImages();
|
||||
},
|
||||
doSycnWeChatProductImages: function () {
|
||||
if (imgs.length > 0) {
|
||||
//执行交换url操作
|
||||
coreHelper.Post("Api/Tools/MiNiShopOpenComponent2_UploadImgByUrlArr", { id: imgs }, function (res) {
|
||||
if (debug) { console.log(res); } //开启调试返回数据
|
||||
if (res.code == 0) {
|
||||
imgs = res.data;
|
||||
$('#headImg').val(imgs);
|
||||
refreshImages();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.msg('请先上传图片或选择商品获取图集');
|
||||
}
|
||||
},
|
||||
doSycnWeChatProductImagesSingle: function (othis) {
|
||||
var imgObj = $(othis).prev().attr('src');
|
||||
console.log(imgObj);
|
||||
coreHelper.Post("Api/Tools/MiNiShopOpenComponent2_UploadImgByUrlSingle", { id: imgObj }, function (res) {
|
||||
if (debug) { console.log(res); } //开启调试返回数据
|
||||
if (res.code == 0) {
|
||||
$(othis).parent().parent().next().find("input[name='product[thumbImg][]']").val(res.data);
|
||||
} else {
|
||||
layer.msg(res.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
function refreshImages() {
|
||||
var getTpl = image_tpl.innerHTML, view = document.getElementById('upload-more-list');
|
||||
laytpl(getTpl).render(imgs, function (html) {
|
||||
view.innerHTML = html;
|
||||
});
|
||||
console.log(imgs);
|
||||
}
|
||||
|
||||
//设为默认图
|
||||
function setDefault(obj, imageUrl) {
|
||||
var imgDiv = $(obj).parent().parent();
|
||||
$("#upload-more-list").prepend(imgDiv);
|
||||
var index = imgs.indexOf(imageUrl);
|
||||
if (index > -1) {
|
||||
imgs.unshift(imgs.splice(index, 1)[0]);
|
||||
}
|
||||
$('#headImg').val(imgs);
|
||||
console.log(imgs);
|
||||
refreshImages();
|
||||
}
|
||||
|
||||
//图集上传
|
||||
upload.render({
|
||||
elem: '#upBtnimageIds'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/MiNiShopOpenComponent2_UploadImg'
|
||||
, before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
layer.msg('上传中', { icon: 16, shade: 0.4 });
|
||||
});
|
||||
}
|
||||
, done: function (res) {
|
||||
layer.closeAll('loading'); //关闭加载层
|
||||
if (res.code > 0) {
|
||||
return layer.msg('上传失败');
|
||||
}
|
||||
layer.msg('上传成功');
|
||||
imgs.push(res.data.fileUrl);
|
||||
$('#headImg').val(imgs);
|
||||
refreshImages();
|
||||
}
|
||||
, error: function () {
|
||||
return layer.msg('上传失败,请重试!');
|
||||
}
|
||||
});
|
||||
|
||||
form.verify({
|
||||
verifyoutProductId: [/^.{0,50}$/, '商品序列最大只允许输入50位字符'],
|
||||
verifytitle: [/^.{0,255}$/, '商品标题最大只允许输入255位字符'],
|
||||
verifypath: [/^.{0,255}$/, '小程序路径最大只允许输入255位字符'],
|
||||
verifyheadImg: [/^.{0,500}$/, '主图列表最大只允许输入500位字符'],
|
||||
verifyqualificationPics: [/^.{0,500}$/, '商品资质图片列表最大只允许输入500位字符'],
|
||||
verifydescInfoImgs: [/^.{0,500}$/, '商品详情图片列表最大只允许输入500位字符'],
|
||||
verifyinfoVersion: [/^.{0,50}$/, '预留字段最大只允许输入50位字符'],
|
||||
});
|
||||
//重载form
|
||||
form.render(null, 'LAY-app-WeChatTransactionComponentGood-createForm');
|
||||
|
||||
})
|
||||
};
|
||||
</script>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user