public string GetBudgetProcessCtrlPorcessList([FromUri] BudgetProcessCtrlRequestModel param)
        {
            if (string.IsNullOrEmpty(param.FOcode))
            {
                return(DCHelper.ErrorMessage("组织编码不能为空!"));
            }
            try
            {
                SUP.Common.DataEntity.DataStoreParam storeparam = new SUP.Common.DataEntity.DataStoreParam();//查询条件
                storeparam.PageIndex = 0; storeparam.PageSize = 100;
                if (param.PageIndex > 0)
                {
                    storeparam.PageIndex = param.PageIndex;
                }
                if (param.PageSize > 0)
                {
                    storeparam.PageSize = param.PageSize;
                }

                List <BudgetProcessCtrlModel> list = null;
                BudgetProcessCtrlService.GetBudgetProcessCtrlPorcessList(storeparam, param.FOcode, param.FYear, out list);
                if (list.Count > 0)
                {
                    BudgetProcessCtrlService.Save <Int64>(list, "");
                }
                var result = BudgetProcessCtrlService.GetBudgetProcessCtrlPorcessList2(storeparam, param.FOcode, param.FYear);

                var changeList = result.Results.ToList();
                if (changeList != null && changeList.Count > 0)//批量更新
                {
                    foreach (var item in changeList)
                    {
                        if (item.FProcessStatus == "1" && DateTime.Now > item.EndDt)
                        {
                            item.FProcessStatus = "2";
                        }
                        if (item.FProcessStatus == "3" && DateTime.Now > item.EndDt2)
                        {
                            item.FProcessStatus = "4";
                        }
                        item.PersistentState = PersistentState.Modified;
                    }
                    BudgetProcessCtrlService.Save <Int64>(changeList, "");
                }
                //再取一遍 不然版本号有问题
                result = BudgetProcessCtrlService.GetBudgetProcessCtrlPorcessList2(storeparam, param.FOcode, param.FYear);
                //return DataConverterHelper.EntityListToJson<BudgetProcessCtrlModel>(result.Results, (Int32)result.TotalItems);
                return(DCHelper.ModelListToJson <BudgetProcessCtrlModel>(result.Results, (Int32)result.TotalItems));
            }
            catch (Exception ex)
            {
                return(DCHelper.ErrorMessage(ex.Message));
            }
        }
Exemple #2
0
        public string GetGHSubjectList([FromUri] GHSubjectRequestModel param)
        {
            if (string.IsNullOrEmpty(param.UserId))
            {
                return(DCHelper.ErrorMessage("用户编码不能为空!"));
            }
            if (string.IsNullOrEmpty(param.Fkmlb))
            {
                return(DCHelper.ErrorMessage("申报种类不能为空!"));
            }
            try
            {
                Dictionary <string, object> dicWhere = new Dictionary <string, object>();//查询条件转Dictionary
                new CreateCriteria(dicWhere).Add(ORMRestrictions <string> .Eq("FProjAttr", param.Fkmlb));

                //增加搜索条件
                if (!string.IsNullOrEmpty(param.FApproveStatus) && !"0".Equals(param.FApproveStatus))
                {
                    new CreateCriteria(dicWhere)
                    .Add(ORMRestrictions <string> .Eq("FApproveStatus", param.FApproveStatus));
                }
                if (!string.IsNullOrEmpty(param.Year))
                {
                    new CreateCriteria(dicWhere).Add(ORMRestrictions <string> .Eq("FYear", param.Year));
                }

                //增加根据操作员对应预算部门的过滤
                var dicWhereDept = new Dictionary <string, object>();
                new CreateCriteria(dicWhereDept)
                .Add(ORMRestrictions <string> .Eq("Dwdm", param.UserId)).Add(ORMRestrictions <string> .Eq("Dylx", "97")); //闭区间
                var           deptList = CorrespondenceSettingsService.Find(dicWhereDept);
                List <string> deptL    = new List <string>();
                for (var i = 0; i < deptList.Data.Count; i++)
                {
                    deptL.Add(deptList.Data[i].Dydm);
                }
                new CreateCriteria(dicWhere).Add(ORMRestrictions <IList <String> > .In("FDeclarationDept", deptL))
                .Add(ORMRestrictions <string> .Eq("FYear", DateTime.Today.Year.ToString()));

                new CreateCriteria(dicWhere).Add(ORMRestrictions <string> .Eq("FType", "c"));

                var result = GHSubjectService.LoadWithPage(param.PageIndex, param.PageSize, dicWhere, new string[] { "NgInsertDt Desc", "NgUpdateDt Desc" });
                //return DataConverterHelper.EntityListToJson<GHSubjectModel>(result.Results, (Int32)result.TotalItems);
                return(DCHelper.ModelListToJson <GHSubjectModel>(result.Results, (Int32)result.TotalItems));
            }
            catch (Exception ex)
            {
                return(DCHelper.ErrorMessage(ex.Message));
            }
        }
