Esempio n. 1
0
        /// <summary>
        /// 角色管理
        /// </summary>
        /// <returns></returns>
        public IActionResult RoleMgt()
        {
            string initWhere = string.Empty;

            if (!_applicationContext.IsAdministrator)
            {
                initWhere = "CreateBy='" + _applicationContext.EmpUid + "' ";
                List <FapRole>            roles = new List <FapRole>();
                IEnumerable <FapRoleRole> rrs   = null;
                //授予的角色
                if (_platformDomain.RoleRoleSet.TryGetValueByRole(_applicationContext.CurrentRoleUid, out rrs))
                {
                    if (rrs != null && rrs.Any())
                    {
                        roles = roles.Where(r => rrs.FirstOrDefault(rr => rr.PRoleUid == r.Fid) != null).ToList();
                    }
                }
                if (roles.Any())
                {
                    initWhere += " or Fid in(" + string.Join(",", roles.Select(r => "'" + r.Fid + "'")) + ")";
                }
            }
            JqGridViewModel model = this.GetJqGridModel("FapRole", (qs) =>
            {
                qs.GlobalWhere = initWhere;
            });

            return(View(model));
        }
Esempio n. 2
0
        /// <summary>
        /// 用户选择
        /// </summary>
        /// <returns></returns>
        public PartialViewResult UserSelector()
        {
            string strWhere = string.Empty;

            if (!_applicationContext.IsAdministrator)
            {
                //DataAccessor da = new DataAccessor();
                //List<dynamic> powers = da.QueryOrginal("select fid from Employee where DeptUid in(" + _httpSession.AcSession.AccountPrivilege.GetUserDeptAuthorityWhere() + ") and " + da.GetValidWhereSql());
                //if (powers != null && powers.Any())
                //{
                //    var power = powers.Select(d => "'" + d.fid + "'");
                //    strWhere = "UserIdentity in(" + string.Join(",", power) + ")";
                //}
                //else
                //{
                //    strWhere = "1=2";
                //}
                strWhere = "UserIdentity in (select fid from Employee where DeptUid in(" + FapPlatformConstants.DepartmentAuthority + "))";
            }
            JqGridViewModel model = this.GetJqGridModel("FapUser", (qs) =>
            {
                qs.QueryCols   = "Id,Fid,UserCode,UserName,UserIdentity";
                qs.GlobalWhere = strWhere;
            });

            return(PartialView(model));
        }
Esempio n. 3
0
        //组织部门首页
        // GET: /Organization/OrgDept/
        public ActionResult DeptIndex()
        {
            //表格权限,不在这里设置,需要取权限--数据权限哪里设置
            JqGridViewModel model = this.GetJqGridModel("OrgDept");

            return(View(model));
        }
Esempio n. 4
0
        public IActionResult Monitor()
        {
            ViewBag.SchemeList = _dbContext.Query <PerfProgram>("select * from PerfProgram", null, true);
            JqGridViewModel model = this.GetJqGridModel("PerfExaminer");

            return(View(model));
        }
Esempio n. 5
0
        public IActionResult Consequent()
        {
            ViewBag.SchemeList = _dbContext.Query <PerfProgram>("select * from PerfProgram", null, true);
            JqGridViewModel model = this.GetJqGridModel("PerfObject");

            return(View(model));
        }
Esempio n. 6
0
        /// <summary>
        /// 返回带有JqGrid的Model
        /// </summary>
        /// <param name="tableName">表名</param>
        /// <param name="handler">处理事件</param>
        /// <param name="hasOperCol">包含操作列</param>
        /// <param name="initCondition">初始化条件</param>
        /// <param name="isGlobalCondition">是否为全局条件</param>
        /// <returns></returns>
        protected JqGridViewModel GetJqGridModel(string tableName, Action <QuerySet> handler = null, bool hasOperCol = false)
        {
            JqGridViewModel model = new JqGridViewModel()
            {
                JqgridId = tableName
            };
            QuerySet qs = new QuerySet()
            {
                TableName   = tableName,
                InitWhere   = "",
                GlobalWhere = "",
                QueryCols   = "*"
            };

            //事件处理
            handler?.Invoke(qs);
            var allCols = _dbContext.Columns(tableName);
            //默认排序
            var sorts = allCols.Where(c => c.SortDirection.IsPresent());

            foreach (var sort in sorts)
            {
                qs.AddOrderBy(sort.ColName, sort.SortDirection);
            }
            //当排序没有设置的时候,设置创建时间倒序排列
            if (!qs.OrderByList.Any())
            {
                //qs.AddOrderBy("CreateDate", "desc");
                qs.AddOrderBy("Id", "desc");
            }
            qs.InitWhere   = qs.InitWhere.IsPresent() ? ReplaceSafeSql(qs.InitWhere) : "";
            qs.GlobalWhere = qs.GlobalWhere.IsPresent() ? ReplaceSafeSql(qs.GlobalWhere) : "";
            model.QuerySet = qs;
            return(model);
        }
Esempio n. 7
0
        /// <summary>
        /// 权限管理
        /// </summary>
        /// <returns></returns>
        public IActionResult Permissions()
        {
            JqGridViewModel model = this.GetJqGridModel("FapRoleData", (qs) =>
            {
                qs.InitWhere = "1=2";
            });

            return(View(model));
        }
Esempio n. 8
0
        //GET: /Time/Manage/Schedule
        /// <summary>
        /// 排班计划表
        /// 管理员工一年的排班情况
        /// </summary>
        /// <returns></returns>
        public ActionResult Schedule()
        {
            JqGridViewModel empModel = this.GetJqGridModel("Employee", (q) =>
            {
                q.QueryCols   = "Id,Fid,EmpCode,EmpName,EmpCategory,DeptUid,Gender,IDCard";
                q.GlobalWhere = "IsMainJob=1";
            });

            return(View(empModel));
        }
Esempio n. 9
0
        /// <summary>
        /// 考核对象
        /// </summary>
        public ActionResult Objectives(string fid)
        {
            JqGridViewModel model = this.GetJqGridModel("PerfObject", qs =>
            {
                qs.InitWhere = "ProgramUid=@PrmUid";
                qs.AddParameter("PrmUid", fid);
            });

            return(PartialView(model));
        }
Esempio n. 10
0
        /// <summary>
        /// 打分结果
        /// </summary>
        /// <returns></returns>
        public IActionResult Scored(string objUid)
        {
            JqGridViewModel model = this.GetJqGridModel("PerfExaminer", qs =>
            {
                qs.GlobalWhere = "ObjectUid=@ObjUid";
                qs.AddParameter("ObjUid", objUid);
            });

            return(View(model));
        }
Esempio n. 11
0
        /// <summary>
        /// 保险项
        /// </summary>
        /// <param name="caseUid"></param>
        /// <returns></returns>
        public PartialViewResult InsItem(string caseUid)
        {
            JqGridViewModel insItemModel = this.GetJqGridModel(nameof(InsItem), (q) =>
            {
                q.GlobalWhere = "CaseUid=@CaseUid";
                q.AddParameter("CaseUid", caseUid);
            });

            return(PartialView(insItemModel));
        }
Esempio n. 12
0
        public IActionResult DataGrid(GridViewModel gridView)
        {
            JqGridViewModel model = GetJqGridModel(gridView.TableName, qs => {
                qs.QueryCols   = gridView.Cols.IsMissing() ? "*" : gridView.Cols;
                qs.GlobalWhere = gridView.Condition;
            });

            model.JqgridId = $"datagrid_" + gridView.TableName;
            return(View(model));
        }
Esempio n. 13
0
        /// <summary>
        /// 薪资项
        /// </summary>
        /// <param name="caseUid"></param>
        /// <returns></returns>
        public PartialViewResult PayItem(string caseUid)
        {
            JqGridViewModel payItemModel = this.GetJqGridModel("PayItem", (q) =>
            {
                q.GlobalWhere = "CaseUid=@CaseUid";
                q.AddParameter("CaseUid", caseUid);
            });

            return(PartialView(payItemModel));
        }
Esempio n. 14
0
        /// <summary>
        /// 薪资套
        /// </summary>
        /// <returns></returns>
        public IActionResult PaySet()
        {
            JqGridViewModel model = this.GetJqGridModel("PayCase", qs =>
            {
                qs.GlobalWhere = "CreateBy=@EmpUid";
                qs.AddParameter("EmpUid", _applicationContext.EmpUid);
            });

            return(View(model));
        }
Esempio n. 15
0
        public IActionResult BizRole()
        {
            MultiJqGridViewModel model   = new MultiJqGridViewModel();
            JqGridViewModel      bizRole = this.GetJqGridModel("FapBizRoleEmployee");

            JqGridViewModel dynRole = this.GetJqGridModel("FapBizDynRole");

            model.JqGridViewModels.Add("FapBizRole", bizRole);
            model.JqGridViewModels.Add("FapBizDynRole", dynRole);
            return(View(model));
        }
