From 10ada97c04a399429285003bfcf97bbf8b24e940 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期一, 21 十一月 2022 14:41:52 +0800
Subject: [PATCH] 项目查询
---
zhengcaioa/zhengcaioa/Controllers/LiaotianController.cs | 146 ++++++++++++++++++++++++++++++++++++++----------
1 files changed, 114 insertions(+), 32 deletions(-)
diff --git a/zhengcaioa/zhengcaioa/Controllers/LiaotianController.cs b/zhengcaioa/zhengcaioa/Controllers/LiaotianController.cs
index 6108fcf..0b53eac 100644
--- a/zhengcaioa/zhengcaioa/Controllers/LiaotianController.cs
+++ b/zhengcaioa/zhengcaioa/Controllers/LiaotianController.cs
@@ -54,7 +54,7 @@
List<LiaotianElasticsearchDTO> liaotianElasticsearchDTOs = new List<LiaotianElasticsearchDTO>();
string api_domain = _configuration.GetSection("Elasticsearchurl").Value;
- string url = $"{api_domain}/liaotian/person/_search";
+ string url = $"{api_domain}/liaotian/_doc/_search";
string question = info;
@@ -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();
@@ -180,7 +191,7 @@
foreach (var liaotianDTO in liaotianDTOs)
{
string api_domain = _configuration.GetSection("Elasticsearchurl").Value;
- string url = $"{api_domain}/liaotian/person/" + liaotianDTO.Id;
+ string url = $"{api_domain}/liaotian/_doc/" + liaotianDTO.Id;
LiaotianElasticsearchDTO liaotianElasticsearchDTO = new LiaotianElasticsearchDTO();
liaotianElasticsearchDTO.id = liaotianDTO.Id;
@@ -261,7 +272,9 @@
[CheckLogin]
public string GetLiaotianList(LiaotianDTOSearch search)
{
-
+ var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
+ ViewData["curentuser"] = curentuser;
+ search.ShouCangCreater = curentuser.Id;
//JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
return JsonConvert.SerializeObject(_liaotianService.SearchByPaging(search));
}
@@ -272,21 +285,33 @@
{
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))
{
liaotianDTO = _liaotianService.GetLiaotianEntity(id);
+ var liaotianShoucangDTOs = _liaotianService.getListLiaotianShoucang(curentuser.Id, id);
+ if(liaotianShoucangDTOs!=null&& liaotianShoucangDTOs.Count > 0)
+ {
+ liaotianDTO.ShouCangStatus = "A";
+ }
+ else
+ {
+ liaotianDTO.ShouCangStatus = "D";
+
+ }
}
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();
+
return View();
}
@@ -314,12 +339,16 @@
[CheckLogin]
public async Task<string> SaveAsync(LiaotianDTO data)
{
+
+
ResultEntity resultEntity = new ResultEntity();
resultEntity.Result = false;
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
ViewData["curentuser"] = curentuser;
data.RecStatus = "A";
data.Clientid = "D";
+ data.Shenheer = null;
+ data.Shenhetime = null;
if (String.IsNullOrEmpty(data.Id))
{
data.Creater= curentuser.Id;
@@ -331,7 +360,7 @@
{
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
{
@@ -370,9 +399,11 @@
resultEntity = _liaotianService.saveLiaotian(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.Question;
@@ -427,6 +458,49 @@
return JsonConvert.SerializeObject(resultEntity);
}
+ /// <summary>
+ /// 鎻愪氦骞跺鏍�
+ /// </summary>
+ /// <param name="data">宀椾綅瀹炰綋绫诲璞�</param>
+ /// <returns></returns>
+ [HttpPost]
+ [CheckLogin]
+ public IActionResult ShouCang(LiaotianDTO data)
+ {
+ ResultEntity resultEntity = new ResultEntity();
+ resultEntity.Result = false;
+ var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
+ ViewData["curentuser"] = curentuser;
+
+ var liaotianShoucangDTOs = _liaotianService.getListLiaotianShoucang(curentuser.Id, data.Id);
+ if (data.ShouCangStatus == "A")
+ {
+ if (liaotianShoucangDTOs == null || liaotianShoucangDTOs.Count == 0)
+ {
+ LiaotianShoucangDTO liaotianShoucangDTO = new LiaotianShoucangDTO();
+ liaotianShoucangDTO.LiaotianId = data.Id;
+ liaotianShoucangDTO.RecStatus = "A";
+ liaotianShoucangDTO.Creater = curentuser.Id;
+ liaotianShoucangDTO.Createtime = DateTime.Now;
+ liaotianShoucangDTO.Modifier = curentuser.Id;
+ liaotianShoucangDTO.Modifytime = DateTime.Now;
+ resultEntity = _liaotianService.saveLiaotianShoucang(liaotianShoucangDTO);
+ }
+ }
+ else
+ {
+ if (liaotianShoucangDTOs != null || liaotianShoucangDTOs.Count > 0)
+ {
+ foreach (var liaotianShoucangDTO in liaotianShoucangDTOs)
+ {
+ resultEntity = _liaotianService.ModifyStatusLiaotianShoucang(liaotianShoucangDTO.Id, curentuser.Id);
+ }
+ }
+ }
+
+ return new JsonResult(resultEntity); ;
+ }
+
/// <summary>
/// 鎻愪氦骞跺鏍�
@@ -437,12 +511,15 @@
[CheckLogin]
public async Task<string> TijiaobingshenheAsync(LiaotianDTO data)
{
+
ResultEntity resultEntity = new ResultEntity();
resultEntity.Result = false;
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
ViewData["curentuser"] = curentuser;
data.RecStatus = "A";
data.Clientid = "A";
+ data.Shenheer = curentuser.Id;
+ data.Shenhetime = DateTime.Now;
if (String.IsNullOrEmpty(data.Id))
{
data.Creater = curentuser.Id;
@@ -455,8 +532,10 @@
resultEntity = _liaotianService.saveLiaotian(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.Question;
@@ -527,13 +606,16 @@
LiaotianDTO data = _liaotianService.GetLiaotianEntity(Id);
+
+ data.Shenheer = curentuser.Id;
+ data.Shenhetime = DateTime.Now;
data.Clientid = "A";
data.Modifier = curentuser.Id;
data.Modifytime = DateTime.Now;
resultEntity = _liaotianService.saveLiaotian(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.Question;
@@ -605,7 +687,7 @@
ResultEntity resultEntity = _liaotianService.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
{
--
Gitblit v1.9.1