mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2026-02-05 00:49:49 +08:00
【修复】修复订单列表单个订单点击【取消】报错的问题。#I4N4U2
【优化】调整个人中心设置昵称长度。调整为2-16长度。增加validate表单验证。#I4N2QX 【修复】修复三级分销逻辑判断异常导致重复更新和创建的问题。#I4M23L 【修复】修复优惠券结果设置为【指定商品减固定金额】,而一张优惠券会被叠加使用的问题。#I4LEQR,#I4IXMP
This commit is contained in:
@@ -552,20 +552,20 @@ namespace CoreCms.Net.Repository
|
|||||||
newDt.Add(pd);
|
newDt.Add(pd);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
else
|
|
||||||
{
|
|
||||||
oldPostProducts.ForEach(p =>
|
|
||||||
{
|
{
|
||||||
var pd = new CoreCmsProductsDistribution();
|
oldPostProducts.ForEach(p =>
|
||||||
pd.createTime = DateTime.Now;
|
{
|
||||||
pd.productsSN = p.sn;
|
var pd = new CoreCmsProductsDistribution();
|
||||||
pd.levelOne = p.levelOne;
|
pd.createTime = DateTime.Now;
|
||||||
pd.levelTwo = p.levelTwo;
|
pd.productsSN = p.sn;
|
||||||
pd.levelThree = p.levelThree;
|
pd.levelOne = p.levelOne;
|
||||||
pd.productsId = p.id;
|
pd.levelTwo = p.levelTwo;
|
||||||
newDt.Add(pd);
|
pd.levelThree = p.levelThree;
|
||||||
});
|
pd.productsId = p.id;
|
||||||
|
newDt.Add(pd);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var upOldData = await DbClient.Updateable(oldDataProducts).ExecuteCommandHasChangeAsync();
|
var upOldData = await DbClient.Updateable(oldDataProducts).ExecuteCommandHasChangeAsync();
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ using CoreCms.Net.IRepository;
|
|||||||
using CoreCms.Net.IRepository.UnitOfWork;
|
using CoreCms.Net.IRepository.UnitOfWork;
|
||||||
using CoreCms.Net.IServices;
|
using CoreCms.Net.IServices;
|
||||||
using CoreCms.Net.Model.Entities;
|
using CoreCms.Net.Model.Entities;
|
||||||
using CoreCms.Net.Model.ViewModels.UI;
|
|
||||||
using CoreCms.Net.Model.ViewModels.DTO;
|
using CoreCms.Net.Model.ViewModels.DTO;
|
||||||
using CoreCms.Net.Utility.Extensions;
|
using CoreCms.Net.Utility.Extensions;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
@@ -31,7 +30,7 @@ namespace CoreCms.Net.Services
|
|||||||
{
|
{
|
||||||
private readonly ICoreCmsPromotionResultRepository _dal;
|
private readonly ICoreCmsPromotionResultRepository _dal;
|
||||||
|
|
||||||
private readonly ICoreCmsPromotionConditionServices _promotionConditionServices;
|
private ICoreCmsPromotionConditionServices _promotionConditionServices;
|
||||||
|
|
||||||
|
|
||||||
private readonly IUnitOfWork _unitOfWork;
|
private readonly IUnitOfWork _unitOfWork;
|
||||||
@@ -59,6 +58,7 @@ namespace CoreCms.Net.Services
|
|||||||
//如果是订单促销就直接去判断促销条件,如果是商品促销,就循环订单明细
|
//如果是订单促销就直接去判断促销条件,如果是商品促销,就循环订单明细
|
||||||
if (resultModel.sValue == "goods")
|
if (resultModel.sValue == "goods")
|
||||||
{
|
{
|
||||||
|
var isUsed = false;
|
||||||
foreach (var item in cart.list)
|
foreach (var item in cart.list)
|
||||||
{
|
{
|
||||||
var type = await _promotionConditionServices.goods_check(promotionInfo.id, (int)item.products.goodsId, item.nums);
|
var type = await _promotionConditionServices.goods_check(promotionInfo.id, (int)item.products.goodsId, item.nums);
|
||||||
@@ -67,20 +67,23 @@ namespace CoreCms.Net.Services
|
|||||||
//到这里就说明此商品信息满足促销商品促销信息的条件,去计算结果
|
//到这里就说明此商品信息满足促销商品促销信息的条件,去计算结果
|
||||||
//注意,在明细上面,就不细分促销的种类了,都放到一个上面,在订单上面才细分
|
//注意,在明细上面,就不细分促销的种类了,都放到一个上面,在订单上面才细分
|
||||||
decimal promotionModel = 0;
|
decimal promotionModel = 0;
|
||||||
switch (resultInfo.code)
|
if (isUsed == false)
|
||||||
{
|
{
|
||||||
case "GOODS_REDUCE":
|
switch (resultInfo.code)
|
||||||
promotionModel = result_GOODS_REDUCE(parameters, item, promotionInfo);
|
{
|
||||||
break;
|
case "GOODS_REDUCE":
|
||||||
case "GOODS_DISCOUNT":
|
promotionModel = result_GOODS_REDUCE(parameters, item, promotionInfo);
|
||||||
promotionModel = result_GOODS_DISCOUNT(parameters, item, promotionInfo);
|
break;
|
||||||
break;
|
case "GOODS_DISCOUNT":
|
||||||
case "GOODS_ONE_PRICE":
|
promotionModel = result_GOODS_DISCOUNT(parameters, item, promotionInfo);
|
||||||
promotionModel = result_GOODS_ONE_PRICE(parameters, item, promotionInfo);
|
break;
|
||||||
break;
|
case "GOODS_ONE_PRICE":
|
||||||
default:
|
promotionModel = result_GOODS_ONE_PRICE(parameters, item, promotionInfo);
|
||||||
promotionModel = 0;
|
break;
|
||||||
break;
|
default:
|
||||||
|
promotionModel = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.isSelect)
|
if (item.isSelect)
|
||||||
@@ -94,10 +97,19 @@ namespace CoreCms.Net.Services
|
|||||||
cart.amount = Math.Round(cart.amount - promotionModel, 2);
|
cart.amount = Math.Round(cart.amount - promotionModel, 2);
|
||||||
break;
|
break;
|
||||||
case (int)GlobalEnumVars.PromotionType.Coupon:
|
case (int)GlobalEnumVars.PromotionType.Coupon:
|
||||||
//优惠券促销金额
|
if (isUsed)
|
||||||
cart.couponPromotionMoney = Math.Round(cart.couponPromotionMoney + promotionModel, 2);
|
{
|
||||||
//设置总的价格
|
item.products.promotionList.Remove(promotionInfo.id);
|
||||||
cart.amount = Math.Round(cart.amount - promotionModel, 2);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//优惠券促销金额
|
||||||
|
cart.couponPromotionMoney = Math.Round(cart.couponPromotionMoney + promotionModel, 2);
|
||||||
|
//设置总的价格
|
||||||
|
cart.amount = Math.Round(cart.amount - promotionModel, 2);
|
||||||
|
//跳出下级处理
|
||||||
|
isUsed = true;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case (int)GlobalEnumVars.PromotionType.Group:
|
case (int)GlobalEnumVars.PromotionType.Group:
|
||||||
//团购
|
//团购
|
||||||
@@ -246,7 +258,7 @@ namespace CoreCms.Net.Services
|
|||||||
}
|
}
|
||||||
cartProducts.products.price = Math.Round(cartProducts.products.price - objMoney, 2);
|
cartProducts.products.price = Math.Round(cartProducts.products.price - objMoney, 2);
|
||||||
//此次商品促销一共优惠了多少钱
|
//此次商品促销一共优惠了多少钱
|
||||||
promotionMoney = Math.Round(cartProducts.nums * objMoney, 2);
|
promotionMoney = promotionInfo.type == (int)GlobalEnumVars.PromotionType.Coupon ? objMoney : Math.Round(cartProducts.nums * objMoney, 2);
|
||||||
//设置商品优惠总金额
|
//设置商品优惠总金额
|
||||||
cartProducts.products.promotionAmount = Math.Round(cartProducts.products.promotionAmount + objMoney, 2);
|
cartProducts.products.promotionAmount = Math.Round(cartProducts.products.promotionAmount + objMoney, 2);
|
||||||
//设置商品的实际销售金额(单品)
|
//设置商品的实际销售金额(单品)
|
||||||
@@ -269,8 +281,9 @@ namespace CoreCms.Net.Services
|
|||||||
decimal promotionMoney = 0;
|
decimal promotionMoney = 0;
|
||||||
decimal goodsPrice = cartProducts.products.price;
|
decimal goodsPrice = cartProducts.products.price;
|
||||||
cartProducts.products.price = Math.Round(Math.Round(Math.Round(cartProducts.products.price * objDiscount, 3) * 10, 2) / 100, 2);
|
cartProducts.products.price = Math.Round(Math.Round(Math.Round(cartProducts.products.price * objDiscount, 3) * 10, 2) / 100, 2);
|
||||||
var pmoney = Math.Round(goodsPrice - cartProducts.products.price, 2); //单品优惠的金额
|
//单品优惠的金额
|
||||||
promotionMoney = Math.Round(cartProducts.nums * pmoney, 2);
|
var pmoney = Math.Round(goodsPrice - cartProducts.products.price, 2);
|
||||||
|
promotionMoney = promotionInfo.type == (int)GlobalEnumVars.PromotionType.Coupon ? pmoney : Math.Round(cartProducts.nums * pmoney, 2);
|
||||||
//设置商品优惠总金额
|
//设置商品优惠总金额
|
||||||
cartProducts.products.promotionAmount = Math.Round(cartProducts.products.promotionAmount + promotionMoney, 2);
|
cartProducts.products.promotionAmount = Math.Round(cartProducts.products.promotionAmount + promotionMoney, 2);
|
||||||
//设置商品的实际销售总金额
|
//设置商品的实际销售总金额
|
||||||
@@ -293,8 +306,9 @@ namespace CoreCms.Net.Services
|
|||||||
}
|
}
|
||||||
var goodsPrice = (decimal)cartProducts.products.price;
|
var goodsPrice = (decimal)cartProducts.products.price;
|
||||||
cartProducts.products.price = Math.Round(objMoney, 2);
|
cartProducts.products.price = Math.Round(objMoney, 2);
|
||||||
var pmoney = Math.Round(goodsPrice - cartProducts.products.price, 2); //单品优惠的金额
|
//单品优惠的金额
|
||||||
promotionMoney = Math.Round(cartProducts.nums * pmoney, 2);
|
var pmoney = Math.Round(goodsPrice - cartProducts.products.price, 2);
|
||||||
|
promotionMoney = promotionInfo.type == (int)GlobalEnumVars.PromotionType.Coupon ? pmoney : Math.Round(cartProducts.nums * pmoney, 2);
|
||||||
//设置商品优惠总金额
|
//设置商品优惠总金额
|
||||||
cartProducts.products.promotionAmount = Math.Round(cartProducts.products.promotionAmount + promotionMoney, 2);
|
cartProducts.products.promotionAmount = Math.Round(cartProducts.products.promotionAmount + promotionMoney, 2);
|
||||||
//设置商品的实际销售总金额
|
//设置商品的实际销售总金额
|
||||||
|
|||||||
@@ -81,18 +81,18 @@
|
|||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
min: 3,
|
min: 2,
|
||||||
max: 16,
|
max: 16,
|
||||||
message: '昵称长度在3到16个字符',
|
message: '昵称长度在2到16个长度',
|
||||||
trigger: ['change', 'blur'],
|
trigger: ['change', 'blur'],
|
||||||
},
|
},
|
||||||
{
|
//{
|
||||||
validator: (rule, value, callback) => {
|
// validator: (rule, value, callback) => {
|
||||||
return this.$u.test.chinese(value);
|
// return this.$u.test.chinese(value);
|
||||||
},
|
// },
|
||||||
message: '昵称必须为中文',
|
// message: '昵称必须为中文',
|
||||||
trigger: ['change', 'blur'],
|
// trigger: ['change', 'blur'],
|
||||||
}
|
//}
|
||||||
],
|
],
|
||||||
sex: [
|
sex: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -607,7 +607,9 @@
|
|||||||
layer.confirm('确认取消订单号:' + id + ' 的订单吗?', {
|
layer.confirm('确认取消订单号:' + id + ' 的订单吗?', {
|
||||||
title: '提示', btn: ['确认', '取消'] //按钮
|
title: '提示', btn: ['确认', '取消'] //按钮
|
||||||
}, function () {
|
}, function () {
|
||||||
coreHelper.Post("Api/CoreCmsOrder/CancelOrder", { id: id }, function (e) {
|
var delidsStr = [];
|
||||||
|
delidsStr.push(id);
|
||||||
|
coreHelper.Post("Api/CoreCmsOrder/CancelOrder", { id: delidsStr }, function (e) {
|
||||||
layer.msg(e.msg, { time: 1300 }, function () {
|
layer.msg(e.msg, { time: 1300 }, function () {
|
||||||
layui.table.reloadData('LAY-app-CoreCmsOrder-tableBox'); //重载表格
|
layui.table.reloadData('LAY-app-CoreCmsOrder-tableBox'); //重载表格
|
||||||
doreLoadOrderCount();
|
doreLoadOrderCount();
|
||||||
|
|||||||
Reference in New Issue
Block a user