コード例 #1
0
        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));
            }
        }
コード例 #2
0
        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));
            }
        }