Exemple #3
0
        public string GetGHSubjectInfo([FromUri] GHSubjectRequestModel param)
        {
            if (param.PhId == 0)
            {
                return(DCHelper.ErrorMessage("主键不能为空!"));
            }
            try
            {
                //主表主键
                string tabtype = param.tabtype; //Tab类型
                switch (tabtype)
                {
                case "ghsubject":
                    var findedresultghsubject = GHSubjectService.Find(param.PhId);
                    return(DataConverterHelper.SerializeObject(findedresultghsubject));

                case "subjectmst":
                    var findedresultsubjectmst = GHSubjectService.FindSubjectMstByForeignKey(param.PhId);
                    foreach (var item in findedresultsubjectmst.Data)
                    {
                        if (!string.IsNullOrEmpty(item.FProjCode) || !string.IsNullOrEmpty(item.FProjName))
                        {
                            item.FSubjectCode = "";
                            item.FSubjectName = "";
                        }
                    }
                    return(DCHelper.ModelListToJson <SubjectMstModel>(findedresultsubjectmst.Data, findedresultsubjectmst.Data.Count));

                case "subjectmstbudgetdtl":
                    var findedresultsubjectmstbudgetdtl = GHSubjectService.FindSubjectMstBudgetDtlByForeignKey(param.PhId);
                    return(DCHelper.ModelListToJson <SubjectMstBudgetDtlModel>(findedresultsubjectmstbudgetdtl.Data, findedresultsubjectmstbudgetdtl.Data.Count));

                default:
                    Common.Model.Results.FindedResult findedresultother = new Common.Model.Results.FindedResult();
                    return(DataConverterHelper.SerializeObject(findedresultother));
                }
            }
            catch (Exception ex)
            {
                return(DCHelper.ErrorMessage(ex.Message));
            }
        }
        public string GetBudgetProcessCtrlDistinctList([FromUri] BudgetProcessCtrlRequestModel param)
        {
            if (string.IsNullOrEmpty(param.UserId))
            {
                return(DCHelper.ErrorMessage("用户编码不能为空!"));
            }
            try
            {
                //string query = System.Web.HttpContext.Current.Request.Params["FOcode"];//查询条件
                string query = "";//查询条件
                SUP.Common.DataEntity.DataStoreParam storeparam = new SUP.Common.DataEntity.DataStoreParam();
                var result = BudgetProcessCtrlService.GetBudgetProcessCtrlDistinctList(storeparam, query, param.UserId);

                return(DCHelper.ModelListToJson <BudgetProcessCtrlModel>(result.Results, (Int32)result.TotalItems));
                //return DataConverterHelper.EntityListToJson<BudgetProcessCtrlModel>(result.Results, (Int32)result.TotalItems);
            }
            catch (Exception ex)
            {
                return(DCHelper.ErrorMessage(ex.Message));
            }
        }
