using System; using BP.En; namespace BP.WF.Data { /// /// 我部门的待办 /// public class MyDeptTodolistAttr { #region 基本属性 /// /// 工作ID /// public const string WorkID = "WorkID"; /// /// 工作流 /// public const string FK_Flow = "FK_Flow"; /// /// 流程状态 /// public const string WFState = "WFState"; /// /// 流程状态(简单) /// public const string WFSta = "WFSta"; /// /// 标题 /// public const string Title = "Title"; /// /// 发起人 /// public const string Starter = "Starter"; /// /// 产生时间 /// public const string RDT = "RDT"; /// /// 完成时间 /// public const string CDT = "CDT"; /// /// 得分 /// public const string Cent = "Cent"; /// /// 当前工作到的节点. /// public const string FK_Node = "FK_Node"; /// /// 当前工作角色 /// public const string FK_Station = "FK_Station"; /// /// 部门 /// public const string FK_Dept = "FK_Dept"; /// /// 流程ID /// public const string FID = "FID"; /// /// 是否启用 /// public const string IsEnable = "IsEnable"; /// /// 流程名称 /// public const string FlowName = "FlowName"; /// /// 发起人名称 /// public const string StarterName = "StarterName"; /// /// 节点名称 /// public const string NodeName = "NodeName"; /// /// 部门名称 /// public const string DeptName = "DeptName"; /// /// 流程类别 /// public const string FK_Emp = "FK_Emp"; /// /// 优先级 /// public const string PRI = "PRI"; /// /// 流程应完成时间 /// public const string SDTOfFlow = "SDTOfFlow"; /// /// 节点应完成时间 /// public const string SDTOfNode = "SDTOfNode"; /// /// 父流程ID /// public const string PWorkID = "PWorkID"; /// /// 父流程编号 /// public const string PFlowNo = "PFlowNo"; /// /// 父流程节点 /// public const string PNodeID = "PNodeID"; /// /// 子流程的调用人. /// public const string PEmp = "PEmp"; /// /// 客户编号(对于客户发起的流程有效) /// public const string GuestNo = "GuestNo"; /// /// 客户名称 /// public const string GuestName = "GuestName"; /// /// 单据编号 /// public const string BillNo = "BillNo"; /// /// 备注 /// public const string FlowNote = "FlowNote"; /// /// 待办人员 /// public const string TodoEmps = "TodoEmps"; /// /// 待办人员数量 /// public const string TodoEmpsNum = "TodoEmpsNum"; /// /// 任务状态 /// public const string TaskSta = "TaskSta"; /// /// 临时存放的参数 /// public const string AtPara = "AtPara"; /// /// 参与人 /// public const string Emps = "Emps"; /// /// GUID /// public const string GUID = "GUID"; /// /// OrgNo /// public const string OrgNo = "OrgNo"; #endregion } /// /// 我部门的待办 /// public class MyDeptTodolist : Entity { #region 基本属性 public override UAC HisUAC { get { UAC uac = new UAC(); uac.Readonly(); return uac; } } /// /// 主键 /// public override string PK { get { return MyDeptTodolistAttr.WorkID; } } /// /// 工作流程编号 /// public string FlowNo { get { return this.GetValStrByKey(MyDeptTodolistAttr.FK_Flow); } set { SetValByKey(MyDeptTodolistAttr.FK_Flow,value); } } /// /// BillNo /// public string BillNo { get { return this.GetValStrByKey(MyDeptTodolistAttr.BillNo); } set { SetValByKey(MyDeptTodolistAttr.BillNo, value); } } /// /// 流程名称 /// public string FlowName { get { return this.GetValStrByKey(MyDeptTodolistAttr.FlowName); } set { SetValByKey(MyDeptTodolistAttr.FlowName, value); } } /// /// 优先级 /// public int PRI { get { return this.GetValIntByKey(MyDeptTodolistAttr.PRI); } set { SetValByKey(MyDeptTodolistAttr.PRI, value); } } /// /// 待办人员数量 /// public int TodoEmpsNum { get { return this.GetValIntByKey(MyDeptTodolistAttr.TodoEmpsNum); } set { SetValByKey(MyDeptTodolistAttr.TodoEmpsNum, value); } } /// /// 待办人员列表 /// public string TodoEmps { get { return this.GetValStrByKey(MyDeptTodolistAttr.TodoEmps); } set { SetValByKey(MyDeptTodolistAttr.TodoEmps, value); } } /// /// 参与人 /// public string Emps { get { return this.GetValStrByKey(MyDeptTodolistAttr.Emps); } set { SetValByKey(MyDeptTodolistAttr.Emps, value); } } /// /// 状态 /// public TaskSta TaskSta { get { return (TaskSta)this.GetValIntByKey(MyDeptTodolistAttr.TaskSta); } set { SetValByKey(MyDeptTodolistAttr.TaskSta, (int)value); } } /// /// 类别编号 /// public string EmpNo { get { return this.GetValStrByKey(MyDeptTodolistAttr.FK_Emp); } set { SetValByKey(MyDeptTodolistAttr.FK_Emp, value); } } /// /// 部门编号 /// public string DeptNo { get { return this.GetValStrByKey(MyDeptTodolistAttr.FK_Dept); } set { SetValByKey(MyDeptTodolistAttr.FK_Dept,value); } } /// /// 标题 /// public string Title { get { return this.GetValStrByKey(MyDeptTodolistAttr.Title); } set { SetValByKey(MyDeptTodolistAttr.Title,value); } } /// /// 客户编号 /// public string GuestNo { get { return this.GetValStrByKey(MyDeptTodolistAttr.GuestNo); } set { SetValByKey(MyDeptTodolistAttr.GuestNo, value); } } /// /// 客户名称 /// public string GuestName { get { return this.GetValStrByKey(MyDeptTodolistAttr.GuestName); } set { SetValByKey(MyDeptTodolistAttr.GuestName, value); } } /// /// 产生时间 /// public string RDT { get { return this.GetValStrByKey(MyDeptTodolistAttr.RDT); } set { SetValByKey(MyDeptTodolistAttr.RDT,value); } } /// /// 节点应完成时间 /// public string SDTOfNode { get { return this.GetValStrByKey(MyDeptTodolistAttr.SDTOfNode); } set { SetValByKey(MyDeptTodolistAttr.SDTOfNode, value); } } /// /// 流程应完成时间 /// public string SDTOfFlow { get { return this.GetValStrByKey(MyDeptTodolistAttr.SDTOfFlow); } set { SetValByKey(MyDeptTodolistAttr.SDTOfFlow, value); } } /// /// 流程ID /// public Int64 WorkID { get { return this.GetValInt64ByKey(MyDeptTodolistAttr.WorkID); } set { SetValByKey(MyDeptTodolistAttr.WorkID,value); } } /// /// 主线程ID /// public Int64 FID { get { return this.GetValInt64ByKey(MyDeptTodolistAttr.FID); } set { SetValByKey(MyDeptTodolistAttr.FID, value); } } /// /// 父节点流程编号. /// public Int64 PWorkID { get { return this.GetValInt64ByKey(MyDeptTodolistAttr.PWorkID); } set { SetValByKey(MyDeptTodolistAttr.PWorkID, value); } } /// /// 父流程调用的节点 /// public int PNodeID { get { return this.GetValIntByKey(MyDeptTodolistAttr.PNodeID); } set { SetValByKey(MyDeptTodolistAttr.PNodeID, value); } } /// /// PFlowNo /// public string PFlowNo { get { return this.GetValStrByKey(MyDeptTodolistAttr.PFlowNo); } set { SetValByKey(MyDeptTodolistAttr.PFlowNo, value); } } /// /// 吊起子流程的人员 /// public string PEmp { get { return this.GetValStrByKey(MyDeptTodolistAttr.PEmp); } set { SetValByKey(MyDeptTodolistAttr.PEmp, value); } } /// /// 发起人 /// public string Starter { get { return this.GetValStrByKey(MyDeptTodolistAttr.Starter); } set { SetValByKey(MyDeptTodolistAttr.Starter, value); } } /// /// 发起人名称 /// public string StarterName { get { return this.GetValStrByKey(MyDeptTodolistAttr.StarterName); } set { this.SetValByKey(MyDeptTodolistAttr.StarterName, value); } } /// /// 发起人部门名称 /// public string DeptName { get { return this.GetValStrByKey(MyDeptTodolistAttr.DeptName); } set { this.SetValByKey(MyDeptTodolistAttr.DeptName, value); } } /// /// 当前节点名称 /// public string NodeName { get { return this.GetValStrByKey(MyDeptTodolistAttr.NodeName); } set { this.SetValByKey(MyDeptTodolistAttr.NodeName, value); } } /// /// 当前工作到的节点 /// public int NodeID { get { return this.GetValIntByKey(MyDeptTodolistAttr.FK_Node); } set { SetValByKey(MyDeptTodolistAttr.FK_Node, value); } } /// /// 工作流程状态 /// public WFState WFState { get { return (WFState)this.GetValIntByKey(MyDeptTodolistAttr.WFState); } set { if (value == BP.WF.WFState.Complete) SetValByKey(MyDeptTodolistAttr.WFSta, (int)WFSta.Complete); else if (value == BP.WF.WFState.Delete) SetValByKey(MyDeptTodolistAttr.WFSta, (int)WFSta.Etc); else SetValByKey(MyDeptTodolistAttr.WFSta, (int)WFSta.Runing); SetValByKey(MyDeptTodolistAttr.WFState, (int)value); } } /// /// 状态(简单) /// public WFSta WFSta { get { return (WFSta)this.GetValIntByKey(MyDeptTodolistAttr.WFSta); } set { SetValByKey(MyDeptTodolistAttr.WFSta, (int)value); } } public string WFStateText { get { BP.WF.WFState ws = (WFState)this.WFState; switch(ws) { case WF.WFState.Complete: return "已完成"; case WF.WFState.Runing: return "在运行"; case WF.WFState.Hungup: return "挂起"; case WF.WFState.Askfor: return "加签"; default: return "未判断"; } } } /// /// GUID /// public string GUID { get { return this.GetValStrByKey(MyDeptTodolistAttr.GUID); } set { SetValByKey(MyDeptTodolistAttr.GUID, value); } } #endregion #region 参数属性. #endregion 参数属性. #region 构造函数 /// /// 产生的工作流程 /// public MyDeptTodolist() { } public MyDeptTodolist(Int64 workId) { QueryObject qo = new QueryObject(this); qo.AddWhere(MyDeptTodolistAttr.WorkID, workId); if (qo.DoQuery() == 0) throw new Exception("工作 MyDeptTodolist [" + workId + "]不存在。"); } /// /// 执行修复 /// public void DoRepair() { } /// /// 重写基类方法 /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; Map map = new Map("WF_EmpWorks", "我部门的待办"); map.setEnType(EnType.View); map.AddTBInt(MyDeptTodolistAttr.FID, 0, "FID", false, false); map.AddTBString(MyDeptTodolistAttr.Title, null, "流程标题", true, false, 0, 300, 10, true); map.AddDDLEntities(MyDeptTodolistAttr.FK_Flow, null, "流程", new Flows(), false); map.AddTBString(MyDeptTodolistAttr.RDT, null, "发起时间", true, false, 0, 100, 10); map.AddTBString(MyDeptTodolistAttr.StarterName, null, "发起人名称", true, false, 0, 30, 10); map.AddTBString(MyDeptTodolistAttr.NodeName, null, "停留节点", true, false, 0, 100, 10); //map.AddTBString(MyDeptTodolistAttr.TodoEmps, null, "当前处理人", true, false, 0, 100, 10); map.AddTBStringDoc(MyDeptTodolistAttr.FlowNote, null, "备注", true, false,true); // MyDeptTodolistAttr.WorkerDept ////作为隐藏字段. //map.AddTBString(MyDeptTodolistAttr.WorkerDept, null, "工作人员部门编号", // false, false, 0, 30, 10); map.AddTBString(MyDeptTodolistAttr.OrgNo, null, "组织编号", false, false, 0, 100, 10); map.AddDDLEntities(MyDeptTodolistAttr.FK_Emp, null, "当前处理人", new BP.Port.Emps(), false); map.AddTBIntPK(MyDeptTodolistAttr.WorkID, 0, "工作ID", true, true); //查询关键字. map.AddTBSKeyWords(4000); //查询条件. map.AddSearchAttr(MyDeptTodolistAttr.FK_Flow); map.AddSearchAttr(MyDeptTodolistAttr.FK_Emp); ////增加隐藏的查询条件. //SearchNormal search = new SearchNormal(MyDeptTodolistAttr.WorkerDept, "部门", // MyDeptTodolistAttr.WorkerDept, "=", BP.Web.WebUser.DeptNo, 0, true); //map.SearchNormals.Add(search); if (BP.Difference.SystemConfig.CCBPMRunModel != Sys.CCBPMRunModel.Single) { SearchNormal search = new SearchNormal(MyDeptTodolistAttr.OrgNo, "组织", MyDeptTodolistAttr.OrgNo, "=", BP.Web.WebUser.OrgNo, 0, true); map.SearchNormals.Add(search); } RefMethod rm = new RefMethod(); rm.Title = "轨迹"; rm.ClassMethodName = this.ToString() + ".DoTrack"; rm.Icon = "../../WF/Img/FileType/doc.gif"; map.AddRefMethod(rm); rm = new RefMethod(); rm.Icon = "../../WF/Img/Btn/CC.gif"; rm.Title = "移交"; rm.ClassMethodName = this.ToString() + ".DoShift"; rm.HisAttrs.AddDDLEntities("ToEmp", null, "移交给:", new BP.WF.Flows(), true); rm.HisAttrs.AddTBString("Note", null, "移交原因", true, false, 0, 300, 100); map.AddRefMethod(rm); rm = new RefMethod(); rm.Icon = "../../WF/Img/Btn/Back.png"; rm.Title = "回滚"; rm.ItIsForEns = false; rm.ClassMethodName = this.ToString() + ".DoComeBack"; rm.HisAttrs.AddTBInt("NodeID", 0, "回滚到节点", true, false); rm.HisAttrs.AddTBString("Note", null, "回滚原因", true, false, 0, 300, 100); map.AddRefMethod(rm); this._enMap = map; return this._enMap; } } #endregion #region 执行功能. public string DoTrack() { return "../../WFRpt.htm?WorkID=" + this.WorkID + "&FID=" + this.FID + "&FK_Flow=" + this.FlowNo + "&FK_Node="; } /// /// 执行移交 /// /// /// /// public string DoShift(string ToEmp, string Note) { if (BP.WF.Dev2Interface.Flow_IsCanViewTruck(this.FlowNo, this.WorkID) == false) return "您没有操作该流程数据的权限."; try { BP.WF.Dev2Interface.Node_Shift( this.WorkID,ToEmp, Note); return "移交成功"; } catch (Exception ex) { return "移交失败@" + ex.Message; } } /// /// 执行删除 /// /// public string DoDelete() { if (BP.WF.Dev2Interface.Flow_IsCanViewTruck(this.FlowNo, this.WorkID) == false) return "您没有操作该流程数据的权限."; try { BP.WF.Dev2Interface.Flow_DoDeleteFlowByReal( this.WorkID, true); return "删除成功"; } catch (Exception ex) { return "删除失败@" + ex.Message; } } public string DoSkip() { return "../../Admin/FlowDB/FlowSkip.htm?WorkID=" + this.WorkID + "&FID=" + this.FID + "&FK_Flow=" + this.FlowNo + "&FK_Node=" + this.NodeID; } /// /// 回滚 /// /// 节点ID /// 回滚原因 /// 回滚的结果 public string DoComeBack(int nodeid, string note) { BP.WF.Template.FlowSheet fl = new BP.WF.Template.FlowSheet(this.FlowNo); return fl.DoRebackFlowData(this.WorkID, nodeid, note); } #endregion } /// /// 我部门的待办s /// public class MyDeptTodolists : Entities { #region 方法 /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new MyDeptTodolist(); } } /// /// 我部门的待办集合 /// public MyDeptTodolists(){} #endregion #region 为了适应自动翻译成java的需要,把实体转换成List. /// /// 转化成 java list,C#不能调用. /// /// List public System.Collections.Generic.IList ToJavaList() { return (System.Collections.Generic.IList)this; } /// /// 转化成list /// /// List public System.Collections.Generic.List Tolist() { System.Collections.Generic.List list = new System.Collections.Generic.List(); for (int i = 0; i < this.Count; i++) { list.Add((MyDeptTodolist)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }