mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2026-03-24 17:27:21 +08:00
### 0.6.0 专业版(大版本升级,破坏性升级,请酌情处理):
【新增】弃用现在sku前端,启用全新sku组件,更加灵活,体验更好。 【新增】新增通过商品序列获取sku全新列表功能。 【新增】仓储层底层增加二级缓存功能,后面将逐步完善底层缓存中心模块。 【新增】0元购,积分兑换模式下,也去计算用户是否科技升级。 【新增】数据及业务仓储增加二级缓存功能。curd可自主控制是否缓存和清除。 【新增】订单导出excel数据增加商品名称+货品sku组合展示的方式。 【新增】自定义交易组件增加【获取商家信息】【更新商家信息】两个接口处理。 【新增】增加公告列表及公告详情页面,首页组件公告点击跳转列表展示。 【新增】个人中心增加【公告中心】入口。 【新增】后台余额变动增加说明录入。 【调整】将前端能进行分包的文件夹都进行分包,减少主包占用,方便进行二开。 【调整】因ckeditor5存在图片不可设置宽度,上传不支持mp4,排版不畅等情况,降级使用ckeditor4版本。 【修复】修复0.5.5版本售后积分返还机制积分模式判断异常的问题。 【修复】修复使用积分全额抵扣,或其他优惠政策导致的0元购,未进行短信提醒及小票打印机未打印的问题。 【修复】修复更换ckeditor4编辑器后接龙添加编辑调用失败的问题。 【修复】修复积分全额抵扣,金额0元购的情况下,进行售后执行完毕,订单未完结的情况。 【优化】去除分销申请面板按钮无用并失效报错的customStyle属性。 【优化】优化部分方法中使用手写字符串的遗留问题,统一采用enum方式。 【优化】优化前端及接口部分命名错误的问题。错将skill误写成seckill。 【优化】去除uniapp端多个客服代码。 【优化】商品详情底部完善购物车数量显示的问题。 【优化】优化团购列表,拼团列表,秒杀页面页面样式布局差异问题。 【优化】调整支付结果界面样式效果,仿微信支付结果界面。更加清晰明朗。 【优化】优化售后提交页面json计算,开放当用户下单后但未发货情况下,可以申请直接售后的操作需求。 【优化】后台商家手机号码支持设置多个,使用小写逗号分隔,方便多个商家管理员接收下单提醒。 【优化】后台售后单审核,调整售后商品为必选项。
This commit is contained in:
@@ -266,6 +266,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
//本月第一天时间
|
||||
DateTime dtFirst = dt.AddDays(1 - (dt.Day));
|
||||
dtFirst = new DateTime(dtFirst.Year, dtFirst.Month, dtFirst.Day, 0, 0, 0);
|
||||
|
||||
//获得某年某月的天数
|
||||
int year = dt.Date.Year;
|
||||
int month = dt.Date.Month;
|
||||
@@ -306,6 +307,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
//本月第一天时间
|
||||
DateTime dtFirst = dt.AddDays(1 - (dt.Day));
|
||||
dtFirst = new DateTime(dtFirst.Year, dtFirst.Month, dtFirst.Day, 0, 0, 0);
|
||||
|
||||
//获得某年某月的天数
|
||||
int dayCount = DateTime.DaysInMonth(dt.Date.Year, dt.Date.Month);
|
||||
//本月最后一天时间
|
||||
|
||||
@@ -8,7 +8,17 @@
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.AccressToken;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.WeChat.Service.Enums;
|
||||
using CoreCms.Net.WeChat.Service.HttpClients;
|
||||
using CoreCms.Net.WeChat.Service.Options;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Options;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api.Models;
|
||||
|
||||
namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
{
|
||||
@@ -17,13 +27,30 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
/// </summary>
|
||||
public class DemoController : ControllerBase
|
||||
{
|
||||
private ICoreCmsPagesServices _pagesServices;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="pagesServices"></param>
|
||||
public DemoController(ICoreCmsPagesServices pagesServices)
|
||||
{
|
||||
_pagesServices = pagesServices;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 默认首页
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public IActionResult Index()
|
||||
public async Task<WebApiCallBack> Index()
|
||||
{
|
||||
return Content("已结束");
|
||||
var item = await _pagesServices.GetPageConfig("mobile22021100321361811869");
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -22,8 +22,8 @@ using CoreCms.Net.IServices;
|
||||
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.Model.ViewModels.DTO;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Utility.Extensions;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
@@ -98,8 +98,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
{
|
||||
var jm = new WebApiCallBack() { status = true };
|
||||
|
||||
var data = await _goodsCategoryServices.QueryListByClauseAsync(p => p.isShow == true, p => p.sort,
|
||||
OrderByType.Asc);
|
||||
var data = await _goodsCategoryServices.QueryListByClauseAsync(p => p.isShow == true, p => p.sort, OrderByType.Asc, true, true);
|
||||
var wxGoodCategoryDto = new List<WxGoodCategoryDto>();
|
||||
|
||||
var parents = data.Where(p => p.parentId == 0).ToList();
|
||||
@@ -190,13 +189,13 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
var catId = obj.catId.ObjectToInt(0);
|
||||
if (catId > 0)
|
||||
{
|
||||
var category = await _goodsCategoryServices.QueryByIdAsync(catId);
|
||||
var category = await _goodsCategoryServices.QueryByIdAsync(catId, true, true);
|
||||
if (category != null)
|
||||
{
|
||||
className = category.name;
|
||||
}
|
||||
|
||||
var childs = await _goodsCategoryServices.QueryListByClauseAsync(p => p.parentId == catId);
|
||||
var childs = await _goodsCategoryServices.QueryListByClauseAsync(p => p.parentId == catId, p => p.sort, OrderByType.Asc, true, true);
|
||||
if (childs.Any())
|
||||
{
|
||||
var ids = childs.Select(p => p.id).ToList();
|
||||
@@ -225,14 +224,11 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
where = where.And(p => p.name.Contains(obj.searchName));
|
||||
}
|
||||
}
|
||||
|
||||
var orderBy = " isRecommend desc,isHot desc";
|
||||
if (!string.IsNullOrWhiteSpace(entity.order))
|
||||
{
|
||||
orderBy += "," + entity.order;
|
||||
}
|
||||
|
||||
|
||||
//获取数据
|
||||
var list = await _goodsServices.QueryPageAsync(where, orderBy, entity.page, entity.limit, false);
|
||||
if (list.Any())
|
||||
@@ -242,10 +238,8 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
goods.images = !string.IsNullOrEmpty(goods.images) ? goods.images.Split(",")[0] : "/static/images/common/empty.png";
|
||||
}
|
||||
}
|
||||
|
||||
//获取品牌
|
||||
var brands = await _brandServices.QueryListByClauseAsync(p => p.isShow == true, p => p.sort, OrderByType.Desc);
|
||||
|
||||
var brands = await _brandServices.QueryListByClauseAsync(p => p.isShow == true, p => p.sort, OrderByType.Desc, true, true);
|
||||
|
||||
//返回数据
|
||||
jm.status = true;
|
||||
@@ -278,13 +272,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
{
|
||||
var jm = new WebApiCallBack();
|
||||
|
||||
var userId = 0;
|
||||
if (_user != null)
|
||||
{
|
||||
userId = _user.ID;
|
||||
}
|
||||
|
||||
var model = await _goodsServices.GetGoodsDetial(entity.id, userId, false);
|
||||
var model = await _goodsServices.GetGoodsDetail(entity.id, 0, false, "goods", 0, entity.data.ObjectToBool());
|
||||
if (model == null)
|
||||
{
|
||||
jm.msg = "商品获取失败";
|
||||
@@ -389,7 +377,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
return jm;
|
||||
}
|
||||
var list = new List<WxNameValueDto>();
|
||||
var goodsParams = await _goodsParamsServices.QueryAsync();
|
||||
var goodsParams = await _goodsParamsServices.QueryAsync(true, true);
|
||||
|
||||
if (!string.IsNullOrEmpty(goods.parameters))
|
||||
{
|
||||
@@ -448,6 +436,47 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 获取商品sku======================================================================
|
||||
/// <summary>
|
||||
/// 获取商品sku
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<WebApiCallBack> GetSku([FromBody] FMGetSku entity)
|
||||
{
|
||||
var jm = new WebApiCallBack();
|
||||
|
||||
var good = await _goodsServices.QueryByClauseAsync(p => p.id == entity.id, true);
|
||||
if (good == null)
|
||||
{
|
||||
jm.msg = "商品获取失败";
|
||||
return jm;
|
||||
}
|
||||
|
||||
//取所有货品
|
||||
var products = await _productsServices.QueryListByClauseAsync(p => p.goodsId == good.id && p.isDel == false, p => p.id, OrderByType.Asc, true);
|
||||
if (products == null)
|
||||
{
|
||||
jm.msg = "商品sku列表获取失败";
|
||||
return jm;
|
||||
}
|
||||
|
||||
var skus = await _goodsServices.GetCoreCmsProductsView(good, products, 0, entity.isPromotion, entity.type, entity.groupId);
|
||||
if (skus == null)
|
||||
{
|
||||
jm.msg = "商品sku列表组合获取失败";
|
||||
return jm;
|
||||
}
|
||||
jm.status = true;
|
||||
jm.msg = "获取商品详情成功";
|
||||
jm.data = skus;
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
//验证接口====================================================================================================
|
||||
|
||||
|
||||
@@ -468,14 +497,13 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
{
|
||||
userId = _user.ID;
|
||||
}
|
||||
var model = await _goodsServices.GetGoodsDetail(entity.id, userId, false, "goods", 0, entity.data.ObjectToBool());
|
||||
|
||||
var model = await _goodsServices.GetGoodsDetial(entity.id, userId, false);
|
||||
if (model == null)
|
||||
{
|
||||
jm.msg = "商品获取失败";
|
||||
return jm;
|
||||
}
|
||||
|
||||
await _goodsServices.UpdateAsync(p => new CoreCmsGoods() { viewCount = p.viewCount + 1 },
|
||||
p => p.id == entity.id);
|
||||
|
||||
@@ -491,5 +519,55 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
|
||||
|
||||
|
||||
|
||||
#region 根据Token获取商品sku======================================================================
|
||||
/// <summary>
|
||||
/// 根据Token获取商品sku
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Authorize]
|
||||
public async Task<WebApiCallBack> GetSkuByToken([FromBody] FMGetSku entity)
|
||||
{
|
||||
var jm = new WebApiCallBack();
|
||||
|
||||
var userId = 0;
|
||||
if (_user != null)
|
||||
{
|
||||
userId = _user.ID;
|
||||
}
|
||||
|
||||
var good = await _goodsServices.QueryByClauseAsync(p => p.id == entity.id, true);
|
||||
if (good == null)
|
||||
{
|
||||
jm.msg = "商品获取失败";
|
||||
return jm;
|
||||
}
|
||||
|
||||
//取所有货品
|
||||
var products = await _productsServices.QueryListByClauseAsync(p => p.goodsId == good.id && p.isDel == false, p => p.id, OrderByType.Asc, true);
|
||||
if (products == null)
|
||||
{
|
||||
jm.msg = "商品sku列表获取失败";
|
||||
return jm;
|
||||
}
|
||||
|
||||
var skus = await _goodsServices.GetCoreCmsProductsView(good, products, userId, entity.isPromotion, entity.type, entity.groupId);
|
||||
if (skus == null)
|
||||
{
|
||||
jm.msg = "商品sku列表组合获取失败";
|
||||
return jm;
|
||||
}
|
||||
|
||||
jm.status = true;
|
||||
jm.msg = "获取商品详情成功";
|
||||
jm.data = skus;
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
[HttpPost]
|
||||
public async Task<WebApiCallBack> GetGoodsDetial([FromBody] FMGetGoodsDetial entity)
|
||||
{
|
||||
var jm = await _coreCmsPromotionServices.GetGroupDetail(entity.id, 0, "group", entity.groupId);
|
||||
var jm = await _coreCmsPromotionServices.GetGroupDetail(entity.id, 0, entity.type, entity.groupId, entity.needSku);
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -19,8 +19,8 @@ using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.FromBody;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Model.ViewModels.DTO;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
@@ -62,7 +62,8 @@ namespace CoreCms.Net.Web.WebApi.Controllers.PayNotify
|
||||
var notify = await _client.ExecuteAsync<WeChatPayUnifiedOrderNotify>(Request, _optionsAccessor.Value);
|
||||
if (notify.ReturnCode == WeChatPayCode.Success)
|
||||
{
|
||||
await _redisOperationRepository.ListLeftPushAsync(RedisMessageQueueKey.WeChatPayNotice, JsonConvert.SerializeObject(notify));
|
||||
await _redisOperationRepository.ListLeftPushAsync(RedisMessageQueueKey.WeChatPayNotice,
|
||||
JsonConvert.SerializeObject(notify));
|
||||
return WeChatPayNotifyResult.Success;
|
||||
}
|
||||
NLogUtil.WriteAll(LogLevel.Trace, LogType.Order, "微信支付成功回调", JsonConvert.SerializeObject(notify));
|
||||
|
||||
@@ -17,8 +17,8 @@ using CoreCms.Net.Auth.HttpContextUser;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.FromBody;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Model.ViewModels.DTO;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Utility.Extensions;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
@@ -37,8 +37,8 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
{
|
||||
|
||||
private IHttpContextUser _user;
|
||||
private ICoreCmsBillPaymentsServices _billPaymentsServices;
|
||||
private ICoreCmsPaymentsServices _paymentsServices;
|
||||
private readonly ICoreCmsBillPaymentsServices _billPaymentsServices;
|
||||
private readonly ICoreCmsPaymentsServices _paymentsServices;
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
|
||||
@@ -82,7 +82,6 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
}
|
||||
jm = await _pinTuanRuleServices.GetPinTuanList(id, userId);
|
||||
return jm;
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -19,8 +19,8 @@ using CoreCms.Net.IServices;
|
||||
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.Model.ViewModels.DTO;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Utility.Extensions;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
@@ -243,7 +243,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
var store = await _storeServices.GetStoreByUserId(_user.ID);
|
||||
if (store != null)
|
||||
{
|
||||
jm = await _orderServices.GetOrderPageByMerchant(entity.dateType, entity.date, entity.status, entity.receiptType, entity.storeId, entity.page, entity.limit);
|
||||
jm = await _orderServices.GetOrderPageByMerchant(entity.dateType, entity.date, entity.status,entity.receiptType, entity.storeId, entity.page, entity.limit);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -191,7 +191,6 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
userInfo.gender = 1;
|
||||
userInfo.createTime = DateTime.Now;
|
||||
userInfo.unionId = response.UnionId;
|
||||
|
||||
await _userWeChatInfoServices.InsertAsync(userInfo);
|
||||
}
|
||||
else
|
||||
@@ -683,7 +682,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
var jm = new WebApiCallBack();
|
||||
|
||||
var userShareCode = 0;
|
||||
if (_user != null && _user.ID > 0)
|
||||
if (_user is { ID: > 0 })
|
||||
{
|
||||
userShareCode = UserHelper.GetShareCodeByUserId(_user.ID);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.AccressToken;
|
||||
using CoreCms.Net.Model.FromBody;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.WeChat.Service.HttpClients;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api.Models;
|
||||
|
||||
namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 微信小程序自定义交易组件
|
||||
/// </summary>
|
||||
[Route("api/[controller]/[action]")]
|
||||
[ApiController]
|
||||
public class WeChatTransactionComponentController : ControllerBase
|
||||
{
|
||||
private readonly WeChat.Service.HttpClients.IWeChatApiHttpClientFactory _weChatApiHttpClientFactory;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="weChatApiHttpClientFactory"></param>
|
||||
public WeChatTransactionComponentController(IWeChatApiHttpClientFactory weChatApiHttpClientFactory)
|
||||
{
|
||||
_weChatApiHttpClientFactory = weChatApiHttpClientFactory;
|
||||
}
|
||||
|
||||
|
||||
#region 获取用户是否订阅
|
||||
/// <summary>
|
||||
/// 获取用户是否订阅
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Authorize]
|
||||
public async Task<WebApiCallBack> CheckScene(FMIntId entity)
|
||||
{
|
||||
var jm = new WebApiCallBack();
|
||||
|
||||
|
||||
//获取小程序认证
|
||||
var accessToken = WeChatCacheAccessTokenHelper.GetWxOpenAccessToken();
|
||||
var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
|
||||
|
||||
var sceneRequest = new ShopSceneCheckRequest();
|
||||
sceneRequest.AccessToken = accessToken;
|
||||
sceneRequest.Scene = entity.id;
|
||||
|
||||
var sceneResponse = await client.ExecuteShopSceneCheckAsync(sceneRequest);
|
||||
|
||||
jm.status = true;
|
||||
jm.data = sceneResponse;
|
||||
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user