Exemple #5
0
        public string GetExpenseMstList([FromUri] ExpenseListRequestModel param)
        {
            //string clientJsonQuery = System.Web.HttpContext.Current.Request.Params["queryfilter"];//查询条件
            //Dictionary<string, object> dicWhere = DataConverterHelper.ConvertToDic(clientJsonQuery);//查询条件转Dictionary

            //var userId = System.Web.HttpContext.Current.Request.Params["userId"];
            Dictionary <string, object> dicWhere = new Dictionary <string, object>();

            /*var dicWhereDept = new Dictionary<string, object>();
             * new CreateCriteria(dicWhereDept)
             *  .Add(ORMRestrictions<string>.Eq("Dwdm", param.UserCode)).Add(ORMRestrictions<string>.Eq("Dylx", "97")); //闭区间
             * var deptList = CorrespondenceSettingsService.Find(dicWhereDept);
             * List<string> deptL = new List<string>();
             * for (var i = 0; i < deptList.Data.Count; i++)
             * {
             *  deptL.Add(deptList.Data[i].Dydm);
             * }
             * new CreateCriteria(dicWhere)
             *     .Add(ORMRestrictions<IList<String>>.In("FBudgetDept", deptL));*/

            new CreateCriteria(dicWhere)
            .Add(ORMRestrictions <string> .Eq("FDeclarationDept", param.FDeclarationDept));
            if (param.FApprovestatus.Count > 0)
            {
                new CreateCriteria(dicWhere)
                .Add(ORMRestrictions <List <string> > .In("FApprovestatus", param.FApprovestatus));
            }
            if (param.FStartdate != null)
            {
                new CreateCriteria(dicWhere)
                .Add(ORMRestrictions <System.DateTime?> .Ge("FDateofdeclaration", param.FStartdate));
            }
            if (param.FEnddate != null)
            {
                new CreateCriteria(dicWhere)
                .Add(ORMRestrictions <System.DateTime?> .Le("FDateofdeclaration", param.FEnddate));
            }
            if (param.MinAmount != 0)
            {
                new CreateCriteria(dicWhere)
                .Add(ORMRestrictions <System.Decimal> .Ge("FSurplusamount", param.MinAmount));
            }
            if (param.MaxAmount != 0)
            {
                new CreateCriteria(dicWhere)
                .Add(ORMRestrictions <System.Decimal> .Le("FSurplusamount", param.MaxAmount));
            }
            if (!string.IsNullOrEmpty(param.searchValue))
            {
                var dic1 = new Dictionary <string, object>();
                var dic2 = new Dictionary <string, object>();
                new CreateCriteria(dic1)
                .Add(ORMRestrictions <String> .Like("FPerformevaltype", param.searchValue));
                new CreateCriteria(dic2)
                .Add(ORMRestrictions <String> .Like("FProjname", param.searchValue));
                new CreateCriteria(dicWhere)
                .Add(ORMRestrictions.Or(dic1, dic2));
            }
            //根据单据号进行排序
            var result = ExpenseMstService.LoadWithPage(param.PageIndex, param.PageSize, dicWhere, new string[] { "FPerformevaltype Desc" });

            if (param.ProcPhid != 0)
            {
                var expenseList = ExpenseMstService.Find(dicWhere, new string[] { "FPerformevaltype Desc" }).Data;
                if (expenseList != null && expenseList.Count > 0)
                {
                    List <string> orgList = expenseList.ToList().Select(t => t.FBudgetDept).Distinct().ToList();
                    if (orgList != null && orgList.Count > 0)
                    {
                        var procList = this.GAppvalProcService.Find(t => orgList.Contains(t.OrgCode)).Data;
                        if (procList != null && procList.Count > 0)
                        {
                            //可以选取相同审批流的打上标记
                            foreach (var res in expenseList)
                            {
                                if (res.FApprovestatus == "1" && procList.ToList().Find(t => t.OrgCode == res.FBudgetDept && t.PhId == param.ProcPhid) != null)
                                {
                                    res.BatchPracBz = 1;
                                }
                                else
                                {
                                    continue;
                                }
                            }
                            expenseList = expenseList.ToList().FindAll(t => t.BatchPracBz == 1);
                        }
                    }
                }

                result.Results    = expenseList.Skip((param.PageIndex - 1) * param.PageSize).Take(param.PageSize).ToList();
                result.TotalItems = expenseList.Count;
            }

            return(DCHelper.ModelListToJson <ExpenseMstModel>(result.Results, (Int32)result.TotalItems));
        }