From db227144dedfb5fb5b1e94e8c8b14eab9eb7462f Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期四, 01 十二月 2022 13:32:50 +0800 Subject: [PATCH] 中国政采网的四川数据 发送验证码 --- zhengcaioa/Services/IntentionCustomerService.cs | 33 ++++++++++++++++++++++++++++++--- 1 files changed, 30 insertions(+), 3 deletions(-) diff --git a/zhengcaioa/Services/IntentionCustomerService.cs b/zhengcaioa/Services/IntentionCustomerService.cs index e942f17..44f86b8 100644 --- a/zhengcaioa/Services/IntentionCustomerService.cs +++ b/zhengcaioa/Services/IntentionCustomerService.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Text; using AutoMapper; +using CommonToolsCore; using DTO; using IServices; using Microsoft.AspNetCore.Mvc.Rendering; @@ -103,7 +104,13 @@ } _context.SaveChanges(); - resultEntity.ReturnID = intentionCustomer.Id; + + var listPosition = _context.IntentionCustomers.Where(r => r.RecStatus == "A").ToList(); + + var intentionCustomerDTOs = _mapper.Map<List<IntentionCustomerDTO>>(listPosition); + CacheHelperNetCore.CacheInsert("intentionCustomerDTOs", intentionCustomerDTOs); + + resultEntity.ReturnID = intentionCustomer.Id; resultEntity.Result = true; } catch (Exception ex) @@ -295,8 +302,21 @@ { query = query.Where( a=>a.Shifoutianjiaweixin == searchEntity.Shifouweixin.Trim()).ToList(); } + if (!string.IsNullOrWhiteSpace(searchEntity.ShifouDianhua)) + { + if (searchEntity.ShifouDianhua != "A") + { + query = query.Where(a => a.Tel == null || a.Tel == "").ToList(); + } + else + { + query = query.Where(a => a.Tel != null && a.Tel != "").ToList(); + } + + } + - if (searchEntity.totalrows == 0) + //if (searchEntity.totalrows == 0) searchEntity.totalrows = query.Count(); var lianlist = query.Skip((searchEntity.page - 1) * searchEntity.rows).Take(searchEntity.rows).ToList(); data.LoadData(searchEntity, lianlist); @@ -336,10 +356,17 @@ /// <returns></returns> public List<IntentionCustomerDTO> GetList() { - + List<IntentionCustomerDTO> intentionCustomerDTOs = (List<IntentionCustomerDTO>)CacheHelperNetCore.CacheValue("intentionCustomerDTOs"); + if (intentionCustomerDTOs != null && intentionCustomerDTOs.Count > 0) + { + return intentionCustomerDTOs; + } var listPosition = _context.IntentionCustomers.Where(r => r.RecStatus == "A").ToList(); + intentionCustomerDTOs = _mapper.Map<List<IntentionCustomerDTO>>(listPosition); + CacheHelperNetCore.CacheInsert("intentionCustomerDTOs", intentionCustomerDTOs); + var list = _mapper.Map<List<IntentionCustomerDTO>>(listPosition); return list; } -- Gitblit v1.9.1