Commit f2eb2b92 authored by 黄奎's avatar 黄奎

页面修改

parent 2dbe9cf8
......@@ -3,29 +3,26 @@ using Mall.Model.Entity.MarketingCenter;
using Mall.Model.Entity.User;
using Mall.Model.Extend.MarketingCenter;
using Mall.Model.Extend.User;
using Mall.Repository;
using Mall.Repository.MarketingCenter;
using Mall.Repository.Product;
using Mall.Repository.User;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Mall.Module.MarketingCenter
{
public class RechargeModule
{
private RB_Recharge_RulesRepository rulesRepository = new RB_Recharge_RulesRepository();
private readonly RB_Recharge_RulesRepository rulesRepository = new RB_Recharge_RulesRepository();
private RB_Member_BalanceRepository balanceRepository = new RB_Member_BalanceRepository();
private RB_Member_IntegralRepository integralRepository = new RB_Member_IntegralRepository();
private RB_Recharge_SettingsRepository settingsRepository = new RB_Recharge_SettingsRepository();
private readonly RB_Member_BalanceRepository balanceRepository = new RB_Member_BalanceRepository();
private readonly RB_Member_IntegralRepository integralRepository = new RB_Member_IntegralRepository();
private readonly RB_Recharge_SettingsRepository settingsRepository = new RB_Recharge_SettingsRepository();
private RB_Recharge_CustomRepository customRepository = new RB_Recharge_CustomRepository();
private RB_Member_BalanceRechargeRepository balanceRechargeRepository = new RB_Member_BalanceRechargeRepository();
private readonly RB_Recharge_CustomRepository customRepository = new RB_Recharge_CustomRepository();
private readonly RB_Member_BalanceRechargeRepository balanceRechargeRepository = new RB_Member_BalanceRechargeRepository();
/// <summary>
/// 会员信息
/// </summary>
......@@ -270,7 +267,6 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public bool UpdateBalanceRecharge(int UserId, int OrderId, string Out_Trade_No, string Transaction_Id, Common.Enum.Goods.OrderPayTypeEnum PayWay, string PayType, decimal Money, DateTime Time_End)
{
bool flag = false;
var umodel = member_UserRepository.GetEntity(UserId);
if (umodel == null)
{
......@@ -292,6 +288,7 @@ namespace Mall.Module.MarketingCenter
}
var trans = balanceRechargeRepository.DbTransaction;
bool flag;
try
{
......@@ -311,37 +308,41 @@ namespace Mall.Module.MarketingCenter
};
flag = balanceRechargeRepository.Update(keyValues, wheres, trans);//更新充值记录
//新增余额
RB_Member_Balance memberBalanceModel = new RB_Member_Balance();
memberBalanceModel.UserId = model.UserId;
memberBalanceModel.Type = Common.Enum.MarketingCenter.RecordTypeEnum.Income;
memberBalanceModel.Balance = model.Balance + Convert.ToDecimal(model.GiveMoney);
memberBalanceModel.Description = "在线充值" + model.Balance + "元余额" + (model.GiveMoney > 0 ? ("赠送" + Convert.ToDecimal(model.GiveMoney)) : "");
memberBalanceModel.CreateDate = model.RechargeTime;
memberBalanceModel.TenantId = model.TenantId;
memberBalanceModel.MallBaseId = model.MallBaseId;
memberBalanceModel.Remarks = "订单号:" + model.OrderNo + "在线充值" + model.Balance + "元余额" + (model.GiveMoney > 0 ? ("赠送" + Convert.ToDecimal(model.GiveMoney)) : "");
memberBalanceModel.PlatformType = model.OrderSource;
RB_Member_Balance memberBalanceModel = new RB_Member_Balance
{
UserId = model.UserId,
Type = Common.Enum.MarketingCenter.RecordTypeEnum.Income,
Balance = model.Balance + Convert.ToDecimal(model.GiveMoney),
Description = "在线充值" + model.Balance + "元余额" + (model.GiveMoney > 0 ? ("赠送" + Convert.ToDecimal(model.GiveMoney)) : ""),
CreateDate = model.RechargeTime,
TenantId = model.TenantId,
MallBaseId = model.MallBaseId,
Remarks = "订单号:" + model.OrderNo + "在线充值" + model.Balance + "元余额" + (model.GiveMoney > 0 ? ("赠送" + Convert.ToDecimal(model.GiveMoney)) : ""),
PlatformType = model.OrderSource
};
balanceRepository.Insert(memberBalanceModel, trans);
//判断是否赠送积分
if (model.GiveIntegral > 0)//有赠送的积分
{
RB_Member_Integral memberIntegralModel = new RB_Member_Integral();
memberIntegralModel.UserId = model.UserId;
memberIntegralModel.Type = Common.Enum.MarketingCenter.RecordTypeEnum.Income;
memberIntegralModel.PlatformType = model.OrderSource;
memberIntegralModel.Integral = model.GiveIntegral;
memberIntegralModel.Description = "在线充值" + model.Balance + "元余额" + (model.GiveMoney > 0 ? ("赠送" + model.GiveIntegral + "积分") : "");
memberIntegralModel.TenantId = model.TenantId;
memberIntegralModel.MallBaseId = model.MallBaseId;
memberIntegralModel.Remarks = "订单号:" + model.OrderNo + "在线充值" + model.Balance + "元余额" + (model.GiveMoney > 0 ? ("赠送" + model.GiveIntegral + "积分") : "");
memberIntegralModel.CreateDate = model.RechargeTime;
memberIntegralModel.OrderId = 0;
RB_Member_Integral memberIntegralModel = new RB_Member_Integral
{
UserId = model.UserId,
Type = Common.Enum.MarketingCenter.RecordTypeEnum.Income,
PlatformType = model.OrderSource,
Integral = model.GiveIntegral,
Description = "在线充值" + model.Balance + "元余额" + (model.GiveMoney > 0 ? ("赠送" + model.GiveIntegral + "积分") : ""),
TenantId = model.TenantId,
MallBaseId = model.MallBaseId,
Remarks = "订单号:" + model.OrderNo + "在线充值" + model.Balance + "元余额" + (model.GiveMoney > 0 ? ("赠送" + model.GiveIntegral + "积分") : ""),
CreateDate = model.RechargeTime,
OrderId = 0
};
integralRepository.Insert(memberIntegralModel, trans);
}
goods_Online_TradeRepository.Insert(new Model.Entity.Product.RB_Goods_Online_Trade()
goods_Online_TradeRepository.Insert(new Model.Entity.Product.RB_Goods_Online_Trade()
{
Id = 0,
User_Id = UserId,
......@@ -363,7 +364,7 @@ namespace Mall.Module.MarketingCenter
TenantId = umodel.TenantId,
Transaction_Id = Transaction_Id,
Type = 3
}) ;
});
balanceRechargeRepository.DBSession.Commit();
}
catch (Exception ex)
......
......@@ -28,46 +28,46 @@ namespace Mall.Module.User
/// <summary>
/// 商户仓储层对象
/// </summary>
private Mall.Repository.User.RB_MiniProgramRepository programRepository = new Repository.User.RB_MiniProgramRepository();
private readonly RB_MiniProgramRepository programRepository = new Repository.User.RB_MiniProgramRepository();
/// <summary>
/// 底部导航仓储层对象
/// </summary>
private Repository.User.RB_Miniprogram_BottomnavRepository bottomnavRepository = new Repository.User.RB_Miniprogram_BottomnavRepository();
private readonly RB_Miniprogram_BottomnavRepository bottomnavRepository = new Repository.User.RB_Miniprogram_BottomnavRepository();
/// <summary>
/// 用户中心仓储层对象
/// </summary>
private Repository.User.RB_MiniProgram_UserCenterMenuRepository centerMenuRepository = new Repository.User.RB_MiniProgram_UserCenterMenuRepository();
private readonly RB_MiniProgram_UserCenterMenuRepository centerMenuRepository = new Repository.User.RB_MiniProgram_UserCenterMenuRepository();
/// <summary>
/// 会员订阅消息仓储层对象
/// </summary>
private Repository.User.RB_Member_SubscriptionRepository subscriptionRepository = new Repository.User.RB_Member_SubscriptionRepository();
private readonly RB_Member_SubscriptionRepository subscriptionRepository = new Repository.User.RB_Member_SubscriptionRepository();
/// <summary>
/// 会员仓储层对象
/// </summary>
private Repository.User.RB_Member_UserRepository userRepository = new Repository.User.RB_Member_UserRepository();
private readonly RB_Member_UserRepository userRepository = new Repository.User.RB_Member_UserRepository();
/// <summary>
/// 直播房间仓储层对象
/// </summary>
private Repository.AppletWeChat.RB_Live_HouseRepository liveHouseRepository = new Repository.AppletWeChat.RB_Live_HouseRepository();
private readonly RB_Live_HouseRepository liveHouseRepository = new Repository.AppletWeChat.RB_Live_HouseRepository();
/// <summary>
/// 直播房间仓储层对象
/// </summary>
private Repository.AppletWeChat.RB_Live_HouseImgRepository liveHouseImgRepository = new Repository.AppletWeChat.RB_Live_HouseImgRepository();
private readonly RB_Live_HouseImgRepository liveHouseImgRepository = new Repository.AppletWeChat.RB_Live_HouseImgRepository();
/// <summary>
/// 轮播图表仓储层对象
/// </summary>
private RB_Mall_NavRepository navRepository = new RB_Mall_NavRepository();
private readonly RB_Mall_NavRepository navRepository = new RB_Mall_NavRepository();
/// <summary>
/// 图片魔方表仓储层对象
/// </summary>
private RB_Mall_MagicRepository magicRepository = new RB_Mall_MagicRepository();
private readonly RB_Mall_MagicRepository magicRepository = new RB_Mall_MagicRepository();
/// <summary>
/// 用户共用模块
......@@ -116,7 +116,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetMallNavModule(RB_Mall_Nav_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -158,12 +158,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveMallNavModule(object Id)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Mall_Nav_Extend.Status),1},
};
flag = navRepository.Update(fileds, new WhereHelper(nameof(RB_Mall_Nav_Extend.Id), Id));
bool flag = navRepository.Update(fileds, new WhereHelper(nameof(RB_Mall_Nav_Extend.Id), Id));
return flag;
}
......@@ -211,7 +210,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetMallMagicModule(RB_Mall_Magic_Extend extModel)
{
bool flag = false;
bool flag;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -257,12 +256,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveMallMagicModule(object Id)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Mall_Magic_Extend.Status),1},
};
flag = magicRepository.Update(fileds, new WhereHelper(nameof(RB_Mall_Magic_Extend.Id), Id));
bool flag = magicRepository.Update(fileds, new WhereHelper(nameof(RB_Mall_Magic_Extend.Id), Id));
return flag;
}
#endregion
......@@ -325,11 +323,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetMiniProgramModule(RB_MiniProgram_Extend extModel)
{
bool flag = false;
if (extModel.IsEffective == 1)
{
extModel.MallValidate = null;
}
bool flag;
if (extModel.MallBaseId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -523,12 +521,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetMiniProgramModule(object MallBaseId, int Status)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_MiniProgram_Extend.Status),Status},
};
flag = programRepository.Update(fileds, new WhereHelper(nameof(RB_MiniProgram_Extend.MallBaseId), MallBaseId));
bool flag = programRepository.Update(fileds, new WhereHelper(nameof(RB_MiniProgram_Extend.MallBaseId), MallBaseId));
return flag;
}
......@@ -540,12 +537,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetMiniProgramStatusModule(object MallBaseId, int Status)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_MiniProgram_Extend.Status),Status},
};
flag = programRepository.Update(fileds, new WhereHelper(nameof(RB_MiniProgram_Extend.MallBaseId), MallBaseId));
bool flag = programRepository.Update(fileds, new WhereHelper(nameof(RB_MiniProgram_Extend.MallBaseId), MallBaseId));
return flag;
}
......@@ -557,12 +553,11 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetMiniProgramRecycleModule(object MallBaseId, int Is_Recycle)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_MiniProgram_Extend.Is_Recycle),Is_Recycle},
};
flag = programRepository.Update(fileds, new WhereHelper(nameof(RB_MiniProgram_Extend.MallBaseId), MallBaseId));
bool flag = programRepository.Update(fileds, new WhereHelper(nameof(RB_MiniProgram_Extend.MallBaseId), MallBaseId));
return flag;
}
......@@ -642,8 +637,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveMiniProgramMallTagModule(string TagId)
{
var flag = false;
flag = bottomnavRepository.DeleteBottomnavRepository(TagId);
bool flag = bottomnavRepository.DeleteBottomnavRepository(TagId);
return flag;
}
......@@ -846,8 +840,7 @@ namespace Mall.Module.User
/// <returns></returns>
public bool RemoveMiniUserCenterMenuModule(object DetailId)
{
bool flag = false;
flag = centerMenuRepository.Delete(DetailId) > 0;
bool flag = centerMenuRepository.Delete(DetailId) > 0;
return flag;
}
......@@ -1841,7 +1834,7 @@ namespace Mall.Module.User
var postdata = new
{
action = "get_replay",
room_id = room_id,
room_id,
start = 0,
limit = 100
};
......@@ -1987,8 +1980,6 @@ namespace Mall.Module.User
/// <returns></returns>
public bool DelLiveHouseImg(int id, int uid, int mallBaseId)
{
bool flag = false;
Dictionary<string, object> cols = new Dictionary<string, object>()
{
{ nameof(RB_Live_HouseImg.Status),1},
......@@ -2010,7 +2001,7 @@ namespace Mall.Module.User
OperatorEnum=OperatorEnum.Equal
}
};
flag = liveHouseImgRepository.Update(cols, wheres1);
bool flag = liveHouseImgRepository.Update(cols, wheres1);
return flag;
}
......@@ -2154,9 +2145,9 @@ namespace Mall.Module.User
/// <returns></returns>
public bool SetLiveConfigModule(RB_Live_Config_Extend extModel)
{
var flag = false;
var oldModel = GetLiveConfigModule(extModel);
if (oldModel!=null&&oldModel.Id > 0)
bool flag;
if (oldModel != null && oldModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
......
......@@ -81,6 +81,6 @@
"GradeEntranceImage": "1234566778"
},
"ShareConfig": {
"ShareImg": "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/zanyang.png",
"ShareImg": "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/zanyang.png"
}
}
\ No newline at end of file
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