Ejemplo n.º 1
0
 /// <summary>
 /// 给组织树加上上报信息
 /// </summary>
 /// <param name="organize">组织对象</param>
 /// <param name="ysAccountMsts">预决算主表集合</param>
 /// <returns></returns>
 public OrganizeModel GetOrgVerify(OrganizeModel organize, IList <YsAccountMstModel> ysAccountMsts)
 {
     if (organize != null)
     {
         YsAccountMstModel ysAccount = new YsAccountMstModel();
         ysAccount = ysAccountMsts.ToList().Find(t => t.Orgid == organize.PhId);
         if (ysAccount != null)
         {
             organize.VerifyEnd        = ysAccount.VerifyEnd;
             organize.VerifyEndTime    = ysAccount.VerifyEndTime;
             organize.VerifyMiddle     = ysAccount.VerifyMiddle;
             organize.VerifyMiddleTime = ysAccount.VerifyMiddleTime;
             organize.VerifyStart      = organize.VerifyStart;
             organize.VerifyStartTime  = organize.VerifyStartTime;
         }
         if (organize.children != null && organize.children.Count > 0)
         {
             foreach (var child in organize.children)
             {
                 GetOrgVerify(child, ysAccountMsts);
             }
         }
     }
     return(organize);
 }
Ejemplo n.º 2
0
 public string GetEndYear([FromUri] BaseListModel param)
 {
     if (param.orgid == 0)
     {
         return(DCHelper.ErrorMessage("组织id不能为空!"));
     }
     if (string.IsNullOrEmpty(param.orgCode))
     {
         return(DCHelper.ErrorMessage("组织Code不能为空!"));
     }
     if (string.IsNullOrEmpty(param.Year))
     {
         return(DCHelper.ErrorMessage("年份信息不能为空!"));
     }
     try
     {
         YsAccountMstModel ysAccountMst = new YsAccountMstModel();
         ysAccountMst = this.YsAccountMstService.GetEndAccounts(param.orgid, param.orgCode, param.Year);
         if (ysAccountMst.YsAccounts != null && ysAccountMst.YsAccounts.Count > 0)
         {
             IList <YsAccountModel> ysAccounts = new List <YsAccountModel>();
             foreach (var acc in ysAccountMst.YsAccounts)
             {
                 if (acc.SUBJECTCODE.Length == 3)
                 {
                     YsAccountModel ys = new YsAccountModel();
                     ysAccounts.Add(this.BudgetMstService.GetCompleteYsAccount(ysAccountMst.YsAccounts, acc.SUBJECTCODE, ys));
                 }
                 else
                 {
                     if (acc.SUBJECTCODE == "4BNHJSR" || acc.SUBJECTCODE == "5BNHJZC" || acc.SUBJECTCODE.StartsWith("5QM"))
                     {
                         ysAccounts.Add(acc);
                     }
                     else
                     {
                         continue;
                     }
                 }
             }
             ysAccountMst.YsAccounts = ysAccounts;
         }
         var data = new
         {
             Status = ResponseStatus.Success,
             Msg    = "获取成功!",
             Data   = ysAccountMst
         };
         return(DataConverterHelper.SerializeObject(data));
     }
     catch (Exception ex)
     {
         return(DCHelper.ErrorMessage(ex.Message));
     }
 }
Ejemplo n.º 3
0
        public string GetAllReportExcel([FromUri] BaseListModel param)
        {
            if (param.orgid == 0)
            {
                return(DCHelper.ErrorMessage("组织id不能为空!"));
            }
            if (param.uid == 0)
            {
                return(DCHelper.ErrorMessage("用户id不能为空!"));
            }
            if (string.IsNullOrEmpty(param.orgCode))
            {
                return(DCHelper.ErrorMessage("组织编码不能为空!"));
            }
            if (string.IsNullOrEmpty(param.Year))
            {
                return(DCHelper.ErrorMessage("年份参数不能为空!"));
            }
            try
            {
                string            result       = "";
                YsAccountMstModel ysAccountMst = new YsAccountMstModel();
                ysAccountMst = this.YsAccountMstService.GetAllYsAccountList(param.orgid, param.orgCode, param.Year, param.ChooseOwn, param.value);
                if (ysAccountMst.YsAccounts != null && ysAccountMst.YsAccounts.Count > 0)
                {
                    //获取组织和用户信息
                    User2Model    userModel     = new User2Model();
                    OrganizeModel organizeModel = new OrganizeModel();
                    userModel     = this.BudgetMstService.GetUser(param.uid);
                    organizeModel = this.BudgetMstService.GetOrganize(param.orgid);


                    if (param.value == "1")
                    {
                        result = this.YsAccountMstService.GetBeginExcel(ysAccountMst.YsAccounts.ToArray(), null, userModel, organizeModel);
                    }
                    else if (param.value == "2")
                    {
                        result = this.YsAccountMstService.GetMiddleExcel(ysAccountMst.YsAccounts.ToArray(), null, userModel, organizeModel);
                    }
                    else if (param.value == "3")
                    {
                        result = this.YsAccountMstService.GetEndExcel(ysAccountMst.YsAccounts.ToArray(), null, userModel, organizeModel);
                    }
                }
                return(result);
            }
            catch (Exception ex)
            {
                return(DCHelper.ErrorMessage(ex.Message));
            }
        }