Commit 4ad1c780 authored by 吴春's avatar 吴春

提交代码

parent 7ec4692a
......@@ -418,21 +418,6 @@ namespace Mall.Module.User
TenantId = model.TenantId;
MallBaseId = model.MallBaseId;
var trans = vipBuyRepository.DbTransaction;
//2020-07-17 Add By:W
Dictionary<string, object> keyValuesVip = new Dictionary<string, object>() {
{ nameof(RB_Vip_Buy.PayTime),Time_End},
{ nameof(RB_Vip_Buy.PayState),1},
{ nameof(RB_Vip_Buy.MerchantsNo),Out_Trade_No}
};
List<WhereHelper> wheresVip = new List<WhereHelper>() {
new WhereHelper{
FiledName=nameof(RB_Vip_Buy.Id),
FiledValue=OrderId,
OperatorEnum=OperatorEnum.Equal
}
};
flag = vipBuyRepository.Update(keyValuesVip, wheresVip, trans);//更新会员购买记录 2020-07-17 Add By: W End
//判断返佣的过期时间
if (distributorModel.VipExpiryDate.HasValue)
......@@ -452,6 +437,24 @@ namespace Mall.Module.User
distributorModel.VipExpiryDate = model.ExpiryDate;
}
//2020-07-17 Add By:W
Dictionary<string, object> keyValuesVip = new Dictionary<string, object>() {
{ nameof(RB_Vip_Buy.PayTime),Time_End},
{ nameof(RB_Vip_Buy.PayState),1},
{ nameof(RB_Vip_Buy.MerchantsNo),Out_Trade_No},
{ nameof(RB_Vip_Buy.ExpiryDate), distributorModel.VipExpiryDate }
};
List<WhereHelper> wheresVip = new List<WhereHelper>() {
new WhereHelper{
FiledName=nameof(RB_Vip_Buy.Id),
FiledValue=OrderId,
OperatorEnum=OperatorEnum.Equal
}
};
flag = vipBuyRepository.Update(keyValuesVip, wheresVip, trans);//更新会员购买记录 2020-07-17 Add By: W End
//2020-07-20 Add By:W
Dictionary<string, object> keyValuesDistributor = new Dictionary<string, object>() {
{ nameof(RB_Distributor_Info.VipExpiryDate),distributorModel.VipExpiryDate},
......@@ -472,13 +475,13 @@ namespace Mall.Module.User
if (basicModel.IsEnableFXGrade == 1)
{
if (uModel == null) { return false; }
if (uModel == null) { vipBuyRepository.DBSession.Rollback(); return false; }
//粉象等级列表
var FXList = distributor_FXGradeRepository.GetList(new RB_Distributor_FXGrade_Extend() { TenantId = TenantId, MallBaseId = MallBaseId });
var VipModel = FXList.Where(x => x.IsGuest == 3).FirstOrDefault();
if (VipModel == null) { return false; }
if (VipModel == null) { vipBuyRepository.DBSession.Rollback(); return false; }
var PTModel = FXList.Where(x => x.IsGuest == 1).FirstOrDefault();
if (PTModel == null) { return false; }
if (PTModel == null) { vipBuyRepository.DBSession.Rollback(); return false; }
//vip购买返佣金额列表
var FXCList = distributor_FXCommissionRepository.GetFXCommissionList(new RB_Distributor_FXCommission_Extend() { TenantId = TenantId, MallBaseId = MallBaseId });
var disModel = distributor_InfoRepository.GetList(new RB_Distributor_Info_Extend() { TenantId = TenantId, MallBaseId = MallBaseId, UserId = BuyUserId, AuditStatus = Common.Enum.User.DistributorAuditStatusEnum.Audited }).FirstOrDefault();
......@@ -486,18 +489,20 @@ namespace Mall.Module.User
{
if (disModel.FXGradeId != VipModel.Id && disModel.FXGradeId != PTModel.Id)
{
vipBuyRepository.DBSession.Rollback();
return false;
}
//求其上级
var pmodel = member_UserRepository.GetEntity(uModel.SuperiorId);
if (pmodel == null) { return false; }
if (pmodel == null) { vipBuyRepository.DBSession.Rollback(); return false; }
var dispModel = distributor_InfoRepository.GetList(new RB_Distributor_Info_Extend() { TenantId = TenantId, MallBaseId = MallBaseId, UserId = pmodel.Id, AuditStatus = Common.Enum.User.DistributorAuditStatusEnum.Audited }).FirstOrDefault();
if (dispModel != null)
{
var pfxModel = FXList.Where(x => x.Id == dispModel.FXGradeId).FirstOrDefault();
if (pfxModel == null) { return false; }
if (pfxModel == null) { vipBuyRepository.DBSession.Rollback(); return false; }
if (pfxModel.Grade < VipModel.Grade)
{
vipBuyRepository.DBSession.Rollback();
return false;//其上级不是vip 直接后面的全部不提
}
//查询出当前用户的所有上级
......
......@@ -465,8 +465,12 @@ namespace Mall.WebApi.Controllers.AppletWeChat
RB_MiniProgram_Extend miniProgram = new RB_MiniProgram_Extend(); //2020年5月26号新增
miniProgram = new RB_MiniProgram_Extend { MiniAppId = "wxacd9f8cc3480d29e", WeChatApiSecret = "936110e2c2214340b9829a3608bde6b0", WeChatPayMerchants = "1562277941" }; // programModule.GetMiniProgramModule(new RB_MiniProgram_Extend { MallBaseId = 1, TenantId =1 });
string RefundOrderNo = System.DateTime.Now.ToString("yyyyMMddHHmmssfff");
var Robj = userCommonModule.InsertVipBuyCommission(21233, 3, "20200720152634009282", "20200720152634009282111", Common.Enum.Goods.OrderPayTypeEnum.WeChatPay, Convert.ToDecimal(365.00), System.DateTime.Now);
// var parmsInfo = RequestParm;
JObject parms = JObject.Parse(RequestParm.msg.ToString());
string orderNo = parms.GetStringValue("orderNo");
int orderId = parms.GetInt("orderId");
int userId = parms.GetInt("userId");
var Robj = userCommonModule.InsertVipBuyCommission(userId, orderId, orderNo, orderNo + "1111", Common.Enum.Goods.OrderPayTypeEnum.WeChatPay, Convert.ToDecimal(365.00), System.DateTime.Now);
return ApiResult.Success("", Robj);
}
......
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