Esempio n. 16
0
        public ActionResult MessageAndNotice()
        {
            JqGridViewModel model = this.GetJqGridModel("FapMessage", (qs) =>
            {
                qs.GlobalWhere = "REmpUid=@EmpUid";
                qs.AddParameter("EmpUid", _applicationContext.EmpUid);
                qs.AddOrderBy("CreateDate", "desc");
            });

            return(View(model));
        }
Esempio n. 17
0
        /// <summary>
        /// 我的代理人
        /// </summary>
        /// <returns></returns>
        public IActionResult MyAgent()
        {
            JqGridViewModel model = this.GetJqGridModel("WfAgentSetting", qs =>
            {
                qs.GlobalWhere = $"Principal='{_applicationContext.EmpUid}'";
                qs.AddDefaultValue("Principal", _applicationContext.EmpUid);
                qs.AddDefaultValue("PrincipalMC", _applicationContext.EmpName);
            });

            return(View(model));
        }
Esempio n. 18
0
        /// <summary>
        /// Job日志
        /// </summary>
        /// <param name="fid"></param>
        /// <returns></returns>
        public PartialViewResult JobLog(string fid)
        {
            JqGridViewModel model = this.GetJqGridModel("FapJobLog", (q) =>
            {
                q.GlobalWhere = $"JobId=@JobId";
                q.AddParameter("JobId", fid);
                q.AddOrderBy("ExecuteTime", "desc");
            });

            return(PartialView(model));
        }
Esempio n. 19
0
        /// <summary>
        /// 组织机构
        /// </summary>
        /// <returns></returns>
        public IActionResult OrgMgt()
        {
            MultiJqGridViewModel multiModel = new MultiJqGridViewModel();
            JqGridViewModel      orgModel   = this.GetJqGridModel("FapOrg");

            multiModel.JqGridViewModels.Add("FapOrg", orgModel);
            JqGridViewModel groupModel = this.GetJqGridModel("FapGroup");

            multiModel.JqGridViewModels.Add("FapGroup", groupModel);
            return(View(multiModel));
        }
Esempio n. 20
0
        /// <summary>
        /// 实时同步设置
        /// </summary>
        /// <returns></returns>
        public IActionResult RealtimeSetting()
        {
            JqGridViewModel modelSetting = this.GetJqGridModel("CfgRTSynchSetting");
            JqGridViewModel modelLog     = this.GetJqGridModel("FapRealtimeSynLog", (qs) => {
                qs.InitWhere = "SynState=0";
            });
            MultiJqGridViewModel model = new MultiJqGridViewModel();

            model.JqGridViewModels.Add("setting", modelSetting);
            model.JqGridViewModels.Add("log", modelLog);
            return(View(model));
        }
Esempio n. 21
0
        /// <summary>
        /// 考核人
        /// </summary>
        /// <returns></returns>
        public IActionResult Examiner(string schemeUid, string objUid)
        {
            JqGridViewModel model = this.GetJqGridModel("PerfExaminer", (q) =>
            {
                q.QueryCols   = "Id,Fid,ObjectUid,ProgramUid,AssessModel,EmpUid,Weights";
                q.GlobalWhere = "ProgramUid=@PrmUid and ObjectUid=@ObjUid";
                q.AddParameter("PrmUid", schemeUid);
                q.AddParameter("ObjUid", objUid);
            });

            return(PartialView(model));
        }
Esempio n. 22
0
        /// <summary>
        /// 历史架构
        /// </summary>
        /// <returns></returns>
        public ActionResult OrgHistroy()
        {
            JqGridViewModel model = GetJqGridModel("OrgPosition", (qs) =>
            {
                qs.InitWhere = "1=2";
                //增加统计
                qs.AddStatSet(StatSymbolEnum.SUM, "Preparation");
                qs.AddStatSet(StatSymbolEnum.SUM, "Actual");
            });

            return(View(model));
        }
Esempio n. 23
0
        /// <summary>
        ///数据属性
        /// </summary>
        /// <returns></returns>
        public PartialViewResult ColumnMetadata(string fid)
        {
            FapTable table = _dbContext.Get <FapTable>(fid);

            JqGridViewModel model = this.GetJqGridModel("FapColumn", (q) =>
            {
                q.GlobalWhere = $"TableName='{table.TableName}' and IsDefaultCol=0";
                q.AddDefaultValue("TableName", table.TableName);
            });

            return(PartialView(model));
        }
Esempio n. 24
0
        /// <summary>
        /// 考核指标
        /// </summary>
        /// <param name="fid">方案Uid</param>
        /// <param name="schemeName">方案名称</param>
        /// <returns></returns>
        public IActionResult KPI(string fid, string schemeName)
        {
            JqGridViewModel model = this.GetJqGridModel("PerfKPIs", qs =>
            {
                qs.GlobalWhere = "ProgramUid=@PrmUid";
                qs.AddParameter("PrmUid", fid);
                qs.AddDefaultValue("ProgramUid", fid);
                qs.AddDefaultValue("ProgramUidMC", schemeName);
            });

            return(PartialView(model));
        }
Esempio n. 25
0
        /// <summary>
        /// 薪资套权限
        /// </summary>
        /// <param name="caseUid"></param>
        /// <returns></returns>
        public PartialViewResult PayAuthority(string caseUid, string caseName)
        {
            JqGridViewModel model = this.GetJqGridModel("PayCaseEmployee", (q) =>
            {
                q.AddDefaultValue("CaseUid", caseUid);
                q.AddDefaultValue("CaseUidMC", caseName);
                q.GlobalWhere = "CaseUid=@CaseUid";
                q.AddParameter("CaseUid", caseUid);
            });

            return(PartialView(model));
        }
Esempio n. 26
0
        /// <summary>
        /// 招聘需求
        /// </summary>
        /// <returns></returns>
        public IActionResult Demand()
        {
            var cols = _dbContext.Columns("RcrtDemand").Where(c => !c.ColProperty.EqualsWithIgnoreCase("3"))?.Select(c => c.ColName);

            Guard.Against.Null(cols, nameof(cols));
            JqGridViewModel model = this.GetJqGridModel("RcrtDemand", (qs) =>
            {
                qs.QueryCols   = string.Join(',', cols);
                qs.GlobalWhere = "BillStatus='PASSED'";
            });

            return(View(model));
        }
Esempio n. 27
0
        public PartialViewResult HistoryVersion(int id)
        {
            WfProcess       template      = _dbContext.Get <WfProcess>(id);
            string          collectionId  = template.CollectionId;
            string          initCondition = $"CollectionId='{collectionId}' AND Status='{WfProcessState.Historical}'";
            JqGridViewModel model         = this.GetJqGridModel("WfProcess", (queryOption) =>
            {
                queryOption.GlobalWhere = initCondition;
            });

            ViewBag.Id = template.Id;
            return(PartialView(model));
        }
Esempio n. 28
0
        /// <summary>
        /// 类别设置
        /// </summary>
        /// <returns></returns>
        public ActionResult TimeType()
        {
            MultiJqGridViewModel mmodel = new MultiJqGridViewModel();
            JqGridViewModel      lm     = GetJqGridModel("TmLeaveType");

            mmodel.JqGridViewModels.Add("leave", lm);
            JqGridViewModel tm = GetJqGridModel("TmTravelType");

            mmodel.JqGridViewModels.Add("travel", tm);
            JqGridViewModel om = GetJqGridModel("TmOvertimeType");

            mmodel.JqGridViewModels.Add("overtime", om);
            return(View(mmodel));
        }
Esempio n. 29
0
        /// <summary>
        /// 数据实体
        /// </summary>
        /// <returns></returns>
        public IActionResult DataEntity()
        {
            JqGridViewModel model = this.GetJqGridModel("FapTable");
            FormViewModel   fm    = new FormViewModel();

            fm.QueryOption = new Core.Infrastructure.Query.QuerySet()
            {
                TableName = "Employee",
                QueryCols = "*",
                InitWhere = "Fid='c4a711e5aee22b59bbe9'"
            };
            ViewBag.FormModel = fm;
            return(View(model));
        }
Esempio n. 30
0
        public ActionResult DailyWeekly()
        {
            JqGridViewModel model = this.GetJqGridModel("EssReport", (qs) =>
            {
                qs.GlobalWhere = "EmpUid='" + _applicationContext.EmpUid + "'";
                qs.AddDefaultValue("EmpUid", _applicationContext.EmpUid);
                qs.AddDefaultValue("EmpUidMC", _applicationContext.EmpName);
                qs.AddDefaultValue("DeptUid", _applicationContext.DeptUid);
                qs.AddDefaultValue("DeptUidMC", _applicationContext.DeptName);
                qs.AddDefaultValue("RptDate", DateTimeUtils.CurrentDateTimeStr);
                qs.AddOrderBy("RptDate", "desc");
            });

            return(View(model));
        }