using System; using BP.En; using BP.WF; namespace BP.CCBill { /// /// 单据状态 /// public enum BillState { /// /// 空白 /// None = 0, /// /// 草稿 /// Draft = 1, /// /// 编辑中 /// Editing = 2, /// /// 归档 /// Over = 100 } /// /// 单据控制表 - Attr /// public class GenerBillAttr { #region 基本属性1 /// /// 工作ID /// public const string WorkID = "WorkID"; /// /// 表单ID /// public const string FrmID = "FrmID"; /// /// 关联的单据号 /// public const string FrmName = "FrmName"; #endregion #region 基本属性 /// /// TSpan /// public const string TSpan = "TSpan"; /// /// 单据状态 /// public const string BillState = "BillState"; /// /// 单据状态(简单) /// public const string BillSta = "BillSta"; /// /// 标题 /// public const string Title = "Title"; /// /// 发起人 /// public const string Starter = "Starter"; /// /// 产生时间 /// public const string RDT = "RDT"; /// /// 完成时间 /// public const string CDT = "CDT"; /// /// 当前步骤. /// public const string NDStep = "NDStep"; /// /// 步骤名称 /// public const string NDStepName = "NDStepName"; /// /// 部门 /// public const string FK_Dept = "FK_Dept"; /// /// 部门名称 /// public const string DeptName = "DeptName"; /// /// 年月 /// public const string FK_NY = "FK_NY"; /// /// 单据ID /// public const string FID = "FID"; /// /// 发起人名称 /// public const string StarterName = "StarterName"; /// /// 单据类别 /// public const string FK_FrmTree = "FK_FrmTree"; /// /// 优先级 /// public const string PRI = "PRI"; /// /// 单据应完成时间 /// public const string SDTOfFlow = "SDTOfFlow"; /// /// 节点应完成时间 /// public const string SDTOfNode = "SDTOfNode"; /// /// 父单据ID /// public const string PWorkID = "PWorkID"; /// /// 父单据编号 /// public const string PFrmID = "PFrmID"; /// /// 父单据节点 /// 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"; public const string Sender = "Sender"; public const string SendDT = "SendDT"; /// /// 待办状态 /// public const string TodoSta = "TodoSta"; #endregion } /// /// 单据控制表 /// public class GenerBill : Entity { #region 属性 /// /// 主键 /// public override string PK { get { return GenerBillAttr.WorkID; } } /// /// 备注 /// public string FlowNote { get { return this.GetValStrByKey(GenerBillAttr.FlowNote); } set { SetValByKey(GenerBillAttr.FlowNote, value); } } /// /// BillNo /// public string BillNo { get { return this.GetValStrByKey(GenerBillAttr.BillNo); } set { SetValByKey(GenerBillAttr.BillNo, value); } } /// /// 单据ID /// public string FrmID { get { return this.GetValStrByKey(GenerBillAttr.FrmID); } set { SetValByKey(GenerBillAttr.FrmID, value); } } /// /// 单据单据 /// public string FrmName { get { return this.GetValStrByKey(GenerBillAttr.FrmName); } set { SetValByKey(GenerBillAttr.FrmName, value); } } /// /// 优先级 /// public int PRI { get { return this.GetValIntByKey(GenerBillAttr.PRI); } set { SetValByKey(GenerBillAttr.PRI, value); } } /// /// 待办人员数量 /// public int TodoEmpsNum { get { return this.GetValIntByKey(GenerBillAttr.TodoEmpsNum); } set { SetValByKey(GenerBillAttr.TodoEmpsNum, value); } } /// /// 待办人员列表 /// public string TodoEmps { get { return this.GetValStrByKey(GenerBillAttr.TodoEmps); } set { SetValByKey(GenerBillAttr.TodoEmps, value); } } /// /// 参与人 /// public string Emps { get { return this.GetValStrByKey(GenerBillAttr.Emps); } set { SetValByKey(GenerBillAttr.Emps, value); } } /// /// 状态 /// public TaskSta TaskSta { get { return (TaskSta)this.GetValIntByKey(GenerBillAttr.TaskSta); } set { SetValByKey(GenerBillAttr.TaskSta, (int)value); } } /// /// 类别编号 /// public string FrmTreeNo { get { return this.GetValStrByKey(GenerBillAttr.FK_FrmTree); } set { SetValByKey(GenerBillAttr.FK_FrmTree, value); } } /// /// 部门编号 /// public string DeptNo { get { return this.GetValStrByKey(GenerBillAttr.FK_Dept); } set { SetValByKey(GenerBillAttr.FK_Dept, value); } } /// /// 标题 /// public string Title { get { return this.GetValStrByKey(GenerBillAttr.Title); } set { SetValByKey(GenerBillAttr.Title, value); } } /// /// 客户编号 /// public string GuestNo { get { return this.GetValStrByKey(GenerBillAttr.GuestNo); } set { SetValByKey(GenerBillAttr.GuestNo, value); } } /// /// 客户名称 /// public string GuestName { get { return this.GetValStrByKey(GenerBillAttr.GuestName); } set { SetValByKey(GenerBillAttr.GuestName, value); } } /// /// 产生时间 /// public string RDT { get { return this.GetValStrByKey(GenerBillAttr.RDT); } set { SetValByKey(GenerBillAttr.RDT, value); } } /// /// 节点应完成时间 /// public string SDTOfNode { get { return this.GetValStrByKey(GenerBillAttr.SDTOfNode); } set { SetValByKey(GenerBillAttr.SDTOfNode, value); } } /// /// 单据应完成时间 /// public string SDTOfFlow { get { return this.GetValStrByKey(GenerBillAttr.SDTOfFlow); } set { SetValByKey(GenerBillAttr.SDTOfFlow, value); } } /// /// 单据ID /// public Int64 WorkID { get { return this.GetValInt64ByKey(GenerBillAttr.WorkID); } set { SetValByKey(GenerBillAttr.WorkID, value); } } /// /// 主线程ID /// public Int64 FID { get { return this.GetValInt64ByKey(GenerBillAttr.FID); } set { SetValByKey(GenerBillAttr.FID, value); } } /// /// 父节点单据编号. /// public Int64 PWorkID { get { return this.GetValInt64ByKey(GenerBillAttr.PWorkID); } set { SetValByKey(GenerBillAttr.PWorkID, value); } } /// /// 父单据调用的节点 /// public int PNodeID { get { return this.GetValIntByKey(GenerBillAttr.PNodeID); } set { SetValByKey(GenerBillAttr.PNodeID, value); } } /// /// PFrmID /// public string PFrmID { get { return this.GetValStrByKey(GenerBillAttr.PFrmID); } set { SetValByKey(GenerBillAttr.PFrmID, value); } } /// /// 吊起子单据的人员 /// public string PEmp { get { return this.GetValStrByKey(GenerBillAttr.PEmp); } set { SetValByKey(GenerBillAttr.PEmp, value); } } /// /// 发起人 /// public string Starter { get { return this.GetValStrByKey(GenerBillAttr.Starter); } set { SetValByKey(GenerBillAttr.Starter, value); } } /// /// 发起人名称 /// public string StarterName { get { return this.GetValStrByKey(GenerBillAttr.StarterName); } set { this.SetValByKey(GenerBillAttr.StarterName, value); } } /// /// 发起人部门名称 /// public string DeptName { get { return this.GetValStrByKey(GenerBillAttr.DeptName); } set { this.SetValByKey(GenerBillAttr.DeptName, value); } } /// /// 当前节点名称 /// public string NDStepName { get { return this.GetValStrByKey(GenerBillAttr.NDStepName); } set { this.SetValByKey(GenerBillAttr.NDStepName, value); } } /// /// 当前工作到的节点 /// public int NDStep { get { return this.GetValIntByKey(GenerBillAttr.NDStep); } set { SetValByKey(GenerBillAttr.NDStep, value); } } /// /// 工作单据状态 /// public BillState BillState { get { return (BillState)this.GetValIntByKey(GenerBillAttr.BillState); } set { //if (value == BillState.) // SetValByKey(GenerBillAttr.BillSta, (int)BillSta.Complete); //else if (value == BP.WF.BillState.Delete) // SetValByKey(GenerBillAttr.BillSta, (int)BillSta.Etc); //else // SetValByKey(GenerBillAttr.BillSta, (int)BillSta.Runing); SetValByKey(GenerBillAttr.BillState, (int)value); } } /// /// 单据状态 /// public string BillStateText { get { return this.GetValRefTextByKey(GenerBillAttr.BillState); } } /// /// GUID /// public string GUID { get { return this.GetValStrByKey(GenerBillAttr.GUID); } set { SetValByKey(GenerBillAttr.GUID, value); } } #endregion #region 权限控制. public override UAC HisUAC { get { UAC uac = new UAC(); if (BP.Web.WebUser.No.Equals("admin")==true) { uac.IsDelete = false; uac.IsUpdate = true; return uac; } uac.Readonly(); return uac; } } #endregion 权限控制. #region 构造方法 /// /// 单据控制表 /// public GenerBill() { } /// /// 单据控制表 /// /// workID public GenerBill(Int64 workid) { this.WorkID = workid; this.Retrieve(); } /// /// EnMap /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; Map map = new Map("Frm_GenerBill", "单据控制表"); map.AddTBIntPK(GenerBillAttr.WorkID, 0, "WorkID", true, true); map.AddTBString(GenerBillAttr.FK_FrmTree, null, "单据类别", true, false, 0, 10, 10); map.AddTBString(GenerBillAttr.FrmID, null, "单据ID", true, false, 0, 100, 10); map.AddTBString(GenerBillAttr.FrmName, null, "单据名称", true, false, 0, 200, 10); map.AddTBString(GenerBillAttr.BillNo, null, "单据编号", true, false, 0, 100, 10); map.AddTBString(GenerBillAttr.Title, null, "标题", true, false, 0, 1000, 10); map.AddDDLSysEnum(GenerBillAttr.BillSta, 0, "状态(简)", true, false, GenerBillAttr.BillSta, "@0=运行中@1=已完成@2=其他"); map.AddDDLSysEnum(GenerBillAttr.BillState, 0, "单据状态", true, false, GenerBillAttr.BillState, "@0=空白@1=草稿@2=编辑中@100=归档"); map.AddTBString(GenerBillAttr.Starter, null, "创建人", true, false, 0, 200, 10); map.AddTBString(GenerBillAttr.StarterName, null, "创建人名称", true, false, 0, 200, 10); map.AddTBString(GenerBillAttr.Sender, null, "发送人", true, false, 0, 200, 10); map.AddTBDateTime(GenerBillAttr.RDT, "记录日期", true, true); map.AddTBDateTime(GenerBillAttr.SendDT, "单据活动时间", true, true); map.AddTBInt(GenerBillAttr.NDStep, 0, "步骤", true, false); map.AddTBString(GenerBillAttr.NDStepName, null, "步骤名称", true, false, 0, 100, 10); map.AddTBString(GenerBillAttr.FK_Dept, null, "部门", true, false, 0, 100, 10); map.AddTBString(GenerBillAttr.DeptName, null, "部门名称", true, false, 0, 100, 10); map.AddTBInt(GenerBillAttr.PRI, 1, "优先级", true, true); map.AddTBDateTime(GenerBillAttr.SDTOfNode, "节点应完成时间", true, true); map.AddTBDateTime(GenerBillAttr.SDTOfFlow, "单据应完成时间", true, true); //父子单据信息. map.AddTBString(GenerBillAttr.PFrmID, null, "父单据编号", true, false, 0, 3, 10); map.AddTBInt(GenerBillAttr.PWorkID, 0, "父单据ID", true, true); map.AddDDLSysEnum(GenerBillAttr.TSpan, 0, "时间段", true, false, GenerBillAttr.TSpan, "@0=本周@1=上周@2=上上周@3=更早"); //参数. map.AddTBString(GenerBillAttr.AtPara, null, "参数(单据运行设置临时存储的参数)", true, false, 0, 2000, 10); map.AddTBString(GenerBillAttr.Emps, null, "参与人", true, false, 0, 4000, 10); map.AddTBString(GenerBillAttr.GUID, null, "GUID", false, false, 0, 36, 10); map.AddTBString(GenerBillAttr.FK_NY, null, "年月", false, false, 0, 7, 7); this._enMap = map; return this._enMap; } } #endregion #region 方法操作. #endregion 方法操作. } /// /// 单据控制表s /// public class GenerBills : Entities { #region 构造 /// /// 单据控制表s /// public GenerBills() { } /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new GenerBill(); } } #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((GenerBill)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }