public ActionResult Search(SysSearchModel model) { ISearchResponse <es_t_bp_item> response = GetSearchResult(model); int pos = model.posStart.HasValue ? model.posStart.Value : 0; int totalCount = (int)response.Total; DhtmlxGrid grid = new DhtmlxGrid(); grid.AddPaging(totalCount, pos); int index = pos; var allItems = itemNameService.GetAllItemName(); var allInsts = checkUnitService.GetAllCheckUnit(); var reportConclusions = sysDictService.GetDictsByKey("ReportConclusionCode"); foreach (var item in response.Documents) { DhtmlxGridRow row = new DhtmlxGridRow(item.SYSPRIMARYKEY); row.AddCell(index + 1); if (item.CONCLUSIONCODE == "Y") { row.AddCell(item.PROJECTNAME); } else { row.AddCell(new DhtmlxGridCell("{0}".Fmt(item.PROJECTNAME), false).AddCellAttribute("style", "color:red")); //row.AddCell(item.PROJECTNAME); } row.AddCell(SysDictUtility.GetKeyFromDic(reportConclusions, item.CONCLUSIONCODE, "/")); row.AddCell(checkUnitService.GetCheckUnitByIdFromAll(allInsts, item.CUSTOMID)); if (item.ITEMCHNAME.IsNullOrEmpty()) { row.AddCell(itemNameService.GetItemCNNameFromAll(allItems, item.REPORTJXLB, item.ITEMNAME)); } else { row.AddCell(item.ITEMCHNAME); } row.AddLinkJsCell(item.REPORTNUM, "detailsReport(\"{0}\")".Fmt(item.SYSPRIMARYKEY)); row.AddCell(item.SAMPLENUM); row.AddCell(item.ENTRUSTDATE.HasValue ? item.ENTRUSTDATE.Value.ToString("yyyy-MM-dd") : "/"); row.AddCell(item.CHECKDATE.HasValue ? item.CHECKDATE.Value.ToString("yyyy-MM-dd") : "/"); row.AddCell(reportService.GetReportDataStatus(item.SAMPLEDISPOSEPHASEORIGIN)); index++; grid.AddGridRow(row); } string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting); return(Content(str, "text/xml")); }
public ActionResult Details(int id) { ZNHTYFangAnViewModel model = new ZNHTYFangAnViewModel(); var progData = HTYRep.GetById(id); if (!string.IsNullOrEmpty(progData.filepath)) { progData.filepath = SymCryptoUtility.Encrypt(progData.filepath); } if (!string.IsNullOrEmpty(progData.hqfilepath)) { progData.hqfilepath = SymCryptoUtility.Encrypt(progData.hqfilepath); } model.programme = progData; var projects = projectRep.GetByCondition(r => r.PROJECTNUM == model.programme.projectnum);//.GetById(id); if (projects != null && projects.Count > 0) { model.project = projects.First(); model.PLANSTARTDATE = model.project.PLANSTARTDATE.HasValue ? model.project.PLANSTARTDATE.Value.ToString("yyyy-MM-dd") : string.Empty; } model.date = (model.programme.planstartdate.HasValue ? model.programme.planstartdate.Value.ToString("yyyy-MM-dd") : string.Empty) + " - " + (model.programme.planenddate.HasValue ? model.programme.planenddate.Value.ToString("yyyy-MM-dd") : string.Empty); var allCustoms = checkUnitServce.GetAllCheckUnit(); model.programme.unitcode = checkUnitServce.GetCheckUnitByIdFromAll(allCustoms, model.programme.unitcode); var peopleIds = progData.testingpeople; if (!peopleIds.IsNullOrEmpty()) { var peoIds = peopleIds.Split(',').ToList(); var peoples = peopleRep.GetByCondition(w => peoIds.Contains(w.id.ToString())); model.people = peoples; } var equipIds = progData.testingequipment; if (!equipIds.IsNullOrEmpty()) { var equIds = equipIds.Split(',').ToList(); var equips = equipRep.GetByCondition(w => equIds.Contains(w.id.ToString())); model.EquipNums = equips.Select(s => s.equnum).Join(","); } return(View(model)); }
public ActionResult GridSearch(TotalStatisSearchModel model) { int pos = model.posStart.HasValue ? model.posStart.Value : 0; var response = GetGridResult(model); DhtmlxGrid grid = new DhtmlxGrid(); if (response.IsValid) { int totalCount = (int)response.Total; grid.AddPaging(totalCount, pos); int index = pos; var allInst = checkUnitService.GetAllCheckUnit(); var allItems = itemNameService.GetAllItemName(); foreach (var item in response.Documents) { DhtmlxGridRow row = new DhtmlxGridRow(item.SYSPRIMARYKEY); row.AddCell(index + 1); row.AddCell(checkUnitService.GetCheckUnitByIdFromAll(allInst, item.CUSTOMID)); row.AddCell(item.PROJECTNAME); if (itemNameService.IsCReport(item.REPORTJXLB, item.ITEMNAME)) { row.AddCell(item.ITEMCHNAME.IsNullOrEmpty() ?itemNameService.GetItemCNNameFromAll(allItems, item.REPORTJXLB, item.ITEMNAME) : item.ITEMCHNAME); } else { row.AddCell(item.ITEMCHNAME.IsNullOrEmpty() ?itemNameService.GetItemCNNameFromAll(allItems, item.REPORTJXLB, item.ITEMNAME) : item.ITEMCHNAME); } row.AddCell(GetUIDtString(item.PRINTDATE)); row.AddCell(item.REPORTNUM); row.AddCell(new DhtmlxGridCell("查看", false).AddCellAttribute("title", "查看")); index++; grid.AddGridRow(row); } } string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting); return(Content(str, "text/xml")); }
public ActionResult CreateQualifySixSearch(DetailQualifyFiveSearchModel model) { var instDicts = checkUnitService.GetAllCheckUnit(); var workStatus = sysDictServcie.GetDictsByKey("workStatus"); var personnelTitles = sysDictServcie.GetDictsByKey("personnelTitles"); var personnelStatus = sysDictServcie.GetDictsByKey("personnelStatus"); var unitcode = repOne.GetById(model.pid); var peoples = peopleRep.GetByCondition(r => r.Customid == unitcode.unitCode && r.Approvalstatus == "3"); //var peoples = peopleRep.GetByCondition(r => r.Customid == "1900021"); DhtmlxGrid grid = new DhtmlxGrid(); string customname = string.Empty; int pos = model.posStart.HasValue ? model.posStart.Value : 0; int index = pos; foreach (var item in peoples) { customname = checkUnitService.GetCheckUnitByIdFromAll(instDicts, item.Customid); DhtmlxGridRow row = new DhtmlxGridRow(item.id.ToString()); //勾选,序号,姓名,性别,年龄,学历,专业,身份证号,从事检测工作类别,从事检测工作年限,社会保险证号,岗位证书编号,职务,职称,在职状况,状态 row.AddCell(""); row.AddCell((++index).ToString()); row.AddCell(item.Name); row.AddCell(item.Sex); row.AddCell(item.age); row.AddCell(item.Education); row.AddCell(item.Professional); //row.AddCell(customname); row.AddCell(item.SelfNum); row.AddCell(string.Empty); row.AddCell(item.gznx); row.AddCell(item.SBNum); row.AddCell(item.PostNum); row.AddCell(item.zw); row.AddCell(SysDictUtility.GetKeyFromDic(personnelTitles, item.Title)); row.AddCell(SysDictUtility.GetKeyFromDic(workStatus, item.iscb)); row.AddCell(SysDictUtility.GetKeyFromDic(personnelStatus, item.Approvalstatus)); row.AddCell(item.educationpath); row.AddCell(item.titlepath); row.AddCell(item.selfnumPath); row.AddCell(item.PostPath); row.AddCell(new DhtmlxGridCell("查看", false).AddCellAttribute("title", "查看")); grid.AddGridRow(row); } string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting); return(Content(str, "text/xml")); }
public ActionResult Search(SysSearchModel model) { model.modelType = SysSearchModelModelType.CheckStatis; var response = GetSearchResponse(model); int pos = model.posStart.HasValue ? model.posStart.Value : 0; int index = pos + 1; DhtmlxGrid grid = new DhtmlxGrid(); var allInsts = checkUnitService.GetAllCheckUnit(); var allItems = itemNameService.GetAllItemName(); if (response.IsValid) { int totalCount = (int)response.Total; grid.AddPaging(totalCount, pos); var pkrReports = reportService.GetPkrReportNums(response.Documents); foreach (var item in response.Documents) { DhtmlxGridRow row = new DhtmlxGridRow(item.SYSPRIMARYKEY); row.AddCell(index++); row.AddCell(item.ENTRUSTUNIT); row.AddCell(item.CONSTRACTUNIT); row.AddCell(checkUnitService.GetCheckUnitByIdFromAll(allInsts, item.CUSTOMID)); row.AddCell(item.PROJECTNAME); row.AddCell(item.STRUCTPART); row.AddCell(itemNameService.GetItemCNNameFromAll(allItems, item.REPORTJXLB, item.ITEMNAME)); row.AddCell(item.CHECKTYPE); row.AddCell(GetUIDtString(item.ENTRUSTDATE, "yyyy-MM-dd")); row.AddCell(GetUIDtString(item.CHECKDATE, "yyyy-MM-dd")); row.AddCell(GetUIDtString(item.PRINTDATE, "yyyy-MM-dd")); BuildReportNumRow(reportService, pkrReports, item, row); row.AddCell(item.CHECKCONCLUSION); row.AddCell(new DhtmlxGridCell("查看", false).AddCellAttribute("title", "查看")); grid.AddGridRow(row); } } string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting); return(Content(str, "text/xml")); }
public InstShortInfos GetUserInsts(int userId, string canCheckAllCustomRoles) { var insts = cacheInsts.Get(PkPmCacheKeys.CustomsByUserIdFmt.Fmt(userId)); if (insts != null) { return(insts); } else { var user = _repUser.GetById(userId); //数据权限检测人员全部从 customid字段取,去掉usercode string customId = string.Empty; if (user != null) { customId = user.CustomId; } if (customId.IsNullOrEmpty()) { customId = pkpmConfigService.DefaultInst; } Role role = GetUserRole(userId); //专家 受理人 承办人 管理员 监督 查看报告 见证取样 的默认为全部 if (canCheckAllCustomRoles.Contains(role.Code) || roleService.IsAdmin(role) || roleService.IsReport(role) || roleService.IsSuperVisor(role) || roleService.IsAllQYYAndJYY(role)) { insts = checkUnitService.GetAllCheckUnit(); } else { insts = checkUnitService.GetSubInsts(customId); } if (insts.Count == 0) { insts = checkUnitService.GetDefaultInsts(); } cacheInsts.Put(PkPmCacheKeys.CustomsByUserIdFmt.Fmt(userId), insts); return(insts); } }
public ActionResult Search(CheckStatisHNKYSearchModel model) { var response = GetResult(model); var totalCount = response.Total; int pos = model.posStart ?? 0; DhtmlxGrid grid = new DhtmlxGrid(); grid.AddPaging((int)totalCount, pos); var allCustoms = checkUnitService.GetAllCheckUnit(); var index = 1; foreach (var item in response.Documents) { var customName = string.Empty; allCustoms.TryGetValue(item.CUSTOMID, out customName); DhtmlxGridRow row = new DhtmlxGridRow(item.SYSPRIMARYKEY); row.AddCell(index++); row.AddCell(item.PROJECTNAME); row.AddCell(item.STRUCTPART); row.AddCell(checkUnitService.GetCheckUnitByIdFromAll(allCustoms, item.CUSTOMID)); row.AddCell(GetUIDtString(item.CHECKDATE, "yyyy-MM-dd")); row.AddLinkJsCell(item.REPORTNUM, "detailsReport(\"{0}\")".Fmt(item.SYSPRIMARYKEY)); row.AddCell(item.LINQI); row.AddCell(item.SHEJIDENGJI); row.AddCell(item.QIANGDUDAIBIAOZHI); if (model.qiangduwuxiao.HasValue && model.qiangduwuxiao == 1) { row.AddCell(string.Empty); } else { row.AddCell(item.BAIFENGBI.ToString()); } grid.AddGridRow(row); } string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting); return(Content(str, "text/xml")); }
public ActionResult Search(SysViewSearchModels searchModel) { var predicate = PredicateBuilder.True <UserAsRole>(); var predicateRole = PredicateBuilder.True <UserInRole>(); if (!string.IsNullOrWhiteSpace(searchModel.CheckUnitName)) { predicate = predicate.And(t => t.CustomId == searchModel.CheckUnitName); } if (!string.IsNullOrWhiteSpace(searchModel.UserDisplayName)) { predicate = predicate.And(t => t.UserDisplayName.Contains(searchModel.UserDisplayName)); } if (!string.IsNullOrWhiteSpace(searchModel.UserName)) { predicate = predicate.And(t => t.UserName == searchModel.UserName); } if (!string.IsNullOrWhiteSpace(searchModel.CheckStatus)) { predicate = predicate.And(t => t.CheckStatus == searchModel.CheckStatus); } if (!string.IsNullOrEmpty(searchModel.RoleNames)) { var allRoles = roleRep.GetByCondition(r => searchModel.RoleNames.Split(',').ToList().Contains(r.Name)).Select(s => s.Id).ToList(); predicate = predicate.And(t => allRoles.Contains(t.RoleId)); } else { var allRoles = roleRep.GetByCondition(t => t.Code != "QYY" && t.Code != "JYY").Select(s => s.Id).ToList(); predicate = predicate.And(t => allRoles.Contains(t.RoleId)); } //if(string.IsNullOrWhiteSpace(searchModel.Valie)) //{ // predicate = predicate.And(t => t.Valie == searchModel.Valie); //} int pos = searchModel.posStart.HasValue ? searchModel.posStart.Value : 0; int count = searchModel.count.HasValue ? searchModel.count.Value : 30; PagingOptions <UserAsRole> pagingOption = new PagingOptions <UserAsRole>(pos, count, u => new { u.Id }); var users = userAsRoleRep.GetByConditonPage(predicate, pagingOption); var userTypes = sysDictService.GetDictsByKey("UserType"); var userStatus = sysDictService.GetDictsByKey("UserStatus"); var allInsts = checkUnitService.GetAllCheckUnit(); var userValie = sysDictService.GetDictsByKey("Valid"); var allRole = roleRep.GetByCondition(u => true); DhtmlxGrid grid = new DhtmlxGrid(); grid.AddPaging(pagingOption.TotalItems, pos); for (int i = 0; i < users.Count; i++) { var oneUser = users[i]; DhtmlxGridRow row = new DhtmlxGridRow(oneUser.Id); row.AddCell((pos + i + 1).ToString()); row.AddCell(oneUser.UserDisplayName); if (oneUser.RoleId == 3 || oneUser.RoleId == 5) { row.AddCell(oneUser.UnitName); } else if (string.IsNullOrWhiteSpace(oneUser.CustomId) || !allInsts.ContainsKey(oneUser.CustomId.ToUpper())) { row.AddCell("系统用户"); } else { row.AddCell(allInsts[oneUser.CustomId]); } row.AddCell(oneUser.UserName); row.AddCell(SysDictUtility.GetKeyFromDic(userValie, oneUser.Valie)); row.AddCell(SysDictUtility.GetKeyFromDic(userStatus, oneUser.Status, "禁止")); var a = allRole.Where(u => u.Id == oneUser.RoleId); row.AddCell(allRole.Where(u => u.Id == oneUser.RoleId).Select(u => u.Name).FirstOrDefault().ToString()); //row.AddCell(oneUser.CheckStatus == "1" ? "已审核" : "未审核"); row.AddLinkJsCell("自定义模块", "personModule({0})".Fmt(oneUser.Id)); row.AddLinkJsCell("自定义按钮", "personAction({0})".Fmt(oneUser.Id)); if (superVisorRoleCode.Contains(userService.GetUserRole(oneUser.Id).Code)) { row.AddLinkJsCell("自定义机构", "personInst({0},\"{1}\")".Fmt(oneUser.Id, oneUser.UserDisplayName)); } else { row.AddCell(string.Empty); } row.AddLinkJsCell("密码重置", "PaswordRest({0})".Fmt(oneUser.Id)); row.AddLinkJsCells(GetOpDicts(oneUser)); grid.AddGridRow(row); } string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting); return(Content(str, "text/xml")); }
public ActionResult Search(CheckStatisDataSearchModel model) { List <CheckStatisDataSearchResultModel> resultmodel = GetSearchData(model); DhtmlxGrid grid = new DhtmlxGrid(); var allInsts = checkUnitService.GetAllCheckUnit(); int index = 1; string customName = string.Empty; foreach (var item in resultmodel) { if (item.CustomId.IsNullOrEmpty()) { continue; } DhtmlxGridRow row = new DhtmlxGridRow(item.CustomId); row.AddCell(index++); row.AddCell(checkUnitService.GetCheckUnitByIdFromAll(allInsts, item.CustomId)); if (item.DayCount > 0) { row.AddLinkJsCell(item.DayCount, "Details(\"{0}\",\"{1}\")".Fmt(item.CustomId, 0)); } else { row.AddCell(item.DayCount); } if (item.WeekCount > 0) { row.AddLinkJsCell(item.WeekCount, "Details(\"{0}\",\"{1}\")".Fmt(item.CustomId, 1)); } else { row.AddCell(item.WeekCount); } if (item.MonthCount > 0) { row.AddLinkJsCell(item.MonthCount, "Details(\"{0}\",\"{1}\")".Fmt(item.CustomId, 2)); } else { row.AddCell(item.MonthCount); } if (item.QuarterCount > 0) { row.AddLinkJsCell(item.QuarterCount, "Details(\"{0}\",\"{1}\")".Fmt(item.CustomId, 3)); } else { row.AddCell(item.QuarterCount); } if (item.YearCount > 0) { row.AddLinkJsCell(item.YearCount, "Details(\"{0}\",\"{1}\")".Fmt(item.CustomId, 4)); } else { row.AddCell(item.YearCount); } if (item.TotalCount > 0) { row.AddLinkJsCell(item.TotalCount, "Details(\"{0}\",\"{1}\")".Fmt(item.CustomId, 5)); } else { row.AddCell(item.TotalCount); } //row.AddCell(item.YearCount); //row.AddCell(item.TotalCount); grid.AddGridRow(row); } string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting); return(Content(str, "text/xml")); }
public ActionResult Search(ZJHistoryCheckSearchModel model) { DhtmlxGrid grid = new DhtmlxGrid(); var client = new JsonServiceClient(GetSceneDataUrl); bool?hasReport = null; if (!model.hasReport.IsNullOrEmpty()) { hasReport = model.hasReport == "1" ? true : false; } var response = client.Get(new HistorySite() { customId = model.customId, projectName = model.projectname, testingpeople = model.testpeople, testtype = model.testtype, testingequip = model.testpeople, areainfo = model.areainfo, piletype = model.piletype, hasReport = hasReport, posStart = model.posStart, count = model.count }); if (response.IsSucc) { var index = 1; int pos = model.posStart.HasValue ? model.posStart.Value : 0; grid.AddPaging((int)response.totalCount, pos); var allCustom = checkUnitService.GetAllCheckUnit(); foreach (var item in response.datas) { List <string> peopleName = new List <string>(); if (!item.testingpeople.IsNullOrEmpty()) { var Peoples = JsonConvert.DeserializeObject <List <LiftingEquipmentPeopleModel> >(item.testingpeople); foreach (var people in Peoples) { peopleName.Add(people.name); } } DhtmlxGridRow row = new DhtmlxGridRow(item.pid.ToString()); row.AddCell(index++); row.AddCell(checkUnitService.GetCheckUnitByIdFromAll(allCustom, item.customid)); row.AddCell(item.projectname); row.AddCell(item.areainfo); row.AddCell(item.projectaddress); row.AddCell(peopleName.Join(",")); row.AddCell(item.testtype); row.AddCell(item.piletype); if (item.num > 0) { row.AddLinkJsCell(item.num.ToString(), "details(\"{0}\",\"{1}\")".Fmt(item.SerialNo, item.customid)); } else { row.AddLinkJsCell(string.Empty, string.Empty); } grid.AddGridRow(row); } } string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting); return(Content(str, "text/xml")); }
public ActionResult SearchImport(ApplyQualifySevenSearchModel model) { DhtmlxGrid grid = new DhtmlxGrid(); var precadite = PredicateBuilder.True <t_bp_Equipment>(); precadite = precadite.And(r => r.approvalstatus == "3"); if (!model.CustomId.IsNullOrEmpty()) { precadite = precadite.And(tt => tt.customid == model.CustomId.Trim()); } int pos = model.posStart.HasValue ? model.posStart.Value : 0; int count = model.count.HasValue ? model.count.Value : 30; var paging = new PagingOptions <t_bp_Equipment>(pos, count, t => t.id); var datas = equipRep.GetByConditonPage(precadite, paging); var totalCount = (int)paging.TotalItems; grid.AddPaging(totalCount, pos); var index = 1; var allcustom = checkUnitService.GetAllCheckUnit(); foreach (var item in datas) { string dateStr = string.Empty; if (item.checkenddate.HasValue && item.checkstartdate.HasValue) { dateStr = GetUIDtString(item.checkstartdate, "yyyy-MM-dd") + "~" + GetUIDtString(item.checkenddate, "yyyy-MM-dd"); } if (item.repairstartdate.HasValue && item.repairenddate.HasValue) { dateStr = GetUIDtString(item.repairstartdate, "yyyy-MM-dd") + "~" + GetUIDtString(item.repairenddate, "yyyy-MM-dd"); } DhtmlxGridRow row = new DhtmlxGridRow(item.id); row.AddCell(string.Empty); row.AddCell(index++); row.AddCell(item.equnum); row.AddCell(item.EquName + "/" + item.equtype + "/" + item.equspec); row.AddCell(item.testrange); row.AddCell(item.degree + "/" + item.uncertainty); row.AddCell(checkUnitService.GetCheckUnitByIdFromAll(allcustom, item.customid)); row.AddCell(item.checkunit.IsNullOrEmpty() ? item.repairunit : item.checkunit); row.AddCell(dateStr); if (item.repairenddate.HasValue || item.checkenddate.HasValue) { var datee = item.repairenddate.HasValue ? item.repairenddate : item.checkenddate; var dateDiff = datee.Value - DateTime.Now; var totalDay = (int)dateDiff.TotalDays; if (totalDay < 0) { row.AddCell(new DhtmlxGridCell("已经超期{0}天".Fmt(0 - totalDay), false).AddCellAttribute("style", "color:red")); } else { row.AddCell("{0}天".Fmt(totalDay)); } } else { row.AddCell(string.Empty); } row.AddCell(item.checkcerfnumpath.IsNullOrEmpty()?item.repaircerfnumpath:item.checkcerfnumpath); row.AddCell(string.Empty); grid.AddGridRow(row); } string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting); return(Content(str, "text/xml")); }
public ActionResult Create() { var allUnit = checkUnitService.GetAllCheckUnit(); return(View(allUnit)); }