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 | 43 +++++++++++++++++++++++++++++-------------- 1 files changed, 29 insertions(+), 14 deletions(-) diff --git a/zhengcaioa/Services/CooperatecustomCustomerService.cs b/zhengcaioa/Services/CooperatecustomCustomerService.cs index 9a04ea6..ac6a6b6 100644 --- a/zhengcaioa/Services/CooperatecustomCustomerService.cs +++ b/zhengcaioa/Services/CooperatecustomCustomerService.cs @@ -145,9 +145,7 @@ var listPosition = _context.CooperatecustomCustomers.Where(r => r.RecStatus == "A").ToList(); - var CooperatecustomCustomerDTOs = _mapper.Map<List<CooperatecustomCustomerDTO>>(listPosition); - CacheHelperNetCore.CacheInsert("CooperatecustomCustomerDTOs", CooperatecustomCustomerDTOs); - + CacheHelperNetCore.CacheNull("CooperatecustomCustomerDTOs"); resultEntity.ReturnID = cooperatecustomCustomer.Id; resultEntity.Result = true; } @@ -519,37 +517,31 @@ { 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)) { - CooperatecustomCustomerDTOs = CooperatecustomCustomerDTOs.Where(x => x.HuiyuanId == HuiyuanId).ToList(); + listPosition = listPosition.Where(x => x.HuiyuanId == HuiyuanId).ToList(); } - if (!string.IsNullOrEmpty(Name)) { - CooperatecustomCustomerDTOs = CooperatecustomCustomerDTOs.Where(x => x.Name == Name).ToList(); + listPosition = listPosition.Where(x => x.Name == Name).ToList(); } - + CooperatecustomCustomerDTOs = _mapper.Map<List<CooperatecustomCustomerDTO>>(listPosition); return CooperatecustomCustomerDTOs; - + } public List<CooperatecustomCustomerDTO> GetListsalary(string userid, DateTime datemin, DateTime datemax) @@ -1290,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 { @@ -1302,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