Commit eac47786 authored by 黄奎's avatar 黄奎

页面修改

parent 88263164
......@@ -448,5 +448,16 @@ namespace Edu.Common
return IsPushMessage;
}
}
/// <summary>
/// 消息推送AppId
/// </summary>
public static string PushAppId
{
get
{
return ReadConfigKey("PushAppId");
}
}
}
}
\ No newline at end of file
......@@ -60,7 +60,8 @@ namespace Edu.Common.Message
message.MsgTemplateCode,
Status = 0,
CreateTime = DateTime.Now,
AppId = Common.Config.ReadConfigKey("PushAppId"),
AppId = Common.Config.PushAppId,
IsRead=0,
};
using (IConnection conn = GetConnectionFactory(rabbitConfig).CreateConnection())
{
......
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Model.Entity.Log
{
{
/// <summary>
/// 流程修改日志实体类
/// </summary>
......
using System;
using VT.FW.DB;
namespace Edu.Model.Entity.Log
{
/// <summary>
/// 系统日志实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "LogConnection")]
public class RB_MsgLog
{
/// <summary>
/// 主键
/// </summary>
public long Id { get; set; }
/// <summary>
/// 推送标题
/// </summary>
public string Title { get; set; }
/// <summary>
/// 推送内容
/// </summary>
public string Content { get; set; }
/// <summary>
/// 封面图
/// </summary>
public string CoverImg { get; set; }
/// <summary>
/// 所属分类
/// </summary>
public int CategoryId { get; set; }
/// <summary>
/// 推送平台[1-手机端,2-Web端,3-短信,4-邮件]
/// </summary>
public int Platform { get; set; }
/// <summary>
/// 推送类型(0-立即推送,1-指定时间推送)
/// </summary>
public int SendType { get; set; }
/// <summary>
/// 推送时间
/// </summary>
public DateTime SendTime { get; set; }
/// <summary>
/// 接收人员
/// </summary>
public string ReceiveId { get; set; }
/// <summary>
/// 跳转地址
/// </summary>
public string JumpUrl { get; set; }
/// <summary>
/// 推送状态(0-未推送,1-已推送)
/// </summary>
public int Status { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 创建人姓名
/// </summary>
public string CreateByName { get; set; }
/// <summary>
/// 平台编号
/// </summary>
public string AppId { get; set; }
/// <summary>
/// 短信模板代码
/// </summary>
public string MsgTemplateCode { get; set; }
/// <summary>
/// 短信签名
/// </summary>
public string MsgSign { get; set; }
/// <summary>
/// 是否已读(0-未读,1-已读)
/// </summary>
public int IsRead { get; set; }
}
}
using Edu.Model.Entity.Log;
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
using VT.Repository;
namespace Edu.Module.Log
{
/// <summary>
/// 系统日志处理类
/// </summary>
public class LogModule
{
/// <summary>
/// 系统消息仓储层对象
/// </summary>
private readonly RB_MsgLogRepository msgLogRepository = new RB_MsgLogRepository();
/// <summary>
/// 获取消息推送列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_MsgLog> GetMsgLogListModule(RB_MsgLog query)
{
return msgLogRepository.GetMsgLogListRepository(query);
}
/// <summary>
/// 更新消息阅读状态
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
public virtual bool SetMsgReadModule(List<int> ids)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_MsgLog.IsRead),1 }
};
foreach (var item in ids)
{
if (item > 0 && flag)
{
flag= msgLogRepository.Update(fileds, new WhereHelper(nameof(RB_MsgLog.IsRead), item));
}
}
return flag;
}
}
}
using System.Collections.Generic;
using System.Text;
using System.Linq;
using Edu.Model.Entity.Log;
using Edu.Repository;
namespace VT.Repository
{
/// <summary>
/// 消息推送仓储层
/// </summary>
public class RB_MsgLogRepository: BaseRepository<RB_MsgLog>
{
/// <summary>
/// 获取消息推送列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_MsgLog> GetMsgLogListRepository(RB_MsgLog query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT *
FROM RB_MsgLog
WHERE 1=1
");
if (query == null)
{
return new List<RB_MsgLog>();
}
else
{
if (!string.IsNullOrEmpty(query.AppId))
{
builder.AppendFormat(" AND {0}='{1}' ", nameof(RB_MsgLog.AppId), query.AppId);
}
if (query.CategoryId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_MsgLog.CategoryId), query.CategoryId);
}
if (query.Platform > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_MsgLog.Platform), query.Platform);
}
if (query.Status > -1)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_MsgLog.Status), query.Status);
}
if (!string.IsNullOrEmpty(query.ReceiveId))
{
builder.AppendFormat(" AND {0}='{1}' ", nameof(RB_MsgLog.ReceiveId), query.ReceiveId);
}
if (query.IsRead >= 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_MsgLog.IsRead), query.IsRead);
}
}
return Get<RB_MsgLog>(builder.ToString()).ToList();
}
/// <summary>
/// 获取推送日志分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_MsgLog> GetMsgLogPageListRepository(int pageIndex,int pageSize,out long rowsCount, RB_MsgLog query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT *
FROM RB_MsgLog
WHERE 1=1
");
if (query == null)
{
rowsCount = 0;
return new List<RB_MsgLog>();
}
else
{
if (!string.IsNullOrEmpty(query.AppId))
{
builder.AppendFormat(" AND {0}='{1}' ", nameof(RB_MsgLog.AppId), query.AppId);
}
if (query.CategoryId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_MsgLog.CategoryId), query.CategoryId);
}
if (query.Platform > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_MsgLog.Platform), query.Platform);
}
if (query.Status > -1)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_MsgLog.Status), query.Status);
}
if (!string.IsNullOrEmpty(query.ReceiveId))
{
builder.AppendFormat(" AND {0}='{1}' ", nameof(RB_MsgLog.ReceiveId), query.ReceiveId);
}
if (query.IsRead >= 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_MsgLog.IsRead), query.IsRead);
}
}
return GetPage<RB_MsgLog>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
}
}
}
......@@ -7,6 +7,7 @@ using Edu.Common.Plugin;
using Edu.Model.Public;
using Edu.Model.ViewModel.Course;
using Edu.Model.ViewModel.System;
using Edu.Module.Log;
using Edu.Module.Public;
using Edu.Module.System;
using Edu.WebApi.Filter;
......@@ -49,6 +50,11 @@ namespace Edu.WebApi.Controllers.Public
/// </summary>
private readonly ClassConfigModule classConfigModule = new ClassConfigModule();
/// <summary>
/// 日志处理类对象
/// </summary>
private readonly LogModule logModule = AOP.AOPHelper.CreateAOPObject<LogModule>();
#region 省市区
/// <summary>
......@@ -445,8 +451,8 @@ namespace Edu.WebApi.Controllers.Public
{
var query = new RB_Class_Config_ViewModel()
{
Group_Id=base.UserInfo.Group_Id,
ConfigId=base.ParmJObj.GetInt("ConfigId")
Group_Id = base.UserInfo.Group_Id,
ConfigId = base.ParmJObj.GetInt("ConfigId")
};
var extModel = classConfigModule.GetClassConfigModule(query);
return ApiResult.Success(data: extModel);
......@@ -462,10 +468,10 @@ namespace Edu.WebApi.Controllers.Public
var extModel = new RB_Class_Config_ViewModel()
{
ConfigId = base.ParmJObj.GetInt("ConfigId"),
BasicHourFee=base.ParmJObj.GetDecimal("BasicHourFee"),
BasicClassNum=base.ParmJObj.GetInt("BasicClassNum"),
BasicMinutes=base.ParmJObj.GetInt("BasicMinutes"),
BasicHours=base.ParmJObj.GetInt("BasicHours"),
BasicHourFee = base.ParmJObj.GetDecimal("BasicHourFee"),
BasicClassNum = base.ParmJObj.GetInt("BasicClassNum"),
BasicMinutes = base.ParmJObj.GetInt("BasicMinutes"),
BasicHours = base.ParmJObj.GetInt("BasicHours"),
};
extModel.Group_Id = base.UserInfo.Group_Id;
extModel.UpdateBy = base.UserInfo.Id;
......@@ -541,6 +547,41 @@ namespace Edu.WebApi.Controllers.Public
var flag = classConfigModule.RemoveClassTypeModule(CTypeId);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion
#endregion
#region 日志管理
/// <summary>
/// 获取日志列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetMsgLogList()
{
var query = new Model.Entity.Log.RB_MsgLog()
{
AppId = Common.Config.PushAppId,
IsRead = 0,
ReceiveId = base.UserInfo.Id.ToString(),
Platform=2
};
var list = logModule.GetMsgLogListModule(query);
return ApiResult.Success(data: list);
}
/// <summary>
/// 修改班级费用类型状态
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult BeatchReadMsgLog()
{
List<int> Ids = Common.Plugin.JsonHelper.DeserializeObject<List<int>>(base.ParmJObj.GetStringValue("Ids"));
var flag = logModule.SetMsgReadModule(Ids);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion
}
}
\ No newline at end of file
......@@ -5,7 +5,9 @@
"FinanceConnection": "server=192.168.20.214;user id=reborn;password=Reborn@2018;database=test_reborn_finance;CharSet=utf8mb4; Convert Zero Datetime=true; ",
"FinanceConnectionPName": "MySql.Data.MySqlClient",
"DataStatisticsConnection": "server=192.168.20.214;user id=reborn;password=Reborn@2018;database=reborn_datastatistics;CharSet=utf8mb4; Convert Zero Datetime=true; ",
"DataStatisticsConnectionPName": "MySql.Data.MySqlClient"
"DataStatisticsConnectionPName": "MySql.Data.MySqlClient",
"LogConnection": "server=192.168.20.214;user id=reborn;password=Reborn@2018;database=reborn_sys;CharSet=utf8mb4; Convert Zero Datetime=true; ",
"LogConnectionPName": "MySql.Data.MySqlClient"
},
"Logging": {
"LogLevel": {
......@@ -60,6 +62,6 @@
//消息推送AppId
"PushAppId": "JiaHeJiaoYu",
//是否推送消息
"IsPushMessage": "0"
"IsPushMessage": "1"
}
\ 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