From 0e5c4a8e17dcefcc10b2507da61b099be12451d8 Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期五, 12 一月 2024 12:52:52 +0800 Subject: [PATCH] 代理合作功能 --- zhengcaioa/zhengcaioa/Controllers/LiaotianController.cs | 98 +++++++++++++++++++++++++++++++++---------------- 1 files changed, 66 insertions(+), 32 deletions(-) diff --git a/zhengcaioa/zhengcaioa/Controllers/LiaotianController.cs b/zhengcaioa/zhengcaioa/Controllers/LiaotianController.cs index 7b1b755..258a5ae 100644 --- a/zhengcaioa/zhengcaioa/Controllers/LiaotianController.cs +++ b/zhengcaioa/zhengcaioa/Controllers/LiaotianController.cs @@ -122,31 +122,42 @@ actionEntity.PageIco = "fa fa-search"; actionEntity.ActionName = "鏌ヨ"; actionlist.Add(actionEntity); - ActionEntity actionEntity1 = new ActionEntity(); - actionEntity1.OpenType = 0; - actionEntity1.ActionUrl = ""; - actionEntity1.ActionFun = "Add"; - actionEntity1.PageIco = "fa fa-plus"; - actionEntity1.ActionName = "鏂板"; - actionlist.Add(actionEntity1); + //ActionEntity actionEntity1 = new ActionEntity(); + //actionEntity1.OpenType = 0; + //actionEntity1.ActionUrl = ""; + //actionEntity1.ActionFun = "Add"; + //actionEntity1.PageIco = "fa fa-plus"; + //actionEntity1.ActionName = "鏂板"; + //actionlist.Add(actionEntity1); - ActionEntity actionEntity2 = new ActionEntity(); - actionEntity2.OpenType = 0; - actionEntity2.ActionUrl = ""; - actionEntity2.ActionFun = "Print"; - actionEntity2.PageIco = "fa fa-print"; - actionEntity2.ActionName = "鎵撳嵃"; - actionlist.Add(actionEntity2); + //ActionEntity actionEntity2 = new ActionEntity(); + //actionEntity2.OpenType = 0; + //actionEntity2.ActionUrl = ""; + //actionEntity2.ActionFun = "Print"; + //actionEntity2.PageIco = "fa fa-print"; + //actionEntity2.ActionName = "鎵撳嵃"; + //actionlist.Add(actionEntity2); - ActionEntity actionEntity3 = new ActionEntity(); - actionEntity3.OpenType = 0; - actionEntity3.ActionUrl = ""; - actionEntity3.ActionFun = "Zhuanyi"; - actionEntity3.PageIco = "fa fa-plus"; - actionEntity3.ActionName = "鏁版嵁杞Щ"; - actionlist.Add(actionEntity3); - + //ActionEntity actionEntity3 = new ActionEntity(); + //actionEntity3.OpenType = 0; + //actionEntity3.ActionUrl = ""; + //actionEntity3.ActionFun = "Zhuanyi"; + //actionEntity3.PageIco = "fa fa-plus"; + //actionEntity3.ActionName = "鏁版嵁杞Щ"; + //actionlist.Add(actionEntity3); + var pageEntities = _pltPageService.GetUserPage(curentuser.Id, "/Liaotian/Indexcheck"); + var pageEntities1 = pageEntities.Where(x => x.PageMethod == "01").ToList(); + foreach (var pageEntity in pageEntities1) + { + ActionEntity actionEntity1 = new ActionEntity(); + actionEntity1.OpenType = pageEntity.OpenType; + actionEntity1.ActionUrl = ""; + actionEntity1.ActionFun = pageEntity.PageShortcut; + actionEntity1.PageIco = pageEntity.PageIco; + actionEntity1.ActionName = pageEntity.PageName; + actionlist.Add(actionEntity1); + } ViewData["ActionInfo"] = actionlist; ViewBag.problemtype = _liaotianService.GetSYScode("Liaotian", "problemtype").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); @@ -172,13 +183,15 @@ ResultEntity resultEntity = new ResultEntity(); resultEntity.Result = false; - List <LiaotianDTO> liaotianDTOs =_liaotianService.SearchForPrint(new LiaotianDTOSearch()).Where(x=>x.Clientid =="A").ToList(); - + List <LiaotianDTO> liaotianDTOs =_liaotianService.SearchForPrint(new LiaotianDTOSearch()).ToList();//.Where(x=>x.Clientid =="A") + try { + int i = 0; foreach (var liaotianDTO in liaotianDTOs) { + i = i + 1; string api_domain = _configuration.GetSection("Elasticsearchurl").Value; string url = $"{api_domain}/liaotian/_doc/" + liaotianDTO.Id; @@ -270,10 +283,13 @@ #region 缂栬緫 [CheckLogin] - public ActionResult Edit(string id = null) + public ActionResult Edit(string id = null, string Questiontype = null, string Problemtype = null) { var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; + var pageEntities = _pltPageService.GetUserPage(curentuser.Id, "/Liaotian/Indexcheck"); + var pageEntities2 = pageEntities.Where(x => x.PageMethod == "02").ToList(); + ViewData["ActionInfo2"] = pageEntities2; LiaotianDTO liaotianDTO = new LiaotianDTO(); if (!String.IsNullOrEmpty(id)) { @@ -289,16 +305,32 @@ } } + else + { + if (!string.IsNullOrEmpty(Questiontype)) + { + liaotianDTO.Questiontype = Questiontype; + } + + if (!string.IsNullOrEmpty(Problemtype)) + { + liaotianDTO.Problemtype = Problemtype; + } + } ViewData.Model = liaotianDTO; - - List<PageEntity> pageEntities = _pltPageService.GetUserPage(curentuser.Id, "/Liaotian/Indexcheck"); ViewData["pageEntities"] = pageEntities; ViewData["questiontype"] = _liaotianService.GetSYScode("Liaotian", "questiontype"); ViewData["problemtype"] = _liaotianService.GetSYScode("Liaotian", "problemtype").Where(x=>x.Contents == liaotianDTO.Questiontype).ToList(); + + + //ViewData["Questiontypesel"] = Questiontype; + + + //ViewData["Problemtypesel"] = Problemtype; return View(); @@ -344,6 +376,11 @@ } data.Modifier = curentuser.Id; data.Modifytime = DateTime.Now; + + + + resultEntity = _liaotianService.saveLiaotian(data); + if (!string.IsNullOrEmpty(data.Id)) { @@ -383,11 +420,8 @@ } } - - resultEntity = _liaotianService.saveLiaotian(data); - //string api_domain = _configuration.GetSection("Elasticsearchurl").Value; @@ -420,7 +454,7 @@ // } // Newtonsoft.Json.Linq.JObject jobject = (Newtonsoft.Json.Linq.JObject)JsonConvert.DeserializeObject(result); - + // if (jobject["error"]==null&& jobject["_shards"]["successful"].ToString() == "1") // { // resultEntity.Result = true; @@ -436,7 +470,7 @@ // resultEntity.Result = false; // throw e; - + //} -- Gitblit v1.9.1