using System; using BP.DA; using BP.En; using BP.Web; using BP.WF.Port.Admin2Group; namespace BP.WF.Admin { /// /// 独立组织属性 /// public class OrgAttr : EntityNoNameAttr { /// /// 管理员帐号 /// public const string Adminer = "Adminer"; /// /// 管理员名称 /// public const string AdminerName = "AdminerName"; /// /// 父级组织编号 /// public const string ParentNo = "ParentNo"; /// /// 父级组织名称 /// public const string ParentName = "ParentName"; /// /// 序号 /// public const string Idx = "Idx"; } /// /// 独立组织 /// public class Org : EntityNoName { #region 属性 /// /// 父级组织编号 /// public string ParentNo { get { return this.GetValStrByKey(OrgAttr.ParentNo); } set { this.SetValByKey(OrgAttr.ParentNo, value); } } /// /// 父级组织名称 /// public string ParentName { get { return this.GetValStrByKey(OrgAttr.ParentName); } set { this.SetValByKey(OrgAttr.ParentName, value); } } /// /// 父节点编号 /// public string Adminer { get { return this.GetValStrByKey(OrgAttr.Adminer); } set { this.SetValByKey(OrgAttr.Adminer, value); } } /// /// 管理员名称 /// public string AdminerName { get { return this.GetValStrByKey(OrgAttr.AdminerName); } set { this.SetValByKey(OrgAttr.AdminerName, value); } } #endregion #region 构造函数 /// /// 独立组织 /// public Org() { } /// /// 独立组织 /// /// 编号 public Org(string no) : base(no) { } #endregion #region 重写方法 /// /// UI界面上的访问控制 /// public override UAC HisUAC { get { UAC uac = new UAC(); uac.OpenForSysAdmin(); return uac; } } /// /// Map /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; Map map = new Map("Port_Org", "系统信息"); map.AddTBStringPK(OrgAttr.No, null, "编号", true, true, 1, 50, 40); map.AddTBString(OrgAttr.Name, null, "单位", true, false, 0, 60, 200); map.AddTBInt("FlowNums", 0, "流程模板数", true, true); map.AddTBInt("FrmNums", 0, "表单模板数", true, true); map.AddTBInt("Users", 0, "用户数", true, true); map.AddTBInt("Depts", 0, "部门数", true, true); map.AddTBInt("GWFS", 0, "运行中流程", true, true); map.AddTBInt("GWFSOver", 0, "完成流程", true, true); map.AddTBString(OrgAttr.Adminer, null, "管理员(创始人)", true, true, 0, 60, 200); map.AddTBString(OrgAttr.AdminerName, null, "管理员名称", true, true, 0, 60, 200); #region 低代码. RefMethod rm = new RefMethod(); rm.GroupName = "低代码"; rm.Title = "菜单体系"; rm.RefMethodType = RefMethodType.RightFrameOpen; rm.ClassMethodName = this.ToString() + ".LowCodeList"; rm.Icon = "icon-grid"; map.AddRefMethod(rm); rm = new RefMethod(); rm.GroupName = "低代码"; rm.Title = "新建系统"; rm.RefMethodType = RefMethodType.RightFrameOpen; rm.ClassMethodName = this.ToString() + ".LowCodeNew"; rm.Icon = "icon-folder"; map.AddRefMethod(rm); #endregion 流程管理. #region 流程管理. rm = new RefMethod(); rm.GroupName = "流程"; rm.Title = "流程模板"; rm.RefMethodType = RefMethodType.RightFrameOpen; rm.ClassMethodName = this.ToString() + ".FlowTemplate"; rm.Icon = "icon-grid"; map.AddRefMethod(rm); rm = new RefMethod(); rm.GroupName = "流程"; rm.Title = "模板目录"; rm.RefMethodType = RefMethodType.RightFrameOpen; rm.ClassMethodName = this.ToString() + ".FlowSorts"; rm.Icon = "icon-folder"; map.AddRefMethod(rm); rm = new RefMethod(); rm.GroupName = "流程"; rm.Title = "流程实例"; rm.RefMethodType = RefMethodType.RightFrameOpen; rm.ClassMethodName = this.ToString() + ".FlowGenerWorkFlowView"; rm.Icon = "icon-layers"; map.AddRefMethod(rm); rm = new RefMethod(); rm.GroupName = "流程"; rm.Title = "流程分析"; rm.RefMethodType = RefMethodType.RightFrameOpen; rm.ClassMethodName = this.ToString() + ".FlowRptWhite"; rm.Icon = "icon-chart"; map.AddRefMethod(rm); #endregion 流程管理. #region 表单管理. rm = new RefMethod(); rm.GroupName = "表单"; rm.Title = "表单模板"; rm.RefMethodType = RefMethodType.RightFrameOpen; rm.ClassMethodName = this.ToString() + ".FrmTemplate"; rm.Icon = "icon-grid"; map.AddRefMethod(rm); rm = new RefMethod(); rm.GroupName = "表单"; rm.Title = "目录"; rm.RefMethodType = RefMethodType.RightFrameOpen; rm.ClassMethodName = this.ToString() + ".FrmSort"; rm.Icon = "icon-chart"; map.AddRefMethod(rm); rm = new RefMethod(); rm.GroupName = "表单"; rm.Title = "外键"; rm.RefMethodType = RefMethodType.RightFrameOpen; rm.ClassMethodName = this.ToString() + ".FrmFK"; rm.Icon = "icon-chart"; map.AddRefMethod(rm); rm = new RefMethod(); rm.GroupName = "表单"; rm.Title = "数据源"; rm.RefMethodType = RefMethodType.RightFrameOpen; rm.ClassMethodName = this.ToString() + ".FrmDBSrc"; rm.Icon = "icon-chart"; map.AddRefMethod(rm); #endregion 表单管理. #region 组织管理. rm = new RefMethod(); rm.GroupName = "组织"; rm.Title = "组织结构"; rm.RefMethodType = RefMethodType.RightFrameOpen; rm.ClassMethodName = this.ToString() + ".OrgUrl"; rm.Icon = "icon-grid"; map.AddRefMethod(rm); rm = new RefMethod(); rm.GroupName = "组织"; rm.Title = "角色"; rm.RefMethodType = RefMethodType.RightFrameOpen; rm.ClassMethodName = this.ToString() + ".OrgStation"; rm.Icon = "icon-chart"; map.AddRefMethod(rm); rm = new RefMethod(); rm.GroupName = "组织"; rm.Title = "角色类型"; rm.RefMethodType = RefMethodType.RightFrameOpen; rm.ClassMethodName = this.ToString() + ".OrgStationType"; rm.Icon = "icon-chart"; map.AddRefMethod(rm); rm = new RefMethod(); rm.GroupName = "组织"; rm.Title = "部门"; rm.RefMethodType = RefMethodType.RightFrameOpen; rm.ClassMethodName = this.ToString() + ".OrgDept"; rm.Icon = "icon-chart"; map.AddRefMethod(rm); #endregion 组织管理. this._enMap = map; return this._enMap; } } #endregion #region 低代码. public string LowCodeList() { return "/WF/GPM/SystemList.htm"; } public string LowCodeNew() { return "/WF/GPM/NewSystem.htm"; } #endregion 低代码. #region 组织. public string OrgUrl() { return "/GPM/Organization.htm"; } public string OrgStation() { return "/WF/Comm/Search.htm?EnsName=BP.Port.Stations"; } public string OrgStationType() { return "/WF/Comm/Ens.htm?EnsName=BP.Port.StationTypes"; } public string OrgDept() { return "/WF/Comm/Search.htm?EnsName=BP.Port.Depts"; } #endregion 组织. #region 表单. public string FrmFK() { return "/WF/Comm/Search.htm?EnsName=BP.Sys.SFTables"; } public string FrmEnum() { return "/WF/Comm/Search.htm?EnsName=BP.Sys.EnumMains"; } public string FrmDBSrc() { return "/WF/Comm/Search.htm?EnsName=BP.Sys.SFDBSrcs"; } public string FrmTemplate() { return "/WF/Comm/Search.htm?EnsName=BP.WF.Admin.Frms"; } public string FrmSort() { return "/WF/Comm/Ens.htm?EnsName=BP.WF.Admin.FrmSorts"; } #endregion 表单. #region 流程模板. public string FlowTemplate() { return "/WF/Comm/Search.htm?EnsName=BP.WF.Admin.Flows"; } public string FlowSorts() { return "/WF/Comm/Ens.htm?EnsName=BP.WF.Admin.FlowSorts"; } public string FlowGenerWorkFlowView() { return "/WF/Comm/Search.htm?EnsName=BP.WF.Data.GenerWorkFlowViews"; } public string FlowRptWhite() { return "/WF/Comm/Group.htm?EnsName=BP.WF.Data.GenerWorkFlowViews"; } #endregion 流程模板 protected override bool beforeUpdateInsertAction() { this.SetValByKey("FlowNums", DBAccess.RunSQLReturnValInt("SELECT COUNT(*) AS a FROM WF_Flow WHERE OrgNo='" + WebUser.OrgNo + "'")); this.SetValByKey("FrmNums", DBAccess.RunSQLReturnValInt("SELECT COUNT(*) AS a FROM Sys_MapData WHERE OrgNo='" + WebUser.OrgNo + "'")); this.SetValByKey("Users", DBAccess.RunSQLReturnValInt("SELECT COUNT(*) AS a FROM Port_Emp WHERE OrgNo='" + WebUser.OrgNo + "'")); this.SetValByKey("Depts", DBAccess.RunSQLReturnValInt("SELECT COUNT(*) AS a FROM Port_Dept WHERE OrgNo='" + WebUser.OrgNo + "'")); this.SetValByKey("GWFS", DBAccess.RunSQLReturnValInt("SELECT COUNT(*) AS a FROM WF_GenerWorkFlow WHERE OrgNo='" + WebUser.OrgNo + "' AND WFState!=3")); this.SetValByKey("GWFSOver", DBAccess.RunSQLReturnValInt("SELECT COUNT(*) AS a FROM WF_GenerWorkFlow WHERE OrgNo='" + WebUser.OrgNo + "' AND WFState=3")); return base.beforeUpdateInsertAction(); } } /// ///独立组织集合 /// public class Orgs : EntitiesNoName { #region 构造. /// /// 得到一个新实体 /// public override Entity GetNewEntity { get { return new Org(); } } /// /// create ens /// public Orgs() { } #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((Org)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }