From 5421f9a6e5e2b28cc32aa8aa6dec9becd0c1eb3c Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期三, 04 一月 2023 10:19:57 +0800 Subject: [PATCH] 业务经理意向和合作客户只能1000,90天意向不转合作就制空业务经理,查询没有业务经理的档案客户和合作客户 --- zhengcaioa/Services/CooperVisitService.cs | 72 ++++++++++++++++++++++++++++------- 1 files changed, 57 insertions(+), 15 deletions(-) diff --git a/zhengcaioa/Services/CooperVisitService.cs b/zhengcaioa/Services/CooperVisitService.cs index 6ecfc8c..d5c2448 100644 --- a/zhengcaioa/Services/CooperVisitService.cs +++ b/zhengcaioa/Services/CooperVisitService.cs @@ -130,22 +130,41 @@ var query = (from a in _context.CooperVisits join b in listCode.Where(x => x.CodeTable == "CooperVisit" && x.CodeField == "visType") - on a.VisType equals b.CodeSn + on a.VisType equals b.CodeSn + into bzsssss + from bzzzzz in bzsssss.DefaultIfEmpty() + join c in listCode.Where(x => x.CodeTable == "CooperVisit" && x.CodeField == "jtype") on a.Jtype equals c.CodeSn + into czsssss + from czzzzz in czsssss.DefaultIfEmpty() + join d in listCode.Where(x => x.CodeTable == "CooperVisit" && x.CodeField == "zw") on a.Zw equals d.CodeSn + into dzsssss + from dzzzzz in dzsssss.DefaultIfEmpty() + join e in listCode.Where(x => x.CodeTable == "CooperVisit" && x.CodeField == "yx") on a.Yx equals e.CodeSn + into ezsssss + from ezzzzz in ezsssss.DefaultIfEmpty() + join f in listCode.Where(x => x.CodeTable == "CooperVisit" && x.CodeField == "jy") on a.Jy equals f.CodeSn - join zz in _context.CooperatecustomCustomers.Where(x => x.RecStatus == "A") + into fzsssss + from fzzzzz in fzsssss.DefaultIfEmpty() + + join zz in _context.CooperatecustomCustomers on a.Viscustomer equals zz.Id - join g in _context.Areas on zz.Sheng equals g.CodeId - join h in _context.Areas on zz.City equals h.CodeId - join i in _context.Areas on zz.AreaId equals i.CodeId + //join g in _context.Areas on zz.Sheng equals g.CodeId + //join h in _context.Areas on zz.City equals h.CodeId + //join i in _context.Areas on zz.AreaId equals i.CodeId + join zzz in _context.PltUsers.Where(x => x.RecStatus == "A") + on a.Creater equals zzz.Id + into zsssss + from zzzzz in zsssss.DefaultIfEmpty() where a.RecStatus == "A" @@ -158,7 +177,7 @@ && (string.IsNullOrWhiteSpace(searchEntity.Sheng) || zz.Sheng == searchEntity.Sheng.Trim()) && (string.IsNullOrWhiteSpace(searchEntity.City) || zz.City == searchEntity.City.Trim()) && (string.IsNullOrWhiteSpace(searchEntity.AreaId) || zz.AreaId == searchEntity.AreaId.Trim()) - + && (string.IsNullOrWhiteSpace(searchEntity.Viscustomer) || a.Viscustomer == searchEntity.Viscustomer.Trim()) select new CooperVisitDTO { Id = a.Id, @@ -168,12 +187,12 @@ Name = zz.Name, Jtype = a.Jtype, Jdr = a.Jdr, - ShengName = g.Name + "-" + h.Name + "-" + i.Name, - VisTypeName = b.Comments, - JtypeName = c.Comments, - ZwName = d.Comments, - YxName = e.Comments, - JyName = f.Comments, + //ShengName = g.Name + "-" + h.Name + "-" + i.Name, + VisTypeName = bzzzzz.Comments, + JtypeName = czzzzz.Comments, + ZwName = dzzzzz.Comments, + YxName = ezzzzz.Comments, + JyName = fzzzzz.Comments, Zw = a.Zw, Talk = a.Talk, Khfk = a.Khfk, @@ -182,7 +201,7 @@ Jy = a.Jy, Creater = a.Creater, Createtime = a.Createtime, - + CreaterName = zzzzz.UserName, RecStatus = a.RecStatus, Modifier = a.Modifier, Modifytime = a.Modifytime, @@ -192,7 +211,7 @@ - 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); @@ -231,7 +250,7 @@ /// 鑾峰彇鎵�鏈夋湁鏁堝悎浣滃鎴� /// </summary> /// <returns></returns> - public List<CooperatecustomCustomerDTO> GetList(string[] id) + public List<CooperatecustomCustomerDTO> GetList(string[] id=null) { List<CooperatecustomCustomerDTO> result = new List<CooperatecustomCustomerDTO>(); if (id != null) @@ -242,6 +261,29 @@ result = _mapper.Map<List<CooperatecustomCustomerDTO>>(listCooperatecustomCustomers); } + else + { + var listCooperatecustomCustomers = _context.CooperatecustomCustomers.ToList(); + + result = _mapper.Map<List<CooperatecustomCustomerDTO>>(listCooperatecustomCustomers); + } + + + + + return result; + } + + public List<CooperVisitDTO> GetListsalary(string userid, DateTime datemin, DateTime datemax) + { + + + // var listCooperVisits = _context.CooperVisits.Where(r => id.Contains(r.Id) && r.RecStatus == "A").Select(x => x.Viscustomer).ToList(); + + var listCooperatecustomCustomers = _context.CooperVisits.Where(r => r.RecStatus == "A"&& r.Creater == userid && r.Vistime >= datemin && r.Vistime < datemax).ToList(); + + var result = _mapper.Map<List<CooperVisitDTO>>(listCooperatecustomCustomers); + -- Gitblit v1.9.1