mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 18:33:27 +08:00
# 2022-01-22
### 开源社区版(会员专业版同步修改): --无修改 ### 0.1.1 会员专业版: 【新增】增加微信支付服务商配置,支付微信支付服务商及子商户功能。 【新增】增加根据不同下单类型,控制不同的下单送货模式的功能,如普通商品购买只需要【物流快递,同城配送】,团购秒杀只需要【同城配送,上门自提】,可后台自定义。 【新增】微信直播带货功能新增【上传图片】功能,可直接将本地图片上传至微信侧,获取cdn图片进行处理。 【更新】nuget更新组件。 【修复】修复首页商品组件图片高度被错写array的问题。 【修复】修复生成海报保存路径问题,调整开发版或者预览版小程序获取不到的二维码的报错问题。 【优化】调整订单详情商品tag未设置宽度,导致撑破容易的问题。 【修复】调整订单列表左侧图片大小,防止被遮挡。I4PP1F 【修复】修复微信自定义交易组件申请商品类目失败的问题。#I4QE17
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="6.0.0" />
|
||||
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="2.5.0" />
|
||||
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="2.7.0" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.2.88" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DotLiquid" Version="2.2.585" />
|
||||
<PackageReference Include="sqlSugarCore" Version="5.0.5.3" />
|
||||
<PackageReference Include="DotLiquid" Version="2.2.595" />
|
||||
<PackageReference Include="sqlSugarCore" Version="5.0.5.4" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -283,6 +283,8 @@
|
||||
public const string CacheWeChatTCThirdCatList = "CacheWeChatTCThirdCatList";
|
||||
public const string CacheWeChatTransactionComponentGood = "CacheWeChatTransactionComponentGood";
|
||||
public const string CacheWeChatTransactionComponentDeliveryCompany = "CacheWeChatTransactionComponentDeliveryCompany";
|
||||
public const string CacheCoreCmsOrderDistributionModel = "CacheCoreCmsOrderDistributionModel";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -374,18 +376,17 @@
|
||||
public const string AfterSalesReview = "AfterSalesReview";
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 日志队列
|
||||
/// </summary>
|
||||
public const string LogingQueue = "LogingQueue";
|
||||
public const string Loging = "LogingQueue";
|
||||
/// <summary>
|
||||
/// 短信发送队列
|
||||
/// </summary>
|
||||
public const string SmsQueue = "SmsQueue";
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 微信自定义交易组件-同步订单状态
|
||||
/// </summary>
|
||||
@@ -404,11 +405,18 @@
|
||||
public const string TransactionComponentAfterSaleCreateSync = "TransactionComponentAfterSaleCreateSyncQueue";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//用户相关
|
||||
|
||||
//订单支付成功后,用户升级处理
|
||||
public const string UserUpGrade = "UserUpGradeQueue";
|
||||
|
||||
//消息相关
|
||||
|
||||
//发送微信模板消息
|
||||
public const string MessageSendWxMessageTemplet = "MessageSendWxMessageTempletQueue";
|
||||
|
||||
|
||||
}
|
||||
@@ -439,5 +447,4 @@
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<PackageReference Include="Microsoft.OpenApi" Version="1.2.3" />
|
||||
<PackageReference Include="Qc.YilianyunSdk" Version="1.0.7" />
|
||||
<PackageReference Include="SqlSugar.IOC" Version="1.7.0" />
|
||||
<PackageReference Include="sqlSugarCore" Version="5.0.5.3" />
|
||||
<PackageReference Include="sqlSugarCore" Version="5.0.5.4" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="7.0.2" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/1/21 2:34:32
|
||||
* 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 ICoreCmsOrderDistributionModelRepository : IBaseRepository<CoreCmsOrderDistributionModel>
|
||||
{
|
||||
#region 重写增删改查操作===========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> InsertAsync(CoreCmsOrderDistributionModel entity);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> UpdateAsync(CoreCmsOrderDistributionModel entity);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> UpdateAsync(List<CoreCmsOrderDistributionModel> entity);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> DeleteByIdAsync(object id);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID集合的数据(批量删除)
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids);
|
||||
|
||||
#endregion
|
||||
|
||||
#region 获取缓存的所有数据==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 获取缓存的所有数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<CoreCmsOrderDistributionModel>> GetCaChe();
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
Task<List<CoreCmsOrderDistributionModel>> UpdateCaChe();
|
||||
|
||||
#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>
|
||||
new Task<IPageList<CoreCmsOrderDistributionModel>> QueryPageAsync(
|
||||
Expression<Func<CoreCmsOrderDistributionModel, bool>> predicate,
|
||||
Expression<Func<CoreCmsOrderDistributionModel, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/1/21 2:34:32
|
||||
* 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 ICoreCmsOrderDistributionModelServices : IBaseServices<CoreCmsOrderDistributionModel>
|
||||
{
|
||||
#region 重写增删改查操作===========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> InsertAsync(CoreCmsOrderDistributionModel entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> UpdateAsync(CoreCmsOrderDistributionModel entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> UpdateAsync(List<CoreCmsOrderDistributionModel> entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> DeleteByIdAsync(object id);
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID集合的数据(批量删除)
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids);
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 获取缓存的所有数据==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 获取缓存的所有数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<CoreCmsOrderDistributionModel>> GetCaChe();
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
Task<List<CoreCmsOrderDistributionModel>> UpdateCaChe();
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
/// <param name="predicate">判断集合</param>
|
||||
/// <param name="orderByType">排序方式</param>
|
||||
/// <param name="pageIndex">当前页面索引</param>
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
new Task<IPageList<CoreCmsOrderDistributionModel>> QueryPageAsync(
|
||||
Expression<Func<CoreCmsOrderDistributionModel, bool>> predicate,
|
||||
Expression<Func<CoreCmsOrderDistributionModel, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="sqlSugarCore" Version="5.0.5.3" />
|
||||
<PackageReference Include="sqlSugarCore" Version="5.0.5.4" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
104
CoreCms.Net.Model/Entities/Shop/CoreCmsOrderDistributionModel.cs
Normal file
104
CoreCms.Net.Model/Entities/Shop/CoreCmsOrderDistributionModel.cs
Normal file
@@ -0,0 +1,104 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/1/21 2:47:59
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using SqlSugar;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CoreCms.Net.Model.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// 订单配送模式
|
||||
/// </summary>
|
||||
public partial class CoreCmsOrderDistributionModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
public CoreCmsOrderDistributionModel()
|
||||
{
|
||||
}
|
||||
|
||||
/// <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}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 orderType { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述
|
||||
/// </summary>
|
||||
[Display(Name = "描述")]
|
||||
|
||||
|
||||
[StringLength(maximumLength:255,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String description { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 物流快递
|
||||
/// </summary>
|
||||
[Display(Name = "物流快递")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Boolean isOpenMailing { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 同城配送
|
||||
/// </summary>
|
||||
[Display(Name = "同城配送")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Boolean isOpenHomeDelivery { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 上门自提
|
||||
/// </summary>
|
||||
[Display(Name = "上门自提")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Boolean isOpenSelfDelivery { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
<PackageReference Include="Essensoft.Paylink.WeChatPay" Version="4.0.8" />
|
||||
<PackageReference Include="InitQ" Version="1.0.0.9" />
|
||||
<PackageReference Include="Qc.YilianyunSdk" Version="1.0.7" />
|
||||
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="2.5.0" />
|
||||
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="2.7.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -10,10 +10,10 @@ namespace CoreCms.Net.RedisMQ.Subscribe
|
||||
public class DemoSubscribe : IRedisSubscribe
|
||||
{
|
||||
|
||||
[Subscribe(RedisMessageQueueKey.LogingQueue)]
|
||||
[Subscribe(RedisMessageQueueKey.Loging)]
|
||||
private async Task SubRedisOrder2(string msg)
|
||||
{
|
||||
NLogUtil.WriteDbLog(LogLevel.Debug, LogType.RedisMessageQueue, "消息队列", $"接口端订阅从队列{RedisMessageQueueKey.LogingQueue} 接受到 消息:{msg}");
|
||||
NLogUtil.WriteDbLog(LogLevel.Debug, LogType.RedisMessageQueue, "消息队列", $"接口端订阅从队列{RedisMessageQueueKey.Loging} 接受到 消息:{msg}");
|
||||
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DotLiquid" Version="2.2.585" />
|
||||
<PackageReference Include="DotLiquid" Version="2.2.595" />
|
||||
<PackageReference Include="Essensoft.Paylink.WeChatPay" Version="4.0.8" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -0,0 +1,239 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/1/21 2:34:32
|
||||
* 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 CoreCmsOrderDistributionModelRepository : BaseRepository<CoreCmsOrderDistributionModel>, ICoreCmsOrderDistributionModelRepository
|
||||
{
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
public CoreCmsOrderDistributionModelRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
|
||||
{
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsOrderDistributionModel entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0;
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
|
||||
if (bl)
|
||||
{
|
||||
await UpdateCaChe();
|
||||
}
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsOrderDistributionModel entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var oldModel = await DbClient.Queryable<CoreCmsOrderDistributionModel>().In(entity.id).SingleAsync();
|
||||
if (oldModel == null)
|
||||
{
|
||||
jm.msg = "不存在此信息";
|
||||
return jm;
|
||||
}
|
||||
//事物处理过程开始
|
||||
oldModel.id = entity.id;
|
||||
oldModel.orderType = entity.orderType;
|
||||
oldModel.description = entity.description;
|
||||
oldModel.isOpenMailing = entity.isOpenMailing;
|
||||
oldModel.isOpenHomeDelivery = entity.isOpenHomeDelivery;
|
||||
oldModel.isOpenSelfDelivery = entity.isOpenSelfDelivery;
|
||||
|
||||
//事物处理过程结束
|
||||
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
if (bl)
|
||||
{
|
||||
await UpdateCaChe();
|
||||
}
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsOrderDistributionModel> entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Updateable(entity).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
if (bl)
|
||||
{
|
||||
await UpdateCaChe();
|
||||
}
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsOrderDistributionModel>(id).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
if (bl)
|
||||
{
|
||||
await UpdateCaChe();
|
||||
}
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID集合的数据(批量删除)
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsOrderDistributionModel>().In(ids).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
if (bl)
|
||||
{
|
||||
await UpdateCaChe();
|
||||
}
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 获取缓存的所有数据==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 获取缓存的所有数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<CoreCmsOrderDistributionModel>> GetCaChe()
|
||||
{
|
||||
var cache = ManualDataCache.Instance.Get<List<CoreCmsOrderDistributionModel>>(GlobalConstVars.CacheCoreCmsOrderDistributionModel);
|
||||
if (cache != null)
|
||||
{
|
||||
return cache;
|
||||
}
|
||||
return await UpdateCaChe();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
public async Task<List<CoreCmsOrderDistributionModel>> UpdateCaChe()
|
||||
{
|
||||
var list = await DbClient.Queryable<CoreCmsOrderDistributionModel>().With(SqlWith.NoLock).ToListAsync();
|
||||
ManualDataCache.Instance.Set(GlobalConstVars.CacheCoreCmsOrderDistributionModel, list);
|
||||
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 new async Task<IPageList<CoreCmsOrderDistributionModel>> QueryPageAsync(Expression<Func<CoreCmsOrderDistributionModel, bool>> predicate,
|
||||
Expression<Func<CoreCmsOrderDistributionModel, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
RefAsync<int> totalCount = 0;
|
||||
List<CoreCmsOrderDistributionModel> page;
|
||||
if (blUseNoLock)
|
||||
{
|
||||
page = await DbClient.Queryable<CoreCmsOrderDistributionModel>()
|
||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||
.WhereIF(predicate != null, predicate).Select(p => new CoreCmsOrderDistributionModel
|
||||
{
|
||||
id = p.id,
|
||||
orderType = p.orderType,
|
||||
description = p.description,
|
||||
isOpenMailing = p.isOpenMailing,
|
||||
isOpenHomeDelivery = p.isOpenHomeDelivery,
|
||||
isOpenSelfDelivery = p.isOpenSelfDelivery,
|
||||
|
||||
}).With(SqlWith.NoLock).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
page = await DbClient.Queryable<CoreCmsOrderDistributionModel>()
|
||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||
.WhereIF(predicate != null, predicate).Select(p => new CoreCmsOrderDistributionModel
|
||||
{
|
||||
id = p.id,
|
||||
orderType = p.orderType,
|
||||
description = p.description,
|
||||
isOpenMailing = p.isOpenMailing,
|
||||
isOpenHomeDelivery = p.isOpenHomeDelivery,
|
||||
isOpenSelfDelivery = p.isOpenSelfDelivery,
|
||||
|
||||
}).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
}
|
||||
var list = new PageList<CoreCmsOrderDistributionModel>(page, pageIndex, pageSize, totalCount);
|
||||
return list;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.4" />
|
||||
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="1.0.0-beta13" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
|
||||
<PackageReference Include="Tencent.QCloud.Cos.Sdk" Version="5.4.25" />
|
||||
<PackageReference Include="Tencent.QCloud.Cos.Sdk" Version="5.4.26" />
|
||||
<PackageReference Include="ToolGood.Words" Version="3.0.3.1" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/1/21 2:34:32
|
||||
* 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 CoreCmsOrderDistributionModelServices : BaseServices<CoreCmsOrderDistributionModel>, ICoreCmsOrderDistributionModelServices
|
||||
{
|
||||
private readonly ICoreCmsOrderDistributionModelRepository _dal;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
|
||||
public CoreCmsOrderDistributionModelServices(IUnitOfWork unitOfWork, ICoreCmsOrderDistributionModelRepository dal)
|
||||
{
|
||||
this._dal = dal;
|
||||
base.BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsOrderDistributionModel entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsOrderDistributionModel entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsOrderDistributionModel> entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
{
|
||||
return await _dal.DeleteByIdAsync(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID集合的数据(批量删除)
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids)
|
||||
{
|
||||
return await _dal.DeleteByIdsAsync(ids);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 获取缓存的所有数据==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 获取缓存的所有数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<CoreCmsOrderDistributionModel>> GetCaChe()
|
||||
{
|
||||
return await _dal.GetCaChe();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
public async Task<List<CoreCmsOrderDistributionModel>> UpdateCaChe()
|
||||
{
|
||||
return await _dal.UpdateCaChe();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
/// <param name="predicate">判断集合</param>
|
||||
/// <param name="orderByType">排序方式</param>
|
||||
/// <param name="pageIndex">当前页面索引</param>
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsOrderDistributionModel>> QueryPageAsync(Expression<Func<CoreCmsOrderDistributionModel, bool>> predicate,
|
||||
Expression<Func<CoreCmsOrderDistributionModel, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -103,6 +103,8 @@ const install = (Vue, vm) => {
|
||||
let orderList = (params, config = {}) => http.post('/Api/Order/GetOrderList', params, { custom: { methodName: 'order.getorderlist', needToken: true } });
|
||||
// 获取订单不同状态的数量
|
||||
let getOrderStatusSum = (params, config = {}) => http.post('/Api/Order/GetOrderStatusNum', params, { custom: { methodName: 'order.getorderstatusnum', needToken: true } });
|
||||
// 获取不同类型营销下单支持的配送方式
|
||||
let getOrderDistributionModel = (params, config = {}) => http.post('/Api/Order/GetOrderDistributionModel', params, { custom: { methodName: 'order.getOrderdistributionmodel', needToken: true } });
|
||||
|
||||
// 售后单列表
|
||||
let afterSalesList = (params, config = {}) => http.post('/Api/Order/AftersalesList', params, { custom: { methodName: 'order.aftersaleslist', needToken: true } });
|
||||
@@ -439,6 +441,7 @@ const install = (Vue, vm) => {
|
||||
orderShip,
|
||||
orderList,
|
||||
getOrderStatusSum,
|
||||
getOrderDistributionModel,
|
||||
afterSalesList,
|
||||
afterSalesInfo,
|
||||
addAfterSales,
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
</u-navbar>
|
||||
<view class="content">
|
||||
<view class="coreshop-margin-left-10 coreshop-margin-right-10 coreshop-margin-top-10">
|
||||
<u-subsection :list="typeItems" mode="subsection" :current="typeCurrent" @change="onTypeItem" bg-color="#ffffff" active-color="#e54d42" v-if="storeSwitch == 1" style="border-radius:0;"></u-subsection>
|
||||
<u-subsection :list="typeItems" mode="subsection" :current="typeCurrent" @change="onTypeItem" bg-color="#ffffff" active-color="#e54d42" v-if="typeItems.length > 0" style="border-radius:0;"></u-subsection>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view v-show="typeCurrent === 0 || typeCurrent === 1">
|
||||
<view v-show="OrderDistributionModelCurrent === 'isOpenHomeDelivery' || OrderDistributionModelCurrent === 'isOpenMailing'">
|
||||
<!-- 收货地址信息 -->
|
||||
<view class="coreshop-margin-top-10 coreshop-margin-bottom-10 coreshop-common-view-box" v-if="userShip && userShip.id" @click="showAddressList">
|
||||
<view class="coreshop-bg-white coreshop-card address-view">
|
||||
@@ -50,7 +50,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-show="typeCurrent === 2">
|
||||
<view v-show="OrderDistributionModelCurrent === 'isOpenSelfDelivery'">
|
||||
<!-- 门店信息 -->
|
||||
<view class="coreshop-margin-top-10 coreshop-margin-bottom-10 coreshop-common-view-box" v-if="store && store.id" @click="goStorelist()">
|
||||
<view class="coreshop-bg-white coreshop-card address-view">
|
||||
@@ -84,7 +84,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class='coreshop-margin-top-10 coreshop-margin-bottom-10 coreshop-common-view-box' v-if="storeSwitch == 1 && typeCurrent === 2">
|
||||
<view class='coreshop-margin-top-10 coreshop-margin-bottom-10 coreshop-common-view-box' v-if="storeSwitch == 1 && OrderDistributionModelCurrent === 'isOpenSelfDelivery'">
|
||||
<view class="coreshop-form-group">
|
||||
<view class="title">姓名</view>
|
||||
<input class='coreshop-cell-bd-input' placeholder='请输入提货人姓名' v-model="storePick.name" style="width: 100%;"></input>
|
||||
@@ -253,7 +253,8 @@
|
||||
|
||||
data() {
|
||||
return {
|
||||
typeItems: ['快递物流', '同城配送', '门店自提'],
|
||||
typeItems: [],
|
||||
//typeItems: ['快递物流', '同城配送', '门店自提'],
|
||||
typeCurrent: 0,
|
||||
cartData: {}, // 购物车商品详情
|
||||
products: [], // 货品信息
|
||||
@@ -302,6 +303,11 @@
|
||||
objectId: 0,//关联对象序列
|
||||
teamId: 0,//拼团订单分组序列
|
||||
submitStatus: false,
|
||||
isOpenHomeDelivery: true,
|
||||
isOpenMailing: true,
|
||||
isOpenSelfDelivery: true,
|
||||
OrderDistributionModels: [],
|
||||
OrderDistributionModelCurrent: ''
|
||||
}
|
||||
},
|
||||
components: {},
|
||||
@@ -309,7 +315,7 @@
|
||||
console.log(options);
|
||||
let cartIds = options.cartIds;
|
||||
if (options.orderType) {
|
||||
this.params.orderType = options.orderType;
|
||||
this.orderType = options.orderType;
|
||||
this.params.type = options.orderType;
|
||||
}
|
||||
if (options.objectId) {
|
||||
@@ -329,6 +335,8 @@
|
||||
}
|
||||
})
|
||||
}
|
||||
// 获取不同类型营销下单支持的配送方式
|
||||
this.getOrderDistributionModel()
|
||||
// 获取用户的默认收货地址信息
|
||||
this.userDefaultShip()
|
||||
// 获取用户的可用优惠券信息
|
||||
@@ -377,11 +385,13 @@
|
||||
this.typeCurrent = index;
|
||||
}
|
||||
let receiptType = 1;
|
||||
if (this.typeCurrent == 0) {
|
||||
|
||||
this.OrderDistributionModelCurrent = this.OrderDistributionModels[this.typeCurrent];
|
||||
if (this.OrderDistributionModelCurrent == 'isOpenMailing') {
|
||||
receiptType = 1;
|
||||
} else if (this.typeCurrent == 1) {
|
||||
} else if (this.OrderDistributionModelCurrent == 'isOpenHomeDelivery') {
|
||||
receiptType = 2;
|
||||
} else if (this.typeCurrent == 2) {
|
||||
} else if (this.OrderDistributionModelCurrent == 'isOpenSelfDelivery') {
|
||||
receiptType = 3;
|
||||
}
|
||||
this.receiptType = receiptType;
|
||||
@@ -397,6 +407,39 @@
|
||||
console.log("没有收货地址时跳转");
|
||||
this.$u.route('/pages/member/address/list/list?type=order')
|
||||
},
|
||||
// 获取不同类型营销下单支持的配送方式
|
||||
getOrderDistributionModel() {
|
||||
let data = {
|
||||
id: this.orderType
|
||||
};
|
||||
this.$u.api.getOrderDistributionModel(data).then(res => {
|
||||
if (res.status) {
|
||||
//物流快递
|
||||
this.isOpenMailing = res.data.isOpenMailing;
|
||||
//同城配送
|
||||
this.isOpenHomeDelivery = res.data.isOpenHomeDelivery;
|
||||
//上门自提
|
||||
this.isOpenSelfDelivery = res.data.isOpenSelfDelivery;
|
||||
|
||||
let newTypeItems = [];
|
||||
if (this.isOpenMailing) {
|
||||
newTypeItems.push('快递物流');
|
||||
this.OrderDistributionModels.push('isOpenMailing');
|
||||
}
|
||||
if (this.isOpenHomeDelivery) {
|
||||
newTypeItems.push('同城配送');
|
||||
this.OrderDistributionModels.push('isOpenHomeDelivery');
|
||||
}
|
||||
if (this.isOpenSelfDelivery) {
|
||||
newTypeItems.push('门店自提');
|
||||
this.OrderDistributionModels.push('isOpenSelfDelivery');
|
||||
}
|
||||
this.typeItems = newTypeItems;
|
||||
this.OrderDistributionModelCurrent = this.OrderDistributionModels[0];
|
||||
}
|
||||
console.log(res);
|
||||
})
|
||||
},
|
||||
// 获取用户的默认收货地址
|
||||
userDefaultShip() {
|
||||
this.$u.api.userDefaultShip().then(res => {
|
||||
@@ -585,11 +628,11 @@
|
||||
toPay() {
|
||||
this.submitStatus = true;
|
||||
let receiptType = 1;
|
||||
if (this.typeCurrent == 0) {
|
||||
if (this.OrderDistributionModelCurrent == 'isOpenMailing') {
|
||||
receiptType = 1;
|
||||
} else if (this.typeCurrent == 1) {
|
||||
} else if (this.OrderDistributionModelCurrent == 'isOpenHomeDelivery') {
|
||||
receiptType = 2;
|
||||
} else if (this.typeCurrent == 2) {
|
||||
} else if (this.OrderDistributionModelCurrent == 'isOpenSelfDelivery') {
|
||||
receiptType = 3;
|
||||
}
|
||||
this.receiptType = receiptType;
|
||||
@@ -601,7 +644,7 @@
|
||||
receiptType: this.receiptType,
|
||||
objectId: this.objectId,
|
||||
teamId: this.teamId,
|
||||
orderType: this.params.orderType, //订单类型
|
||||
orderType: this.orderType, //订单类型
|
||||
scene: this.$store.state.scene //场景值(用于确定小程序是否来源直播和视频号)
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="2.5.0" />
|
||||
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="2.7.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1586,5 +1586,86 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
//微信自定义交易组件================================================================
|
||||
|
||||
#region 自定义交易组件上传图片====================================================
|
||||
|
||||
/// <summary>
|
||||
/// 自定义交易组件上传图片
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<AdminUiCallBack> MiNiShopOpenComponent2_UploadImg()
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var filesStorageOptions = await _coreCmsSettingServices.GetFilesStorageOptions();
|
||||
//初始化上传参数
|
||||
var maxSize = 1024 * 1024 * filesStorageOptions.MaxSize; //上传大小5M
|
||||
|
||||
var file = Request.Form.Files["file"];
|
||||
if (file == null)
|
||||
{
|
||||
jm.msg = "请选择文件";
|
||||
return jm;
|
||||
}
|
||||
var fileName = file.FileName;
|
||||
var fileExt = Path.GetExtension(fileName).ToLowerInvariant();
|
||||
|
||||
//检查大小
|
||||
if (file.Length > maxSize)
|
||||
{
|
||||
jm.msg = "上传文件大小超过限制,最大允许上传" + filesStorageOptions.MaxSize + "M";
|
||||
return jm;
|
||||
}
|
||||
|
||||
//检查文件扩展名
|
||||
if (string.IsNullOrEmpty(fileExt) || Array.IndexOf(filesStorageOptions.FileTypes.Split(','), fileExt.Substring(1).ToLower()) == -1)
|
||||
{
|
||||
jm.msg = "上传文件扩展名是不允许的扩展名,请上传后缀名为:" + filesStorageOptions.FileTypes;
|
||||
return jm;
|
||||
}
|
||||
|
||||
byte[] bytes;
|
||||
await using (var ms = new MemoryStream())
|
||||
{
|
||||
await file.CopyToAsync(ms);
|
||||
bytes = ms.ToArray();
|
||||
}
|
||||
|
||||
string url = string.Empty;
|
||||
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
|
||||
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
|
||||
var request = new ShopImageUploadRequest();
|
||||
request.AccessToken = accessToken;
|
||||
request.ImageFileBytes = bytes;
|
||||
request.ResponseType = 1;
|
||||
|
||||
var response = await client.ExecuteShopImageUploadAsync(request);
|
||||
if (response.IsSuccessful())
|
||||
{
|
||||
jm.code = 0;
|
||||
jm.msg = "上传成功!";
|
||||
jm.data = new
|
||||
{
|
||||
fileUrl = response.Image.TempImageUrl,
|
||||
src = response.Image.TempImageUrl
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
jm.code = 1;
|
||||
jm.msg = response.ErrorMessage;
|
||||
}
|
||||
jm.otherData = response;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,377 @@
|
||||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2022/1/21 2:34:32
|
||||
* 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 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]
|
||||
public class CoreCmsOrderDistributionModelController : ControllerBase
|
||||
{
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
private readonly ICoreCmsOrderDistributionModelServices _coreCmsOrderDistributionModelServices;
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
///</summary>
|
||||
public CoreCmsOrderDistributionModelController(IWebHostEnvironment webHostEnvironment
|
||||
, ICoreCmsOrderDistributionModelServices coreCmsOrderDistributionModelServices
|
||||
)
|
||||
{
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
_coreCmsOrderDistributionModelServices = coreCmsOrderDistributionModelServices;
|
||||
}
|
||||
|
||||
#region 获取列表============================================================
|
||||
// POST: Api/CoreCmsOrderDistributionModel/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<CoreCmsOrderDistributionModel>();
|
||||
//获取排序字段
|
||||
var orderField = Request.Form["orderField"].FirstOrDefault();
|
||||
|
||||
Expression<Func<CoreCmsOrderDistributionModel, object>> orderEx = orderField switch
|
||||
{
|
||||
"id" => p => p.id,
|
||||
"orderType" => p => p.orderType,
|
||||
"description" => p => p.description,
|
||||
"isOpenMailing" => p => p.isOpenMailing,
|
||||
"isOpenHomeDelivery" => p => p.isOpenHomeDelivery,
|
||||
"isOpenSelfDelivery" => p => p.isOpenSelfDelivery,
|
||||
_ => 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);
|
||||
}
|
||||
//订单类型 int
|
||||
var orderType = Request.Form["orderType"].FirstOrDefault().ObjectToInt(0);
|
||||
if (orderType > 0)
|
||||
{
|
||||
where = where.And(p => p.orderType == orderType);
|
||||
}
|
||||
//描述 nvarchar
|
||||
var description = Request.Form["description"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(description))
|
||||
{
|
||||
where = where.And(p => p.description.Contains(description));
|
||||
}
|
||||
//物流快递 bit
|
||||
var isOpenMailing = Request.Form["isOpenMailing"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(isOpenMailing) && isOpenMailing.ToLowerInvariant() == "true")
|
||||
{
|
||||
where = where.And(p => p.isOpenMailing == true);
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(isOpenMailing) && isOpenMailing.ToLowerInvariant() == "false")
|
||||
{
|
||||
where = where.And(p => p.isOpenMailing == false);
|
||||
}
|
||||
//同城配送 bit
|
||||
var isOpenHomeDelivery = Request.Form["isOpenHomeDelivery"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(isOpenHomeDelivery) && isOpenHomeDelivery.ToLowerInvariant() == "true")
|
||||
{
|
||||
where = where.And(p => p.isOpenHomeDelivery == true);
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(isOpenHomeDelivery) && isOpenHomeDelivery.ToLowerInvariant() == "false")
|
||||
{
|
||||
where = where.And(p => p.isOpenHomeDelivery == false);
|
||||
}
|
||||
//上门自提 bit
|
||||
var isOpenSelfDelivery = Request.Form["isOpenSelfDelivery"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(isOpenSelfDelivery) && isOpenSelfDelivery.ToLowerInvariant() == "true")
|
||||
{
|
||||
where = where.And(p => p.isOpenSelfDelivery == true);
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(isOpenSelfDelivery) && isOpenSelfDelivery.ToLowerInvariant() == "false")
|
||||
{
|
||||
where = where.And(p => p.isOpenSelfDelivery == false);
|
||||
}
|
||||
//获取数据
|
||||
var list = await _coreCmsOrderDistributionModelServices.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/CoreCmsOrderDistributionModel/GetIndex
|
||||
/// <summary>
|
||||
/// 首页数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("首页数据")]
|
||||
public AdminUiCallBack GetIndex()
|
||||
{
|
||||
//返回数据
|
||||
var jm = new AdminUiCallBack { code = 0 };
|
||||
var orderTypes = EnumHelper.EnumToList<GlobalEnumVars.OrderType>();
|
||||
jm.data = new
|
||||
{
|
||||
orderTypes
|
||||
};
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 创建数据============================================================
|
||||
// POST: Api/CoreCmsOrderDistributionModel/GetCreate
|
||||
/// <summary>
|
||||
/// 创建数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("创建数据")]
|
||||
public AdminUiCallBack GetCreate()
|
||||
{
|
||||
//返回数据
|
||||
var jm = new AdminUiCallBack { code = 0 };
|
||||
|
||||
var orderTypes = EnumHelper.EnumToList<GlobalEnumVars.OrderType>();
|
||||
jm.data = new
|
||||
{
|
||||
orderTypes
|
||||
};
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 创建提交============================================================
|
||||
// POST: Api/CoreCmsOrderDistributionModel/DoCreate
|
||||
/// <summary>
|
||||
/// 创建提交
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("创建提交")]
|
||||
public async Task<AdminUiCallBack> DoCreate([FromBody] CoreCmsOrderDistributionModel entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
var isHava = await _coreCmsOrderDistributionModelServices.ExistsAsync(p => p.orderType == entity.orderType);
|
||||
if (isHava)
|
||||
{
|
||||
jm.msg = "请勿录入重复类型数据";
|
||||
return jm;
|
||||
}
|
||||
|
||||
jm = await _coreCmsOrderDistributionModelServices.InsertAsync(entity);
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 编辑数据============================================================
|
||||
// POST: Api/CoreCmsOrderDistributionModel/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 _coreCmsOrderDistributionModelServices.QueryByIdAsync(entity.id, false);
|
||||
if (model == null)
|
||||
{
|
||||
jm.msg = "不存在此信息";
|
||||
return jm;
|
||||
}
|
||||
jm.code = 0;
|
||||
var orderTypes = EnumHelper.EnumToList<GlobalEnumVars.OrderType>();
|
||||
jm.data = new
|
||||
{
|
||||
orderTypes,
|
||||
model
|
||||
};
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 编辑提交============================================================
|
||||
// POST: Api/CoreCmsOrderDistributionModel/Edit
|
||||
/// <summary>
|
||||
/// 编辑提交
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("编辑提交")]
|
||||
public async Task<AdminUiCallBack> DoEdit([FromBody] CoreCmsOrderDistributionModel entity)
|
||||
{
|
||||
var jm = await _coreCmsOrderDistributionModelServices.UpdateAsync(entity);
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除数据============================================================
|
||||
// POST: Api/CoreCmsOrderDistributionModel/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 _coreCmsOrderDistributionModelServices.ExistsAsync(p => p.id == entity.id, true);
|
||||
if (!model)
|
||||
{
|
||||
jm.msg = GlobalConstVars.DataisNo;
|
||||
return jm;
|
||||
}
|
||||
jm = await _coreCmsOrderDistributionModelServices.DeleteByIdAsync(entity.id);
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 设置物流快递============================================================
|
||||
// POST: Api/CoreCmsOrderDistributionModel/DoSetisOpenMailing/10
|
||||
/// <summary>
|
||||
/// 设置物流快递
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("设置物流快递")]
|
||||
public async Task<AdminUiCallBack> DoSetisOpenMailing([FromBody] FMUpdateBoolDataByIntId entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var oldModel = await _coreCmsOrderDistributionModelServices.QueryByIdAsync(entity.id, false);
|
||||
if (oldModel == null)
|
||||
{
|
||||
jm.msg = "不存在此信息";
|
||||
return jm;
|
||||
}
|
||||
oldModel.isOpenMailing = (bool)entity.data;
|
||||
|
||||
jm = await _coreCmsOrderDistributionModelServices.UpdateAsync(oldModel);
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 设置同城配送============================================================
|
||||
// POST: Api/CoreCmsOrderDistributionModel/DoSetisOpenHomeDelivery/10
|
||||
/// <summary>
|
||||
/// 设置同城配送
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("设置同城配送")]
|
||||
public async Task<AdminUiCallBack> DoSetisOpenHomeDelivery([FromBody] FMUpdateBoolDataByIntId entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var oldModel = await _coreCmsOrderDistributionModelServices.QueryByIdAsync(entity.id, false);
|
||||
if (oldModel == null)
|
||||
{
|
||||
jm.msg = "不存在此信息";
|
||||
return jm;
|
||||
}
|
||||
oldModel.isOpenHomeDelivery = (bool)entity.data;
|
||||
|
||||
jm = await _coreCmsOrderDistributionModelServices.UpdateAsync(oldModel);
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 设置上门自提============================================================
|
||||
// POST: Api/CoreCmsOrderDistributionModel/DoSetisOpenSelfDelivery/10
|
||||
/// <summary>
|
||||
/// 设置上门自提
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("设置上门自提")]
|
||||
public async Task<AdminUiCallBack> DoSetisOpenSelfDelivery([FromBody] FMUpdateBoolDataByIntId entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var oldModel = await _coreCmsOrderDistributionModelServices.QueryByIdAsync(entity.id, false);
|
||||
if (oldModel == null)
|
||||
{
|
||||
jm.msg = "不存在此信息";
|
||||
return jm;
|
||||
}
|
||||
oldModel.isOpenSelfDelivery = (bool)entity.data;
|
||||
|
||||
jm = await _coreCmsOrderDistributionModelServices.UpdateAsync(oldModel);
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,7 @@
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.Data.SqlClient" Version="4.0.0" />
|
||||
<PackageReference Include="Microsoft.Data.SqlClient" Version="4.0.1" />
|
||||
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="3.1.6" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.PlatformAbstractions" Version="1.1.0" />
|
||||
@@ -77,8 +77,8 @@
|
||||
<PackageReference Include="Qc.YilianyunSdk" Version="1.0.7" />
|
||||
<PackageReference Include="Snowflake.Core" Version="2.0.0" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.2.88" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.15.0" />
|
||||
<PackageReference Include="Tencent.QCloud.Cos.Sdk" Version="5.4.25" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.15.1" />
|
||||
<PackageReference Include="Tencent.QCloud.Cos.Sdk" Version="5.4.26" />
|
||||
<PackageReference Include="ToolGood.Words" Version="3.0.3.1" />
|
||||
<PackageReference Include="Yitter.IdGenerator" Version="1.0.12" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -649,6 +649,12 @@
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.ToolsController.GetProductsPages">
|
||||
<summary>
|
||||
获取关联商品的货品列表数据
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.ToolsController.GetArticles">
|
||||
<summary>
|
||||
获取文章列表
|
||||
@@ -3193,6 +3199,83 @@
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:CoreCms.Net.Web.Admin.Controllers.CoreCmsOrderDistributionModelController">
|
||||
<summary>
|
||||
订单配送模式
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsOrderDistributionModelController.#ctor(Microsoft.AspNetCore.Hosting.IWebHostEnvironment,CoreCms.Net.IServices.ICoreCmsOrderDistributionModelServices)">
|
||||
<summary>
|
||||
构造函数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsOrderDistributionModelController.GetPageList">
|
||||
<summary>
|
||||
获取列表
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsOrderDistributionModelController.GetIndex">
|
||||
<summary>
|
||||
首页数据
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsOrderDistributionModelController.GetCreate">
|
||||
<summary>
|
||||
创建数据
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsOrderDistributionModelController.DoCreate(CoreCms.Net.Model.Entities.CoreCmsOrderDistributionModel)">
|
||||
<summary>
|
||||
创建提交
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsOrderDistributionModelController.GetEdit(CoreCms.Net.Model.FromBody.FMIntId)">
|
||||
<summary>
|
||||
编辑数据
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsOrderDistributionModelController.DoEdit(CoreCms.Net.Model.Entities.CoreCmsOrderDistributionModel)">
|
||||
<summary>
|
||||
编辑提交
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsOrderDistributionModelController.DoDelete(CoreCms.Net.Model.FromBody.FMIntId)">
|
||||
<summary>
|
||||
单选删除
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsOrderDistributionModelController.DoSetisOpenMailing(CoreCms.Net.Model.FromBody.FMUpdateBoolDataByIntId)">
|
||||
<summary>
|
||||
设置物流快递
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsOrderDistributionModelController.DoSetisOpenHomeDelivery(CoreCms.Net.Model.FromBody.FMUpdateBoolDataByIntId)">
|
||||
<summary>
|
||||
设置同城配送
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsOrderDistributionModelController.DoSetisOpenSelfDelivery(CoreCms.Net.Model.FromBody.FMUpdateBoolDataByIntId)">
|
||||
<summary>
|
||||
设置上门自提
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:CoreCms.Net.Web.Admin.Controllers.CoreCmsPagesController">
|
||||
<summary>
|
||||
页面设计
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
<script type="text/html" template lay-done="layui.data.done(d);">
|
||||
<div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-CoreCmsOrderDistributionModel-createForm" id="LAY-app-CoreCmsOrderDistributionModel-createForm">
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="orderType" class="layui-form-label layui-form-required">订单类型</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="orderType" lay-verify="required|number">
|
||||
<option value="">请选择类型</option>
|
||||
{{# layui.each(d.params.data.orderTypes, function(index, item){ }}
|
||||
<option value="{{ item.value }}">{{ item.description }}</option>
|
||||
{{# }); }}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="description" class="layui-form-label">描述</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="description" lay-verType="tips" class="layui-input" lay-reqText="请输入描述" placeholder="请输入描述" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item" pane>
|
||||
<label for="isOpenMailing" class="layui-form-label layui-form-required">物流快递</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" lay-filter="switch" name="isOpenMailing" lay-skin="switch" lay-text="开启|关闭" checked="checked">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item" pane>
|
||||
<label for="isOpenHomeDelivery" class="layui-form-label layui-form-required">同城配送</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" lay-filter="switch" name="isOpenHomeDelivery" lay-skin="switch" lay-text="开启|关闭" checked="checked">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item" pane>
|
||||
<label for="isOpenSelfDelivery" class="layui-form-label layui-form-required">上门自提</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" lay-filter="switch" name="isOpenSelfDelivery" lay-skin="switch" lay-text="开启|关闭" checked="checked">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item text-right core-hidden">
|
||||
<input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-CoreCmsOrderDistributionModel-createForm-submit" id="LAY-app-CoreCmsOrderDistributionModel-createForm-submit" value="确认添加">
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script>
|
||||
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'],
|
||||
function () {
|
||||
var $ = layui.$
|
||||
, form = layui.form
|
||||
, admin = layui.admin
|
||||
, laydate = layui.laydate
|
||||
, upload = layui.upload
|
||||
, cropperImg = layui.cropperImg
|
||||
, coreHelper = layui.coreHelper;
|
||||
|
||||
form.verify({
|
||||
|
||||
verifydescription: [/^.{0,255}$/, '描述最大只允许输入255位字符'],
|
||||
});
|
||||
//重载form
|
||||
form.render(null, 'LAY-app-CoreCmsOrderDistributionModel-createForm');
|
||||
})
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,81 @@
|
||||
<script type="text/html" template lay-done="layui.data.done(d);">
|
||||
<table class="layui-table layui-form" lay-filter="LAY-app-CoreCmsOrderDistributionModel-detailsForm" id="LAY-app-CoreCmsOrderDistributionModel-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="orderType">订单类型</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.orderType || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="description">描述</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.description || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="isOpenMailing">物流快递</label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" disabled name="isOpenMailing" value="{{d.params.data.isOpenMailing}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="isOpenMailing" {{ d.params.data.isOpenMailing ? 'checked' : '' }}>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="isOpenHomeDelivery">同城配送</label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" disabled name="isOpenHomeDelivery" value="{{d.params.data.isOpenHomeDelivery}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="isOpenHomeDelivery" {{ d.params.data.isOpenHomeDelivery ? 'checked' : '' }}>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="isOpenSelfDelivery">上门自提</label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" disabled name="isOpenSelfDelivery" value="{{d.params.data.isOpenSelfDelivery}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="isOpenSelfDelivery" {{ d.params.data.isOpenSelfDelivery ? 'checked' : '' }}>
|
||||
</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-CoreCmsOrderDistributionModel-detailsForm');
|
||||
});
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,72 @@
|
||||
<script type="text/html" template lay-done="layui.data.sendParams(d);">
|
||||
<div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-CoreCmsOrderDistributionModel-editForm" id="LAY-app-CoreCmsOrderDistributionModel-editForm">
|
||||
<input type="hidden" name="id" value="{{d.params.data.model.id || '' }}" />
|
||||
<div class="layui-form-item">
|
||||
<label for="orderType" class="layui-form-label layui-form-required">订单类型</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="orderType" lay-verify="required|number" disabled="disabled">
|
||||
<option value="">请选择类型</option>
|
||||
{{# layui.each(d.params.data.orderTypes, function(index, item){ }}
|
||||
<option value="{{ item.value }}" {{item.value===d.params.data.model.orderType?'selected="selected"':''}}>{{ item.description }}</option>
|
||||
{{# }); }}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="description" class="layui-form-label">描述</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="description" lay-verType="tips" class="layui-input" placeholder="请输入描述" lay-reqText="请输入描述" value="{{d.params.data.model.description || '' }}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item" pane>
|
||||
<label for="isOpenMailing" class="layui-form-label layui-form-required">物流快递</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" lay-filter="switch" name="isOpenMailing" {{ d.params.data.model.isOpenMailing ? 'checked' : '' }} lay-skin="switch" lay-text="开启|关闭">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item" pane>
|
||||
<label for="isOpenHomeDelivery" class="layui-form-label layui-form-required">同城配送</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" lay-filter="switch" name="isOpenHomeDelivery" {{ d.params.data.model.isOpenHomeDelivery ? 'checked' : '' }} lay-skin="switch" lay-text="开启|关闭">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item" pane>
|
||||
<label for="isOpenSelfDelivery" class="layui-form-label layui-form-required">上门自提</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" lay-filter="switch" name="isOpenSelfDelivery" {{ d.params.data.model.isOpenSelfDelivery ? 'checked' : '' }} lay-skin="switch" lay-text="开启|关闭">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item text-right core-hidden">
|
||||
<input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-CoreCmsOrderDistributionModel-editForm-submit" id="LAY-app-CoreCmsOrderDistributionModel-editForm-submit" value="确认编辑">
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script>
|
||||
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 () {
|
||||
var $ = layui.$
|
||||
, form = layui.form
|
||||
, admin = layui.admin
|
||||
, laydate = layui.laydate
|
||||
, upload = layui.upload
|
||||
, cropperImg = layui.cropperImg
|
||||
, coreHelper = layui.coreHelper;
|
||||
|
||||
form.verify({
|
||||
|
||||
verifydescription: [/^.{0,255}$/, '描述最大只允许输入255位字符'],
|
||||
});
|
||||
//重载form
|
||||
form.render(null, 'LAY-app-CoreCmsOrderDistributionModel-editForm');
|
||||
})
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,298 @@
|
||||
<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/CoreCmsOrderDistributionModel/GetIndex" lay-done="layui.data.done(d);">
|
||||
|
||||
</script>
|
||||
<div class="table-body">
|
||||
<table id="LAY-app-CoreCmsOrderDistributionModel-tableBox" lay-filter="LAY-app-CoreCmsOrderDistributionModel-tableBox"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="LAY-app-CoreCmsOrderDistributionModel-toolbar">
|
||||
<div class="layui-form coreshop-toolbar-search-form">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
注:未添加的订单类型,默认将开启所有下单配送模式。
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="LAY-app-CoreCmsOrderDistributionModel-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-CoreCmsOrderDistributionModel-tableBox-bar">
|
||||
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" data-dropdown="#CoreCmsOrderDistributionModelTbDelDrop{{d.LAY_INDEX}}" no-shade="true">删除</a>
|
||||
<div class="dropdown-menu-nav dropdown-popconfirm dropdown-top-right layui-hide" id="CoreCmsOrderDistributionModelTbDelDrop{{d.LAY_INDEX}}"
|
||||
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-CoreCmsOrderDistributionModel-search)',
|
||||
function (data) {
|
||||
var field = data.field;
|
||||
searchwhere = field;
|
||||
//执行重载
|
||||
table.reloadData('LAY-app-CoreCmsOrderDistributionModel-tableBox', { where: field });
|
||||
});
|
||||
//数据绑定
|
||||
table.render({
|
||||
elem: '#LAY-app-CoreCmsOrderDistributionModel-tableBox',
|
||||
url: layui.setter.apiUrl + 'Api/CoreCmsOrderDistributionModel/GetPageList',
|
||||
method: 'POST',
|
||||
toolbar: '#LAY-app-CoreCmsOrderDistributionModel-toolbar',
|
||||
pagebar: '#LAY-app-CoreCmsOrderDistributionModel-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: '序列', sort: false, width: 55 },
|
||||
{
|
||||
field: 'orderType', title: '订单类型', sort: false, width: 155, templet: function (data) {
|
||||
for (var i = 0; i < d.data.orderTypes.length; i++) {
|
||||
if (data.orderType == d.data.orderTypes[i].value) {
|
||||
return d.data.orderTypes[i].description;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
},
|
||||
{ field: 'isOpenMailing', title: '物流快递', width: 95, templet: '#switch_isOpenMailing', sort: false, unresize: true },
|
||||
{ field: 'isOpenHomeDelivery', title: '同城配送', width: 95, templet: '#switch_isOpenHomeDelivery', sort: false, unresize: true },
|
||||
{ field: 'isOpenSelfDelivery', title: '上门自提', width: 95, templet: '#switch_isOpenSelfDelivery', sort: false, unresize: true },
|
||||
{ field: 'description', title: '描述', sort: false },
|
||||
{ width: 122, align: 'center', title: '操作', fixed: 'right', toolbar: '#LAY-app-CoreCmsOrderDistributionModel-tableBox-bar' }
|
||||
]
|
||||
]
|
||||
});
|
||||
//监听排序事件
|
||||
table.on('sort(LAY-app-CoreCmsOrderDistributionModel-tableBox)', function (obj) {
|
||||
table.reloadData('LAY-app-CoreCmsOrderDistributionModel-tableBox', {
|
||||
initSort: obj, //记录初始排序,如果不设的话,将无法标记表头的排序状态。
|
||||
where: { //请求参数(注意:这里面的参数可任意定义,并非下面固定的格式)
|
||||
orderField: obj.field, //排序字段
|
||||
orderDirection: obj.type //排序方式
|
||||
}
|
||||
});
|
||||
});
|
||||
//头工具栏事件
|
||||
table.on('pagebar(LAY-app-CoreCmsOrderDistributionModel-tableBox)', function (obj) {
|
||||
var checkStatus = table.checkStatus(obj.config.id);
|
||||
switch (obj.event) {
|
||||
case 'addData':
|
||||
doCreate();
|
||||
break;
|
||||
};
|
||||
});
|
||||
//监听工具条
|
||||
table.on('tool(LAY-app-CoreCmsOrderDistributionModel-tableBox)',
|
||||
function (obj) {
|
||||
if (obj.event === 'del') {
|
||||
doDelete(obj);
|
||||
} else if (obj.event === 'edit') {
|
||||
doEdit(obj)
|
||||
}
|
||||
});
|
||||
//执行创建操作
|
||||
function doCreate() {
|
||||
coreHelper.Post("Api/CoreCmsOrderDistributionModel/GetCreate", null, function (e) {
|
||||
if (e.code === 0) {
|
||||
admin.popup({
|
||||
shadeClose: false,
|
||||
title: '创建数据',
|
||||
area: ['500px', '400px'],
|
||||
id: 'LAY-popup-CoreCmsOrderDistributionModel-create',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('shop/orderdistributionmodel/create', { data: e.data }).done(function () {
|
||||
//监听提交
|
||||
form.on('submit(LAY-app-CoreCmsOrderDistributionModel-createForm-submit)',
|
||||
function (data) {
|
||||
var field = data.field; //获取提交的字段
|
||||
|
||||
field.isOpenMailing = field.isOpenMailing == 'on';
|
||||
field.isOpenHomeDelivery = field.isOpenHomeDelivery == 'on';
|
||||
field.isOpenSelfDelivery = field.isOpenSelfDelivery == 'on';
|
||||
|
||||
if (debug) { console.log(field); } //开启调试返回数据
|
||||
//提交 Ajax 成功后,关闭当前弹层并重载表格
|
||||
coreHelper.Post("Api/CoreCmsOrderDistributionModel/DoCreate", field, function (e) {
|
||||
console.log(e)
|
||||
if (e.code === 0) {
|
||||
layui.table.reloadData('LAY-app-CoreCmsOrderDistributionModel-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-CoreCmsOrderDistributionModel-createForm-submit").click();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.msg(e.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
//执行编辑操作
|
||||
function doEdit(obj) {
|
||||
coreHelper.Post("Api/CoreCmsOrderDistributionModel/GetEdit", { id: obj.data.id }, function (e) {
|
||||
if (e.code === 0) {
|
||||
admin.popup({
|
||||
shadeClose: false,
|
||||
title: '编辑数据',
|
||||
area: ['500px', '400px'],
|
||||
id: 'LAY-popup-CoreCmsOrderDistributionModel-edit',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('shop/orderdistributionmodel/edit', { data: e.data }).done(function () {
|
||||
//监听提交
|
||||
form.on('submit(LAY-app-CoreCmsOrderDistributionModel-editForm-submit)',
|
||||
function (data) {
|
||||
var field = data.field; //获取提交的字段
|
||||
|
||||
field.isOpenMailing = field.isOpenMailing == 'on';
|
||||
field.isOpenHomeDelivery = field.isOpenHomeDelivery == 'on';
|
||||
field.isOpenSelfDelivery = field.isOpenSelfDelivery == 'on';
|
||||
|
||||
if (debug) { console.log(field); } //开启调试返回数据
|
||||
//提交 Ajax 成功后,关闭当前弹层并重载表格
|
||||
coreHelper.Post("Api/CoreCmsOrderDistributionModel/DoEdit", field, function (e) {
|
||||
console.log(e)
|
||||
if (e.code === 0) {
|
||||
layui.table.reloadData('LAY-app-CoreCmsOrderDistributionModel-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-CoreCmsOrderDistributionModel-editForm-submit").click();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.msg(e.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//执行单个删除
|
||||
function doDelete(obj) {
|
||||
coreHelper.Post("Api/CoreCmsOrderDistributionModel/DoDelete", { id: obj.data.id }, function (e) {
|
||||
if (debug) { console.log(e); } //开启调试返回数据
|
||||
table.reloadData('LAY-app-CoreCmsOrderDistributionModel-tableBox');
|
||||
layer.msg(e.msg);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//监听 表格复选框操作
|
||||
|
||||
layui.form.on('switch(switch_isOpenMailing)', function (obj) {
|
||||
coreHelper.Post("Api/CoreCmsOrderDistributionModel/DoSetisOpenMailing", { id: this.value, data: obj.elem.checked }, function (e) {
|
||||
if (debug) { console.log(e); } //开启调试返回数据
|
||||
//table.reloadData('LAY-app-CoreCmsOrderDistributionModel-tableBox');
|
||||
layer.msg(e.msg);
|
||||
});
|
||||
});
|
||||
|
||||
layui.form.on('switch(switch_isOpenHomeDelivery)', function (obj) {
|
||||
coreHelper.Post("Api/CoreCmsOrderDistributionModel/DoSetisOpenHomeDelivery", { id: this.value, data: obj.elem.checked }, function (e) {
|
||||
if (debug) { console.log(e); } //开启调试返回数据
|
||||
//table.reloadData('LAY-app-CoreCmsOrderDistributionModel-tableBox');
|
||||
layer.msg(e.msg);
|
||||
});
|
||||
});
|
||||
|
||||
layui.form.on('switch(switch_isOpenSelfDelivery)', function (obj) {
|
||||
coreHelper.Post("Api/CoreCmsOrderDistributionModel/DoSetisOpenSelfDelivery", { id: this.value, data: obj.elem.checked }, function (e) {
|
||||
if (debug) { console.log(e); } //开启调试返回数据
|
||||
//table.reloadData('LAY-app-CoreCmsOrderDistributionModel-tableBox');
|
||||
layer.msg(e.msg);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
//重载form
|
||||
form.render();
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<!--设置物流快递-->
|
||||
<script type="text/html" id="switch_isOpenMailing">
|
||||
<input type="checkbox" name="switch_isOpenMailing" value="{{d.id}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="switch_isOpenMailing" {{ d.isOpenMailing ? 'checked' : '' }}>
|
||||
</script>
|
||||
|
||||
<!--设置同城配送-->
|
||||
<script type="text/html" id="switch_isOpenHomeDelivery">
|
||||
<input type="checkbox" name="switch_isOpenHomeDelivery" value="{{d.id}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="switch_isOpenHomeDelivery" {{ d.isOpenHomeDelivery ? 'checked' : '' }}>
|
||||
</script>
|
||||
|
||||
<!--设置上门自提-->
|
||||
<script type="text/html" id="switch_isOpenSelfDelivery">
|
||||
<input type="checkbox" name="switch_isOpenSelfDelivery" value="{{d.id}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="switch_isOpenSelfDelivery" {{ d.isOpenSelfDelivery ? 'checked' : '' }}>
|
||||
</script>
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
//普通图片上传
|
||||
var uploadInst = upload.render({
|
||||
elem: '#upBtnlicenseImage'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/UploadFiles'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/MiNiShopOpenComponent2_UploadImg'
|
||||
, before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
|
||||
@@ -179,7 +179,7 @@
|
||||
|
||||
upload.render({
|
||||
elem: '#upBtnimageIds'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/UploadFiles'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/MiNiShopOpenComponent2_UploadImg'
|
||||
, before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
//$('#viewImgBoxlicenseImage').attr('src', result);
|
||||
|
||||
@@ -163,7 +163,7 @@
|
||||
//普通图片上传
|
||||
var uploadInst = upload.render({
|
||||
elem: '#upBtnlicenseImage'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/UploadFiles'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/MiNiShopOpenComponent2_UploadImg'
|
||||
, before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
|
||||
upload.render({
|
||||
elem: '#upBtnimageIds'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/UploadFiles'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/MiNiShopOpenComponent2_UploadImg'
|
||||
, before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
//$('#viewImgBoxlicenseImage').attr('src', result);
|
||||
|
||||
@@ -46,6 +46,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
private readonly ICoreCmsLogisticsServices _logisticsServices;
|
||||
private readonly ICoreCmsGoodsServices _goodsServices;
|
||||
private readonly ICoreCmsStoreServices _storeServices;
|
||||
private readonly ICoreCmsOrderDistributionModelServices _orderDistributionModelServices;
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
@@ -56,7 +57,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
, ICoreCmsSettingServices settingServices
|
||||
, ICoreCmsAreaServices areaServices
|
||||
, ICoreCmsBillReshipServices reshipServices, ICoreCmsShipServices shipServices
|
||||
, ICoreCmsBillDeliveryServices billDeliveryServices, ICoreCmsLogisticsServices logisticsServices, ICoreCmsGoodsServices goodsServices, ICoreCmsStoreServices storeServices)
|
||||
, ICoreCmsBillDeliveryServices billDeliveryServices, ICoreCmsLogisticsServices logisticsServices, ICoreCmsGoodsServices goodsServices, ICoreCmsStoreServices storeServices, ICoreCmsOrderDistributionModelServices orderDistributionModelServices)
|
||||
{
|
||||
_user = user;
|
||||
_orderServices = orderServices;
|
||||
@@ -69,6 +70,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
_logisticsServices = logisticsServices;
|
||||
_goodsServices = goodsServices;
|
||||
_storeServices = storeServices;
|
||||
_orderDistributionModelServices = orderDistributionModelServices;
|
||||
}
|
||||
|
||||
|
||||
@@ -77,6 +79,42 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
|
||||
//验证接口====================================================================================================
|
||||
|
||||
#region 获取不同类型营销下单支持的配送方式==================================================
|
||||
/// <summary>
|
||||
/// 获取不同类型营销下单支持的配送方式
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Authorize]
|
||||
public async Task<WebApiCallBack> GetOrderDistributionModel([FromBody] FMIntId entity)
|
||||
{
|
||||
var jm = new WebApiCallBack() { status = true };
|
||||
|
||||
var cache = await _orderDistributionModelServices.GetCaChe();
|
||||
var model = cache.Find(p => p.orderType == entity.id);
|
||||
if (model == null)
|
||||
{
|
||||
jm.data = new
|
||||
{
|
||||
isOpenMailing = true,
|
||||
isOpenHomeDelivery = true,
|
||||
isOpenSelfDelivery = true
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
jm.data = new
|
||||
{
|
||||
model.isOpenMailing,
|
||||
model.isOpenHomeDelivery,
|
||||
model.isOpenSelfDelivery
|
||||
};
|
||||
}
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 发票模糊查询==================================================
|
||||
/// <summary>
|
||||
/// 发票模糊查询
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
<PackageReference Include="Hangfire.Dashboard.BasicAuthorization" Version="1.0.2" />
|
||||
<PackageReference Include="Hangfire.Redis.StackExchange" Version="1.8.5" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.Data.SqlClient" Version="4.0.0" />
|
||||
<PackageReference Include="Microsoft.Data.SqlClient" Version="4.0.1" />
|
||||
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="3.1.6" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.1" />
|
||||
<PackageReference Include="Nito.AsyncEx" Version="5.1.2" />
|
||||
@@ -67,7 +67,7 @@
|
||||
<PackageReference Include="Qc.YilianyunSdk" Version="1.0.7" />
|
||||
<PackageReference Include="Snowflake.Core" Version="2.0.0" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.2.88" />
|
||||
<PackageReference Include="Tencent.QCloud.Cos.Sdk" Version="5.4.25" />
|
||||
<PackageReference Include="Tencent.QCloud.Cos.Sdk" Version="5.4.26" />
|
||||
<PackageReference Include="ToolGood.Words" Version="3.0.3.1" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -468,11 +468,17 @@
|
||||
订单调用接口数据
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.WebApi.Controllers.OrderController.#ctor(CoreCms.Net.Auth.HttpContextUser.IHttpContextUser,CoreCms.Net.IServices.ICoreCmsOrderServices,CoreCms.Net.IServices.ICoreCmsBillAftersalesServices,CoreCms.Net.IServices.ICoreCmsSettingServices,CoreCms.Net.IServices.ICoreCmsAreaServices,CoreCms.Net.IServices.ICoreCmsBillReshipServices,CoreCms.Net.IServices.ICoreCmsShipServices,CoreCms.Net.IServices.ICoreCmsBillDeliveryServices,CoreCms.Net.IServices.ICoreCmsLogisticsServices,CoreCms.Net.IServices.ICoreCmsGoodsServices,CoreCms.Net.IServices.ICoreCmsStoreServices)">
|
||||
<member name="M:CoreCms.Net.Web.WebApi.Controllers.OrderController.#ctor(CoreCms.Net.Auth.HttpContextUser.IHttpContextUser,CoreCms.Net.IServices.ICoreCmsOrderServices,CoreCms.Net.IServices.ICoreCmsBillAftersalesServices,CoreCms.Net.IServices.ICoreCmsSettingServices,CoreCms.Net.IServices.ICoreCmsAreaServices,CoreCms.Net.IServices.ICoreCmsBillReshipServices,CoreCms.Net.IServices.ICoreCmsShipServices,CoreCms.Net.IServices.ICoreCmsBillDeliveryServices,CoreCms.Net.IServices.ICoreCmsLogisticsServices,CoreCms.Net.IServices.ICoreCmsGoodsServices,CoreCms.Net.IServices.ICoreCmsStoreServices,CoreCms.Net.IServices.ICoreCmsOrderDistributionModelServices)">
|
||||
<summary>
|
||||
构造函数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.WebApi.Controllers.OrderController.GetOrderDistributionModel(CoreCms.Net.Model.FromBody.FMIntId)">
|
||||
<summary>
|
||||
获取不同类型营销下单支持的配送方式
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.WebApi.Controllers.OrderController.GetTaxCode(CoreCms.Net.Model.ViewModels.DTO.GetTaxCodePost)">
|
||||
<summary>
|
||||
发票模糊查询
|
||||
@@ -763,6 +769,28 @@
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:CoreCms.Net.Web.WebApi.Controllers.SolitaireController">
|
||||
<summary>
|
||||
接龙
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.WebApi.Controllers.SolitaireController.#ctor(CoreCms.Net.IServices.ICoreCmsSolitaireServices,CoreCms.Net.IServices.ICoreCmsSolitaireItemsServices,CoreCms.Net.Auth.HttpContextUser.IHttpContextUser,CoreCms.Net.IServices.ICoreCmsCartServices)">
|
||||
<summary>
|
||||
构造函数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.WebApi.Controllers.SolitaireController.GetList(CoreCms.Net.Model.FromBody.FMPageByIntId)">
|
||||
<summary>
|
||||
获取接龙列表
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.WebApi.Controllers.SolitaireController.GetDetail(CoreCms.Net.Model.FromBody.FMIntId)">
|
||||
<summary>
|
||||
获取单个接龙详情
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:CoreCms.Net.Web.WebApi.Controllers.StoreController">
|
||||
<summary>
|
||||
门店调用接口数据
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
BIN
数据库/MySql/20220122/完整数据库/coreshop.rar
Normal file
BIN
数据库/MySql/20220122/完整数据库/coreshop.rar
Normal file
Binary file not shown.
44
数据库/MySql/20220122/数据库升级脚本/1、创建表.sql
Normal file
44
数据库/MySql/20220122/数据库升级脚本/1、创建表.sql
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
Navicat Premium Data Transfer
|
||||
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 50732
|
||||
Source Schema : coreshop
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 50732
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 22/01/2022 02:20:16
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for CoreCmsOrderDistributionModel
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `CoreCmsOrderDistributionModel`;
|
||||
CREATE TABLE `CoreCmsOrderDistributionModel` (
|
||||
`id` int(11) NOT NULL COMMENT '序列',
|
||||
`orderType` int(11) NOT NULL COMMENT '订单类型',
|
||||
`description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '描述',
|
||||
`isOpenMailing` tinyint(4) NOT NULL COMMENT '物流快递',
|
||||
`isOpenHomeDelivery` tinyint(4) NOT NULL COMMENT '同城配送',
|
||||
`isOpenSelfDelivery` tinyint(4) NOT NULL COMMENT '上门自提',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '订单配送模式' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of CoreCmsOrderDistributionModel
|
||||
-- ----------------------------
|
||||
INSERT INTO `CoreCmsOrderDistributionModel` VALUES (1, 1, '', 1, 1, 1);
|
||||
INSERT INTO `CoreCmsOrderDistributionModel` VALUES (2, 2, '', 1, 1, 1);
|
||||
INSERT INTO `CoreCmsOrderDistributionModel` VALUES (3, 3, '', 1, 1, 1);
|
||||
INSERT INTO `CoreCmsOrderDistributionModel` VALUES (4, 4, '', 1, 1, 0);
|
||||
INSERT INTO `CoreCmsOrderDistributionModel` VALUES (5, 6, '', 0, 1, 1);
|
||||
INSERT INTO `CoreCmsOrderDistributionModel` VALUES (6, 7, '', 1, 1, 0);
|
||||
INSERT INTO `CoreCmsOrderDistributionModel` VALUES (7, 8, '', 1, 1, 1);
|
||||
INSERT INTO `CoreCmsOrderDistributionModel` VALUES (8, 10, '', 1, 0, 1);
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
4
数据库/MySql/20220122/数据库升级脚本/升级方法.txt
Normal file
4
数据库/MySql/20220122/数据库升级脚本/升级方法.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
1、使用20220118版本完整数据库执行sql。
|
||||
2、后台菜单管理中,针对【下单模式设置】导入按钮。(存在按钮可不需要导入)
|
||||
3、角色添加权限。
|
||||
4、注销登录再次进入。
|
||||
@@ -1,3 +1,6 @@
|
||||
2022-01-22
|
||||
【新增】新增【CoreCmsOrderDistributionModel】表
|
||||
|
||||
2022-01-18
|
||||
1、【新增】新增【WeChatTransactionComponentAuditCategory】【WeChatTransactionComponentAuditCategoryAuditLog】【WeChatTransactionComponentDeliveryCompany】【WeChatTransactionComponentGood】【WeChatTransactionComponentGoodAuditLog】【WeChatTransactionComponentGoodSKU】【WeChatTransactionComponentOrder】【WeChatTransactionComponentThirdCategory】8个自定义交易组件表。
|
||||
2、【新增】【CoreCmsOrder】表新增scene字段,增加场景值功能。
|
||||
|
||||
BIN
数据库/SqlServer/20220122/完整数据库/202201220200完整数据库.rar
Normal file
BIN
数据库/SqlServer/20220122/完整数据库/202201220200完整数据库.rar
Normal file
Binary file not shown.
BIN
数据库/SqlServer/20220122/数据库升级脚本/1、创建数据库表.sql
Normal file
BIN
数据库/SqlServer/20220122/数据库升级脚本/1、创建数据库表.sql
Normal file
Binary file not shown.
BIN
数据库/SqlServer/20220122/数据库升级脚本/2、创建后台菜单.sql
Normal file
BIN
数据库/SqlServer/20220122/数据库升级脚本/2、创建后台菜单.sql
Normal file
Binary file not shown.
4
数据库/SqlServer/20220122/数据库升级脚本/升级方法.txt
Normal file
4
数据库/SqlServer/20220122/数据库升级脚本/升级方法.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
1、使用20220117版本完整数据库执行sql。
|
||||
2、后台菜单管理中,针对【下单模式设置】导入按钮。(存在按钮可不需要导入)
|
||||
3、角色添加权限。
|
||||
4、注销登录再次进入。
|
||||
@@ -1,3 +1,6 @@
|
||||
2022-01-22
|
||||
【新增】新增【CoreCmsOrderDistributionModel】表
|
||||
|
||||
2022-01-11
|
||||
1、【新增】新增【WeChatTransactionComponentAuditCategory】【WeChatTransactionComponentAuditCategoryAuditLog】【WeChatTransactionComponentDeliveryCompany】【WeChatTransactionComponentGood】【WeChatTransactionComponentGoodAuditLog】【WeChatTransactionComponentGoodSKU】【WeChatTransactionComponentOrder】【WeChatTransactionComponentThirdCategory】8个自定义交易组件表。
|
||||
2、【新增】【CoreCmsOrder】表新增scene字段,增加场景值功能。
|
||||
|
||||
Reference in New Issue
Block a user