Browse Source

清理过期的审批消息

master
yashen 9 years ago
parent
commit
f5afbaf39d
3 changed files with 43 additions and 0 deletions
  1. +2
    -0
      B3WeChat.Web/PluginClass.cs
  2. +1
    -0
      B3WeChat/B3WeChat.csproj
  3. +40
    -0
      B3WeChat/Tasks/ClearExpiredApproveMessagesTask.cs

+ 2
- 0
B3WeChat.Web/PluginClass.cs View File

@ -1,6 +1,7 @@
using Bwp.MainSystem;
using Bwp.MainSystem.Auth;
using Bwp.Web.Pages;
using BWP.B3WeChat.Tasks;
using BWP.B3WeChat.Utils;
using Forks.EnterpriseServices.BusinessInterfaces;
using Forks.Utils;
@ -45,6 +46,7 @@ namespace BWP.Web
var roleSchemas = Wpf.Settings.RoleSchemas;
roleSchemas.Add(new RoleSchema("wechat", "微信公众号用户", RoleSchema.DefaultFunctions.Empty));
Global.RegisterCustomPrePam(new WeChatAuth());
ClearExpiredApproveMessagesTask.Register();
}
}
}

+ 1
- 0
B3WeChat/B3WeChat.csproj View File

@ -132,6 +132,7 @@
<Compile Include="Rpcs\ApproveMessageRpc.cs" />
<Compile Include="Rpcs\ClientRpc.cs" />
<Compile Include="Rpcs\WeChatUserRpc.cs" />
<Compile Include="Tasks\ClearExpiredApproveMessagesTask.cs" />
<Compile Include="Utils\InOutMessageUtil.cs" />
<Compile Include="Utils\SendMessageUtil.cs" />
<Compile Include="Utils\WeChatPageUtil.cs" />


+ 40
- 0
B3WeChat/Tasks/ClearExpiredApproveMessagesTask.cs View File

@ -0,0 +1,40 @@
using BWP.B3WeChat.BO;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TSingSoft.WebPluginFramework;
using TSingSoft.WebPluginFramework.TimerTasks;
using TSingSoft.WebPluginFramework;
namespace BWP.B3WeChat.Tasks
{
public class ClearExpiredApproveMessagesTask
{
public static void Register()
{
TimerConfig.Register("0 3 * * *", new Task1());
}
#if DEBUG
public
#endif
class Task1 : ITimerTask
{
public void Execute()
{
var del = new DQDeleteDom(typeof(ApproveMessage));
del.Where.Conditions.Add(DQCondition.LessThan("CreateTime", BLContext.Today.AddDays(-7)));
del.EExecute();
}
public string Name
{
get { return "清理过期的审批消息(7天前)"; }
}
}
}
}

Loading…
Cancel
Save