From 69a8bb4807c77d05b5b43328acbf4ad26fb5fc68 Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期五, 05 五月 2023 15:00:52 +0800 Subject: [PATCH] 提交 --- zhengcaioa/Services/IntentionCustomerService.cs | 82 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 81 insertions(+), 1 deletions(-) diff --git a/zhengcaioa/Services/IntentionCustomerService.cs b/zhengcaioa/Services/IntentionCustomerService.cs index 29c77ff..9c77a76 100644 --- a/zhengcaioa/Services/IntentionCustomerService.cs +++ b/zhengcaioa/Services/IntentionCustomerService.cs @@ -162,7 +162,7 @@ var entity = _context.IntentionCustomers.Find(id); - if (entity.RecStatus != "A") + if (entity ==null || entity.RecStatus != "A") { entity = new IntentionCustomer(); } @@ -352,12 +352,27 @@ Zuijinzhuizongtime = a.Zuijinzhuizongtime, ZuijinzhuizongtimeName = a.Zuijinzhuizongtime.HasValue ? a.Zuijinzhuizongtime.Value.ToString("yyyy-MM-dd") : "", Visittimes = lll.Visittimes, + Kuaidistatus = a.Kuaidistatus, + Kuaiditime = a.Kuaiditime, } ); if (!string.IsNullOrWhiteSpace(searchEntity.Shifouweixin)) { query = query.Where( a=>a.Shifoutianjiaweixin == searchEntity.Shifouweixin.Trim()); + } + + if (!string.IsNullOrWhiteSpace(searchEntity.Kuaidistatus)) + { + if (searchEntity.Kuaidistatus == "A") + { + query = query.Where(a => a.Kuaidistatus == searchEntity.Kuaidistatus.Trim()); + } + else + { + query = query.Where(a => a.Kuaidistatus == searchEntity.Kuaidistatus.Trim() || a.Kuaidistatus == null); + } + } if (!string.IsNullOrWhiteSpace(searchEntity.Ywjl)) @@ -592,5 +607,70 @@ return list; } + public ResultEntity saveKhlx(CooperatecustomCustomerDTO cooperatecustomCustomerDTO) + { + ResultEntity resultEntity = new ResultEntity(); + try + { + + + + + + + var updateproject = _context.IntentionCustomers.Find(cooperatecustomCustomerDTO.Id); + + + updateproject.Khlx = cooperatecustomCustomerDTO.Khlx; + + updateproject.Modifier = cooperatecustomCustomerDTO.Modifier; + updateproject.Modifytime = cooperatecustomCustomerDTO.Modifytime; + + + _context.SaveChanges(); + + + resultEntity.ReturnID = cooperatecustomCustomerDTO.Id; + resultEntity.Result = true; + } + catch (Exception ex) + { + resultEntity.Result = false; + resultEntity.Message = "淇濆瓨澶辫触锛岃鑱旂郴绠$悊鍛�"; + + } + return resultEntity; + } + + + + public ResultEntity GetZhengfuProjectDTOByTitle(string Name, string Id) + { + ResultEntity resultEntity = new ResultEntity(); + resultEntity.Result = true; + if (!string.IsNullOrWhiteSpace(Name)) + { + var checkUserSn = _context.IntentionCustomers.Where(r => r.RecStatus == "A" && r.Name == Name).FirstOrDefault(); + if (checkUserSn != null && (string.IsNullOrWhiteSpace(Id) || (!string.IsNullOrWhiteSpace(Id) && checkUserSn.Id != Id))) + { + resultEntity.Result = false; + resultEntity.Message = "璇ユ。妗堝鎴峰凡缁忓瓨鍦�"; + + } + var checkUserSncooper = _context.CooperatecustomCustomers.Where(r => r.RecStatus == "A" && r.Name == Name).FirstOrDefault(); + if (checkUserSncooper != null && (string.IsNullOrWhiteSpace(Id) || (!string.IsNullOrWhiteSpace(Id) && checkUserSncooper.Id != Id))) + { + resultEntity.Result = false; + resultEntity.Message = "璇ュ悎浣滃鎴峰凡缁忓瓨鍦�"; + + } + + } + + + + return resultEntity; + } + } } -- Gitblit v1.9.1