From 6e2b929cf381e2320ba6e7dec56c0371124d2b51 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期六, 27 八月 2022 15:03:00 +0800
Subject: [PATCH] 提交

---
 zhengcaioa/zhengcaioa/Controllers/ProjectController.cs | 1063 ++++++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 799 insertions(+), 264 deletions(-)

diff --git a/zhengcaioa/zhengcaioa/Controllers/ProjectController.cs b/zhengcaioa/zhengcaioa/Controllers/ProjectController.cs
index a0f7ae5..e23b9a9 100644
--- a/zhengcaioa/zhengcaioa/Controllers/ProjectController.cs
+++ b/zhengcaioa/zhengcaioa/Controllers/ProjectController.cs
@@ -14,6 +14,8 @@
 using System.Threading.Tasks;
 using zhengcaioa.IService;
 using zhengcaioa.Models;
+using System.IdentityModel.Tokens.Jwt;
+using CommonToolsCore;
 
 namespace zhengcaioa.Controllers
 {
@@ -24,15 +26,29 @@
         private readonly ILiaotianService _liaotianService;
         private readonly IIntentionCustomerService _intentionCustomerService;
         private readonly IUserService _userService;
+        private readonly ICooperatecustomCustomerService _cooperatecustomCustomerService;
+        private readonly ISysBaimingdanService _sysBaimingdanService;
+        private readonly IFiOrderrecievemoneyService _fiOrderrecievemoneyService;
+        private readonly IAreaService _areaService;
+        private readonly IPltPageService _pltPageService;
 
-
-        public ProjectController(ILogger<ProjectController> logger, IProjectService projectService, ILiaotianService liaotianService,IIntentionCustomerService intentionCustomerService, IUserService userService)
+        public ProjectController(ILogger<ProjectController> logger, IProjectService projectService, ILiaotianService liaotianService,IIntentionCustomerService intentionCustomerService, IUserService userService
+            , ICooperatecustomCustomerService cooperatecustomCustomerService
+            , ISysBaimingdanService sysBaimingdanService
+            , IFiOrderrecievemoneyService fiOrderrecievemoneyService
+            , IAreaService areaService
+              , IPltPageService pltPageService)
         {
             _logger = logger;
             _projectService = projectService;
             _liaotianService = liaotianService;
             _intentionCustomerService = intentionCustomerService;
             _userService = userService;
+            _cooperatecustomCustomerService = cooperatecustomCustomerService;
+            _sysBaimingdanService = sysBaimingdanService;
+            _fiOrderrecievemoneyService = fiOrderrecievemoneyService;
+            _areaService = areaService;
+            _pltPageService = pltPageService;
         }
         [CheckLogin]
         public IActionResult Index()
@@ -62,12 +78,15 @@
         {
             var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
             ViewData["curentuser"] = curentuser;
-
+            var pageEntities = _pltPageService.GetUserPage(curentuser.Id, "/Project/Select");
+            var pageEntities2 = pageEntities.Where(x => x.PageMethod == "02").ToList();
+            ViewData["ActionInfo2"] = pageEntities2;
             ProjectDTO projectDTO = new ProjectDTO();
             if (!String.IsNullOrEmpty(id))
             {
                 projectDTO = _projectService.GetLiaotianEntity(id);
                var intentionCustomerDTOs =  _intentionCustomerService.GetList();
+               var  cooperatecustomCustomerDTOs  = _cooperatecustomCustomerService.GetList();
 
                 if (projectDTO.Projectzhongbiaos!=null && projectDTO.Projectzhongbiaos.Count > 0)
                 {
@@ -75,6 +94,11 @@
                     {
                         var intt = intentionCustomerDTOs.Count(x=>x.Name == projectDTO.Projectzhongbiaos[i].Names);
 
+                        if (intt > 0)
+                        {
+                            projectDTO.Projectzhongbiaos[i].ProjectId = "yes";
+                        }
+                        intt = cooperatecustomCustomerDTOs.Count(x => x.Name == projectDTO.Projectzhongbiaos[i].Names);
                         if (intt > 0)
                         {
                             projectDTO.Projectzhongbiaos[i].ProjectId = "yes";
@@ -89,12 +113,22 @@
                     {
                         projectDTO.Drcunzai = "yes";
                     }
+                    intt = cooperatecustomCustomerDTOs.Count(x => x.Name == projectDTO.Drhx);
+                    if (intt > 0)
+                    {
+                        projectDTO.Drcunzai = "yes";
+                    }
                 }
 
                 if (!string.IsNullOrWhiteSpace(projectDTO.Dshx))
                 {
                     var intt = intentionCustomerDTOs.Count(x => x.Name == projectDTO.Dshx);
 
+                    if (intt > 0)
+                    {
+                        projectDTO.Dscunzai = "yes";
+                    }
+                    intt = cooperatecustomCustomerDTOs.Count(x => x.Name == projectDTO.Dshx);
                     if (intt > 0)
                     {
                         projectDTO.Dscunzai = "yes";
@@ -106,6 +140,11 @@
                     {
                         var intt = intentionCustomerDTOs.Count(x => x.Name == projectDTO.projectreasons[i].Reasonname);
 
+                        if (intt > 0)
+                        {
+                            projectDTO.projectreasons[i].ProjectId = "yes";
+                        }
+                        intt = cooperatecustomCustomerDTOs.Count(x => x.Name == projectDTO.projectreasons[i].Reasonname);
                         if (intt > 0)
                         {
                             projectDTO.projectreasons[i].ProjectId = "yes";
@@ -123,6 +162,41 @@
                         {
                             projectDTO.Projectyouxiaos[i].ProjectId = "yes";
                         }
+                        intt = cooperatecustomCustomerDTOs.Count(x => x.Name == projectDTO.Projectyouxiaos[i].Namesyouxiao);
+                        if (intt > 0)
+                        {
+                            projectDTO.Projectyouxiaos[i].ProjectId = "yes";
+                        }
+                    }
+                }
+
+                if (!string.IsNullOrWhiteSpace(projectDTO.Caigourenname))
+                {
+                    var intt = intentionCustomerDTOs.Count(x => x.Name == projectDTO.Caigourenname);
+
+                    if (intt > 0)
+                    {
+                        projectDTO.Caigourennamecunzai = "yes";
+                    }
+                    intt = cooperatecustomCustomerDTOs.Count(x => x.Name == projectDTO.Caigourenname);
+                    if (intt > 0)
+                    {
+                        projectDTO.Caigourennamecunzai = "yes";
+                    }
+                }
+
+                if (!string.IsNullOrWhiteSpace(projectDTO.Dailiname))
+                {
+                    var intt = intentionCustomerDTOs.Count(x => x.Name == projectDTO.Dailiname);
+
+                    if (intt > 0)
+                    {
+                        projectDTO.Dailinamecunzai = "yes";
+                    }
+                    intt = cooperatecustomCustomerDTOs.Count(x => x.Name == projectDTO.Dailiname);
+                    if (intt > 0)
+                    {
+                        projectDTO.Dailinamecunzai = "yes";
                     }
                 }
 
@@ -140,14 +214,28 @@
                 Projectyouxiaolist.Add(new Projectyouxiao());
                 projectDTO.Projectyouxiaos = Projectyouxiaolist;
 
-                var Projectzhongbiaoslist = new List<Projectzhongbiao>();
-                Projectzhongbiaoslist.Add(new Projectzhongbiao());
+                var Projectzhongbiaoslist = new List<ProjectzhongbiaoDTO>();
+                Projectzhongbiaoslist.Add(new ProjectzhongbiaoDTO());
                 projectDTO.Projectzhongbiaos = Projectzhongbiaoslist;
                 projectDTO.StartTime = DateTime.Now;
             }
             var zhuanjia = _projectService.Getzhuanjie();
             var cgfs = _projectService.GetCgfs();
-            var sheng = _projectService.Getsheng();
+            var areaDTOs = _projectService.Getsheng().ToList();
+            foreach (var areaDTO in areaDTOs)
+            {
+                if (areaDTO.CodeId == "510000")
+                {
+                    areaDTOs.Remove(areaDTO);
+                    break;
+                }
+            }
+            var areaDTOsic = new Area();
+            areaDTOsic.CodeId = "510000";
+            areaDTOsic.Name = "鍥涘窛鐪�";
+            areaDTOsic.ParentId = "0     ";
+            areaDTOs.Insert(1, areaDTOsic);
+            var sheng = areaDTOs;
             var shi = _projectService.Getshi(projectDTO.Sheng);
             var quxian = _projectService.Getquxian(projectDTO.City);
 
@@ -222,24 +310,63 @@
             var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
             ViewData["curentuser"] = curentuser;
             List<ActionEntity> actionlist = new List<ActionEntity>();
-            ActionEntity actionEntity = new ActionEntity();
-            actionEntity.OpenType = 0;
-            actionEntity.ActionUrl = "";
-            actionEntity.ActionFun = "Search";
-            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 actionEntity = new ActionEntity();
+            //actionEntity.OpenType = 0;
+            //actionEntity.ActionUrl = "";
+            //actionEntity.ActionFun = "Search";
+            //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);
+            var pageEntities = _pltPageService.GetUserPage(curentuser.Id, "/Project/Select");
+            var pageEntities1 = pageEntities.Where(x => x.PageMethod == "01").ToList();
+            if (pageEntities1.Count(x => x.PageShortcut == "Search") <= 0)
+            {
+                ActionEntity actionEntity = new ActionEntity();
+                actionEntity.OpenType = 0;
+                actionEntity.ActionUrl = "";
+                actionEntity.ActionFun = "Search";
+                actionEntity.PageIco = "fa fa-search";
+                actionEntity.ActionName = "鏌ヨ";
+                actionlist.Add(actionEntity);
+
+                ViewData["Creater11"] = curentuser.Id;
+            }
+            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.ProjectDropDown = _projectService.AllcgfsDropDown().Select(x => new { code = x.Value, label = x.Text }).ToList();
             //ViewBag.flbx = _liaotianService.GetSYScode("Project", "flbx").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
-            ViewBag.ShengDropDown = _projectService.Getsheng().Select(x => new { code = x.CodeId, label = x.Name }).ToList();
+            var areaDTOs = _projectService.Getsheng().ToList();
+            foreach (var areaDTO in areaDTOs)
+            {
+                if (areaDTO.CodeId == "510000")
+                {
+                    areaDTOs.Remove(areaDTO);
+                    break;
+                }
+            }
+            var areaDTOsic = new Area();
+            areaDTOsic.CodeId = "510000";
+            areaDTOsic.Name = "鍥涘窛鐪�";
+            areaDTOsic.ParentId = "0     ";
+            areaDTOs.Insert(1, areaDTOsic);
+            ViewBag.ShengDropDown = areaDTOs.Select(x => new { code = x.CodeId, label = x.Name }).ToList();
 
             ViewBag.Creater = _userService.GetList().Select(x => new { code = x.Id, label = x.UserName }).ToList();
             ViewBag.flbx = _liaotianService.GetSYScode("system", "shifou").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
@@ -285,298 +412,706 @@
                 HttpResponseMessage response = client.GetAsync(address).Result;
                 var res = response.Content.ReadAsStringAsync().Result;
                 var document = parser.ParseDocument(res);
-                var time = document.QuerySelector("p");
-                if (time != null)
+                if (address.StartsWith("https://zfcg.scsczt.cn/"))
                 {
-                    string timestr = time.TextContent;
-                    if (timestr.IndexOf("绯荤粺鍙戝竷鏃堕棿锛�") >= 0)
+                    //鏂版嫑鏍囩綉绔�
+                    var contentList = document.All.Where(m => m.Id == "print-content");
+                    if (contentList != null)
                     {
-                        timestr = timestr.Replace("绯荤粺鍙戝竷鏃堕棿锛�", "");
-                    }
-                    projectDTO.StartTimestr = timestr;
-                }
-                var table = document.QuerySelector("table").QuerySelectorAll("tr");
-                if (table != null)
-                {
+                        var cDocumet = contentList.First();
+                        var title = cDocumet.QuerySelector("h1");
+                        if (title != null)
+                            projectDTO.Name = title.TextContent.Replace("\n", "").Trim();
 
-
-                    for (int i = 0; i < table.Length; i++)
-                    {
-                        var select = table[i].QuerySelector("td");
-                        if (select != null && select.TextContent.IndexOf("椤圭洰缂栧彿") >= 0)
+                        var time = contentList.Where(m => m.Id == "noticeTime");
+                        if (time != null)
                         {
-                            if (table[i + 1] != null)
+                            var time1 = contentList.First();
+                            var timestr = time1.QuerySelector("i");
+                            if (timestr != null)
                             {
-                                var td1 = table[i + 1].QuerySelector("td");
-                                if (td1 != null)
-                                {
-                                    projectDTO.Number = table[i + 1].QuerySelector("td").TextContent.Trim();//OuterHtml
-                                }
+                                projectDTO.StartTimestr = timestr.TextContent;
                             }
-
                         }
-                        else if (select != null && select.TextContent.IndexOf("椤圭洰鍚嶇О") >= 0)
+
+                        var Numbers = cDocumet.QuerySelectorAll("h4");
+                        foreach(var Number in Numbers )
                         {
-                            if (table[i + 1] != null)
+                            if(Number!=null&& Number.TextContent.Contains("椤圭洰缂栧彿"))
                             {
-                                var td1 = table[i + 1].QuerySelector("td");
-                                if (td1 != null)
-                                {
-                                    projectDTO.Name = table[i + 1].QuerySelector("td").TextContent.Trim();//OuterHtml
-                                }
+                                projectDTO.Number = Number.TextContent.Replace("涓�銆侀」鐩紪鍙凤細", "").Trim();
                             }
-
                         }
-                        else if (select != null && select.TextContent.IndexOf("涓爣锛堟垚浜わ級淇℃伅") >= 0)
+
+                        var Numberss = cDocumet.QuerySelectorAll("p");
+                        foreach (var Number in Numberss)
                         {
-                            projectDTO.Projectzhongbiaos = new List<Projectzhongbiao>();
-                            
-                            if (table[i + 1] != null)
+                            if (Number != null && Number.TextContent.Contains("椤圭洰缂栧彿"))
                             {
-                                var tds = table[i + 1].QuerySelectorAll("td");
-                                if (tds != null)
+                                projectDTO.Number = Number.TextContent.Replace("椤圭洰缂栧彿锛�", "").Trim();
+                            }
+                            if (Number != null && Number.TextContent.Contains("棰勭畻閲戦"))
+                            {
+                                decimal caigouyusuanName = 0;
+                                decimal.TryParse(Number.TextContent.Replace("棰勭畻閲戦锛�", "").Replace("鍏�", "").Replace(",", "").Trim(), out caigouyusuanName);
+
+                                projectDTO.CaigouyusuanName = (caigouyusuanName/new decimal(10000)).ToString();
+                            }
+                            if (Number != null && Number.TextContent.Contains("搴熸爣鐞嗙敱"))
+                            {
+                                var Fbyy = Number.QuerySelector("span");
+                                projectDTO.Fbyy = Fbyy.TextContent.Trim();
+                            }
+                        }
+                        var Caigourennames = cDocumet.QuerySelectorAll("span").Where(m => m.Id == "_notice_content_noticePurchase-purchaserOrgName");
+                        if (Caigourennames != null && Caigourennames.ToList().Count > 0)
+                        {
+                            var Caigourenname = Caigourennames.First();
+                            projectDTO.Caigourenname = Caigourenname.TextContent;
+                        }
+                        var Caigourenaddresss = cDocumet.QuerySelectorAll("span").Where(m => m.Id == "_notice_content_noticePurchase-purchaserOrgAddress");
+                        if (Caigourenaddresss != null && Caigourenaddresss.ToList().Count > 0)
+                        {
+                            var Caigourenaddress = Caigourenaddresss.First();
+                            projectDTO.Caigourenaddress = Caigourenaddress.TextContent;
+                        }
+                        var Caigourencontacts = cDocumet.QuerySelectorAll("span").Where(m => m.Id == "_notice_content_noticePurchase-purchaserLinkTel");
+                        if (Caigourencontacts != null && Caigourencontacts.ToList().Count > 0)
+                        {
+                            var Caigourencontact = Caigourencontacts.First();
+                            projectDTO.Caigourencontact = Caigourencontact.TextContent;
+                        }
+                        var Dailinames = cDocumet.QuerySelectorAll("span").Where(m => m.Id == "_notice_content_noticeAgency-agencyName");
+                        if (Dailinames != null && Dailinames.ToList().Count > 0)
+                        {
+                            var Dailiname = Dailinames.First();
+                            projectDTO.Dailiname = Dailiname.TextContent;
+                        }
+                        var Dailiaddresss = cDocumet.QuerySelectorAll("span").Where(m => m.Id == "_notice_content_noticeAgency-agentAddress");
+                        if (Dailiaddresss != null && Dailiaddresss.ToList().Count > 0)
+                        {
+                            var Dailiaddress = Dailiaddresss.First();
+                            projectDTO.Dailiaddress = Dailiaddress.TextContent;
+                        }
+                        var Dailicontacts = cDocumet.QuerySelectorAll("span").Where(m => m.Id == "_notice_content_noticeAgency-agentLinkTel");
+                        if (Dailicontacts != null && Dailicontacts.ToList().Count > 0)
+                        {
+                            var Dailicontact = Dailicontacts.First();
+                            projectDTO.Dailicontact = Dailicontact.TextContent;
+                        }
+
+                        var table1 = cDocumet.QuerySelectorAll("div").Where(m => m.Id == "_notice_content_noticeBidResult-noticeBidResult");
+                        
+                        if (table1 != null && table1.ToList().Count > 0)
+                        {
+                           var table = table1.First().QuerySelectorAll("table");
+                            if (table != null && table.ToList().Count > 0)
+                            {
+                                projectDTO.Projectzhongbiaos = new List<ProjectzhongbiaoDTO>();
+                                for (int i = 0; i < table.Length; i++)
                                 {
-                                    if (tds.Length > 1)
+                                    var td = table[i].QuerySelectorAll("td");
+                                    if (td.Length >= 3)
                                     {
-                                        string surpliername= table[i + 1].QuerySelectorAll("td")[1].TextContent.Trim();//OuterHtml
-                                        var surpliernames = surpliername.Split(',');
-                                        for(int j = 0;j< surpliernames.Length; j++)
+                                        var projectzhongbiao = new ProjectzhongbiaoDTO();
+                                        projectzhongbiao.Names = td[0].TextContent.Trim();
+                                        projectzhongbiao.Price = td[2].TextContent.Trim();
+                                        projectDTO.Projectzhongbiaos.Add(projectzhongbiao);
+                                    }
+                                }
+                            }
+                               
+                        }
+
+                        var zhuanjias = cDocumet.QuerySelectorAll("div").Where(m => m.ClassName == "noticeBidResult-noticeBidResult _notice_content_noticeBidResult-noticeBidResult expert dynamic-form-editor");
+                        if (zhuanjias != null && zhuanjias.ToList().Count > 0)
+                        {
+                           var zhuanjia = zhuanjias.First();
+
+                            projectDTO.Zhuanjia = zhuanjia.TextContent.Trim();//OuterHtml
+                        }
+                    } 
+                    
+
+                   
+
+                }
+                else
+                {
+                    //鏃ф嫑鏍囩綉绔�
+                    var time = document.QuerySelector("p");
+                    if (time != null)
+                    {
+                        string timestr = time.TextContent;
+                        if (timestr.IndexOf("绯荤粺鍙戝竷鏃堕棿锛�") >= 0)
+                        {
+                            timestr = timestr.Replace("绯荤粺鍙戝竷鏃堕棿锛�", "");
+                        }
+                        projectDTO.StartTimestr = timestr;
+                    }
+                    var table = document.QuerySelector("table").QuerySelectorAll("tr");
+                    if (table != null)
+                    {
+
+
+                        for (int i = 0; i < table.Length; i++)
+                        {
+                            var select = table[i].QuerySelector("td");
+                            if (select != null && select.TextContent.IndexOf("椤圭洰缂栧彿") >= 0)
+                            {
+                                if (table[i + 1] != null)
+                                {
+                                    var td1 = table[i + 1].QuerySelector("td");
+                                    if (td1 != null)
+                                    {
+                                        projectDTO.Number = table[i + 1].QuerySelector("td").TextContent.Trim();//OuterHtml
+                                    }
+                                }
+
+                            }
+                            else if (select != null && select.TextContent.IndexOf("椤圭洰鍚嶇О") >= 0)
+                            {
+                                if (table[i + 1] != null)
+                                {
+                                    var td1 = table[i + 1].QuerySelector("td");
+                                    if (td1 != null)
+                                    {
+                                        projectDTO.Name = table[i + 1].QuerySelector("td").TextContent.Trim();//OuterHtml
+                                    }
+                                }
+
+                            }
+                            else if (select != null && select.TextContent.IndexOf("涓爣锛堟垚浜わ級淇℃伅") >= 0)
+                            {
+                                projectDTO.Projectzhongbiaos = new List<ProjectzhongbiaoDTO>();
+
+                                if (table[i + 1] != null)
+                                {
+                                    var tds = table[i + 1].QuerySelectorAll("td");
+                                    if (tds != null)
+                                    {
+                                        if (tds.Length > 1)
                                         {
-                                            var projectzhongbiao = new Projectzhongbiao();
-                                            projectzhongbiao.Names = surpliernames[j].Trim();
-                                            //if (table[i + 2] != null)
-                                            //{
-                                            //    var tds2 = table[i + 2].QuerySelectorAll("td");
-                                            //    if (tds2 != null)
-                                            //    {
-                                            //        if (tds2.Length > 1)
-                                            //        {
-                                            //            string adress = table[i + 2].QuerySelectorAll("td")[1].TextContent.Trim();//OuterHtml
-                                            //            var adresss = adress.Split('锛�');
-                                            //            if (adresss.Length == surpliernames.Length)
-                                            //            {
-                                            //                projectzhongbiao.Names += " " + adresss[j].Trim();
-                                            //            }
-                                            //            else if (adresss.Length < surpliernames.Length)
-                                            //            {
-                                            //                if (j < adresss.Length)
-                                            //                {
-                                            //                    projectzhongbiao.Names += " " + adresss[j].Trim();
-                                            //                }
-                                            //                else
-                                            //                {
-                                            //                    projectzhongbiao.Names += " ";
-                                            //                }
-
-                                            //            }
-                                            //            else if (adresss.Length % surpliernames.Length == 0)
-                                            //            {
-
-                                            //                projectzhongbiao.Names += " " + adresss[(j + 1) * (adresss.Length / surpliernames.Length) - 1].Trim();
-
-
-                                            //            }
-                                            //            else
-                                            //            {
-                                            //                projectzhongbiao.Names += " " + adresss[j + (adresss.Length - surpliernames.Length)].Trim();
-                                            //            }
-                                            //        }
-                                            //    }
-                                            //}
-                                            if (table[i + 3] != null)
+                                            string surpliername = table[i + 1].QuerySelectorAll("td")[1].TextContent.Trim();//OuterHtml
+                                            var surpliernames = surpliername.Split(',');
+                                            for (int j = 0; j < surpliernames.Length; j++)
                                             {
-                                                var tds3 = table[i + 3].QuerySelectorAll("td");
-                                                if (tds3 != null)
+                                                var projectzhongbiao = new ProjectzhongbiaoDTO();
+                                                projectzhongbiao.Names = surpliernames[j].Trim();
+                                                //if (table[i + 2] != null)
+                                                //{
+                                                //    var tds2 = table[i + 2].QuerySelectorAll("td");
+                                                //    if (tds2 != null)
+                                                //    {
+                                                //        if (tds2.Length > 1)
+                                                //        {
+                                                //            string adress = table[i + 2].QuerySelectorAll("td")[1].TextContent.Trim();//OuterHtml
+                                                //            var adresss = adress.Split('锛�');
+                                                //            if (adresss.Length == surpliernames.Length)
+                                                //            {
+                                                //                projectzhongbiao.Names += " " + adresss[j].Trim();
+                                                //            }
+                                                //            else if (adresss.Length < surpliernames.Length)
+                                                //            {
+                                                //                if (j < adresss.Length)
+                                                //                {
+                                                //                    projectzhongbiao.Names += " " + adresss[j].Trim();
+                                                //                }
+                                                //                else
+                                                //                {
+                                                //                    projectzhongbiao.Names += " ";
+                                                //                }
+
+                                                //            }
+                                                //            else if (adresss.Length % surpliernames.Length == 0)
+                                                //            {
+
+                                                //                projectzhongbiao.Names += " " + adresss[(j + 1) * (adresss.Length / surpliernames.Length) - 1].Trim();
+
+
+                                                //            }
+                                                //            else
+                                                //            {
+                                                //                projectzhongbiao.Names += " " + adresss[j + (adresss.Length - surpliernames.Length)].Trim();
+                                                //            }
+                                                //        }
+                                                //    }
+                                                //}
+                                                if (table[i + 3] != null)
                                                 {
-                                                    if (tds3.Length > 1)
+                                                    var tds3 = table[i + 3].QuerySelectorAll("td");
+                                                    if (tds3 != null)
                                                     {
-                                                        string jine = table[i + 3].QuerySelectorAll("td")[1].TextContent.Trim();//OuterHtml
-                                                        var jines = jine.Split('锛�');
-                                                        if (jines.Length == surpliernames.Length)
+                                                        if (tds3.Length > 1)
                                                         {
-                                                            projectzhongbiao.Price = jines[j].Trim().Replace("涓爣閲戦","").Replace(":", "").Replace("锛�", "");//OuterHtml
-                                                        }
-                                                        else if (jines.Length < surpliernames.Length)
-                                                        {
-                                                            if (j < jines.Length)
+                                                            string jine = table[i + 3].QuerySelectorAll("td")[1].TextContent.Trim();//OuterHtml
+                                                            var jines = jine.Split('锛�');
+                                                            if (jines.Length == surpliernames.Length)
                                                             {
-                                                                projectzhongbiao.Price =   jines[j].Trim().Replace("涓爣閲戦", "").Replace(":", "").Replace("锛�", "");
+                                                                projectzhongbiao.Price = jines[j].Trim().Replace("涓爣閲戦", "").Replace(":", "").Replace("锛�", "");//OuterHtml
+                                                            }
+                                                            else if (jines.Length < surpliernames.Length)
+                                                            {
+                                                                if (j < jines.Length)
+                                                                {
+                                                                    projectzhongbiao.Price = jines[j].Trim().Replace("涓爣閲戦", "").Replace(":", "").Replace("锛�", "");
+                                                                }
+                                                                else
+                                                                {
+                                                                    projectzhongbiao.Price = " ";
+                                                                }
+
                                                             }
                                                             else
                                                             {
-                                                                projectzhongbiao.Price = " ";
+                                                                if (j == 0)
+                                                                {
+                                                                    projectzhongbiao.Price = jine.Trim().Replace("涓爣閲戦", "").Replace(":", "").Replace("锛�", "");
+                                                                }
+                                                                else
+                                                                {
+                                                                    projectzhongbiao.Price = jines[j + (jines.Length - surpliernames.Length)].Trim().Replace("涓爣閲戦", "").Replace(":", "").Replace("锛�", "");
+                                                                }
+
                                                             }
+
 
                                                         }
-                                                        else
-                                                        {
-                                                            if (j == 0)
-                                                            {
-                                                                projectzhongbiao.Price = jine.Trim().Replace("涓爣閲戦", "").Replace(":", "").Replace("锛�", "");
-                                                            }
-                                                            else
-                                                            {
-                                                                projectzhongbiao.Price = jines[j + (jines.Length - surpliernames.Length)].Trim().Replace("涓爣閲戦", "").Replace(":", "").Replace("锛�", "");
-                                                            }
-                                                            
-                                                        }
-
-
                                                     }
+
+
+
                                                 }
 
-
-
+                                                projectDTO.Projectzhongbiaos.Add(projectzhongbiao);
                                             }
 
-                                            projectDTO.Projectzhongbiaos.Add(projectzhongbiao);
                                         }
-
                                     }
+
+
+
                                 }
 
 
 
-                            }
-                           
-                            
 
-                           
+
+                            }
+                            else if (select != null && select.TextContent.IndexOf("璇勫涓撳") >= 0)
+                            {
+                                if (table[i + 1] != null)
+                                {
+                                    var td1 = table[i + 1].QuerySelector("td");
+                                    if (td1 != null)
+                                    {
+                                        string ssss = table[i + 1].QuerySelector("td").TextContent.Trim();
+                                        ssss = ssss.Replace("锛堢粍闀匡級", "").Replace("(缁勯暱)", "").Replace(",", "銆�").Replace("锛堣瘎瀹$粍闀匡級", "").Replace("(璇勫缁勯暱)", "").Replace("锛�", "銆�").Replace("璇勫缁勯暱锛�", "").Replace("缁勯暱锛�", "").Replace("缁勫憳锛�", "");
+                                        projectDTO.Zhuanjia = ssss;//OuterHtml
+                                    }
+                                }
+
+                            }
+                            else if (table[i] != null && table[i].TextContent.IndexOf("閲囪喘浜轰俊鎭�") >= 0)
+                            {
+                                //StringBuilder remark = new StringBuilder();
+                                // remark.Append("閲囪喘浜轰俊鎭�:");
+                                if (table[i + 1] != null)
+                                {
+                                    var tds = table[i + 1].QuerySelectorAll("td");
+                                    if (tds != null)
+                                    {
+                                        // remark.Append(table[i + 1].QuerySelectorAll("td")[0].TextContent.Trim());//OuterHtml)
+                                        if (tds.Length > 1)
+                                        {
+                                            //  remark.Append(table[i + 1].QuerySelectorAll("td")[1].TextContent.Trim());//OuterHtml)
+                                            projectDTO.Caigourenname = table[i + 1].QuerySelectorAll("td")[1].TextContent.Trim();
+                                        }
+                                    }
+                                    // remark.Append("  ");
+                                }
+                                if (table[i + 2] != null)
+                                {
+                                    var tds = table[i + 2].QuerySelectorAll("td");
+                                    if (tds != null)
+                                    {
+                                        // remark.Append(table[i + 2].QuerySelectorAll("td")[0].TextContent.Trim());//OuterHtml)
+                                        if (tds.Length > 1)
+                                        {
+                                            // remark.Append(table[i + 2].QuerySelectorAll("td")[1].TextContent.Trim());//OuterHtml)
+                                            projectDTO.Caigourenaddress = table[i + 2].QuerySelectorAll("td")[1].TextContent.Trim();
+                                        }
+                                    }
+                                    // remark.Append("  ");
+                                }
+                                if (table[i + 3] != null)
+                                {
+                                    var tds = table[i + 3].QuerySelectorAll("td");
+                                    if (tds != null)
+                                    {
+                                        // remark.Append(table[i + 3].QuerySelectorAll("td")[0].TextContent.Trim());//OuterHtml)
+                                        if (tds.Length > 1)
+                                        {
+                                            //   remark.Append(table[i + 3].QuerySelectorAll("td")[1].TextContent.Trim());//OuterHtml)
+                                            projectDTO.Caigourencontact = table[i + 3].QuerySelectorAll("td")[1].TextContent.Trim();
+                                        }
+                                    }
+                                    //  remark.Append("  ");
+                                }
+                                // remark.Append(" \n");
+                                //  projectDTO.Remark = remark.ToString();
+                            }
+
+                            else if (table[i] != null && table[i].TextContent.IndexOf("閲囪喘浠g悊鏈烘瀯淇℃伅") >= 0)
+                            {
+                                // StringBuilder remark = new StringBuilder();
+                                //  remark.Append("閲囪喘浠g悊鏈烘瀯淇℃伅:");
+                                if (table[i + 1] != null)
+                                {
+                                    var tds = table[i + 1].QuerySelectorAll("td");
+                                    if (tds != null)
+                                    {
+                                        //  remark.Append(table[i + 1].QuerySelectorAll("td")[0].TextContent.Trim());//OuterHtml)
+                                        if (tds.Length > 1)
+                                        {
+                                            //      remark.Append(table[i + 1].QuerySelectorAll("td")[1].TextContent.Trim());//OuterHtml)
+                                            projectDTO.Dailiname = table[i + 1].QuerySelectorAll("td")[1].TextContent.Trim();
+                                        }
+                                        // remark.Append("  ");
+                                    }
+                                }
+                                if (table[i + 2] != null)
+                                {
+                                    var tds = table[i + 2].QuerySelectorAll("td");
+                                    if (tds != null)
+                                    {
+                                        // remark.Append(table[i + 2].QuerySelectorAll("td")[0].TextContent.Trim());//OuterHtml)
+                                        if (tds.Length > 1)
+                                        {
+                                            //     remark.Append(table[i + 2].QuerySelectorAll("td")[1].TextContent.Trim());//OuterHtml)
+                                            projectDTO.Dailiaddress = table[i + 2].QuerySelectorAll("td")[1].TextContent.Trim();
+                                        }
+                                    }
+                                    //  remark.Append("  ");
+                                }
+                                if (table[i + 3] != null)
+                                {
+                                    var tds = table[i + 3].QuerySelectorAll("td");
+                                    if (tds != null)
+                                    {
+                                        //remark.Append(table[i + 3].QuerySelectorAll("td")[0].TextContent.Trim());//OuterHtml)
+                                        if (tds.Length > 1)
+                                        {
+                                            //      remark.Append(table[i + 3].QuerySelectorAll("td")[1].TextContent.Trim());//OuterHtml)
+                                            projectDTO.Dailicontact = table[i + 3].QuerySelectorAll("td")[1].TextContent.Trim();
+                                        }
+                                    }
+                                    //remark.Append("  ");
+                                }
+                                // remark.Append(" \n");
+                                //if (string.IsNullOrEmpty(projectDTO.Remark))
+                                //{
+                                //    projectDTO.Remark = remark.ToString();
+                                //}
+                                //else
+                                //{
+                                //    projectDTO.Remark += remark.ToString();
+                                //}
+
+                            }
+
+
+
 
                         }
-                        else if (select != null && select.TextContent.IndexOf("璇勫涓撳") >= 0)
-                        {
-                            if (table[i + 1] != null)
-                            {
-                                var td1 = table[i + 1].QuerySelector("td");
-                                if (td1 != null)
-                                {
-                                    string ssss = table[i + 1].QuerySelector("td").TextContent.Trim();
-                                    ssss =  ssss.Replace("锛堢粍闀匡級", "").Replace("(缁勯暱)", "").Replace(",", "銆�").Replace("锛堣瘎瀹$粍闀匡級", "").Replace("(璇勫缁勯暱)", "").Replace("锛�", "銆�").Replace("璇勫缁勯暱锛�", "").Replace("缁勯暱锛�", "").Replace("缁勫憳锛�","");
-                                    projectDTO.Zhuanjia = ssss;//OuterHtml
-                                }
-                            }
-
-                        }
-                        else if (table[i] != null && table[i].TextContent.IndexOf("閲囪喘浜轰俊鎭�") >= 0)
-                        {
-                            //StringBuilder remark = new StringBuilder();
-                           // remark.Append("閲囪喘浜轰俊鎭�:");
-                            if (table[i + 1] != null)
-                            {
-                                var tds = table[i + 1].QuerySelectorAll("td");
-                                if (tds != null)
-                                {
-                                   // remark.Append(table[i + 1].QuerySelectorAll("td")[0].TextContent.Trim());//OuterHtml)
-                                    if (tds.Length > 1)
-                                    {
-                                        //  remark.Append(table[i + 1].QuerySelectorAll("td")[1].TextContent.Trim());//OuterHtml)
-                                        projectDTO.Caigourenname = table[i + 1].QuerySelectorAll("td")[1].TextContent.Trim();
-                                    }
-                                }
-                               // remark.Append("  ");
-                            }
-                            if (table[i + 2] != null)
-                            {
-                                var tds = table[i + 2].QuerySelectorAll("td");
-                                if (tds != null)
-                                {
-                                   // remark.Append(table[i + 2].QuerySelectorAll("td")[0].TextContent.Trim());//OuterHtml)
-                                    if (tds.Length > 1)
-                                    {
-                                        // remark.Append(table[i + 2].QuerySelectorAll("td")[1].TextContent.Trim());//OuterHtml)
-                                        projectDTO.Caigourenaddress = table[i + 2].QuerySelectorAll("td")[1].TextContent.Trim();
-                                    }
-                                }
-                               // remark.Append("  ");
-                            }
-                            if (table[i + 3] != null)
-                            {
-                                var tds = table[i + 3].QuerySelectorAll("td");
-                                if (tds != null)
-                                {
-                                   // remark.Append(table[i + 3].QuerySelectorAll("td")[0].TextContent.Trim());//OuterHtml)
-                                    if (tds.Length > 1)
-                                    {
-                                        //   remark.Append(table[i + 3].QuerySelectorAll("td")[1].TextContent.Trim());//OuterHtml)
-                                        projectDTO.Caigourencontact = table[i + 3].QuerySelectorAll("td")[1].TextContent.Trim();
-                                    }
-                                }
-                              //  remark.Append("  ");
-                            }
-                           // remark.Append(" \n");
-                          //  projectDTO.Remark = remark.ToString();
-                        }
-
-                        else if (table[i] != null && table[i].TextContent.IndexOf("閲囪喘浠g悊鏈烘瀯淇℃伅") >= 0)
-                        {
-                           // StringBuilder remark = new StringBuilder();
-                          //  remark.Append("閲囪喘浠g悊鏈烘瀯淇℃伅:");
-                            if (table[i + 1] != null)
-                            {
-                                var tds = table[i + 1].QuerySelectorAll("td");
-                                if (tds != null)
-                                {
-                                  //  remark.Append(table[i + 1].QuerySelectorAll("td")[0].TextContent.Trim());//OuterHtml)
-                                    if (tds.Length > 1)
-                                    {
-                                        //      remark.Append(table[i + 1].QuerySelectorAll("td")[1].TextContent.Trim());//OuterHtml)
-                                        projectDTO.Dailiname = table[i + 1].QuerySelectorAll("td")[1].TextContent.Trim();
-                                    }
-                                   // remark.Append("  ");
-                                }
-                            }
-                            if (table[i + 2] != null)
-                            {
-                                var tds = table[i + 2].QuerySelectorAll("td");
-                                if (tds != null)
-                                {
-                                   // remark.Append(table[i + 2].QuerySelectorAll("td")[0].TextContent.Trim());//OuterHtml)
-                                    if (tds.Length > 1)
-                                    {
-                                        //     remark.Append(table[i + 2].QuerySelectorAll("td")[1].TextContent.Trim());//OuterHtml)
-                                        projectDTO.Dailiaddress = table[i + 2].QuerySelectorAll("td")[1].TextContent.Trim();
-                                    }
-                                }
-                              //  remark.Append("  ");
-                            }
-                            if (table[i + 3] != null)
-                            {
-                                var tds = table[i + 3].QuerySelectorAll("td");
-                                if (tds != null)
-                                {
-                                    //remark.Append(table[i + 3].QuerySelectorAll("td")[0].TextContent.Trim());//OuterHtml)
-                                    if (tds.Length > 1)
-                                    {
-                                        //      remark.Append(table[i + 3].QuerySelectorAll("td")[1].TextContent.Trim());//OuterHtml)
-                                        projectDTO.Dailicontact = table[i + 3].QuerySelectorAll("td")[1].TextContent.Trim();
-                                    }
-                                }
-                                //remark.Append("  ");
-                            }
-                           // remark.Append(" \n");
-                            //if (string.IsNullOrEmpty(projectDTO.Remark))
-                            //{
-                            //    projectDTO.Remark = remark.ToString();
-                            //}
-                            //else
-                            //{
-                            //    projectDTO.Remark += remark.ToString();
-                            //}
-                           
-                        }
-
-
 
 
                     }
-
-
                 }
+
+
+
+
+
 
                 return JsonConvert.SerializeObject(projectDTO);
 
             }
         }
+
+
+        //鑾峰彇瀵规墜鍒嗘瀽
+        public IActionResult GetProjectFenxi([FromBody] ProjectDTOSearch search)
+        {
+            ReturnMsg<List<ProjectDTO>> returnMsg = new ReturnMsg<List<ProjectDTO>>();
+            returnMsg.code = 2;
+
+            var sysBaimingdanDTOs =  _sysBaimingdanService.GetList();
+            if (!string.IsNullOrEmpty(search.Zhuanjia))
+            {
+             var sss =    sysBaimingdanDTOs.Where(x => x.PostType == "01" && search.Zhuanjia.Contains(x.BaimingdanName)).Count();
+                if (sss > 0)
+                {
+                    returnMsg.code = 2;
+                    returnMsg.error = "璇ヤ笓瀹惰鐩存帴鑱旂郴鏀块噰鍜ㄨ";
+                    returnMsg.count = 0;
+                    return new JsonResult(returnMsg);
+                }
+            }
+            if (!string.IsNullOrEmpty(search.Names))
+            {
+                var sss = sysBaimingdanDTOs.Where(x => x.PostType == "02" && search.Names.Contains(x.BaimingdanName)).Count();
+                if (sss > 0)
+                {
+                    returnMsg.code = 11;
+                    returnMsg.error = "璇ヤ緵搴斿晢璇风洿鎺ヨ仈绯绘斂閲囧挩璇�";
+                    returnMsg.count = 0;
+                    return new JsonResult(returnMsg);
+                }
+            }
+            if (!string.IsNullOrEmpty(search.NamesToubiao))
+            {
+                var sss = sysBaimingdanDTOs.Where(x => x.PostType == "02" && search.NamesToubiao.Contains(x.BaimingdanName)).Count();
+                if (sss > 0)
+                {
+                    returnMsg.code = 11;
+                    returnMsg.error = "璇ヤ緵搴斿晢璇风洿鎺ヨ仈绯绘斂閲囧挩璇�";
+                    returnMsg.count = 0;
+                    return new JsonResult(returnMsg);
+                }
+            }
+            if (!string.IsNullOrEmpty(search.Reasonname))
+            {
+                var sss = sysBaimingdanDTOs.Where(x => x.PostType == "02" && search.Reasonname.Contains(x.BaimingdanName)).Count();
+                if (sss > 0)
+                {
+                    returnMsg.code = 11;
+                    returnMsg.error = "璇ヤ緵搴斿晢璇风洿鎺ヨ仈绯绘斂閲囧挩璇�";
+                    returnMsg.count = 0;
+                    return new JsonResult(returnMsg);
+                }
+            }
+
+         
+            try
+            {
+                string userid = "";
+                var headers = Request.Headers;
+                if (headers != null)
+                {
+                    //string SecurityKey = _configuration.GetSection("SecurityKey").Value;
+                    var keyId = headers["Authorization"].FirstOrDefault();
+                    if (string.IsNullOrEmpty("keyId"))
+                    {
+                        returnMsg.code = 2;
+                        returnMsg.error = "娌℃湁鑾峰彇鍒版潈闄愪俊鎭�";
+                        returnMsg.count = 0;
+
+                        return new JsonResult(returnMsg);
+                    }
+
+
+                    JwtSecurityToken jwt = null;
+                    var handler = new JwtSecurityTokenHandler();
+                    var key1 = keyId.Replace("Bearer", "").Trim();
+                    jwt = handler.ReadJwtToken(key1);
+                    System.Security.Claims.Claim sss = jwt.Claims.Where(x => x.Type == "id").FirstOrDefault();
+                    userid = sss.Value;
+
+                    System.Security.Claims.Claim act = jwt.Claims.Where(x => x.Type == "act").FirstOrDefault();
+                    AesClass aesClass = new AesClass();
+                    RuleCollection ruleCollection = aesClass.DecryptRules(act.Value);
+                    //鍒ゆ柇鏄惁鏈夋案涔呭鎵嬪垎鏋愭潈闄�
+                    FiOrderrecievemoneyDTOSearch searchs = new FiOrderrecievemoneyDTOSearch();
+                    searchs.page = 1;
+                    searchs.rows = 10000;
+                    searchs.Fkzt = "03";
+                    searchs.OrderType = "02";
+                    searchs.StartTime = DateTime.Now.AddYears(-1).ToString("yyyy-MM-dd HH:mm:ss");
+                    searchs.EndTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+                    searchs.HuiyuanId = userid;
+                    searchs.OrderType1 = "绔炰簤瀵规墜鍜岃瘎瀹′笓瀹跺弬鍔犳斂搴滈噰璐暟鎹俊鎭煡璇�";
+                    ResultDataEntity<FiOrderrecievemoneyDTO> resultDataEntitys = _fiOrderrecievemoneyService.SearchByPaging(searchs);
+                    if (resultDataEntitys.DataList ==null || resultDataEntitys.DataList.Count == 0)
+                    //if (resultDataEntitys.DataList.Count > 0)
+                    {
+                        string token = key1.Length > 100 ? key1.Substring(key1.Length - 100) : key1;
+                        if (ruleCollection.PrivilegeService.Count(x=>x== "ZXDSFXLS")>0)
+                        //if (ruleCollection.ZXDSFXLS == 0)
+                        {
+                            DateTime yuechu = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
+                            var zxdsfxlDTOs = _projectService.GetListZxdsfxl(userid, yuechu, yuechu.AddMonths(1),"1").OrderByDescending(x => x.Visittime).ToList();
+
+                            if (zxdsfxlDTOs.Count > 30)
+                            {
+                                returnMsg.code = 2;
+                                returnMsg.error = "浣犳湰鏈�30娆℃祴璇曟満浼氬凡缁忕敤瀹岋紒";
+                                returnMsg.count = 0;
+                                return new JsonResult(returnMsg);
+                            }
+                            else if (zxdsfxlDTOs.Count == 30 && zxdsfxlDTOs[0].Visittime.Value.Day != DateTime.Now.Day)
+                            {
+                                returnMsg.code = 2;
+                                returnMsg.error = "浣犳湰鏈�30娆℃祴璇曟満浼氬凡缁忕敤瀹岋紒";
+                                returnMsg.count = 0;
+                                return new JsonResult(returnMsg);
+                            }
+                            var zxdsfxlDTOsnowdate = zxdsfxlDTOs.Where(x => x.Visittime >= DateTime.Now.Date && x.Visittime < DateTime.Now.AddDays(1).Date).OrderByDescending(x=>x.Visittime).ToList();
+                            if (zxdsfxlDTOsnowdate.Count > 2)
+                            {
+                                returnMsg.code = 2;
+                                returnMsg.error = "浣犳湰鏃�2娆℃祴璇曟満浼氬凡缁忕敤瀹岋紒";
+                                returnMsg.count = 0;
+                                return new JsonResult(returnMsg);
+                            }
+                            else if (zxdsfxlDTOsnowdate.Count == 2)
+                            {
+                                
+                                TimeSpan ts2 = new TimeSpan(zxdsfxlDTOsnowdate[0].Visittime.Value.Ticks);
+                                TimeSpan ts1 = new TimeSpan(DateTime.Now.Ticks);
+                                TimeSpan timeLoop = ts1.Subtract(ts2).Duration();
+                                if (timeLoop.TotalMinutes > 15)
+                                {
+                                    returnMsg.code = 2;
+                                    returnMsg.error = "浣犳湰鏃�2娆℃祴璇曟満浼氬凡缁忕敤瀹岋紒";
+                                    returnMsg.count = 0;
+                                    return new JsonResult(returnMsg);
+                                }
+                                else if (token != zxdsfxlDTOsnowdate[0].Token/* && zxdsfxlDTOs.Count == 30*/)
+                                {
+                                    returnMsg.code = 2;
+                                    returnMsg.error = "浣犳湰鏃�2娆℃祴璇曟満浼氬凡缁忕敤瀹岋紒";
+                                    returnMsg.count = 0;
+                                    return new JsonResult(returnMsg);
+                                }
+                            }
+                            else if(zxdsfxlDTOsnowdate.Count == 1)
+                            {
+                               
+                                TimeSpan ts2 = new TimeSpan(zxdsfxlDTOsnowdate[0].Visittime.Value.Ticks);
+                                TimeSpan ts1 = new TimeSpan(DateTime.Now.Ticks);
+                                TimeSpan timeLoop = ts1.Subtract(ts2).Duration();
+                                if (token== zxdsfxlDTOsnowdate[0].Token &&  timeLoop.TotalMinutes > 15)
+                                {
+                                    Response.StatusCode = 401;//閲嶆柊鐧婚檰
+                                    returnMsg.code = 2;
+                                    returnMsg.error = "浣犳湰娆¤闂椂闂村凡缁忚秴杩�15鍒嗛挓锛岃閲嶆柊鐧婚檰锛�";
+                                    returnMsg.count = 0;
+                                    return new JsonResult(returnMsg);
+                                }
+                                else if(token != zxdsfxlDTOsnowdate[0].Token && zxdsfxlDTOs.Count == 30)
+                                {
+                                    returnMsg.code = 2;
+                                    returnMsg.error = "浣犳湰鏈�30娆℃祴璇曟満浼氬凡缁忕敤瀹岋紒";
+                                    returnMsg.count = 0;
+                                    return new JsonResult(returnMsg);
+                                }
+                            }
+                            if (zxdsfxlDTOsnowdate.Count == 0 || token != zxdsfxlDTOsnowdate[0].Token)
+                            {
+                                //瀛樺偍鏈鐨勮闂俊鎭�
+                                ZxdsfxlDTO zxdsfxlDTO = new ZxdsfxlDTO();
+                                //zxdsfxlDTO.Id = Guid.NewGuid().ToString() ;
+                                zxdsfxlDTO.Huiyuanid = userid;
+                                zxdsfxlDTO.Huiyuanname = ruleCollection.User;
+                                zxdsfxlDTO.Visittime = DateTime.Now;
+                                zxdsfxlDTO.Token = key1.Length > 100 ? key1.Substring(key1.Length - 100) : key1;
+                                zxdsfxlDTO.Leixing = "1";
+                                zxdsfxlDTO.RecStatus = "A";
+                                zxdsfxlDTO.Creater = "1";
+                                zxdsfxlDTO.Createtime = zxdsfxlDTO.Visittime.Value;
+                                zxdsfxlDTO.Modifier = "1";
+                                zxdsfxlDTO.Modifytime = zxdsfxlDTO.Visittime.Value;
+                                ResultEntity resultEntity = _projectService.saveZxdsfxl(zxdsfxlDTO);
+                                if (resultEntity.Result == false)
+                                {
+                                    returnMsg.code = 2;
+                                    returnMsg.error = "璁块棶澶辫触";
+                                    returnMsg.count = 0;
+                                    return new JsonResult(returnMsg);
+                                }
+                            }
+                           
+                        }
+                        else
+                        {
+                            returnMsg.code = 2;
+                            returnMsg.error = "浣犳病鏈夋潈闄愯闂珵浜夊鎵嬪垎鏋�";
+                            returnMsg.count = 0;
+                            return new JsonResult(returnMsg);
+                        }
+                    }
+                }
+                else
+                {
+                    returnMsg.code = 2;
+                    returnMsg.error = "浣犳病鏈夌櫥褰曪紒";
+                    returnMsg.count = 0;
+                    return new JsonResult(returnMsg);
+                }
+                //search.page = 1;
+                //search.rows = 1;
+                ResultDataEntity<ProjectDTO> resultDataEntity = _projectService.SearchByPaging(search);
+
+                returnMsg.code = 1;
+                returnMsg.count = search.totalrows;
+                returnMsg.returnObj = resultDataEntity.DataList;
+
+            }
+            catch (Exception ex)
+            {
+                returnMsg.code = 2;
+                returnMsg.error = "绯荤粺鍙戠敓閿欒";
+                returnMsg.count = 0;
+
+            }
+            return new JsonResult(returnMsg);
+        }
+
+
+
+        //鑾峰彇椤圭洰璇︾粏淇℃伅
+        public IActionResult GetProjectFenxiDtl(string id = null)
+        {
+            ReturnMsg<ProjectDTO> returnMsg = new ReturnMsg<ProjectDTO>();
+            returnMsg.code = 2;
+
+            var  projectDTO = _projectService.GetLiaotianEntity(id);
+            var cgfs = _projectService.GetCgfs().Where(x=>x.Id == projectDTO.Cgfs).FirstOrDefault();
+            var areaDTOs = _areaService.GetList();
+            var flbx = _liaotianService.GetSYScode("Project", "flbx").Where(x => x.Id == projectDTO.Fblx).FirstOrDefault();
+
+
+            projectDTO.StartTimestr = projectDTO.StartTime.ToString("yyyy-MM-dd HH:mm:ss");
+            var shengname = areaDTOs.Where(x => x.CodeId == projectDTO.Sheng).FirstOrDefault();
+            if (shengname != null)
+            {
+                projectDTO.ShengName = shengname.Name;
+            }
+            var cityname = areaDTOs.Where(x => x.CodeId == projectDTO.City).FirstOrDefault();
+            if (cityname != null)
+            {
+                projectDTO.CityName = cityname.Name;
+            }
+            var areaIdName = areaDTOs.Where(x => x.CodeId == projectDTO.AreaId).FirstOrDefault();
+            if (areaIdName != null)
+            {
+                projectDTO.AreaIdName = areaIdName.Name;
+            }
+            if (cgfs != null)
+            {
+                projectDTO.CgfsName = cgfs.Name;
+            }
+            if (flbx != null)
+            {
+                projectDTO.FblxName = flbx.Comments;
+            }
+            
+            returnMsg.code = 1;
+            returnMsg.count = 1;
+            returnMsg.returnObj = projectDTO;
+
+            return new JsonResult(returnMsg);
+        }
     }
 }

--
Gitblit v1.9.1