Commit 9ab065d9 authored by liudong1993's avatar liudong1993

Merge branch 'master' of http://gitlab.oytour.com/Kui2/mall.oytour.com into sdzq-ld

parents cdfa701e e88dadd0
...@@ -4,6 +4,10 @@ ...@@ -4,6 +4,10 @@
<TargetFramework>netcoreapp3.0</TargetFramework> <TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<None Include="..\.editorconfig" Link=".editorconfig" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.0.1" /> <PackageReference Include="Microsoft.Extensions.Configuration" Version="3.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.0.1" /> <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.0.1" />
......
...@@ -238,6 +238,10 @@ namespace Mall.Model.Entity.Education ...@@ -238,6 +238,10 @@ namespace Mall.Model.Entity.Education
/// </summary> /// </summary>
public int WeiXinType { get; set; } public int WeiXinType { get; set; }
/// <summary>
/// 关联老师
/// </summary>
public int TeacherId { get; set; }
} }
} }
...@@ -87,6 +87,11 @@ namespace Mall.Model.Extend.Education ...@@ -87,6 +87,11 @@ namespace Mall.Model.Extend.Education
public string StuBirth { get; set; } public string StuBirth { get; set; }
public List<int> ExcelEnumIds { get; set; } public List<int> ExcelEnumIds { get; set; }
/// <summary>
/// 教师名称
/// </summary>
public string TeacherName { get; set; }
} }
......
...@@ -154,10 +154,10 @@ namespace Mall.Module.Education ...@@ -154,10 +154,10 @@ namespace Mall.Module.Education
/// </summary> /// </summary>
private readonly RB_Education_ActivityPlanRepository education_ActivityPlanRepository = new RB_Education_ActivityPlanRepository(); private readonly RB_Education_ActivityPlanRepository education_ActivityPlanRepository = new RB_Education_ActivityPlanRepository();
/// <summary>
#region 活动分类 #region 活动分类
/// <summary> /// <summary>
/// 活动分类
/// <summary>
/// 获取商会活动类型分页列表 /// 获取商会活动类型分页列表
/// </summary> /// </summary>
/// <param name="pageIndex"></param> /// <param name="pageIndex"></param>
...@@ -573,7 +573,7 @@ namespace Mall.Module.Education ...@@ -573,7 +573,7 @@ namespace Mall.Module.Education
var list = education_EduSellRepository.GetEducationStuList(query, true); var list = education_EduSellRepository.GetEducationStuList(query, true);
if (list != null && list.Any(x => x.EduSellId > 0)) if (list != null && list.Any(x => x.EduSellId > 0))
{ {
string qIds = string.Join(",", list.Where(x => x.EduSellId > 0 && x.Type ==1).Distinct().Select(x => x.EduSellId)); string qIds = string.Join(",", list.Where(x => x.EduSellId > 0 && x.Type == 1).Distinct().Select(x => x.EduSellId));
var employeeList = RB_AccountRepository.GetEmployeeListRepository(new Employee_ViewModel { QIds = qIds }).ToList(); var employeeList = RB_AccountRepository.GetEmployeeListRepository(new Employee_ViewModel { QIds = qIds }).ToList();
string qstuIds = string.Join(",", list.Where(x => x.EduSellId > 0 && x.Type == 2).Distinct().Select(x => x.EduSellId)); string qstuIds = string.Join(",", list.Where(x => x.EduSellId > 0 && x.Type == 2).Distinct().Select(x => x.EduSellId));
var stuList = RB_AccountRepository.GetStudentExt(new RB_Account_ViewModel() { QIds = qstuIds, AccountType = 4 }); var stuList = RB_AccountRepository.GetStudentExt(new RB_Account_ViewModel() { QIds = qstuIds, AccountType = 4 });
...@@ -584,7 +584,8 @@ namespace Mall.Module.Education ...@@ -584,7 +584,8 @@ namespace Mall.Module.Education
{ {
item.employeeModel = employeeList.Where(x => x.Id == item.EduSellId).FirstOrDefault(); item.employeeModel = employeeList.Where(x => x.Id == item.EduSellId).FirstOrDefault();
} }
else if (item.Type == 2) { else if (item.Type == 2)
{
var stuModel = stuList.Where(x => x.Id == item.EduSellId).FirstOrDefault(); var stuModel = stuList.Where(x => x.Id == item.EduSellId).FirstOrDefault();
item.employeeModel = new Employee_ViewModel() item.employeeModel = new Employee_ViewModel()
{ {
...@@ -644,7 +645,8 @@ namespace Mall.Module.Education ...@@ -644,7 +645,8 @@ namespace Mall.Module.Education
if (model.Id == 0) if (model.Id == 0)
{ {
flag = education_EduSellRepository.Insert(model) > 0; flag = education_EduSellRepository.Insert(model) > 0;
if (flag) { if (flag)
{
//绑定成功 直接初始化 免费咖啡劵 //绑定成功 直接初始化 免费咖啡劵
//if (model.Type == 1) //if (model.Type == 1)
//{ //{
...@@ -933,6 +935,11 @@ namespace Mall.Module.Education ...@@ -933,6 +935,11 @@ namespace Mall.Module.Education
var employeeList = RB_AccountRepository.GetStudentExt(new RB_Account_ViewModel { QIds = qIds }).ToList(); var employeeList = RB_AccountRepository.GetStudentExt(new RB_Account_ViewModel { QIds = qIds }).ToList();
list.ForEach(x => x.EduStudentName = x.EduStudentId > 0 ? employeeList.Where(y => y.Id == x.EduStudentId).FirstOrDefault()?.AccountName : ""); list.ForEach(x => x.EduStudentName = x.EduStudentId > 0 ? employeeList.Where(y => y.Id == x.EduStudentId).FirstOrDefault()?.AccountName : "");
} }
List<Employee_ViewModel> teacherList = RB_AccountRepository.GetEmployeeListRepository(new Employee_ViewModel
{
AccountTypeStr = "2"
}).ToList();
List<RB_Finance_Extend> flist = new List<RB_Finance_Extend>(); List<RB_Finance_Extend> flist = new List<RB_Finance_Extend>();
string orderIds = string.Join(",", list.Select(x => x.Id)); string orderIds = string.Join(",", list.Select(x => x.Id));
flist = financeRepository.GetListJH(new RB_Finance_Extend() { ReFinanceIds2 = orderIds }); flist = financeRepository.GetListJH(new RB_Finance_Extend() { ReFinanceIds2 = orderIds });
...@@ -978,16 +985,17 @@ namespace Mall.Module.Education ...@@ -978,16 +985,17 @@ namespace Mall.Module.Education
} }
} }
} }
} }
foreach (var item in list) }
foreach (var item in list)
{
item.FinanceList = new List<RB_Finance_Extend>();
item.FinanceList = flist.Where(x => x.ReFinanceId2 == item.Id).ToList();
if (item.FinanceList == null || !item.FinanceList.Any())
{ {
item.FinanceList = new List<RB_Finance_Extend>(); item.FinanceList = new List<RB_Finance_Extend>();
item.FinanceList = flist.Where(x => x.ReFinanceId2 == item.Id).ToList();
if (item.FinanceList == null || !item.FinanceList.Any())
{
item.FinanceList = new List<RB_Finance_Extend>();
}
} }
item.TeacherName = teacherList?.FirstOrDefault(qitem => qitem.AccountId == item.TeacherId)?.EmployeeName ?? "";
} }
} }
return list; return list;
...@@ -1107,21 +1115,23 @@ namespace Mall.Module.Education ...@@ -1107,21 +1115,23 @@ namespace Mall.Module.Education
try try
{ {
flag = education_ConsultRepository.Insert(demodel, trans); flag = education_ConsultRepository.Insert(demodel, trans);
if (flag > 0) if (flag > 0)
{ {
if (demodel.TotalPoint > 0) if (demodel.TotalPoint > 0)
{ {
Dictionary<string, object> keyValues = new Dictionary<string, object>() { Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(Model.Extend.User.RB_Member_User_Extend.PointNum),umodel.PointNum - demodel.TotalPoint} {
}; nameof(Model.Extend.User.RB_Member_User_Extend.PointNum),umodel.PointNum - demodel.TotalPoint}
List<WhereHelper> wheres = new List<WhereHelper>() { };
new WhereHelper(){ List<WhereHelper> wheres = new List<WhereHelper>()
FiledName=nameof(RB_Member_User_Extend.Id), {
FiledValue=umodel.Id, new WhereHelper()
OperatorEnum=OperatorEnum.Equal {
} FiledName=nameof(RB_Member_User_Extend.Id),
}; FiledValue=umodel.Id,
OperatorEnum=OperatorEnum.Equal
}
};
member_UserRepository.Update(keyValues, wheres, trans); member_UserRepository.Update(keyValues, wheres, trans);
member_PointBalanceRepository.Insert(new Model.Entity.User.RB_Member_PointBalance() member_PointBalanceRepository.Insert(new Model.Entity.User.RB_Member_PointBalance()
{ {
...@@ -1146,7 +1156,6 @@ namespace Mall.Module.Education ...@@ -1146,7 +1156,6 @@ namespace Mall.Module.Education
LogHelper.Write(ex, "SetActivityEnrollInfo"); LogHelper.Write(ex, "SetActivityEnrollInfo");
education_ConsultRepository.DBSession.Rollback("SetActivityEnrollInfo"); education_ConsultRepository.DBSession.Rollback("SetActivityEnrollInfo");
return 0; return 0;
} }
} }
else if (demodel.PaymentWay == Common.Enum.Goods.OrderPaymentTypeEnum.OnlinePayment) else if (demodel.PaymentWay == Common.Enum.Goods.OrderPaymentTypeEnum.OnlinePayment)
...@@ -1174,8 +1183,6 @@ namespace Mall.Module.Education ...@@ -1174,8 +1183,6 @@ namespace Mall.Module.Education
} }
/// <summary> /// <summary>
/// 订单记录当前用户的所有上级 /// 订单记录当前用户的所有上级
/// </summary> /// </summary>
...@@ -1937,7 +1944,6 @@ namespace Mall.Module.Education ...@@ -1937,7 +1944,6 @@ namespace Mall.Module.Education
#endregion #endregion
#region 教育学生信息 #region 教育学生信息
/// <summary> /// <summary>
/// 获取学生列表 /// 获取学生列表
...@@ -2033,9 +2039,6 @@ namespace Mall.Module.Education ...@@ -2033,9 +2039,6 @@ namespace Mall.Module.Education
#endregion #endregion
#region 活动总结 #region 活动总结
/// <summary> /// <summary>
...@@ -2231,8 +2234,6 @@ namespace Mall.Module.Education ...@@ -2231,8 +2234,6 @@ namespace Mall.Module.Education
} }
#endregion #endregion
#region 财务单据信息 #region 财务单据信息
...@@ -2625,7 +2626,8 @@ namespace Mall.Module.Education ...@@ -2625,7 +2626,8 @@ namespace Mall.Module.Education
DateTime STime = Convert.ToDateTime(query.SelectStartTimeStr); DateTime STime = Convert.ToDateTime(query.SelectStartTimeStr);
DateTime ETime = Convert.ToDateTime(query.SelectEndTimeStr); DateTime ETime = Convert.ToDateTime(query.SelectEndTimeStr);
List<object> RList = new List<object>(); List<object> RList = new List<object>();
while (true) { while (true)
{
var alist = list.Where(x => Convert.ToDateTime(x.StartTime.ToString("yyyy-MM-dd")) <= STime && Convert.ToDateTime(x.EndTime.ToString("yyyy-MM-dd")) >= STime).ToList(); var alist = list.Where(x => Convert.ToDateTime(x.StartTime.ToString("yyyy-MM-dd")) <= STime && Convert.ToDateTime(x.EndTime.ToString("yyyy-MM-dd")) >= STime).ToList();
RList.Add(new RList.Add(new
{ {
...@@ -2647,7 +2649,8 @@ namespace Mall.Module.Education ...@@ -2647,7 +2649,8 @@ namespace Mall.Module.Education
x.TeacherName x.TeacherName
}) })
}); });
if (STime == ETime) { if (STime == ETime)
{
break; break;
} }
STime = STime.AddDays(1); STime = STime.AddDays(1);
......
This diff is collapsed.
...@@ -80,21 +80,23 @@ namespace Mall.Repository.Education ...@@ -80,21 +80,23 @@ namespace Mall.Repository.Education
{ {
builder.Append($" AND a.{nameof(RB_Education_CouponProduct.CouponId)} in ({DiscountCouponIds})"); builder.Append($" AND a.{nameof(RB_Education_CouponProduct.CouponId)} in ({DiscountCouponIds})");
} }
string sql = ""; string builderStr = builder.ToString();
string sql;
if (IsSelectDel) if (IsSelectDel)
{ {
sql = $"SELECT a.* from {TableName} as a WHERE 1=1 "; sql = $"SELECT a.* from {TableName} as a WHERE 1=1 ";
} }
else { else
sql = $"SELECT a.* from {TableName} as a WHERE a.{nameof(RB_Education_CouponProduct.Status)}=0 {builder.ToString()} "; {
sql = $"SELECT a.* from {TableName} as a WHERE a.{nameof(RB_Education_CouponProduct.Status)}=0 {builderStr} ";
} }
if (query.UseType == Common.Enum.MarketingCenter.UseTypeEnum.Category) if (query.UseType == Common.Enum.MarketingCenter.UseTypeEnum.Category)
{ {
sql = $" SELECT a.*,b.`Name` as Relevance from {TableName} as a LEFT JOIN {PCategoryTableName} as b on a.ProductId=b.Id WHERE a.{nameof(RB_Education_CouponProduct.Status)}=0 {builder.ToString()} "; sql = $" SELECT a.*,b.`Name` as Relevance from {TableName} as a LEFT JOIN {PCategoryTableName} as b on a.ProductId=b.Id WHERE a.{nameof(RB_Education_CouponProduct.Status)}=0 {builderStr} ";
} }
else if (query.UseType == Common.Enum.MarketingCenter.UseTypeEnum.Product) else if (query.UseType == Common.Enum.MarketingCenter.UseTypeEnum.Product)
{ {
sql = $" SELECT a.*,b.`Name` as Relevance from {TableName} as a LEFT JOIN {GoodsTableName} as b on a.ProductId=b.Id WHERE a.{nameof(RB_Education_CouponProduct.Status)}=0 {builder.ToString()} "; sql = $" SELECT a.*,b.`Name` as Relevance from {TableName} as a LEFT JOIN {GoodsTableName} as b on a.ProductId=b.Id WHERE a.{nameof(RB_Education_CouponProduct.Status)}=0 {builderStr} ";
} }
return Get<RB_Education_CouponProduct_Extend>(sql).ToList(); return Get<RB_Education_CouponProduct_Extend>(sql).ToList();
} }
......
...@@ -1649,7 +1649,7 @@ where {where} group by g.Id order by col.Id desc"; ...@@ -1649,7 +1649,7 @@ where {where} group by g.Id order by col.Id desc";
{ {
DynamicParameters parameters = new DynamicParameters(); DynamicParameters parameters = new DynamicParameters();
string where = $" 1=1 and g.{nameof(RB_Goods_Extend.Status)}=0 and g.RetailStore=1"; string where = $" 1=1 and g.{nameof(RB_Goods_Extend.Status)}=0 and g.RetailStore=1";
string sourceWhere = "";
if (dmodel.GoodsClassify == 3) if (dmodel.GoodsClassify == 3)
{//查询非司导商品 {//查询非司导商品
where += $@" and g.GoodsClassify =3"; where += $@" and g.GoodsClassify =3";
...@@ -1694,7 +1694,7 @@ where {where} group by g.Id order by col.Id desc"; ...@@ -1694,7 +1694,7 @@ where {where} group by g.Id order by col.Id desc";
where += $@" and IFNULL(synchro.{nameof(RB_Goods_Extend.Isynchro)},0)=0"; where += $@" and IFNULL(synchro.{nameof(RB_Goods_Extend.Isynchro)},0)=0";
} }
} }
sourceWhere = $@"and TenantId={dmodel.SourceTenantId} and MallBaseId={dmodel.SourceMallBaseId}"; string sourceWhere = $@"and TenantId={dmodel.SourceTenantId} and MallBaseId={dmodel.SourceMallBaseId}";
if (!string.IsNullOrEmpty(dmodel.GoodsIds)) if (!string.IsNullOrEmpty(dmodel.GoodsIds))
{ {
where += $@" and g.{nameof(RB_Goods_Extend.Id)} in({dmodel.GoodsIds})"; where += $@" and g.{nameof(RB_Goods_Extend.Id)} in({dmodel.GoodsIds})";
......
...@@ -760,18 +760,6 @@ WHERE u.TenantId={tenantId} and u.MallBaseId={mallBaseId} and u.SuperiorId ={uid ...@@ -760,18 +760,6 @@ WHERE u.TenantId={tenantId} and u.MallBaseId={mallBaseId} and u.SuperiorId ={uid
return 0; return 0;
} }
/// <summary>
/// 获取七天后自动释放
/// </summary>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public List<RB_Member_User_Extend> AutoReleaseTheOffline(int tenantId, int mallBaseId)
{
string sql = $@"SELECT * FROM rb_member_user WHERE DownlineCondition=4 and IsDistributor = 0 and SuperiorId >0 AND DATE_ADD(CreateDate,INTERVAL 7 DAY) < '{Common.ConvertHelper.FormatTime(DateTime.Now)}'";
return Get<RB_Member_User_Extend>(sql).ToList();
}
/// <summary> /// <summary>
/// 获取用户上级所有的id /// 获取用户上级所有的id
/// </summary> /// </summary>
...@@ -868,6 +856,7 @@ WHERE u.TenantId={tenantId} and u.MallBaseId={mallBaseId} and u.SuperiorId ={use ...@@ -868,6 +856,7 @@ WHERE u.TenantId={tenantId} and u.MallBaseId={mallBaseId} and u.SuperiorId ={use
/// <returns></returns> /// <returns></returns>
public RB_Member_User_Extend GetMemberUserEntityRepository(RB_Member_User_Extend query) public RB_Member_User_Extend GetMemberUserEntityRepository(RB_Member_User_Extend query)
{ {
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" builder.AppendFormat(@"
SELECT A.*,IFNULL(B.UserId,0) AS AdminId SELECT A.*,IFNULL(B.UserId,0) AS AdminId
...@@ -888,11 +877,13 @@ WHERE 1=1 ...@@ -888,11 +877,13 @@ WHERE 1=1
} }
if (!string.IsNullOrEmpty(query.Name)) if (!string.IsNullOrEmpty(query.Name))
{ {
builder.AppendFormat($@" and A.{nameof(RB_Member_User.Name)} like '%{query.Name}%' "); builder.AppendFormat($@" and A.{nameof(RB_Member_User.Name)} like @Name ");
parameters.Add("Name", "%" + query.Name.Trim() + "%");
} }
if (!string.IsNullOrEmpty(query.AliasName)) if (!string.IsNullOrEmpty(query.AliasName))
{ {
builder.AppendFormat($@" and A.{nameof(RB_Member_User.AliasName)} like '%{query.AliasName}%'"); builder.AppendFormat($@" and A.{nameof(RB_Member_User.AliasName)} like @AliasName ");
parameters.Add("AliasName", "%" + query.AliasName.Trim() + "%");
} }
if (query.Source > 0) if (query.Source > 0)
{ {
...@@ -900,7 +891,8 @@ WHERE 1=1 ...@@ -900,7 +891,8 @@ WHERE 1=1
} }
if (!string.IsNullOrEmpty(query.Moblie)) if (!string.IsNullOrEmpty(query.Moblie))
{ {
builder.AppendFormat($@" and A.{nameof(RB_Member_User.Moblie)} like '%{query.Moblie}%'"); builder.AppendFormat($@" and A.{nameof(RB_Member_User.Moblie)} like @Moblie ");
parameters.Add("Moblie", "%" + query.Moblie.Trim() + "%");
} }
if (query.MemberGrade > 0) if (query.MemberGrade > 0)
{ {
...@@ -917,10 +909,10 @@ WHERE 1=1 ...@@ -917,10 +909,10 @@ WHERE 1=1
//HK06-01新增查询条件 //HK06-01新增查询条件
if (query.OpenId != null && !string.IsNullOrWhiteSpace(query.OpenId)) if (query.OpenId != null && !string.IsNullOrWhiteSpace(query.OpenId))
{ {
builder.AppendFormat($@" and A.{nameof(RB_Member_User.OpenId)} LIKE '{query.OpenId}%'"); builder.AppendFormat($@" and A.{nameof(RB_Member_User.OpenId)} LIKE @OpenId ");
parameters.Add("OpenId", "%" + query.OpenId.Trim() + "%");
} }
return Get<RB_Member_User_Extend>(builder.ToString(), parameters).FirstOrDefault();
return Get<RB_Member_User_Extend>(builder.ToString()).FirstOrDefault();
} }
#endregion #endregion
......
...@@ -4,7 +4,7 @@ using System.Text; ...@@ -4,7 +4,7 @@ using System.Text;
using Mall.Model.Entity.User; using Mall.Model.Entity.User;
using Mall.Model.Extend.User; using Mall.Model.Extend.User;
using System.Linq; using System.Linq;
using VT.FW.DB.Dapper;
namespace Mall.Repository.User namespace Mall.Repository.User
{ {
...@@ -61,6 +61,7 @@ namespace Mall.Repository.User ...@@ -61,6 +61,7 @@ namespace Mall.Repository.User
/// <returns></returns> /// <returns></returns>
public RB_MiniProgram_Extend GetMiniProgramRepository(RB_MiniProgram_Extend query) public RB_MiniProgram_Extend GetMiniProgramRepository(RB_MiniProgram_Extend query)
{ {
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.Append(" SELECT * FROM RB_MiniProgram WHERE 1=1 "); builder.Append(" SELECT * FROM RB_MiniProgram WHERE 1=1 ");
if (query != null) if (query != null)
...@@ -75,10 +76,11 @@ namespace Mall.Repository.User ...@@ -75,10 +76,11 @@ namespace Mall.Repository.User
} }
if (query.MiniAppId != null && !string.IsNullOrEmpty(query.MiniAppId)) if (query.MiniAppId != null && !string.IsNullOrEmpty(query.MiniAppId))
{ {
builder.AppendFormat(" AND MiniAppId='{0}' ", query.MiniAppId); builder.AppendFormat(" AND MiniAppId=@MiniAppId ");
parameters.Add("MiniAppId", query.MiniAppId.Trim());
} }
} }
return Get<RB_MiniProgram_Extend>(builder.ToString()).FirstOrDefault(); return Get<RB_MiniProgram_Extend>(builder.ToString(),parameters).FirstOrDefault();
} }
/// <summary> /// <summary>
......
...@@ -1394,13 +1394,13 @@ namespace Mall.WebApi.Controllers.Education ...@@ -1394,13 +1394,13 @@ namespace Mall.WebApi.Controllers.Education
BaseList = list.Where(x => x.FormType == FormTypeEnum.Base) BaseList = list.Where(x => x.FormType == FormTypeEnum.Base)
.OrderBy(x => x.Sort) .OrderBy(x => x.Sort)
.Select(x => .Select(x =>
new { x.ID, x.IsRequired, x.ActivitySurveyId, SurveyType = (int)x.SurveyType, x.FormType, x.Title, x.Sort, SurveyTypeStr = EnumHelper.GetEnumName(x.SurveyType), FormTypeStr = EnumHelper.GetEnumName(x.FormType), x.SurveyOptionsList, ScoreNum = (x.SurveyType.HasValue && x.SurveyType == SurveyTypeEnum.Score) ? 5 : 0, TextContent = "" }).ToList(), new { x.ID, x.IsRequired, x.ActivitySurveyId, SurveyType = (int)x.SurveyType, x.FormType, x.Title, x.Sort, SurveyTypeStr = EnumHelper.GetEnumName(x.SurveyType), FormTypeStr = EnumHelper.GetEnumName(x.FormType), x.SurveyOptionsList, ScoreNum = (x.SurveyType.HasValue && x.SurveyType == SurveyTypeEnum.Score) ? 0 : 0, TextContent = "" }).ToList(),
SurveyList = list.Where(x => x.FormType == FormTypeEnum.Survey).OrderBy(x => x.Sort).Select(x => new { x.ID, x.IsRequired, x.ActivitySurveyId, SurveyType = (int)x.SurveyType, x.FormType, x.Title, x.Sort, SurveyTypeStr = EnumHelper.GetEnumName(x.SurveyType), FormTypeStr = EnumHelper.GetEnumName(x.FormType), x.SurveyOptionsList, ScoreNum = (x.SurveyType.HasValue && x.SurveyType == SurveyTypeEnum.Score) ? 3 : 0, TextContent = "" }).ToList(), SurveyList = list.Where(x => x.FormType == FormTypeEnum.Survey).OrderBy(x => x.Sort).Select(x => new { x.ID, x.IsRequired, x.ActivitySurveyId, SurveyType = (int)x.SurveyType, x.FormType, x.Title, x.Sort, SurveyTypeStr = EnumHelper.GetEnumName(x.SurveyType), FormTypeStr = EnumHelper.GetEnumName(x.FormType), x.SurveyOptionsList, ScoreNum = (x.SurveyType.HasValue && x.SurveyType == SurveyTypeEnum.Score) ? 0 : 0, TextContent = "" }).ToList(),
CourseArrangementList = list.Where(x => x.FormType == FormTypeEnum.CourseArrangement).OrderBy(x => x.Sort).Select(x => new { x.ID, x.IsRequired, x.ActivitySurveyId, SurveyType = (int)x.SurveyType, x.FormType, x.Title, x.Sort, SurveyTypeStr = EnumHelper.GetEnumName(x.SurveyType), FormTypeStr = EnumHelper.GetEnumName(x.FormType), x.SurveyOptionsList, ScoreNum = (x.SurveyType.HasValue && x.SurveyType == SurveyTypeEnum.Score) ? 3 : 0, TextContent = "" }).ToList(), CourseArrangementList = list.Where(x => x.FormType == FormTypeEnum.CourseArrangement).OrderBy(x => x.Sort).Select(x => new { x.ID, x.IsRequired, x.ActivitySurveyId, SurveyType = (int)x.SurveyType, x.FormType, x.Title, x.Sort, SurveyTypeStr = EnumHelper.GetEnumName(x.SurveyType), FormTypeStr = EnumHelper.GetEnumName(x.FormType), x.SurveyOptionsList, ScoreNum = (x.SurveyType.HasValue && x.SurveyType == SurveyTypeEnum.Score) ? 0 : 0, TextContent = "" }).ToList(),
TeachersSituationList = list.Where(x => x.FormType == FormTypeEnum.TeachersSituation).OrderBy(x => x.Sort).Select(x => new { x.ID, x.IsRequired, x.ActivitySurveyId, SurveyType = (int)x.SurveyType, x.FormType, x.Title, x.Sort, SurveyTypeStr = EnumHelper.GetEnumName(x.SurveyType), FormTypeStr = EnumHelper.GetEnumName(x.FormType), x.SurveyOptionsList, ScoreNum = (x.SurveyType.HasValue && x.SurveyType == SurveyTypeEnum.Score) ? 3 : 0, TextContent = "" }).ToList(), TeachersSituationList = list.Where(x => x.FormType == FormTypeEnum.TeachersSituation).OrderBy(x => x.Sort).Select(x => new { x.ID, x.IsRequired, x.ActivitySurveyId, SurveyType = (int)x.SurveyType, x.FormType, x.Title, x.Sort, SurveyTypeStr = EnumHelper.GetEnumName(x.SurveyType), FormTypeStr = EnumHelper.GetEnumName(x.FormType), x.SurveyOptionsList, ScoreNum = (x.SurveyType.HasValue && x.SurveyType == SurveyTypeEnum.Score) ? 0 : 0, TextContent = "" }).ToList(),
TeachingAssistantList = list.Where(x => x.FormType == FormTypeEnum.TeachingAssistant).OrderBy(x => x.Sort).Select(x => new { x.ID, x.IsRequired, x.ActivitySurveyId, SurveyType = (int)x.SurveyType, x.FormType, x.Title, x.Sort, SurveyTypeStr = EnumHelper.GetEnumName(x.SurveyType), FormTypeStr = EnumHelper.GetEnumName(x.FormType), x.SurveyOptionsList, ScoreNum = (x.SurveyType.HasValue && x.SurveyType == SurveyTypeEnum.Score) ? 3 : 0, TextContent = "" }).ToList(), TeachingAssistantList = list.Where(x => x.FormType == FormTypeEnum.TeachingAssistant).OrderBy(x => x.Sort).Select(x => new { x.ID, x.IsRequired, x.ActivitySurveyId, SurveyType = (int)x.SurveyType, x.FormType, x.Title, x.Sort, SurveyTypeStr = EnumHelper.GetEnumName(x.SurveyType), FormTypeStr = EnumHelper.GetEnumName(x.FormType), x.SurveyOptionsList, ScoreNum = (x.SurveyType.HasValue && x.SurveyType == SurveyTypeEnum.Score) ? 0 : 0, TextContent = "" }).ToList(),
LearningEnvironmentList = list.Where(x => x.FormType == FormTypeEnum.LearningEnvironment).OrderBy(x => x.Sort).Select(x => new { x.ID, x.IsRequired, x.ActivitySurveyId, SurveyType = (int)x.SurveyType, x.FormType, x.Title, x.Sort, SurveyTypeStr = EnumHelper.GetEnumName(x.SurveyType), FormTypeStr = EnumHelper.GetEnumName(x.FormType), x.SurveyOptionsList, ScoreNum = (x.SurveyType.HasValue && x.SurveyType == SurveyTypeEnum.Score) ? 3 : 0, TextContent = "" }).ToList(), LearningEnvironmentList = list.Where(x => x.FormType == FormTypeEnum.LearningEnvironment).OrderBy(x => x.Sort).Select(x => new { x.ID, x.IsRequired, x.ActivitySurveyId, SurveyType = (int)x.SurveyType, x.FormType, x.Title, x.Sort, SurveyTypeStr = EnumHelper.GetEnumName(x.SurveyType), FormTypeStr = EnumHelper.GetEnumName(x.FormType), x.SurveyOptionsList, ScoreNum = (x.SurveyType.HasValue && x.SurveyType == SurveyTypeEnum.Score) ? 0 : 0, TextContent = "" }).ToList(),
OpinionandsuggestionList = list.Where(x => x.FormType == FormTypeEnum.Opinionandsuggestion).OrderBy(x => x.Sort).Select(x => new { x.ID, x.IsRequired, x.ActivitySurveyId, SurveyType = (int)x.SurveyType, x.FormType, x.Title, x.Sort, SurveyTypeStr = EnumHelper.GetEnumName(x.SurveyType), FormTypeStr = EnumHelper.GetEnumName(x.FormType), x.SurveyOptionsList, ScoreNum = (x.SurveyType.HasValue && x.SurveyType == SurveyTypeEnum.Score) ? 3 : 0, TextContent = "" }).ToList(), OpinionandsuggestionList = list.Where(x => x.FormType == FormTypeEnum.Opinionandsuggestion).OrderBy(x => x.Sort).Select(x => new { x.ID, x.IsRequired, x.ActivitySurveyId, SurveyType = (int)x.SurveyType, x.FormType, x.Title, x.Sort, SurveyTypeStr = EnumHelper.GetEnumName(x.SurveyType), FormTypeStr = EnumHelper.GetEnumName(x.FormType), x.SurveyOptionsList, ScoreNum = (x.SurveyType.HasValue && x.SurveyType == SurveyTypeEnum.Score) ? 0 : 0, TextContent = "" }).ToList(),
}; };
return ApiResult.Success("", result); return ApiResult.Success("", result);
} }
......
...@@ -569,17 +569,28 @@ namespace Mall.WebApi.Controllers.Education ...@@ -569,17 +569,28 @@ namespace Mall.WebApi.Controllers.Education
[RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)] [RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)]
public ApiResult GetEducationStartUpModel(object requestMsg) public ApiResult GetEducationStartUpModel(object requestMsg)
{ {
var parms = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString()); JObject jobj = JObject.Parse(requestMsg.ToString());
//var parms = RequestParm; var parms = new RequestParm()
var query = JsonConvert.DeserializeObject<RB_Education_StartUp>(parms.msg.ToString());
query.TenantId = parms.TenantId;
query.MallBaseId = parms.MallBaseId;
var oldLogisticsModel = educationModule.GetEducationStartUpListRepository(query).FirstOrDefault();
if (oldLogisticsModel == null)
{ {
oldLogisticsModel = new RB_Education_StartUp(); MallBaseId=jobj.GetInt("MallBaseId"),
TenantId=jobj.GetInt("TenantId"),
};
if (parms != null)
{
var query = new RB_Education_StartUp()
{
};
query.TenantId = parms.TenantId;
query.MallBaseId = parms.MallBaseId;
var oldLogisticsModel = educationModule.GetEducationStartUpListRepository(query).FirstOrDefault();
if (oldLogisticsModel == null)
{
oldLogisticsModel = new RB_Education_StartUp();
}
return ApiResult.Success("", oldLogisticsModel);
} }
return ApiResult.Success("", oldLogisticsModel); return ApiResult.Success("", new RB_Education_StartUp());
} }
#endregion #endregion
...@@ -666,10 +677,12 @@ namespace Mall.WebApi.Controllers.Education ...@@ -666,10 +677,12 @@ namespace Mall.WebApi.Controllers.Education
public ApiResult GetEducationTalkList(object requestMsg) public ApiResult GetEducationTalkList(object requestMsg)
{ {
var parms = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString()); var parms = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString());
Rb_Education_Talk_Extend demodel = new Rb_Education_Talk_Extend(); Rb_Education_Talk_Extend demodel = new Rb_Education_Talk_Extend
demodel.TenantId = parms.TenantId; {
demodel.MallBaseId = parms.MallBaseId; TenantId = parms.TenantId,
demodel.IsOpen = 1; MallBaseId = parms.MallBaseId,
IsOpen = 1
};
List<Rb_Education_Talk_Extend> talkList = dynamicModule.GetEducationTalkList(demodel); List<Rb_Education_Talk_Extend> talkList = dynamicModule.GetEducationTalkList(demodel);
return ApiResult.Success("", talkList.Select(x => new { x.IsOpen, x.Id, x.Content, x.CoverPhoto })); return ApiResult.Success("", talkList.Select(x => new { x.IsOpen, x.Id, x.Content, x.CoverPhoto }));
} }
......
...@@ -33,7 +33,7 @@ namespace Mall.WebApi.Controllers.Education ...@@ -33,7 +33,7 @@ namespace Mall.WebApi.Controllers.Education
public class EducationController : BaseController public class EducationController : BaseController
{ {
private readonly IHttpContextAccessor _accessor; private readonly IHttpContextAccessor _accessor;
private readonly EducationModule educationModule = new EducationModule(); private readonly EducationModule educationModule = AOP.AOPHelper.CreateAOPObject<EducationModule>();
private readonly Module.User.UserModule UserModule = new Module.User.UserModule(); private readonly Module.User.UserModule UserModule = new Module.User.UserModule();
private readonly DynamicModule dynamicModule = new DynamicModule(); private readonly DynamicModule dynamicModule = new DynamicModule();
private readonly ActivityModule activityModule = new ActivityModule(); private readonly ActivityModule activityModule = new ActivityModule();
...@@ -2391,6 +2391,7 @@ namespace Mall.WebApi.Controllers.Education ...@@ -2391,6 +2391,7 @@ namespace Mall.WebApi.Controllers.Education
StartTime = jObj.GetDateTime("StartTime"),//活动开始时间 StartTime = jObj.GetDateTime("StartTime"),//活动开始时间
EndTime = jObj.GetDateTime("EndTime"),//活动结束时间 EndTime = jObj.GetDateTime("EndTime"),//活动结束时间
Id = jObj.GetInt("Id", 0),//订单号 Id = jObj.GetInt("Id", 0),//订单号
TeacherId=jObj.GetInt("TeacherId"),
}; };
query.MallBaseId = RequestParm.MallBaseId; query.MallBaseId = RequestParm.MallBaseId;
query.TenantId = RequestParm.TenantId; query.TenantId = RequestParm.TenantId;
...@@ -2444,6 +2445,8 @@ namespace Mall.WebApi.Controllers.Education ...@@ -2444,6 +2445,8 @@ namespace Mall.WebApi.Controllers.Education
x.CoverImg, x.CoverImg,
IncomeFinanceList = (x.FinanceList != null && x.FinanceList.Any()) ? x.FinanceList.Where(x => (x.Status == FinanceAuditStatus.InReview || x.Status == FinanceAuditStatus.Pass || x.Status == FinanceAuditStatus.CTemporary) && x.Type == WFTempLateClassEnum.IN && x.ReFinanceId2 > 0).ToList() : new List<Model.Extend.Finance.RB_Finance_Extend>(), IncomeFinanceList = (x.FinanceList != null && x.FinanceList.Any()) ? x.FinanceList.Where(x => (x.Status == FinanceAuditStatus.InReview || x.Status == FinanceAuditStatus.Pass || x.Status == FinanceAuditStatus.CTemporary) && x.Type == WFTempLateClassEnum.IN && x.ReFinanceId2 > 0).ToList() : new List<Model.Extend.Finance.RB_Finance_Extend>(),
ExpendFinanceList = (x.FinanceList != null && x.FinanceList.Any()) ? x.FinanceList.Where(x => (x.Status == FinanceAuditStatus.InReview || x.Status == FinanceAuditStatus.Pass || x.Status == FinanceAuditStatus.CTemporary) && x.Type == WFTempLateClassEnum.OUT && x.ReFinanceId2 > 0).ToList() : new List<Model.Extend.Finance.RB_Finance_Extend>(), ExpendFinanceList = (x.FinanceList != null && x.FinanceList.Any()) ? x.FinanceList.Where(x => (x.Status == FinanceAuditStatus.InReview || x.Status == FinanceAuditStatus.Pass || x.Status == FinanceAuditStatus.CTemporary) && x.Type == WFTempLateClassEnum.OUT && x.ReFinanceId2 > 0).ToList() : new List<Model.Extend.Finance.RB_Finance_Extend>(),
x.TeacherId,
x.TeacherName,
}) })
}; };
...@@ -2709,8 +2712,25 @@ namespace Mall.WebApi.Controllers.Education ...@@ -2709,8 +2712,25 @@ namespace Mall.WebApi.Controllers.Education
public ApiResult SetActivityEnrollInfo() public ApiResult SetActivityEnrollInfo()
{ {
var request = RequestParm; var request = RequestParm;
JObject jObj = JObject.Parse(RequestParm.msg.ToString());
Model.Extend.Education.RB_Education_Consult_Extend demodel = JsonConvert.DeserializeObject<Model.Extend.Education.RB_Education_Consult_Extend>(request.msg.ToString()); RB_Education_Consult_Extend demodel = new RB_Education_Consult_Extend()
{
Id=jObj.GetInt("Id"),
LinkMan=jObj.GetStringValue("LinkMan"),
LinkTel=jObj.GetStringValue("LinkTel"),
Remark=jObj.GetStringValue("Remark"),
ActivityId=jObj.GetInt("ActivityId"),
PeopleNum=jObj.GetInt("PeopleNum"),
Sex=jObj.GetInt("Sex"),
EduStudentId=jObj.GetInt("EduStudentId"),
UnitPrice=jObj.GetDecimal("UnitPrice"),
Money=jObj.GetInt("Money"),
EduUserId=jObj.GetInt("EduUserId"),
PayWay=(Common.Enum.Goods.OrderPayTypeEnum)jObj.GetInt("PayWay"),
TenantId=jObj.GetInt("TenantId"),
MallBaseId=jObj.GetInt("MallBaseId"),
TeacherId=jObj.GetInt("TeacherId"),
};
var model = activityModule.GetActivityModule(demodel.ActivityId); var model = activityModule.GetActivityModule(demodel.ActivityId);
List<RB_Education_Consult_Extend> list = new List<RB_Education_Consult_Extend>(); List<RB_Education_Consult_Extend> list = new List<RB_Education_Consult_Extend>();
if (demodel.EduStudentId > 0) if (demodel.EduStudentId > 0)
...@@ -2798,7 +2818,6 @@ namespace Mall.WebApi.Controllers.Education ...@@ -2798,7 +2818,6 @@ namespace Mall.WebApi.Controllers.Education
} }
else else
{ {
var bmodel = activityModule.GetStudentListByEnterID(new RB_Student { StuId = demodel.EduStudentId }, demodel.EduUserId).FirstOrDefault(); var bmodel = activityModule.GetStudentListByEnterID(new RB_Student { StuId = demodel.EduStudentId }, demodel.EduUserId).FirstOrDefault();
if (bmodel == null || bmodel.StuId == 0) if (bmodel == null || bmodel.StuId == 0)
{ {
......
...@@ -17,6 +17,7 @@ using Mall.Common; ...@@ -17,6 +17,7 @@ using Mall.Common;
using Mall.Module.Product; using Mall.Module.Product;
using Mall.Model.Extend.User; using Mall.Model.Extend.User;
using Google.Protobuf.WellKnownTypes; using Google.Protobuf.WellKnownTypes;
using Mall.Common.Enum.Goods;
namespace Mall.WebApi.Controllers.MallBase namespace Mall.WebApi.Controllers.MallBase
{ {
...@@ -84,12 +85,28 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -84,12 +85,28 @@ namespace Mall.WebApi.Controllers.MallBase
[HttpPost] [HttpPost]
public ApiResult GetProductCategoryTreeList(object requestMsg) public ApiResult GetProductCategoryTreeList(object requestMsg)
{ {
var parms = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString()); JObject rootObj = JObject.Parse(requestMsg.ToString());
var parms = new RequestParm()
{
TenantId = rootObj.GetInt("TenantId"),
MallBaseId = rootObj.GetInt("MallBaseId"),
};
if (parms.MallBaseId <= 0) if (parms.MallBaseId <= 0)
{ {
return ApiResult.ParamIsNull(); return ApiResult.ParamIsNull();
} }
RB_Product_Category_Extend demodel = JsonConvert.DeserializeObject<RB_Product_Category_Extend>(parms.msg.ToString()); JObject jObj = JObject.Parse(rootObj.GetStringValue("msg"));
RB_Product_Category_Extend demodel = new RB_Product_Category_Extend()
{
Id = jObj.GetInt("Id"),
CategoryIds=jObj.GetStringValue("CategoryIds"),
Name=jObj.GetStringValue("Name"),
Tier=jObj.GetInt("Tier"),
ParentId=jObj.GetInt("ParentId"),
RootId=jObj.GetInt("RootId"),
CategoryPageType=(Common.Enum.Goods.GoodsPageTypeEnum)jObj.GetInt("CategoryPageType"),
};
demodel.TenantId = parms.TenantId; demodel.TenantId = parms.TenantId;
demodel.MallBaseId = parms.MallBaseId; demodel.MallBaseId = parms.MallBaseId;
...@@ -128,7 +145,13 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -128,7 +145,13 @@ namespace Mall.WebApi.Controllers.MallBase
[HttpPost] [HttpPost]
public ApiResult GetProductCategoryStyleInfo(object requestMsg) public ApiResult GetProductCategoryStyleInfo(object requestMsg)
{ {
var parms = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString()); JObject jobj = JObject.Parse(requestMsg.ToString());
var parms = new RequestParm()
{
MallBaseId = jobj.GetInt("MallBaseId"),
TenantId = jobj.GetInt("TenantId"),
UserId=jobj.GetInt("UserId"),
};
if (parms.MallBaseId <= 0) if (parms.MallBaseId <= 0)
{ {
return ApiResult.ParamIsNull(); return ApiResult.ParamIsNull();
...@@ -191,20 +214,43 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -191,20 +214,43 @@ namespace Mall.WebApi.Controllers.MallBase
[HttpPost] [HttpPost]
public ApiResult GetAppletGoodsPageListForZY(object requestMsg) public ApiResult GetAppletGoodsPageListForZY(object requestMsg)
{ {
var parms = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString()); JObject rootObj = JObject.Parse(requestMsg.ToString());
var parms = new RequestParm()
{
TenantId=rootObj.GetInt("TenantId"),
MallBaseId=rootObj.GetInt("MallBaseId"),
SmallShopsId=rootObj.GetInt("SmallShopsId"),
UserId=rootObj.GetInt("UserId"),
msg=rootObj.GetStringValue("msg")
};
if (parms.MallBaseId <= 0) if (parms.MallBaseId <= 0)
{ {
return ApiResult.ParamIsNull(); return ApiResult.ParamIsNull();
} }
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(parms.msg.ToString()); JObject sObj = JObject.Parse(rootObj.GetStringValue("msg"));
RB_Goods_Extend demodel = JsonConvert.DeserializeObject<RB_Goods_Extend>(parms.msg.ToString()); ResultPageModel pagelist = new ResultPageModel()
{
pageIndex=sObj.GetInt("pageIndex"),
pageSize=sObj.GetInt("pageSize"),
};
RB_Goods_Extend demodel = new RB_Goods_Extend()
{
Name=sObj.GetStringValue("Name"),
GoodsType=(OrderTypeEnum)sObj.GetInt ("GoodsType"),
CategoryIds=sObj.GetStringValue("CategoryIds"),
OrderBy=sObj.GetInt("OrderBy"),
UserId=sObj.GetInt("UserId"),
GoodsPageType=(GoodsPageTypeEnum)sObj.GetInt("GoodsPageType"),
IsVideo=sObj.GetInt("IsVideo")
};
demodel.TenantId = parms.TenantId; demodel.TenantId = parms.TenantId;
demodel.MallBaseId = parms.MallBaseId; demodel.MallBaseId = parms.MallBaseId;
demodel.GoodsStatus = 1;//只查询销售中的 demodel.GoodsStatus = 1;//只查询销售中的
demodel.SmallShopsId = parms.SmallShopsId; demodel.SmallShopsId = parms.SmallShopsId;
JObject newParms = JObject.Parse(parms.msg.ToString()); JObject newParms = JObject.Parse(parms.msg.ToString());
int UserId = parms.UserId; int UserId = parms.UserId;
if (newParms.GetInt("ERPUserId") > 0) if (sObj.GetInt("ERPUserId") > 0)
{ {
UserId = newParms.GetInt("ERPUserId"); UserId = newParms.GetInt("ERPUserId");
} }
...@@ -1140,17 +1186,22 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1140,17 +1186,22 @@ namespace Mall.WebApi.Controllers.MallBase
[HttpPost] [HttpPost]
public ApiResult GetAppletGoodsRecommendListForZY(object requestMsg) public ApiResult GetAppletGoodsRecommendListForZY(object requestMsg)
{ {
var parms = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString()); JObject rootObj = JObject.Parse(requestMsg.ToString());
var parms = new RequestParm()
{
TenantId=rootObj.GetInt("TenantId"),
MallBaseId= rootObj.GetInt("MallBaseId"),
SmallShopsId=rootObj.GetInt("SmallShopsId"),
};
if (parms.MallBaseId <= 0) if (parms.MallBaseId <= 0)
{ {
return ApiResult.ParamIsNull(); return ApiResult.ParamIsNull();
} }
RB_Goods_Extend demodel = JsonConvert.DeserializeObject<RB_Goods_Extend>(parms.msg.ToString()); RB_Goods_Extend demodel = JsonConvert.DeserializeObject<RB_Goods_Extend>(rootObj.GetStringValue("msg"));
if (!demodel.RecommendType.HasValue && demodel.RecommendType <= 0) if (!demodel.RecommendType.HasValue && demodel.RecommendType <= 0)
{ {
return ApiResult.ParamIsNull("请传递推荐类型"); return ApiResult.ParamIsNull("请传递推荐类型");
} }
demodel.TenantId = parms.TenantId; demodel.TenantId = parms.TenantId;
demodel.MallBaseId = parms.MallBaseId; demodel.MallBaseId = parms.MallBaseId;
demodel.GoodsStatus = 1;//只查询销售中的 demodel.GoodsStatus = 1;//只查询销售中的
......
...@@ -23,19 +23,24 @@ namespace Mall.WebApi.Controllers.User ...@@ -23,19 +23,24 @@ namespace Mall.WebApi.Controllers.User
[EnableCors("AllowCors")] [EnableCors("AllowCors")]
public class MemberUserController : BaseController public class MemberUserController : BaseController
{ {
private MemberUserModule MemberUserModule = new MemberUserModule(); private readonly MemberUserModule MemberUserModule = new MemberUserModule();
[AllowAnonymous] [RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)]
/// <summary> /// <summary>
/// 用户登录 /// 根据用户Id更新用户头像和名称
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)] [RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)]
[AllowAnonymous]
public ApiResult SetMemberPhoto() public ApiResult SetMemberPhoto()
{ {
var extModel = JsonConvert.DeserializeObject<RB_Member_User_Extend>(RequestParm.msg.ToString()); JObject jobj = JObject.Parse(RequestParm.msg.ToString());
if (extModel.Name != "微信用户") var extModel = new RB_Member_User_Extend()
{
Id=jobj.GetInt("Id"),
AliasName=jobj.GetStringValue("AliasName"),
Photo=jobj.GetStringValue("Photo"),
};
if (extModel.Name != "微信用户" && extModel.Id>0)
{ {
var flag = MemberUserModule.SetMemberUserNameAndPhoto(extModel); var flag = MemberUserModule.SetMemberUserNameAndPhoto(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
...@@ -44,7 +49,6 @@ namespace Mall.WebApi.Controllers.User ...@@ -44,7 +49,6 @@ namespace Mall.WebApi.Controllers.User
{ {
return ApiResult.Failed("获取用户信息失败"); return ApiResult.Failed("获取用户信息失败");
} }
} }
/// <summary> /// <summary>
......
...@@ -59,6 +59,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.Module.TradePavilion", ...@@ -59,6 +59,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.Module.TradePavilion",
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.Module.Miai", "Mall.Module.Miai\Mall.Module.Miai.csproj", "{2EEB81FD-7176-4407-871E-AC41343BC601}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.Module.Miai", "Mall.Module.Miai\Mall.Module.Miai.csproj", "{2EEB81FD-7176-4407-871E-AC41343BC601}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7E74ADDD-09BE-4C5B-8FA4-EE384282D553}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
......
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