From 1aa53fde5eb18a39c53daf910d69cb857913b08d Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期三, 06 七月 2022 15:23:02 +0800
Subject: [PATCH] 提交

---
 zhengcaioa/zhengcaioa/Controllers/ProjectController.cs |   55 ++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 52 insertions(+), 3 deletions(-)

diff --git a/zhengcaioa/zhengcaioa/Controllers/ProjectController.cs b/zhengcaioa/zhengcaioa/Controllers/ProjectController.cs
index b24828f..3f77fd8 100644
--- a/zhengcaioa/zhengcaioa/Controllers/ProjectController.cs
+++ b/zhengcaioa/zhengcaioa/Controllers/ProjectController.cs
@@ -29,11 +29,13 @@
         private readonly ICooperatecustomCustomerService _cooperatecustomCustomerService;
         private readonly ISysBaimingdanService _sysBaimingdanService;
         private readonly IFiOrderrecievemoneyService _fiOrderrecievemoneyService;
+        private readonly IAreaService _areaService;
 
         public ProjectController(ILogger<ProjectController> logger, IProjectService projectService, ILiaotianService liaotianService,IIntentionCustomerService intentionCustomerService, IUserService userService
             , ICooperatecustomCustomerService cooperatecustomCustomerService
             , ISysBaimingdanService sysBaimingdanService
-            , IFiOrderrecievemoneyService fiOrderrecievemoneyService)
+            , IFiOrderrecievemoneyService fiOrderrecievemoneyService
+            , IAreaService areaService)
         {
             _logger = logger;
             _projectService = projectService;
@@ -43,6 +45,7 @@
             _cooperatecustomCustomerService = cooperatecustomCustomerService;
             _sysBaimingdanService = sysBaimingdanService;
             _fiOrderrecievemoneyService = fiOrderrecievemoneyService;
+            _areaService = areaService;
         }
         [CheckLogin]
         public IActionResult Index()
@@ -903,7 +906,7 @@
                     //if (resultDataEntitys.DataList.Count > 0)
                     {
                         string token = key1.Length > 100 ? key1.Substring(key1.Length - 100) : key1;
-                        if (ruleCollection.ZXDSFXLS > 0)
+                        if (ruleCollection.PrivilegeService.Count(x=>x== "ZXDSFXLS")>0)
                         //if (ruleCollection.ZXDSFXLS == 0)
                         {
                             DateTime yuechu = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
@@ -974,7 +977,7 @@
                                     return new JsonResult(returnMsg);
                                 }
                             }
-                            if ( token != zxdsfxlDTOsnowdate[0].Token)
+                            if (zxdsfxlDTOsnowdate.Count == 0 || token != zxdsfxlDTOsnowdate[0].Token)
                             {
                                 //瀛樺偍鏈鐨勮闂俊鎭�
                                 ZxdsfxlDTO zxdsfxlDTO = new ZxdsfxlDTO();
@@ -1034,5 +1037,51 @@
             }
             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