username@email.com
2024-01-12 0e5c4a8e17dcefcc10b2507da61b099be12451d8
zhengcaioa/zhengcaioa/Controllers/LiaotianController.cs
@@ -183,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;
@@ -281,7 +283,7 @@
        #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;
@@ -303,6 +305,18 @@
                }
            }
            else
            {
                if (!string.IsNullOrEmpty(Questiontype))
                {
                    liaotianDTO.Questiontype = Questiontype;
                }
                if (!string.IsNullOrEmpty(Problemtype))
                {
                    liaotianDTO.Problemtype = Problemtype;
                }
            }
            ViewData.Model = liaotianDTO;
@@ -311,6 +325,12 @@
            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();
@@ -356,6 +376,11 @@
            }
            data.Modifier = curentuser.Id;
            data.Modifytime = DateTime.Now;
              resultEntity = _liaotianService.saveLiaotian(data);
            if (!string.IsNullOrEmpty(data.Id))
            {
@@ -395,11 +420,8 @@
                }
            }
              resultEntity = _liaotianService.saveLiaotian(data);
            //string api_domain = _configuration.GetSection("Elasticsearchurl").Value;
@@ -432,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;
@@ -448,7 +470,7 @@
            //    resultEntity.Result = false;
            //    throw e;
            //}