public ActionResult GetSelectScaffoldWorkJson(Pagination pagination, string queryJson) { pagination.p_kid = "Id as workid"; pagination.p_fields = "purpose,dismentlereason,setupcompanyname,setupcompanyid,setupcompanycode,case when setupcompanytype='0' then '电厂内部' when setupcompanytype='1' then '外包单位' end setupcompanytypename,setupcompanytype,setupstartdate,setupenddate,setupaddress,dismentlestartdate,dismentleenddate,outprojectid,outprojectname"; pagination.p_tablename = " bis_scaffold"; pagination.conditionJson = "1=1"; Operator user = ERCHTMS.Code.OperatorProvider.Provider.Current(); if (!user.IsSystem) { pagination.conditionJson += string.Format(" and setupcompanyid in(select departmentid from base_department where encode like '{0}%' or senddeptid='{1}')", user.DeptCode, user.DeptId); } var data = scaffoldbll.GetSelectPageList(pagination, queryJson); var watch = CommonHelper.TimerStart(); var jsonData = new { rows = data, total = pagination.total, page = pagination.page, records = pagination.records, costtime = CommonHelper.TimerEnd(watch) }; return(ToJsonResult(jsonData)); }
public ActionResult GetSelectScaffoldWorkJson(Pagination pagination, string queryJson) { try { pagination.p_kid = "Id as workid"; pagination.p_fields = "purpose,dismentlereason,setupcompanyname,setupcompanyid,setupcompanycode,case when setupcompanytype='0' then '单位内部' when setupcompanytype='1' then '外包单位' end setupcompanytypename,setupcompanytype,setupstartdate,setupenddate,setupaddress,dismentlestartdate,dismentleenddate,outprojectid,outprojectname,WORKAREA,setuppersons,dismentlepersons"; pagination.p_tablename = " v_scaffoldledger"; pagination.conditionJson = "1=1"; Operator user = ERCHTMS.Code.OperatorProvider.Provider.Current(); if (!user.IsSystem) { if (user.RoleName.Contains("厂级") || user.RoleName.Contains("公司")) { pagination.conditionJson += " and createuserorgcode='" + user.OrganizeCode + "'"; } else { pagination.conditionJson += string.Format(" and ((setupcompanyid in(select departmentid from base_department where encode like '{0}%')) or (outprojectid in(select id from epg_outsouringengineer a where a.engineerletdeptid = '{1}')))", user.DeptCode, user.DeptId); } } var data = scaffoldbll.GetSelectPageList(pagination, queryJson); var watch = CommonHelper.TimerStart(); var jsonData = new { rows = data, total = pagination.total, page = pagination.page, records = pagination.records, costtime = CommonHelper.TimerEnd(watch) }; return(ToJsonResult(jsonData)); } catch (Exception ex) { return(Error(ex.Message)); } }