using System; using System.Collections.Generic; using System.Text; using BP.En; using BP.WF.Template; using BP.Sys; namespace BP.WF { /// /// 属性 /// public class GERptAttr { /// /// 工作实例ID /// public const string OID = "OID"; /// /// 流程ID /// public const string FID = "FID"; /// /// 标题 /// public const string Title = "Title"; /// /// 参与人员 /// public const string FlowEmps = "FlowEmps"; /// /// 发起年月 /// public const string FK_NY = "FK_NY"; /// /// 发起人编号 /// public const string FlowStarter = "FlowStarter"; /// /// 发起时间 /// public const string FlowStartRDT = "FlowStartRDT"; /// /// 发起人部门编号 /// public const string FK_Dept = "FK_Dept"; /// /// 发起人部门名称 /// public const string FK_DeptName = "FK_DeptName"; /// /// 流程状态(详细状态) /// public const string WFState = "WFState"; /// /// 流程状态(概要状态) /// public const string WFSta = "WFSta"; /// /// 结束人 /// public const string FlowEnder = "FlowEnder"; /// /// 最后处理时间 /// public const string FlowEnderRDT = "FlowEnderRDT"; /// /// 跨度 /// public const string FlowDaySpan = "FlowDaySpan"; /// /// 停留节点 /// public const string FlowEndNode = "FlowEndNode"; /// /// 父流程WorkID /// public const string PWorkID = "PWorkID"; /// /// PFID /// public const string PFID = "PFID"; /// /// 父流程节点发送 /// public const string PNodeID = "PNodeID"; /// /// 父流程编号 /// public const string PFlowNo = "PFlowNo"; /// /// 调用父流程的工作人员 /// public const string PEmp = "PEmp"; /// /// 客户编号 /// public const string GuestNo = "GuestNo"; /// /// 客户名称 /// public const string GuestName = "GuestName"; /// /// 单据编号 /// public const string BillNo = "BillNo"; /// /// 参数 /// public const string AtPara = "AtPara"; /// /// 项目编号 /// public const string PrjNo = "PrjNo"; /// /// 项目名称 /// public const string PrjName = "PrjName"; /// /// GUID /// public const string GUID = "GUID"; /// /// RDT /// public const string RDT = "RDT"; /// /// CDT /// public const string CDT = "CDT"; /// /// 记录人 /// public const string Rec = "Rec"; /// /// 紧急程度 /// public const string PRI = "PRI"; } /// /// 报表 /// public class GERpt : BP.En.EntityOID { #region attrs public new Int64 OID { get { return this.GetValInt64ByKey(GERptAttr.OID); } set { this.SetValByKey(GERptAttr.OID, value); } } /// /// 流程时间跨度 /// public float FlowDaySpan { get { return this.GetValFloatByKey(GERptAttr.FlowDaySpan); } set { this.SetValByKey(GERptAttr.FlowDaySpan, value); } } /// /// 主流程ID /// public Int64 FID { get { return this.GetValInt64ByKey(GERptAttr.FID); } set { this.SetValByKey(GERptAttr.FID, value); } } public string GUID { get { return this.GetValStringByKey(GERptAttr.GUID); } set { this.SetValByKey(GERptAttr.GUID, value); } } /// /// 流程参与人员 /// public string FlowEmps { get { return this.GetValStringByKey(GERptAttr.FlowEmps); } set { this.SetValByKey(GERptAttr.FlowEmps, value); } } /// /// 客户编号 /// public string GuestNo { get { return this.GetValStringByKey(GERptAttr.GuestNo); } set { this.SetValByKey(GERptAttr.GuestNo, value); } } /// /// 客户名称 /// public string GuestName { get { return this.GetValStringByKey(GERptAttr.GuestName); } set { this.SetValByKey(GERptAttr.GuestName, value); } } public string BillNo { get { try { return this.GetValStringByKey(GERptAttr.BillNo); } catch (Exception ex) { return ""; } } set { this.SetValByKey(GERptAttr.BillNo, value); } } /// /// 流程发起人 /// public string FlowStarter { get { return this.GetValStringByKey(GERptAttr.FlowStarter); } set { this.SetValByKey(GERptAttr.FlowStarter, value); } } /// /// 流程发起时间 /// public string FlowStartRDT { get { return this.GetValStringByKey(GERptAttr.FlowStartRDT); } set { this.SetValByKey(GERptAttr.FlowStartRDT, value); } } /// /// 流程结束者 /// public string FlowEnder { get { return this.GetValStringByKey(GERptAttr.FlowEnder); } set { this.SetValByKey(GERptAttr.FlowEnder, value); } } /// /// 流程最后处理时间 /// public string FlowEnderRDT { get { return this.GetValStringByKey(GERptAttr.FlowEnderRDT); } set { this.SetValByKey(GERptAttr.FlowEnderRDT, value); } } public string FlowEndNodeText { get { Node nd =new Node(this.FlowEndNode); return nd.Name; } } public int FlowEndNode { get { return this.GetValIntByKey(GERptAttr.FlowEndNode); } set { this.SetValByKey(GERptAttr.FlowEndNode, value); } } /// /// 流程标题 /// public string Title { get { return this.GetValStringByKey(GERptAttr.Title); } set { this.SetValByKey(GERptAttr.Title, value); } } /// /// 隶属年月 /// public string FK_NY { get { return this.GetValStringByKey(GERptAttr.FK_NY); } set { this.SetValByKey(GERptAttr.FK_NY, value); } } /// /// 发起人部门 /// public string FK_Dept { get { return this.GetValStringByKey(GERptAttr.FK_Dept); } set { this.SetValByKey(GERptAttr.FK_Dept, value); } } public string FK_DeptName { get { return this.GetValStringByKey(GERptAttr.FK_DeptName); } set { this.SetValByKey(GERptAttr.FK_DeptName, value); } } /// /// 流程状态 /// public WFState WFState { get { return (WFState)this.GetValIntByKey(GERptAttr.WFState); } set { //设置他的值. this.SetValByKey(GERptAttr.WFState,(int)value); // 设置 WFSta 的值. switch (value) { case WF.WFState.Complete: SetValByKey(BP.WF.GenerWorkFlowAttr.WFSta, (int)WFSta.Complete); break; case WF.WFState.Delete: case WF.WFState.Blank: SetValByKey(BP.WF.GenerWorkFlowAttr.WFSta, (int)WFSta.Etc); break; default: SetValByKey(BP.WF.GenerWorkFlowAttr.WFSta, (int)WFSta.Runing); break; } } } /// /// 父流程WorkID /// public Int64 PWorkID { get { return this.GetValInt64ByKey(GERptAttr.PWorkID); } set { this.SetValByKey(GERptAttr.PWorkID, value); } } /// /// 发出的节点 /// public int PNodeID { get { return this.GetValIntByKey(GERptAttr.PNodeID); } set { this.SetValByKey(GERptAttr.PNodeID, value); } } /// /// 父流程流程编号 /// public string PFlowNo { get { return this.GetValStringByKey(GERptAttr.PFlowNo); } set { this.SetValByKey(GERptAttr.PFlowNo, value); } } public string PEmp { get { return this.GetValStringByKey(GERptAttr.PEmp); } set { this.SetValByKey(GERptAttr.PEmp, value); } } /// /// 项目编号 /// public string PrjNo { get { return this.GetValStringByKey(GERptAttr.PrjNo); } set { this.SetValByKey(GERptAttr.PrjNo, value); } } public string PrjName { get { return this.GetValStringByKey(GERptAttr.PrjName); } set { this.SetValByKey(GERptAttr.PrjName, value); } } #endregion attrs #region 重写。 public override void Copy(System.Data. DataRow dr) { foreach (Attr attr in this.EnMap.Attrs) { if ( attr.Key == WorkAttr.Rec || attr.Key == WorkAttr.FID || attr.Key == WorkAttr.OID || attr.Key == WorkAttr.Emps || attr.Key == GERptAttr.AtPara || attr.Key == GERptAttr.BillNo //|| attr.Key == GERptAttr.CFlowNo //|| attr.Key == GERptAttr.CWorkID || attr.Key == GERptAttr.FID || attr.Key == GERptAttr.FK_Dept || attr.Key == GERptAttr.FK_NY || attr.Key == GERptAttr.FlowDaySpan || attr.Key == GERptAttr.FlowEmps || attr.Key == GERptAttr.FlowEnder || attr.Key == GERptAttr.FlowEnderRDT || attr.Key == GERptAttr.FlowEndNode || attr.Key == GERptAttr.FlowStarter || attr.Key == GERptAttr.GuestName || attr.Key == GERptAttr.GuestNo || attr.Key == GERptAttr.GUID || attr.Key == GERptAttr.PEmp || attr.Key == GERptAttr.PFlowNo || attr.Key == GERptAttr.PNodeID || attr.Key == GERptAttr.PWorkID || attr.Key == GERptAttr.Title || attr.Key == GERptAttr.PrjNo || attr.Key == GERptAttr.PrjName || attr.Key.Equals("No") || attr.Key.Equals("Name")) continue; try { this.SetValByKey(attr.Key, dr[attr.Key]); } catch { } } } public override void Copy(Entity fromEn) { if (fromEn == null) return; Attrs attrs = fromEn.EnMap.Attrs; foreach (Attr attr in attrs) { if (attr.Key == WorkAttr.Rec || attr.Key == WorkAttr.FID || attr.Key == WorkAttr.OID || attr.Key == WorkAttr.Emps || attr.Key == GERptAttr.AtPara || attr.Key == GERptAttr.BillNo //|| attr.Key == GERptAttr.CFlowNo //|| attr.Key == GERptAttr.CWorkID || attr.Key == GERptAttr.FID || attr.Key == GERptAttr.FK_Dept || attr.Key == GERptAttr.FK_NY || attr.Key == GERptAttr.FlowDaySpan || attr.Key == GERptAttr.FlowEmps || attr.Key == GERptAttr.FlowEnder || attr.Key == GERptAttr.FlowEnderRDT || attr.Key == GERptAttr.FlowEndNode || attr.Key == GERptAttr.FlowStarter || attr.Key == GERptAttr.GuestName || attr.Key == GERptAttr.GuestNo || attr.Key == GERptAttr.GUID || attr.Key == GERptAttr.PEmp || attr.Key == GERptAttr.PFlowNo || attr.Key == GERptAttr.PNodeID || attr.Key == GERptAttr.PWorkID || attr.Key == GERptAttr.Title || attr.Key == GERptAttr.PrjNo || attr.Key == GERptAttr.PrjName || attr.Key == "No" || attr.Key == "Name") continue; this.SetValByKey(attr.Key, fromEn.GetValByKey(attr.Key)); } } #endregion #region 属性. private string _RptName = null; public string RptName { get { return _RptName; } set { this._RptName = value; this._SQLCash = null; this._enMap = null; this.Row = null; } } public override string ToString() { return RptName; } public override string PK { get { return "OID"; } } public override string PKField { get { return "OID"; } } /// /// Map /// public override Map EnMap { get { if (this.RptName == null) { BP.Port.Emp emp = new BP.Port.Emp(); return emp.EnMap; } if (this._enMap == null) this._enMap = MapData.GenerHisMap(this.RptName); return this._enMap; } } /// /// 报表 /// /// public GERpt(string rptName) { this.RptName = rptName; } public GERpt() { } /// /// 报表 /// /// /// public GERpt(string rptName, Int64 oid) { this.RptName = rptName; this.OID = (int)oid; this.Retrieve(); } #endregion attrs } /// /// 报表s /// public class GERpts : BP.En.EntitiesOID { /// /// 报表s /// public GERpts() { } /// /// 获得一个实例. /// public override Entity GetNewEntity { get { return new GERpt(); } } #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((GERpt)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }