/// <summary>
/// 待办工作超时处理方式
/// </summary>
public enum OutTimeDeal
{
/// <summary>
/// 不处理
/// </summary>
None,
/// <summary>
/// 自动的转向下一步骤
/// </summary>
AutoTurntoNextStep,
/// <summary>
/// 自动移交到指定的人员
/// </summary>
AutoShiftToSpecUser,
/// <summary>
/// 向指定的人员发送消息
/// </summary>
SendMsgToSpecUser,
/// <summary>
/// 删除流程
/// </summary>
DeleteFlow,
/// <summary>
/// 执行SQL
/// </summary>
RunSQL
}
工作接口BP.WF.Dev2Interface
/// <summary>
/// 处理延期的任务.根据节点属性的设置
/// </summary>
/// <returns>返回处理的消息</returns>
public static string DTS_DealDeferredWork()
{
string sql = "SELECT * FROM WF_EmpWorks WHERE FK_Node IN (SELECT NodeID from WF_Node WHERE OutTimeDeal >0 ) AND SDT <='" + DataType.CurrentData + "' ORDER BY FK_Emp";
DataTable dt = DBAccess.RunSQLReturnTable(sql);
string msg = "";
foreach (DataRow dr in dt.Rows)
{
string fk_emp = dr["FK_Emp"].ToString();
string fk_flow = dr["FK_Flow"].ToString();
int fk_node = int.Parse(dr["FK_Node"].ToString());
Int64 workid = Int64.Parse(dr["WorkID"].ToString());
if (WebUser.No != fk_emp)
{
Emp emp = new Emp(WebUser.No);
BP.Web.WebUser.SignInOfGener(emp);
}
BP.WF.Ext.NodeSheet nd = new BP.WF.Ext.NodeSheet();
nd.NodeID = fk_node;
nd.Retrieve();
switch (nd.HisOutTimeDeal)
{
case OutTimeDeal.None:
break;
case OutTimeDeal.AutoTurntoNextStep: //自动转到下一步骤.
msg += BP.WF.Dev2Interface.Node_SendWork(fk_flow, workid).ToMsgOfText();
break;
case OutTimeDeal.AutoShiftToSpecUser:
msg += BP.WF.Dev2Interface.Node_Forward(workid, nd.OutTimeDeal, "来自ccflow的自动消息:(" + BP.Web.WebUser.Name + ")工作未按时处理(" + nd.Name + "),现在移交给您。");
break;
case OutTimeDeal.SendMsgToSpecUser:
BP.WF.Dev2Interface.Port_SendSMS(nd.OutTimeDeal, "来自ccflow的自动消息:(" + BP.Web.WebUser.Name + ")工作未按时处理(" + nd.Name + ")", "感谢您选择ccflow.");
break;
case OutTimeDeal.DeleteFlow:
msg += BP.WF.Dev2Interface.Flow_DoDeleteFlowByReal(fk_flow, workid, true);
break;
default:
throw new Exception("@错误没有判断的超时处理方式." + nd.HisOutTimeDeal);
}
}
Emp emp1 = new Emp("admin");
BP.Web.WebUser.SignInOfGener(emp1);
return msg;
}