using System; using System.Data; using BP.DA; using BP.En; namespace BP.WF.DTS { /// /// 升级ccflow6 要执行的调度 /// public class Tool_Repair : Method { /// /// 不带有参数的方法 /// public Tool_Repair() { this.Title = "修复因显示不出来到达节点下拉框而导致的,发送不下去的bug引起的垃圾数据"; this.Help = "此bug已经修复掉了,如果仍然出现类似的问题,有可能是其他问题引起的."; } /// /// 设置执行变量 /// /// public override void Init() { } /// /// 当前的操纵员是否可以执行这个方法 /// public override bool IsCanDo { get { if (BP.Web.WebUser.No.Equals("admin")==true) return true; else return false; } } /// /// 执行 /// /// 返回执行结果 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 += "
@流程:" + 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; } } }