Commit 9a658bc8 authored by liudong1993's avatar liudong1993

储值卡订单对接

parent 4a19043f
......@@ -39,5 +39,10 @@ namespace Mall.Common.Enum.Goods
/// </summary>
[EnumField("支付定金")]
PayDeposit = 5,
/// <summary>
/// 储值卡支付
/// </summary>
[EnumField("储值卡支付")]
PayCards = 6
}
}
......@@ -345,5 +345,15 @@ namespace Mall.Model.Entity.Product
/// 版本来源 0默认商城 1教育
/// </summary>
public int? VersionSource { get; set; }
/// <summary>
/// 储值卡id
/// </summary>
public int DepositId { get; set; }
/// <summary>
/// 储值卡抵扣金额
/// </summary>
public decimal DepositMoney { get; set; }
}
}
......@@ -378,5 +378,20 @@ namespace Mall.Model.Entity.Product
/// 是否为可开发票商品,1-是
/// </summary>
public int IsNoTax { get; set; }
/// <summary>
/// 储值卡抵扣金额
/// </summary>
public decimal DepositMoney { get; set; }
/// <summary>
/// 储值卡抵扣运费金额
/// </summary>
public decimal DepositFreightMoney { get; set; }
/// <summary>
/// 储值卡退回金额
/// </summary>
public decimal DepositRefundMoney { get; set; }
}
}
......@@ -172,6 +172,11 @@ namespace Mall.Model.Extend.Product
/// 使用课程卡id
/// </summary>
public int? Use_Education_Id { get; set; }
/// <summary>
/// 使用储值卡id
/// </summary>
public int Use_Deposit_Id { get; set; }
/// <summary>
/// 优惠券描述
/// </summary>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -5,7 +5,7 @@ using System.Text;
using Mall.Model.Entity.User;
using Mall.Model.Extend.User;
namespace Mall.Repository.MarketingCenter
namespace Mall.Repository.User
{
/// <summary>
/// 储值卡合并/赠送仓储层
......
......@@ -242,6 +242,8 @@ namespace Mall.WebApi.Controllers.MallBase
x.Income,
x.FreightMoney,
x.CouponMoney,
x.DepositId,
x.DepositMoney,
x.PaymentWay,
PaymentWayName = x.PaymentWay.GetEnumName(),
DetailList = x.DetailList.Select(y => new
......
......@@ -100,6 +100,8 @@ namespace Mall.WebApi.Controllers.MallBase
CouponMoney = x.CouponMoney ?? 0,
IntegralMoney = (x.DetailList != null && x.DetailList.Any()) ? (x.DetailList.Sum(x => x.IntegralMoney ?? 0)) : 0,
IntegralNumber = (x.DetailList != null && x.DetailList.Any()) ? (x.DetailList.Sum(x => x.IntegralNumber ?? 0)) : 0,
x.DepositId,
x.DepositMoney,
MemberDiscountCouponList = x.MemberDiscountCouponList.Select(y => new
{
y.Name,
......@@ -2550,6 +2552,8 @@ namespace Mall.WebApi.Controllers.MallBase
x.Income,
x.FreightMoney,
x.CouponMoney,
x.DepositId,
x.DepositMoney,
x.PaymentWay,
PaymentWayName = x.PaymentWay.GetEnumName(),
DetailList = x.DetailList.Select(y => new
......
......@@ -158,6 +158,14 @@ namespace Mall.WindowsService.Module
/// 活动完成名单
/// </summary>
private static readonly RB_Goods_Activity_GetRepository goods_Activity_GetRepository = new RB_Goods_Activity_GetRepository();
/// <summary>
/// 储值卡
/// </summary>
private static readonly RB_Member_DepositBuyRepository member_DepositBuyRepository = new RB_Member_DepositBuyRepository();
/// <summary>
/// 储值卡流水
/// </summary>
private static readonly RB_Member_DepositBalanceRepository member_DepositBalanceRepository = new RB_Member_DepositBalanceRepository();
......@@ -634,6 +642,20 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
goodsRepository.Update(keyValues1, wheres1);
}
}
if (qitem.DepositId > 0)
{
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
{ nameof(RB_Goods_OrderDetail_Extend.DepositRefundMoney),ditem.DepositMoney + ditem.DepositFreightMoney}
};
List<WhereHelper> wheres1 = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Goods_OrderDetail_Extend.Id),
FiledValue=ditem.Id,
OperatorEnum=OperatorEnum.Equal
}
};
goods_OrderDetailRepository.Update(keyValues1, wheres1);
}
goods_LogRepository.Insert(new Mall.Model.Entity.Product.RB_Goods_Log()
{
Id = 0,
......@@ -704,6 +726,45 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
member_CouponRepository.Update(keyValues1, wheres1);
}
}
//储值卡回滚
if (qitem.DepositId > 0)
{
var depositModel = member_DepositBuyRepository.GetEntity(qitem.DepositId);
if (depositModel != null)
{
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
{ nameof(RB_Member_DepositBuy_Extend.SurplusPrice),depositModel.SurplusPrice + qitem.DepositMoney}
};
List<WhereHelper> wheres1 = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Member_DepositBuy_Extend.Id),
FiledValue=depositModel.Id,
OperatorEnum=OperatorEnum.Equal
}
};
member_DepositBuyRepository.Update(keyValues1, wheres1);
member_DepositBalanceRepository.Insert(new RB_Member_DepositBalance()
{
Id = 0,
UserId = umodel.Id,
Balance = depositModel.SurplusPrice,
CouponIco = depositModel.CouponIco,
CreateDate = DateTime.Now,
DepositPrice = depositModel.DepositPrice,
MallBaseId = umodel.MallBaseId,
MergeType = 3,
Name = depositModel.Name,
NewDepositBuyId = 0,
OldDepositBuyId = 0,
Remarks = "订单" + qitem.OrderNo + "取消,退回使用储值卡抵扣" + qitem.DepositMoney + "金额",
SalePrice = depositModel.SalePrice,
Status = 0,
Surplus = depositModel.SurplusPrice + qitem.DepositMoney,
TenantId = umodel.TenantId,
Type = Common.Enum.MarketingCenter.RecordTypeEnum.Income
});
}
}
//余额支付回滚
if (qitem.OrderClassify == 2 && qitem.EducationMoney > 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment