From d594c576eb6cd7073e880cd09fe581fb2ac5504b Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期一, 21 四月 2025 08:38:36 +0800 Subject: [PATCH] 修改在职企业维护 --- zhengcaioa/Services/CooperatecustomCustomerService.cs | 50 ++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 42 insertions(+), 8 deletions(-) diff --git a/zhengcaioa/Services/CooperatecustomCustomerService.cs b/zhengcaioa/Services/CooperatecustomCustomerService.cs index 4f5b9cb..ac6a6b6 100644 --- a/zhengcaioa/Services/CooperatecustomCustomerService.cs +++ b/zhengcaioa/Services/CooperatecustomCustomerService.cs @@ -145,7 +145,7 @@ var listPosition = _context.CooperatecustomCustomers.Where(r => r.RecStatus == "A").ToList(); - + CacheHelperNetCore.CacheNull("CooperatecustomCustomerDTOs"); resultEntity.ReturnID = cooperatecustomCustomer.Id; resultEntity.Result = true; } @@ -510,27 +510,38 @@ /// <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(); } - if (!string.IsNullOrEmpty(Name)) { listPosition = listPosition.Where(x => x.Name == Name).ToList(); } - var CooperatecustomCustomerDTOs = _mapper.Map<List<CooperatecustomCustomerDTO>>(listPosition); + CooperatecustomCustomerDTOs = _mapper.Map<List<CooperatecustomCustomerDTO>>(listPosition); return CooperatecustomCustomerDTOs; - + } public List<CooperatecustomCustomerDTO> GetListsalary(string userid, DateTime datemin, DateTime datemax) @@ -1271,6 +1282,18 @@ { DTO.Id = Guid.NewGuid().ToString(); _context.CustomerGuanlianhuiyuans.Add(DTO); + + + var cooperatecustomCustomer = _context.CooperatecustomCustomers.Where(x => x.RecStatus == "A" && x.Id == DTO.Customerid ).FirstOrDefault(); + if (cooperatecustomCustomer != null) + { + cooperatecustomCustomer.HuiyuanId = DTO.Huiyuanid; + } + var intentionCustomer = _context.IntentionCustomers.Where(x => x.RecStatus == "A" && x.Id == DTO.Customerid ).FirstOrDefault(); + if (intentionCustomer != null) + { + intentionCustomer.HuiyuanId = DTO.Huiyuanid; + } } else { @@ -1283,7 +1306,18 @@ updateproject.RecStatus = DTO.RecStatus; updateproject.Modifier = DTO.Modifier; updateproject.Modifytime = DTO.Modifytime; - + + var cooperatecustomCustomer = _context.CooperatecustomCustomers.Where(x => x.RecStatus == "A" && x.Id == DTO.Customerid ).FirstOrDefault(); + if (cooperatecustomCustomer != null) + { + cooperatecustomCustomer.HuiyuanId = DTO.Huiyuanid; + } + var intentionCustomer = _context.IntentionCustomers.Where(x => x.RecStatus == "A" && x.Id == DTO.Customerid ).FirstOrDefault(); + if (intentionCustomer != null) + { + intentionCustomer.HuiyuanId = DTO.Huiyuanid; + } + } _context.SaveChanges(); -- Gitblit v1.9.1