| | |
| | | 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); |
| | | |
| | | |
| | | ViewData["ActionInfo"] = actionlist; |
| | | |
| | | |
| | |
| | | ViewBag.zhongdian = _liaotianService.GetSYScode("system", "shifou").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); |
| | | ViewBag.jiexi_status = _liaotianService.GetSYScode("expert_test_topic", "jiexi_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); |
| | | ViewBag.shenpi_status = _liaotianService.GetSYScode("expert_test_topic", "shenpi_status").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); |
| | | ViewBag.Falv = _liaotianService.GetSYScode("expert_test_topicjiexi", "falv").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); |
| | | |
| | | ViewBag.shanchuzhishitype = _liaotianService.GetSYScodeshanchu("expert_test_topic", "zhishitype").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); |
| | | |
| | | var areaDTOs = _areaService.GetList().Where(x => x.ParentId == "0 ").ToList(); |
| | | foreach (var areaDTO in areaDTOs) |
| | | { |
| | |
| | | { |
| | | |
| | | string api_domain = _configuration.GetSection("Elasticsearchurl").Value; |
| | | string url = $"{api_domain}/liaotian/person/" + data.Id; |
| | | string url = $"{api_domain}/liaotian/_doc/" + data.Id; |
| | | //string requestJson = "{\"id\": \"" + Id + "\",\"question\": \"" + data.Question + "\",\"anwser\": \"" + data.Anwser + "\"}"; |
| | | try |
| | | { |
| | |
| | | resultEntity = _expertTestTopicService.shenpi(data); |
| | | |
| | | string api_domain = _configuration.GetSection("Elasticsearchurl").Value; |
| | | string url = $"{api_domain}/liaotian/person/" + data.Id; |
| | | string url = $"{api_domain}/liaotian/_doc/" + data.Id; |
| | | LiaotianElasticsearchDTO liaotianElasticsearchDTO = new LiaotianElasticsearchDTO(); |
| | | liaotianElasticsearchDTO.id = data.Id; |
| | | liaotianElasticsearchDTO.question = data.Topic; |
| | |
| | | data = _expertTestTopicService.Get(data.Id); |
| | | var datadtls = _expertTestTopicService.GetListanwser(data.Id); |
| | | string api_domain = _configuration.GetSection("Elasticsearchurl").Value; |
| | | string url = $"{api_domain}/liaotian/person/" + data.Id; |
| | | string url = $"{api_domain}/liaotian/_doc/" + data.Id; |
| | | LiaotianElasticsearchDTO liaotianElasticsearchDTO = new LiaotianElasticsearchDTO(); |
| | | liaotianElasticsearchDTO.id = data.Id; |
| | | liaotianElasticsearchDTO.question = data.Topic; |
| | |
| | | ResultEntity resultEntity = _expertTestTopicService.ModifyStatus(Id, curentuser.Id); |
| | | |
| | | string api_domain = _configuration.GetSection("Elasticsearchurl").Value; |
| | | string url = $"{api_domain}/liaotian/person/" + Id; |
| | | string url = $"{api_domain}/liaotian/_doc/" + Id; |
| | | //string requestJson = "{\"id\": \"" + Id + "\",\"question\": \"" + data.Question + "\",\"anwser\": \"" + data.Anwser + "\"}"; |
| | | try |
| | | { |
| | |
| | | expertTestTopicpeizhiDTO.zongFenshu = aaaa.HasValue? aaaa.Value.ToString("0.##"):""; |
| | | expertTestTopicpeizhiDTO.zongFenzhi = expertTestTopicpeizhiDTO.Fenzhi.HasValue ? expertTestTopicpeizhiDTO.Fenzhi.Value.ToString("0.##") : ""; |
| | | } |
| | | foreach (var zhishitype in zhishitypes) |
| | | { |
| | | var bbbb = expertTestTopicpeizhiDTOs.Where(x => x.Zhishitype == zhishitype.CodeSn).ToList(); |
| | | if (bbbb.Count <= 0) |
| | | { |
| | | foreach (var topictype in topictypes) |
| | | { |
| | | ExpertTestTopicpeizhiDTO expertTestTopicpeizhiDTO = new ExpertTestTopicpeizhiDTO(); |
| | | expertTestTopicpeizhiDTO.ShijianId = "01"; |
| | | expertTestTopicpeizhiDTO.Topictype = topictype.CodeSn; |
| | | expertTestTopicpeizhiDTO.TopictypeName = topictype.Comments; |
| | | |
| | | expertTestTopicpeizhiDTO.Zhishitype = zhishitype.CodeSn; |
| | | expertTestTopicpeizhiDTO.ZhishitypeName = zhishitype.Comments; |
| | | |
| | | expertTestTopicpeizhiDTO.Fenshu = 0; |
| | | expertTestTopicpeizhiDTO.Fenzhi = 0; |
| | | expertTestTopicpeizhiDTO.FenshuName = "0"; |
| | | expertTestTopicpeizhiDTO.FenzhiName = "0"; |
| | | expertTestTopicpeizhiDTO.zongFenshu = "0"; |
| | | expertTestTopicpeizhiDTO.zongFenzhi = "0"; |
| | | expertTestTopicpeizhiDTOs.Add(expertTestTopicpeizhiDTO); |
| | | } |
| | | |
| | | expertTestTopicpeizhiDTOs = expertTestTopicpeizhiDTOs.OrderBy(x => x.Topictype).ThenBy(x => x.Zhishitype).ToList(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | return View(); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 转移数据 |
| | | /// </summary> |
| | | /// <param name="data">岗位实体类对象</param> |
| | | /// <returns></returns> |
| | | |
| | | [CheckLogin] |
| | | public async Task<string> ZhuanyiAsync() |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ViewData["curentuser"] = curentuser; |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | resultEntity.Result = false; |
| | | |
| | | var expertTestTopicDTOs = _expertTestTopicService.GetList().Where(x => x.ShenpiStatus == "A").ToList(); |
| | | |
| | | |
| | | try |
| | | { |
| | | foreach (var data in expertTestTopicDTOs) |
| | | { |
| | | |
| | | |
| | | string api_domain = _configuration.GetSection("Elasticsearchurl").Value; |
| | | string url = $"{api_domain}/liaotian/_doc/" + data.Id; |
| | | |
| | | var datadtls = _expertTestTopicService.GetListanwser(data.Id); |
| | | LiaotianElasticsearchDTO liaotianElasticsearchDTO = new LiaotianElasticsearchDTO(); |
| | | liaotianElasticsearchDTO.id = data.Id; |
| | | liaotianElasticsearchDTO.question = data.Topic; |
| | | liaotianElasticsearchDTO.anwser = data.Topic + " </br> "; |
| | | foreach (var datadtl in datadtls) |
| | | { |
| | | if (datadtl.Shifouzhengqu == "A") |
| | | { |
| | | liaotianElasticsearchDTO.anwser += "<font color=\"#FF0000\">" + datadtl.Anwserno + " " + datadtl.Anwser + "</font> </br>"; |
| | | } |
| | | else |
| | | { |
| | | liaotianElasticsearchDTO.anwser += datadtl.Anwserno + " " + datadtl.Anwser + " </br> "; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | string requestJson = JsonConvert.SerializeObject(liaotianElasticsearchDTO); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | string result = string.Empty; |
| | | Uri postUrl = new Uri(url); |
| | | |
| | | using (HttpContent httpContent = new StringContent(requestJson)) |
| | | { |
| | | httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json"); |
| | | |
| | | var httpClient = _clientFactory.CreateClient(); |
| | | httpClient.Timeout = new TimeSpan(0, 0, 60); |
| | | var Result = await httpClient.PutAsync(postUrl, httpContent); |
| | | result = Result.Content.ReadAsStringAsync().Result; |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | Newtonsoft.Json.Linq.JObject jobject = (Newtonsoft.Json.Linq.JObject)JsonConvert.DeserializeObject(result); |
| | | |
| | | if (jobject["error"] == null && jobject["_shards"]["successful"].ToString() == "1") |
| | | { |
| | | resultEntity.Result = true; |
| | | } |
| | | else |
| | | { |
| | | resultEntity.Result = false; |
| | | return JsonConvert.SerializeObject(resultEntity); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | resultEntity.Result = false; |
| | | throw e; |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | return JsonConvert.SerializeObject(resultEntity); |
| | | } |
| | | |
| | | } |
| | | } |