Commit 2590f06d authored by 吴春's avatar 吴春

提交代码

parent afc7aa4e
......@@ -51,14 +51,14 @@
<Reference Include="Aliyun.OSS, Version=2.11.0.0, Culture=neutral, PublicKeyToken=0ad4175f0dac0b9b, processorArchitecture=MSIL">
<HintPath>..\packages\Aliyun.OSS.SDK.2.11.0\lib\net45\Aliyun.OSS.dll</HintPath>
</Reference>
<Reference Include="Aspose.Pdf, Version=17.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL">
<HintPath>..\packages\Aspose.Pdf.17.7\lib\net40-client\Aspose.Pdf.dll</HintPath>
<Reference Include="Aspose.Pdf, Version=17.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL">
<HintPath>..\packages\Aspose.Pdf.17.1.0\lib\net40-client\Aspose.Pdf.dll</HintPath>
</Reference>
<Reference Include="Aspose.Slides, Version=17.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL">
<HintPath>..\packages\Aspose.Slides.NET.17.7\lib\net4.0-client\Aspose.Slides.dll</HintPath>
<Reference Include="Aspose.Slides, Version=17.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL">
<HintPath>..\packages\Aspose.Slides.NET.17.1\lib\net4.0-client\Aspose.Slides.dll</HintPath>
</Reference>
<Reference Include="Aspose.Words, Version=17.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL">
<HintPath>..\packages\Aspose.Words.17.7\lib\net40\Aspose.Words.dll</HintPath>
<Reference Include="Aspose.Words, Version=17.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL">
<HintPath>..\packages\Aspose.Words.17.1.0\lib\net40\Aspose.Words.dll</HintPath>
</Reference>
<Reference Include="COSXML, Version=5.4.13.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Tencent.QCloud.Cos.Sdk.5.4.13\lib\netstandard2.0\COSXML.dll</HintPath>
......
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Mall.Model.Entity.Education
{
/// <summary>
/// 校企基础信息实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class Rb_Education_School
{
/// <summary>
/// id
/// </summary>
public int Id
{
get;
set;
}
/// <summary>
/// 商户id
/// </summary>
public int TenantId { get; set; }
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId { get; set; }
/// <summary>
/// 老师对应的用户id
/// </summary>
public int? CreateBy
{
get;
set;
}
/// <summary>
/// 创建时间
/// </summary>
public DateTime? CreateTime
{
get;
set;
}
/// <summary>
/// 状态 0:正常,1:删除
/// </summary>
public int Status
{
get;
set;
}
/// <summary>
/// 封面图片
/// </summary>
public string CoverPhoto
{
get;
set;
}
/// <summary>
/// 学校名称
/// </summary>
public string ShoolName { get; set; }
/// <summary>
/// 关联代理
/// </summary>
public string AgentIds { get; set; }
}
}
......@@ -241,5 +241,10 @@ namespace Mall.Model.Entity.User
/// 教育点数(针对购买直播产品)
/// </summary>
public int PointNum { get; set; }
/// <summary>
/// 教育学校id
/// </summary>
public int EduSchoolId { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.Education;
namespace Mall.Model.Extend.Education
{
public class Rb_Education_School_Extend : Rb_Education_School
{
/// <summary>
/// 下级用户人数
/// </summary>
public int UserCount { get; set; }
/// <summary>
/// 代理人员
/// </summary>
public List<object> AgentList { get; set; }
/// <summary>
/// ids
/// </summary>
public string Ids { get; set; }
public int UserId { get; set; }
}
}
......@@ -141,6 +141,10 @@ namespace Mall.Module.Education
/// </summary>
private readonly RB_Education_ViolationLogRepository educationViolationLogRepository = new RB_Education_ViolationLogRepository();
/// <summary>
/// 校企仓储
/// </summary>
private readonly Rb_Education_SchoolRepository education_SchoolRepository = new Rb_Education_SchoolRepository();
#region 课程管理
......@@ -3308,7 +3312,7 @@ namespace Mall.Module.Education
Id = 0,
Type = Common.Enum.MiAi.MessageTypeEnum.ViolationNotice,
UserId = model.UserId ?? 0,
SourceId =0,
SourceId = 0,
Content = "您评论内容出现违规文字",
Status = 0,
TenantId = model.TenantId,
......@@ -3354,5 +3358,138 @@ namespace Mall.Module.Education
return member_UserRepository.Update(cols, wheres);
}
#endregion
#region 校企合作管理
/// 获取列表
/// </summary>
/// <param name="where"></param>
/// <returns></returns>
public List<Rb_Education_School_Extend> GetEducationSchoolList(Rb_Education_School_Extend where)
{
var list = education_SchoolRepository.GetEducationSchoolList(where);
if (list != null && list.Any())
{
string userIds = string.Join(",", list.Where(x => !string.IsNullOrWhiteSpace(x.AgentIds)).Select(x => x.AgentIds));
if (!string.IsNullOrWhiteSpace(userIds))
{
var userList = member_UserRepository.GetList(new RB_Member_User_Extend { TenantId = where.TenantId, MallBaseId = where.MallBaseId, UserIds = userIds });
foreach (var item in list.Where(x => !string.IsNullOrWhiteSpace(x.AgentIds)))
{
item.AgentList = new List<object>();
foreach (var itemAgentId in item.AgentIds.Split(","))
{
item.AgentList.Add(new
{
UserName = userList.Where(x => x.Id.ToString() == itemAgentId).FirstOrDefault()?.Name ?? "",
Id = userList.Where(x => x.Id.ToString() == itemAgentId).FirstOrDefault()?.Id ?? 0,
});
}
}
}
}
return list;
}
/// <summary>
/// 校企分页
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowCount"></param>
/// <param name="where"></param>
/// <returns></returns>
public List<Rb_Education_School_Extend> GetEducationSchoolPageList(int pageIndex, int pageSize, out long rowCount, Rb_Education_School_Extend where)
{
var list = education_SchoolRepository.GetEducationSchoolPageList(pageIndex, pageSize, out rowCount, where);
return list;
}
/// <summary>
/// 新增/修改校企信息
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetEduSchool(Rb_Education_School_Extend model)
{
if (model.Id == 0)
{
return education_SchoolRepository.Insert(model) > 0;
}
else
{
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(Rb_Education_School_Extend.ShoolName),model.ShoolName},
{ nameof(Rb_Education_School_Extend.CoverPhoto),model.CoverPhoto},
{ nameof(Rb_Education_School_Extend.AgentIds),model.AgentIds},
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(Rb_Education_School_Extend.Id),
FiledValue=model.Id,
OperatorEnum=OperatorEnum.Equal
}
};
return education_SchoolRepository.Update(keyValues, wheres);
}
}
/// <summary>
/// 批量删除校企
/// </summary>
/// <param name="gradeId"></param>
/// <param name="uid"></param>
/// <returns></returns>
public bool DelEduSchool(List<string> ids, int uid, int mallBaseId)
{
var trans = education_SchoolRepository.DbTransaction;
bool flag = false;
try
{
foreach (var item in ids)
{
if (!string.IsNullOrWhiteSpace(item))
{
Dictionary<string, object> cols = new Dictionary<string, object>()
{
{ nameof(Rb_Education_School_Extend.Status),1},
};
List<WhereHelper> wheres1 = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(Rb_Education_School_Extend.Id),
FiledValue=Convert.ToInt32(item),
OperatorEnum=OperatorEnum.Equal
},
new WhereHelper(){
FiledName=nameof(Rb_Education_School_Extend.TenantId),
FiledValue=Convert.ToInt32(uid),
OperatorEnum=OperatorEnum.Equal
},
new WhereHelper(){
FiledName=nameof(Rb_Education_School_Extend.MallBaseId),
FiledValue=Convert.ToInt32(mallBaseId),
OperatorEnum=OperatorEnum.Equal
}
};
flag = education_SchoolRepository.Update(cols, wheres1, trans);
}
}
education_SchoolRepository.DBSession.Commit();
}
catch (Exception ex)
{
LogHelper.Write(ex, "DelEduSchool");
education_SchoolRepository.DBSession.Rollback("DelEduSchool");
return false;
}
return flag;
}
#endregion
}
}
......@@ -6004,7 +6004,7 @@ namespace Mall.Module.User
int IsNormalServer = Convert.ToInt32(new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("IsNormalServer").Value);
if (IsNormalServer != 1)
{
token = "37_0-lYjcCk7K4srJ_SWIumrzRMY4s2UdttdugOEOLBoeQEOUEXga2hutyJrM7PC9QZkK9aXu7g4nE62J7YWfA2T6CKbq1_qPq0njfMvmk2_OZndOv-Rr1BIRhkqa6gFq71zo2Dr73T5tFe5QQ9LWQhAFAEPJ";
token = "46_01sFR99p0-s3mWH1RZrwT7dYMWoHelRyygi6ic07xS_cU2jDuZZ7w22IqiUzStUwa8Acy84oVByIsCIFjpF-FIbLdvb6Y9bQvBl4osyxQWcj5oTZZdrRyWQe6K7gVi21KWqEwwZ-9SEy7QnCYIXiAAAGQF";
}
if (string.IsNullOrEmpty(token))
{
......@@ -6088,7 +6088,7 @@ namespace Mall.Module.User
int IsNormalServer = Convert.ToInt32(new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("IsNormalServer").Value);
if (IsNormalServer != 1)
{
token = "37_0-lYjcCk7K4srJ_SWIumrzRMY4s2UdttdugOEOLBoeQEOUEXga2hutyJrM7PC9QZkK9aXu7g4nE62J7YWfA2T6CKbq1_qPq0njfMvmk2_OZndOv-Rr1BIRhkqa6gFq71zo2Dr73T5tFe5QQ9LWQhAFAEPJ";
token = "46_01sFR99p0-s3mWH1RZrwT7dYMWoHelRyygi6ic07xS_cU2jDuZZ7w22IqiUzStUwa8Acy84oVByIsCIFjpF-FIbLdvb6Y9bQvBl4osyxQWcj5oTZZdrRyWQe6K7gVi21KWqEwwZ-9SEy7QnCYIXiAAAGQF";
}
if (string.IsNullOrEmpty(token))
{
......@@ -6118,6 +6118,12 @@ namespace Mall.Module.User
return "";
}
#endregion
#region 推荐返佣账单
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mall.Model.Entity.Education;
using Mall.Model.Extend.Education;
namespace Mall.Repository.Education
{
/// <summary>
/// 校企仓储层
/// </summary>
public class Rb_Education_SchoolRepository : BaseRepository<Rb_Education_School>
{
/// <summary>
/// 表名称
/// </summary>
public string TableName { get { return nameof(Rb_Education_School); } }
/// 获取列表
/// </summary>
/// <param name="where"></param>
/// <returns></returns>
public List<Rb_Education_School_Extend> GetEducationSchoolList(Rb_Education_School_Extend where)
{
StringBuilder sb = new StringBuilder();
sb.Append($@"SELECT a.*,b.UserCount from Rb_Education_School as a
LEFT JOIN (SELECT EduSchoolId,COUNT(*) as UserCount from rb_member_user GROUP BY EduSchoolId ) as b on a.Id=b.EduSchoolId
where a.Status=0 ");
if (where != null)
{
if (where.TenantId > 0)
{
sb.AppendFormat(" and a.TenantId={0}", where.TenantId);
}
if (where.MallBaseId > 0)
{
sb.AppendFormat(" and a.MallBaseId={0}", where.MallBaseId);
}
if (!string.IsNullOrWhiteSpace(where.ShoolName))
{
sb.AppendFormat(" and a.ShoolName like '%{0}%'", where.ShoolName);
}
if (where.Id > 0)
{
sb.AppendFormat(" and a.Id={0}", where.Id);
}
if (where.UserId > 0)
{
sb.Append($" AND FIND_IN_SET('{where.UserId}', {nameof(Rb_Education_School_Extend.AgentIds)})");
}
}
return Get<Rb_Education_School_Extend>(sb.ToString()).ToList();
}
/// <summary>
/// 校企分页
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowCount"></param>
/// <param name="where"></param>
/// <returns></returns>
public List<Rb_Education_School_Extend> GetEducationSchoolPageList(int pageIndex, int pageSize, out long rowCount, Rb_Education_School_Extend where)
{
StringBuilder sb = new StringBuilder();
sb.Append($@"SELECT a.*,b.UserCount from Rb_Education_School as a
LEFT JOIN (SELECT EduSchoolId,COUNT(*) as UserCount from rb_member_user GROUP BY EduSchoolId ) as b on a.Id=b.EduSchoolId
where a.Status=0 ");
if (where != null)
{
if (where.TenantId > 0)
{
sb.AppendFormat(" and a.TenantId={0}", where.TenantId);
}
if (where.MallBaseId > 0)
{
sb.AppendFormat(" and a.MallBaseId={0}", where.MallBaseId);
}
if (!string.IsNullOrWhiteSpace(where.ShoolName))
{
sb.AppendFormat(" and a.ShoolName like '%{0}%'", where.ShoolName);
}
if (where.Id > 0)
{
sb.AppendFormat(" and a.Id={0}", where.Id);
}
}
return GetPage<Rb_Education_School_Extend>(pageIndex, pageSize, out rowCount, sb.ToString()).ToList();
}
}
}
......@@ -1553,6 +1553,10 @@ FROM RB_Member_User AS a LEFT JOIN rb_miai_baseinfo AS b ON a.Id = b.UserId) as
{
where += $@" and a.{nameof(RB_Member_User.Id)}={dmodel.Id}";
}
if (dmodel.EduSchoolId > 0)
{
where += $@" and a.{nameof(RB_Member_User.EduSchoolId)}={dmodel.EduSchoolId}";
}
if (!string.IsNullOrEmpty(dmodel.Name))
{
where += $@" and a.{nameof(RB_Member_User.Name)} like '%{dmodel.Name}%'";
......
......@@ -2140,5 +2140,25 @@ namespace Mall.WebApi.Controllers.Education
#endregion
#region
/// <summary>
/// 获取代理的学校
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetEduSchool()
{
var userInfo = AppletUserInfo;
Rb_Education_School_Extend demodel = new Rb_Education_School_Extend();
demodel.TenantId = userInfo.TenantId;
demodel.MallBaseId = userInfo.MallBaseId;
demodel.UserId = userInfo.UserId;
var list = educationModule.GetEducationSchoolList(demodel);
return ApiResult.Success("", list.Select(x => new { x.Id, x.CoverPhoto, x.ShoolName }));
}
#endregion
}
}
\ No newline at end of file
......@@ -2104,8 +2104,8 @@ namespace Mall.WebApi.Controllers.Education
//else
//{
int ManPeopleNum = activityModule.GetActivityEnrollNum(extModel.Id, 0);
if (extModel.ManNum < ManPeopleNum ) { return ApiResult.Failed("已报名" + ManPeopleNum + "人、不能低于此数量"); }
// }
if (extModel.ManNum < ManPeopleNum) { return ApiResult.Failed("已报名" + ManPeopleNum + "人、不能低于此数量"); }
// }
}
var flag = activityModule.SetActivityModule(extModel);
......@@ -2253,6 +2253,7 @@ namespace Mall.WebApi.Controllers.Education
Moblie = param.GetStringValue("Moblie"),
StartTime = param.GetStringValue("StartTime"),
EndTime = param.GetStringValue("EndTime"),
EduSchoolId = param.GetInt("EduSchoolId", 0),
};
demodel.TenantId = Convert.ToInt32(parms.uid);
demodel.MallBaseId = parms.MallBaseId;
......@@ -2408,5 +2409,147 @@ namespace Mall.WebApi.Controllers.Education
}
}
#endregion
#region 校企合作管理
/// <summary>
/// 校企分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetEducationSchoolPageList()
{
var parms = RequestParm;
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(RequestParm.msg.ToString());
Rb_Education_School_Extend demodel = JsonConvert.DeserializeObject<Rb_Education_School_Extend>(RequestParm.msg.ToString());
demodel.TenantId = UserInfo.TenantId;
demodel.MallBaseId = parms.MallBaseId;
//demodel.TeacherStatus = -1;
var list = educationModule.GetEducationSchoolPageList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list.Select(x => new
{
x.Id,
x.ShoolName,
x.CoverPhoto,
x.UserCount,
x.AgentList,
x.AgentIds
});
return ApiResult.Success("", pagelist);
}
/// <summary>
/// 学校详情
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetEducationSchoolDetails()
{
var parms = RequestParm;
JObject parmsJob = JObject.Parse(RequestParm.msg.ToString());
int Id = parmsJob.GetInt("Id", 0);
if (Id == 0)
{
return ApiResult.ParamIsNull();
}
Rb_Education_School_Extend demodel = new Rb_Education_School_Extend();
demodel.TenantId = UserInfo.TenantId;
demodel.MallBaseId = parms.MallBaseId;
demodel.Id = Id;
//demodel.TeacherStatus = -1;
var model = educationModule.GetEducationSchoolList(demodel);
var result = model.Select(x => new
{
x.Id,
x.ShoolName,
x.CoverPhoto,
x.UserCount,
x.AgentList,
x.AgentIds
});
return ApiResult.Success("", result);
}
/// <summary>
/// 保存校企信息
/// </summary>
/// <returns></returns>
public ApiResult AddOrUpdateEduSchool()
{
var parms = RequestParm;
var query = JsonConvert.DeserializeObject<Rb_Education_School_Extend>(RequestParm.msg.ToString());
query.TenantId = UserInfo.TenantId;
query.MallBaseId = parms.MallBaseId;
if (query == null)
{
return ApiResult.Failed("请传入校企信息");
}
else
{
if (string.IsNullOrWhiteSpace(query.ShoolName))
{
return ApiResult.Failed("请输入学校名称");
}
if (query.Id == 0)
{
query.CreateTime = System.DateTime.Now;
query.CreateBy = UserInfo.EmpId;
}
bool result = educationModule.SetEduSchool(query);
if (result)
{
return ApiResult.Success("校企信息保存成功");
}
else
{
return ApiResult.Failed("校企信息保存失败");
}
}
}
/// <summary>
/// 删除校企
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult DelSchoolInfo()
{
var parms = RequestParm;
JObject parmsJob = JObject.Parse(RequestParm.msg.ToString());
string idInfo = parmsJob.GetStringValue("Ids");
if (string.IsNullOrWhiteSpace(idInfo))
{
return ApiResult.Failed("请传递参数");
}
Rb_Education_School_Extend demodel = new Rb_Education_School_Extend();
demodel.TenantId = UserInfo.TenantId;
demodel.MallBaseId = parms.MallBaseId;
demodel.Ids = idInfo;
var list = educationModule.GetEducationSchoolList(demodel);
if (list.Any(x => x.UserCount > 0))
{
return ApiResult.Failed("请先迁移下级用户再删除");
}
bool flag = educationModule.DelEduSchool(idInfo.Split(",").ToList(), UserInfo.TenantId, parms.MallBaseId);
if (flag)
{
return ApiResult.Success();
}
else
{
return ApiResult.Failed();
}
}
#endregion
}
}
\ No newline at end of file
......@@ -68,6 +68,7 @@ namespace Mall.WebApi.Controllers.User
UserPageType = (Common.Enum.Goods.GoodsPageTypeEnum)parms.GetInt("UserPageType", 0),
CounponPassword = parms.GetInt("CounponPassword", 3),
KeyWord = parms.GetStringValue("KeyWord"),
EduSchoolId = parms.GetInt("EduSchoolId", 0),
};
if (requestParm.TenantId <= 0)
{
......@@ -355,14 +356,14 @@ namespace Mall.WebApi.Controllers.User
if (oldBaseInfo != null && oldBaseInfo.Id > 0 && oldBaseInfo.StudentId > 0)
{
appletUserInfo.IsAddBaseInfo = 1;
if (demodel.Gender > 0 )
if (demodel.Gender > 0)
{
oldBaseInfo.Sex = demodel.Gender;
activityModule.UpdateEduBaseInfoSex(oldBaseInfo);
}
}
//赞羊教育保存性别 2021-05-08 Add by:W
if ((oldBaseInfo == null && (oldBaseInfo?.Id ?? 0) == 0) &&demodel.Gender > 0)
if ((oldBaseInfo == null && (oldBaseInfo?.Id ?? 0) == 0) && demodel.Gender > 0)
{
var eduBaseInfo = new Model.Extend.Education.RB_Education_BaseInfo_Extend
{
......
......@@ -1549,7 +1549,6 @@ namespace Mall.WebApi.Controllers.User
string base64Img = userModule.GetWeiXinQRCodeForSmallShops(Path, With, userInfo.MallBaseId, userInfo.UserId);
return ApiResult.Success("", base64Img);
}
#endregion
#region 获取分销海报
......
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