You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.6 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
using System.Data;
using BP.DA;
using BP.En;
namespace BP.WF.DTS
{
/// <summary>
/// 升级ccflow6 要执行的调度
/// </summary>
public class Tool_Repair : Method
{
/// <summary>
/// 不带有参数的方法
/// </summary>
public Tool_Repair()
{
this.Title = "修复因显示不出来到达节点下拉框而导致的发送不下去的bug引起的垃圾数据";
this.Help = "此bug已经修复掉了,如果仍然出现类似的问题,有可能是其他问题引起的.";
}
/// <summary>
/// 设置执行变量
/// </summary>
/// <returns></returns>
public override void Init()
{
}
/// <summary>
/// 当前的操纵员是否可以执行这个方法
/// </summary>
public override bool IsCanDo
{
get
{
if (BP.Web.WebUser.No.Equals("admin")==true)
return true;
else
return false;
}
}
/// <summary>
/// 执行
/// </summary>
/// <returns>返回执行结果</returns>
public override object Do()
{
string sql = "SELECT WorkID,TODOEMPS,FK_NODE FROM WF_GENERWORKFLOW WHERE (WFState=2 OR WFState=5) ";
DataTable dt = DBAccess.RunSQLReturnTable(sql);
string msg = "";
foreach (DataRow dr in dt.Rows)
{
Int64 workid = Int64.Parse(dr["WorkID"].ToString());
string todoEmps = dr["TODOEMPS"].ToString();
string nodeID = dr["FK_NODE"].ToString();
GenerWorkerLists gwls = new GenerWorkerLists();
gwls.Retrieve(GenerWorkerListAttr.WorkID, workid, GenerWorkerListAttr.IsPass, 0);
foreach (GenerWorkerList gwl in gwls)
{
if (todoEmps.Contains(gwl.EmpNo + ",") == false)
{
if (nodeID.ToString().EndsWith("01") == true)
continue;
GenerWorkFlow gwf = new GenerWorkFlow(workid);
msg += "<br>@流程:" + gwf.FlowName + "节点:" + gwf.NodeID + "," + gwf.NodeName + " workid: " + workid + "title:" + gwf.Title + " todoEmps:" + gwf.TodoEmps;
msg += "不包含:" + gwl.EmpNo + "," + gwl.EmpName;
gwf.TodoEmps += gwl.EmpNo + "," + gwl.EmpName + ";";
// gwf.Update();
}
}
}
return msg;
}
}
}