/// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="pagination">分页</param>
        /// <param name="queryJson">查询参数</param>
        /// <returns>返回分页列表</returns>
        public IEnumerable <EcommerceProjectRelationView> GetPageList(Pagination pagination, string queryJson, string urlname)
        {
            var           queryParam = queryJson.ToJObject();
            var           parameter  = new List <DbParameter>();
            StringBuilder sqlstr     = new StringBuilder();

            sqlstr.Append(@"select  er.EcommerceName,epr.EcommerceProjectRelationID,epr.ProjectID,epr.ProjecName,epr.EcommerceTypeName,       epr.CooperateStartTime,epr.CooperateEndTime,epr.PlatformRate,epr.Agent,epr.ApprovalState,epr.CreateDate,epr.Procinstid,epr.Account,
                ergroup.EcommerceGroupName
                 from T_EcommerceProjectRelation epr
                 inner join T_Ecommerce er
                 on epr.EcommerceID=er.EcommerceID
                 inner join T_EcommerceGroup ergroup
                 on ergroup.EcommerceGroupID=epr.EcommerceGroupID where 1=1 and epr.DeleteMark=0");
            if (!queryParam["ProjecName"].IsEmpty())
            {
                sqlstr.Append(" and epr.ProjecName like @projecName");
                parameter.Add(DbParameters.CreateDbParameter("@projecName", "%" + queryParam["ProjecName"].ToString() + "%"));
            }
            if (!queryParam["EcommerceGroupName"].IsEmpty())
            {
                sqlstr.Append(" and ergroup.EcommerceGroupName like @ecommerceGroupName");
                parameter.Add(DbParameters.CreateDbParameter("@ecommerceGroupName", "%" + queryParam["EcommerceGroupName"].ToString() + "%"));
            }
            if (!queryParam["EcommerceName"].IsEmpty())
            {
                sqlstr.Append(" and er.EcommerceName like @ecommerceName");
                parameter.Add(DbParameters.CreateDbParameter("@ecommerceName", "%" + queryParam["EcommerceName"].ToString() + "%"));
            }
            var olddata = new AuthorizeService <EcommerceProjectRelationEntity>().FindList(sqlstr.ToString(), parameter.ToArray(), pagination, "projectid");


            string domainurl = urlname;

            var result = olddata.Select(p => new EcommerceProjectRelationView()
            {
                Agent = p.Agent,
                EcommerceProjectRelationID = p.EcommerceProjectRelationID,
                ProjecName         = p.ProjecName,
                EcommerceName      = p.EcommerceName,
                EcommerceID        = p.EcommerceID,
                EcommerceGroupID   = p.EcommerceGroupID,
                EcommerceGroupName = p.EcommerceGroupName,
                EcommerceTypeName  = p.EcommerceTypeName,
                CooperateStartTime = p.CooperateStartTime,
                CooperateEndTime   = p.CooperateEndTime,
                PlatformRate       = p.PlatformRate,
                CreateUserId       = p.CreateUserId,
                CreateUserName     = p.CreateUserName,
                Account            = p.Account,
                ApprovalState      = p.ApprovalState,
                CreateDate         = p.CreateDate,
                Procinstid         = p.Procinstid,
                url = string.Format("{0}?procInstId={1}&userid={2}&key={3}", domainurl, p.Procinstid, p.Account, BpmMD5Helper.GetEnCodeStr(p.Procinstid))
            });

            return(result);
        }
        ///<summary>
        ///作者:durry
        ///time:2018-06-29 10:06
        ///获取发起流程的url
        public IEnumerable <EcommerceProjectRelationView> GetStartUrl(string keyValue, string starturlname)
        {
            var expression = LinqExtensions.True <EcommerceProjectRelationEntity>();

            expression = expression.And(t => t.DeleteMark == 0).And(t => t.EcommerceProjectRelationID == keyValue);
            var predata = this.BaseRepository().FindList <EcommerceProjectRelationEntity>(expression);
            List <EcommerceProjectRelationView> eprviews = new List <EcommerceProjectRelationView>();

            foreach (var item in predata)
            {
                EcommerceProjectRelationView eprview = new EcommerceProjectRelationView();
                eprview.EcommerceProjectRelationID = keyValue;
                eprview.url = string.Format("{0}?BSID=EC_Contract_Add&BOID={1}&UserId={2}&Key={3}", starturlname, keyValue, item.Account, BpmMD5Helper.GetEnCodeStr(keyValue));
                if (!eprviews.Contains(eprview))
                {
                    eprviews.Add(eprview);
                }
            }
            return(eprviews);
        }
示例#3
0
        public IEnumerable <CapitalFlowViewModel> GetStartUrl(string keyValue, string starturlname)
        {
            var expression = LinqExtensions.True <T_CapitalFlowEntity>();

            expression = expression.And(t => t.DeleteMark == 0).And(t => t.CapitalFlow_Id == keyValue);
            var predata = this.BaseRepository().FindList <T_CapitalFlowEntity>(expression);
            List <CapitalFlowViewModel> eprviews = new List <CapitalFlowViewModel>();

            foreach (var item in predata)
            {
                CapitalFlowViewModel eprview = new CapitalFlowViewModel();
                eprview.CapitalFlow_Id = keyValue;
                eprview.url            = string.Format("{0}?BSID=EC_Income&BOID={1}&UserId={2}&Key={3}", starturlname, keyValue, item.Account, BpmMD5Helper.GetEnCodeStr(keyValue));
                if (!eprviews.Contains(eprview))
                {
                    eprviews.Add(eprview);
                }
            }
            return(eprviews);
        }
示例#4
0
        public IEnumerable <CapitalFlowViewModel> GetPageList(Pagination pagination, string queryJson, string urlname)
        {
            StringBuilder sqlstr     = new StringBuilder();
            var           queryParam = queryJson.ToJObject();

            sqlstr.Append(@"select a.CapitalFlow_Id as CapitalFlow_Id,c.FullName as FullName,
	                               a.ApprovalState,
	                               a.Year,a.Month,
	                               a.Company_Id,
                                   a.CreateDate as CreateDate,
                                   a.Account,a.Procinstid,
	                               isnull(SUM(b.IncomeAmount),0) as IncomeAmount,
	                               isnull(SUM(b.ClearingAmount),0) as ClearingAmount,
	                               isnull(SUM(b.PlatformExpensesAmount),0) as PlatformExpensesAmount,
	                               isnull(SUM(b.CapitalPoolAdd),0) as CapitalPoolAdd  
                                   from T_CapitalFlow a 
                                   left join T_CapitalFlow_Node b on a.CapitalFlow_Id=b.CapitalFlow_Id 
                                    and b.DeleteMark=0
                                   left join Base_Department c  on a.Company_Id=c.DepartmentId 
                                   where 1=1 and a.DeleteMark='0'  ");
            if (!new AuthorizeService <CapitalFlowViewModel>().LookAll())
            {
                string query         = null;
                string projectIdList = "'";
                List <Base_ProjectInfoEntity> proList = baseProject.GetListByAuthorize(query).ToList();
                foreach (var item in proList)
                {
                    projectIdList += item.ProjectID + "','";
                }
                if (projectIdList == "'")
                {
                    projectIdList = "''";
                }
                else
                {
                    projectIdList = projectIdList.Substring(0, projectIdList.LastIndexOf(','));
                }
                sqlstr.Append("and b.ProjectID in(" + projectIdList + ") ");

                //string a = new AuthorizeService<CapitalFlowViewModel>().GetReadProjectId();
                //if (a != null && a!="") {
                //    string b = a.Replace(",", "','");
                //    string c = b.Substring(0, b.Length - 2);
                //
                //}
            }
            var parameter = new List <DbParameter>();

            if (!queryParam["FullName"].IsEmpty())
            {
                sqlstr.Append("and c.FullName like '%" + queryParam["FullName"].ToString() + "%'");
                //parameter.Add(DbParameters.CreateDbParameter("@FullName", queryParam["FullName"].ToString()));
            }
            if (!queryParam["ApprovalState"].IsEmpty())
            {
                sqlstr.Append(" and a.ApprovalState = " + queryParam["ApprovalState"].ToString());
            }
            sqlstr.Append(" group by a.Year,a.Month,a.Company_Id,c.FullName,a.ApprovalState,a.CreateDate,a.CapitalFlow_Id,a.Account,a.Procinstid");
            var    olddata   = this.BaseRepository().FindList <CapitalFlowViewModel>(sqlstr.ToString(), pagination);
            string domainurl = urlname;
            var    result    = olddata.Select(p => new CapitalFlowViewModel()
            {
                Account                = p.Account,
                CreateDate             = p.CreateDate,
                FullName               = p.FullName,
                Year                   = p.Year,
                CapitalFlow_Id         = p.CapitalFlow_Id,
                IncomeAmount           = p.IncomeAmount,
                ClearingAmount         = p.ClearingAmount,
                PlatformExpensesAmount = p.PlatformExpensesAmount,
                CapitalPoolAdd         = p.CapitalPoolAdd,
                ApprovalState          = p.ApprovalState,
                Month                  = p.Month,
                Procinstid             = p.Procinstid,
                url = string.Format("{0}?procInstId={1}&userid={2}&key={3}", domainurl, p.Procinstid, p.Account, BpmMD5Helper.GetEnCodeStr(p.Procinstid))
            });

            return(result);
        }
示例#5
0
        public ActionResult GetPageListJson(Pagination pagination, string queryJson)
        {
            var watch  = CommonHelper.TimerStart();
            var data   = pay_infobll.GetPageList(pagination, queryJson);
            var geturl = dataItemCache.GetDataItemByCodeAndName("SysConfig", "BPMApplicateRoad");


            foreach (var item in data)
            {
                item.Url = string.Format("{0}?procInstId={1}&userid={2}&key={3}", geturl.ItemValue, item.Procinstid, item.CreateUserId, BpmMD5Helper.GetEnCodeStr(item.Procinstid));
            }

            var JsonData = new
            {
                rows     = data,
                total    = pagination.total,
                page     = pagination.page,
                records  = pagination.records,
                costtime = CommonHelper.TimerEnd(watch),
            };

            return(Content(JsonData.ToJson()));
        }