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/Customer/CooperatecustomCustomerController.cs |   77 ++++++++++++++++++++++++++++++++++++--
 1 files changed, 73 insertions(+), 4 deletions(-)

diff --git a/zhengcaioa/zhengcaioa/Controllers/Customer/CooperatecustomCustomerController.cs b/zhengcaioa/zhengcaioa/Controllers/Customer/CooperatecustomCustomerController.cs
index 41774d5..ab44c04 100644
--- a/zhengcaioa/zhengcaioa/Controllers/Customer/CooperatecustomCustomerController.cs
+++ b/zhengcaioa/zhengcaioa/Controllers/Customer/CooperatecustomCustomerController.cs
@@ -100,13 +100,27 @@
             ViewBag.khlx = _liaotianService.GetSYScode("CooperatecustomCustomer", "khlx").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
             ViewBag.khly = _liaotianService.GetSYScode("CooperatecustomCustomer", "khly").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
             ViewBag.hyfl = _liaotianService.GetSYScode("CooperatecustomCustomer", "hyfl").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
-
+            ViewBag.shifou = _liaotianService.GetSYScode("system", "shifou").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
             ViewBag.users = _userService.GetList().Where(x => x.IsYwjl == "A").Select(x => new { code = x.Id, label = x.UserName }).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();
             return View();
    
         }
@@ -137,8 +151,22 @@
                 cooperatecustomCustomerDTO.AreaId = "510107";
                  
             }
-           
-            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(cooperatecustomCustomerDTO.Sheng);
             var quxian = _projectService.Getquxian(cooperatecustomCustomerDTO.City);
             var users = _userService.GetList().Where(x => x.IsYwjl == "A").ToList(); ;
@@ -158,6 +186,23 @@
         }
 
 
+
+        public IActionResult GetCustomer(string id)
+        {
+            var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
+            ViewData["curentuser"] = curentuser;
+
+             
+            
+              var  cooperatecustomCustomerDTO = _cooperatecustomCustomerService.Get(id);
+
+
+
+            return new JsonResult(cooperatecustomCustomerDTO);
+        }
+
+
+
         /// <summary>
         /// 淇濆瓨
         /// </summary>
@@ -170,6 +215,30 @@
             var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
             ViewData["curentuser"] = curentuser;
             data.RecStatus = "A";
+            if (string.IsNullOrEmpty(data.Shifoutianjiaweixin))
+            {
+                data.Shifoutianjiaweixin = "D";
+                data.Weixiner = null;
+                data.Weixintime = null;
+            }
+            else
+            {
+                if (String.IsNullOrEmpty(data.Id))
+                {
+                    data.Weixiner = curentuser.Id;
+                    data.Weixintime = DateTime.Now;
+                }
+                else
+                {
+                 var cooperatecustomCustomerDTO    =   _cooperatecustomCustomerService.Get(data.Id);
+                    if (string.IsNullOrEmpty(cooperatecustomCustomerDTO.Weixiner) )
+                    {
+                        data.Weixiner = curentuser.Id;
+                        data.Weixintime = DateTime.Now;
+                    }
+
+                }
+            }
             if (String.IsNullOrEmpty(data.Id))
             {
                 data.Creater = curentuser.Id;

--
Gitblit v1.9.1