From 688b1ea208da068bfd5911eacc4d2be023219a7c Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期五, 24 二月 2023 13:51:21 +0800
Subject: [PATCH] 1、APP和短信同时推送,没有加APP的只推短信。
2、有归属的客户就留客户经理的电话,没有归属的客户留公司400电话。

---
 zhengcaioa/zhengcaioa/Controllers/LiaotianController.cs |   99 ++++++++++++++++++++++++++++++-------------------
 1 files changed, 61 insertions(+), 38 deletions(-)

diff --git a/zhengcaioa/zhengcaioa/Controllers/LiaotianController.cs b/zhengcaioa/zhengcaioa/Controllers/LiaotianController.cs
index b318520..2ca906d 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();
@@ -172,15 +183,17 @@
             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/person/" + liaotianDTO.Id;
+                    string url = $"{api_domain}/liaotian/_doc/" + liaotianDTO.Id;
 
                     LiaotianElasticsearchDTO liaotianElasticsearchDTO = new LiaotianElasticsearchDTO();
                     liaotianElasticsearchDTO.id = liaotianDTO.Id;
@@ -274,6 +287,9 @@
         {
             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))
             {
@@ -291,8 +307,6 @@
             }
             ViewData.Model = liaotianDTO;
 
-
-            List<PageEntity> pageEntities = _pltPageService.GetUserPage(curentuser.Id, "/Liaotian/Indexcheck");
 
             ViewData["pageEntities"] = pageEntities;
 
@@ -335,6 +349,8 @@
             ViewData["curentuser"] = curentuser;
             data.RecStatus = "A";
             data.Clientid = "D";
+            data.Shenheer = null;
+            data.Shenhetime = null;
             if (String.IsNullOrEmpty(data.Id))
             {
                 data.Creater= curentuser.Id;
@@ -342,11 +358,16 @@
             }
             data.Modifier = curentuser.Id;
             data.Modifytime = DateTime.Now;
+      
+           
+
+              resultEntity = _liaotianService.saveLiaotian(data);
+
             if (!string.IsNullOrEmpty(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;
                 //string requestJson = "{\"id\": \"" + Id + "\",\"question\": \"" + data.Question + "\",\"anwser\": \"" + data.Anwser + "\"}";
                 try
                 {
@@ -381,15 +402,12 @@
 
                 }
             }
-           
 
-              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;
@@ -418,7 +436,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;
@@ -434,7 +452,7 @@
             //    resultEntity.Result = false;
             //    throw e;
 
-             
+
             //}
 
 
@@ -504,6 +522,8 @@
             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;
@@ -519,7 +539,7 @@
             
 
             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;
@@ -590,13 +610,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;
@@ -668,7 +691,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