From 0c7b13e91cd472e21e4a620355e6fcabc11f695a Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期二, 04 一月 2022 13:56:24 +0800 Subject: [PATCH] 计件登记,汇总,打印 --- zhengcaioa/zhengcaioa/Controllers/SysCodeController.cs | 65 ++++++++++++++++++++++++++++---- 1 files changed, 57 insertions(+), 8 deletions(-) diff --git a/zhengcaioa/zhengcaioa/Controllers/SysCodeController.cs b/zhengcaioa/zhengcaioa/Controllers/SysCodeController.cs index 0473139..07d97cb 100644 --- a/zhengcaioa/zhengcaioa/Controllers/SysCodeController.cs +++ b/zhengcaioa/zhengcaioa/Controllers/SysCodeController.cs @@ -669,6 +669,8 @@ actionEntity1.ActionName = "鏂板"; actionlist.Add(actionEntity1); ViewData["ActionInfo"] = actionlist; + ViewBag.falv = _liaotianService.GetSYScode("expert_test_topicjiexi", "falv").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); + ViewBag.question = _liaotianService.GetSYScode("t_challenge_items", "question").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); return View(); } @@ -680,13 +682,33 @@ //JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver()); searchEntity.CodeTable = "t_complaint_items"; searchEntity.CodeField = "law"; - searchEntity.Sort = "CodeSn"; - return new JsonResult(_sysCodeService.SearchSysCodeDtlPaging(searchEntity)); + searchEntity.Sort1 = "CodeSn"; + + ResultDataEntity<SysCodeDtlEntity> resultDataEntity = _sysCodeService.SearchSysCodeDtlPaging(searchEntity); + + + var sysCodeDtls = _liaotianService.GetSYScode("expert_test_topicjiexi", "falv"); + + foreach(var sysCodeDtlEntity in resultDataEntity.DataList) + { + var sysCodeDtl = sysCodeDtls.Where(x => x.CodeSn == sysCodeDtlEntity.Comments).FirstOrDefault(); + if (sysCodeDtl != null) + sysCodeDtlEntity.CommentsName = sysCodeDtl.Comments; + } + sysCodeDtls = _liaotianService.GetSYScode("t_challenge_items", "question"); + foreach (var sysCodeDtlEntity in resultDataEntity.DataList) + { + var sysCodeDtl = sysCodeDtls.Where(x => x.CodeSn == sysCodeDtlEntity.Classify1).FirstOrDefault(); + if(sysCodeDtl!=null) + sysCodeDtlEntity.Classify1Name = sysCodeDtl.Comments; + } + + return new JsonResult(resultDataEntity); } - public IActionResult Editlaw(string id) + public IActionResult Editlaw(string Classify1="") { var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; @@ -694,17 +716,44 @@ SysCodeDtlEntity sysCodeDtlEntity = new SysCodeDtlEntity(); - - sysCodeDtlEntity = _sysCodeService.GetSysCodeDtlInfo(id, "t_complaint_items", "law"); - + var sysCodeDtlEntities = _sysCodeService.GetSysCodeDtlInfoss(Classify1, "t_complaint_items", "law"); + sysCodeDtlEntity.Classify1 = Classify1; + sysCodeDtlEntity.CodeId = sysCodeDtlEntities[0].CodeId; ViewData.Model = sysCodeDtlEntity; - - + ViewBag.falv = _liaotianService.GetSYScode("expert_test_topicjiexi", "falv"); + ViewBag.question = _liaotianService.GetSYScode("t_challenge_items", "question"); + ViewBag.sysCodeDtlEntities = sysCodeDtlEntities; return View(); } + + /// <summary> + /// 淇濆瓨 + /// </summary> + /// <param name="data">宀椾綅瀹炰綋绫诲璞�</param> + /// <returns></returns> + [HttpPost] + + public string Savequestiontypes(SysCodeDtlEntity data) + { + var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); + ViewData["curentuser"] = curentuser; + data.RecStatus = "A"; + if (String.IsNullOrEmpty(data.Id)) + { + data.Creater = curentuser.Id; + data.Createtime = DateTime.Now; + } + data.Modifier = curentuser.Id; + data.Modifytime = DateTime.Now; + + ResultEntity resultEntity = _sysCodeService.SaveSysCodeDtls(data); + + return JsonConvert.SerializeObject(resultEntity); + } + } } -- Gitblit v1.9.1