From 378725af30f2ccf5007f80c553865be2b39f727a Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期二, 18 十月 2022 17:09:58 +0800
Subject: [PATCH] 修改数据库地址

---
 zhengcaioa/Services/CooperatecustomCustomerService.cs |   72 ++++++++++++++++++++++++++++++++++--
 1 files changed, 68 insertions(+), 4 deletions(-)

diff --git a/zhengcaioa/Services/CooperatecustomCustomerService.cs b/zhengcaioa/Services/CooperatecustomCustomerService.cs
index da4db33..acdb492 100644
--- a/zhengcaioa/Services/CooperatecustomCustomerService.cs
+++ b/zhengcaioa/Services/CooperatecustomCustomerService.cs
@@ -3,6 +3,7 @@
 using System.Linq;
 using System.Text;
 using AutoMapper;
+using CommonToolsCore;
 using DTO;
 using IServices;
 using Microsoft.AspNetCore.Mvc.Rendering;
@@ -99,7 +100,47 @@
                     updateproject.Weixintime = cooperatecustomCustomer.Weixintime;
                     updateproject.Weixiner = cooperatecustomCustomer.Weixiner;
                     updateproject.Shouxinedu = cooperatecustomCustomer.Shouxinedu;
+                    updateproject.Taocanjianshu = cooperatecustomCustomer.Taocanjianshu;
                 }
+
+                _context.SaveChanges();
+
+                var listPosition = _context.CooperatecustomCustomers.Where(r => r.RecStatus == "A").ToList();
+
+               var  CooperatecustomCustomerDTOs = _mapper.Map<List<CooperatecustomCustomerDTO>>(listPosition);
+                CacheHelperNetCore.CacheInsert("CooperatecustomCustomerDTOs", CooperatecustomCustomerDTOs);
+
+                resultEntity.ReturnID = cooperatecustomCustomer.Id;
+                resultEntity.Result = true;
+            }
+            catch (Exception ex)
+            {
+                resultEntity.Result = false;
+                resultEntity.Message = "淇濆瓨澶辫触锛岃鑱旂郴绠$悊鍛�";
+
+            }
+            return resultEntity;
+        }
+
+
+        public ResultEntity saveyufukuan(CooperatecustomCustomerDTO cooperatecustomCustomerDTO)
+        {
+            ResultEntity resultEntity = new ResultEntity();
+            try
+            {
+                
+
+                var cooperatecustomCustomer = _mapper.Map<CooperatecustomCustomer>(cooperatecustomCustomerDTO);
+
+
+                
+                    var updateproject = _context.CooperatecustomCustomers.Find(cooperatecustomCustomer.Id);
+
+                     
+                    updateproject.Yufukuan = cooperatecustomCustomer.Yufukuan;
+                    updateproject.Shenyushouxin = cooperatecustomCustomer.Shenyushouxin;
+                    updateproject.Shouxinedu = cooperatecustomCustomer.Shouxinedu;
+                 
 
                 _context.SaveChanges();
                 resultEntity.ReturnID = cooperatecustomCustomer.Id;
@@ -294,6 +335,7 @@
                              YufukuanName = a.Yufukuan.HasValue ? a.Yufukuan.Value.ToString("f2") : "",
                              ShouxineduName = a.Shouxinedu.HasValue ? a.Shouxinedu.Value.ToString("f2") : "",
                              ShenyushouxinName = a.Shenyushouxin.HasValue ? a.Shenyushouxin.Value.ToString("f2") : "",
+                             Taocanjianshu = a.Taocanjianshu ?? 0,
                          }
                         ).OrderByDescending(x => x.Modifytime).ToList();
 
@@ -348,22 +390,44 @@
         /// <returns></returns>
         public List<CooperatecustomCustomerDTO> GetList(string HuiyuanId = "", string Name = "")
         {
+            List<CooperatecustomCustomerDTO> CooperatecustomCustomerDTOs = (List<CooperatecustomCustomerDTO>)CacheHelperNetCore.CacheValue("CooperatecustomCustomerDTOs");
+            if (CooperatecustomCustomerDTOs != null && CooperatecustomCustomerDTOs.Count > 0)
+            {
+                if (!string.IsNullOrEmpty(HuiyuanId))
+                {
+                    CooperatecustomCustomerDTOs = CooperatecustomCustomerDTOs.Where(x => x.HuiyuanId == HuiyuanId).ToList();
+                }
 
+                if (!string.IsNullOrEmpty(Name))
+                {
+                    CooperatecustomCustomerDTOs = CooperatecustomCustomerDTOs.Where(x => x.Name == Name).ToList();
+                }
+
+                return CooperatecustomCustomerDTOs;
+            }
 
             var listPosition = _context.CooperatecustomCustomers.Where(r => r.RecStatus == "A").ToList();
 
+            CooperatecustomCustomerDTOs = _mapper.Map<List<CooperatecustomCustomerDTO>>(listPosition);
+            CacheHelperNetCore.CacheInsert("CooperatecustomCustomerDTOs", CooperatecustomCustomerDTOs);
+
+
             if (!string.IsNullOrEmpty(HuiyuanId))
             {
-                listPosition = listPosition.Where(x => x.HuiyuanId == HuiyuanId).ToList();
+                CooperatecustomCustomerDTOs = CooperatecustomCustomerDTOs.Where(x => x.HuiyuanId == HuiyuanId).ToList();
             }
 
             if (!string.IsNullOrEmpty(Name))
             {
-                listPosition = listPosition.Where(x => x.Name == Name).ToList();
+                CooperatecustomCustomerDTOs = CooperatecustomCustomerDTOs.Where(x => x.Name == Name).ToList();
             }
 
-            var list = _mapper.Map<List<CooperatecustomCustomerDTO>>(listPosition);
-            return list;
+            return CooperatecustomCustomerDTOs;
+
+
+
+
+           
         }
 
         public List<CooperatecustomCustomerDTO> GetListsalary(string userid, DateTime datemin, DateTime datemax)

--
Gitblit v1.9.1