| | |
| | | updateplExpert.CertiBack = expert.CertiBack; |
| | | updateplExpert.TitileCerti = expert.TitileCerti; |
| | | updateplExpert.Remark = expert.Remark; |
| | | updateplExpert.TitileCerti1 = expert.TitileCerti1; |
| | | updateplExpert.TitileCerti2 = expert.TitileCerti2; |
| | | updateplExpert.TitileCerti3 = expert.TitileCerti3; |
| | | updateplExpert.TitileCerti4 = expert.TitileCerti4; |
| | | updateplExpert.TitileCerti5 = expert.TitileCerti5; |
| | | updateplExpert.TitileCerti6 = expert.TitileCerti6; |
| | | updateplExpert.TitileCerti7 = expert.TitileCerti7; |
| | | updateplExpert.TitileCerti8 = expert.TitileCerti8; |
| | | updateplExpert.TitileCerti9 = expert.TitileCerti9; |
| | | updateplExpert.TitileCerti10 = expert.TitileCerti10; |
| | | updateplExpert.ShenheStatus = expert.ShenheStatus; |
| | | } |
| | | |
| | | _context.SaveChanges(); |
| | |
| | | |
| | | public ResultDataEntity<ExpertDTO> SearchByPaging(ExpertDTOSearch searchEntity) |
| | | { |
| | | |
| | | |
| | | var listCode = (from a in _context.SysCodeDtls |
| | | join b in _context.SysCodes |
| | | on a.CodeId equals b.Id |
| | | where a.RecStatus == "A" |
| | | && b.RecStatus == "A" |
| | | select new CodeDataEntity() |
| | | { |
| | | CodeId = b.Id, |
| | | CodeTable = b.CodeTable, |
| | | CodeField = b.CodeField, |
| | | CodeSn = a.CodeSn, |
| | | Comments = a.Comments, |
| | | Contents = a.Contents, |
| | | RecStatus = a.RecStatus, |
| | | Sort = a.Sort |
| | | } |
| | | ); |
| | | |
| | | ResultDataEntity<ExpertDTO> data = new ResultDataEntity<ExpertDTO>(); |
| | | List<ExpertDTO> list = new List<ExpertDTO>(); |
| | | //筛选 |
| | |
| | | { |
| | | ExpertId = q.Key.ExpertId, |
| | | JoinCount = q.Count(), |
| | | } |
| | | ) |
| | | }) |
| | | |
| | | |
| | | on a.Id equals h.ExpertId |
| | | into hsss |
| | | from hhh in hsss.DefaultIfEmpty() |
| | | |
| | | |
| | | join c in listCode.Where(x => x.CodeTable == "experts" && x.CodeField == "level") |
| | | on a.Level equals c.CodeSn |
| | | into csss |
| | | from ccc in csss.DefaultIfEmpty() |
| | | |
| | | join m in _context.PltUsers |
| | | on a.Creater equals m.Id |
| | | into msssss |
| | | from mmm in msssss.DefaultIfEmpty() |
| | | |
| | | |
| | | join n in _context.Areas |
| | | on a.Province equals n.CodeId |
| | | into nsssss |
| | | from nnn in nsssss.DefaultIfEmpty() |
| | | |
| | | join o in _context.Areas |
| | | on a.City equals o.CodeId |
| | | into osssss |
| | | from ooo in osssss.DefaultIfEmpty() |
| | | |
| | | |
| | | where a.RecStatus == "A" |
| | | && (searchEntity.JoinCount<=0 || hhh.JoinCount >= searchEntity.JoinCount) |
| | | select a).ToList(); |
| | | select new ExpertDTO |
| | | { |
| | | Id = a.Id, |
| | | Name = a.Name, |
| | | Sex = a.Sex, |
| | | InfoSource = a.InfoSource, |
| | | IdCard = a.IdCard, |
| | | Province = a.Province, |
| | | AreaId = a.AreaId, |
| | | City = a.City, |
| | | |
| | | Address = a.Address, |
| | | Postal = a.Postal, |
| | | ExpertType = a.ExpertType, |
| | | |
| | | Level = a.Level, |
| | | LevelName = ccc.Comments, |
| | | Phone1 = a.Phone1, |
| | | Phone2 = a.Phone2, |
| | | Qq = a.Qq, |
| | | |
| | | Remark = a.Remark, |
| | | |
| | | Creater = a.Creater, |
| | | CreaterName = mmm.UserName, |
| | | Createtime = a.Createtime, |
| | | |
| | | RecStatus = a.RecStatus, |
| | | Modifier = a.Modifier, |
| | | Modifytime = a.Modifytime, |
| | | |
| | | Wechat = a.Wechat, |
| | | ReviewItem = a.ReviewItem, |
| | | CertiNumber = a.CertiNumber, |
| | | CertiFont = a.CertiFont, |
| | | CertiBack = a.CertiBack, |
| | | TitileCerti = a.TitileCerti, |
| | | |
| | | Sort = a.Sort, |
| | | ShenheStatus = a.ShenheStatus, |
| | | |
| | | AreaName = nnn.Name + "-" + ooo.Name, |
| | | |
| | | |
| | | }).ToList(); |
| | | |
| | | if (!string.IsNullOrEmpty(searchEntity.Name)) |
| | | { |
| | | query = query.Where(m => m.Name.Contains(searchEntity.Name)).ToList(); |
| | | } |
| | | if (!string.IsNullOrEmpty(searchEntity.ShenheStatus)) |
| | | { |
| | | query = query.Where(m => m.ShenheStatus == searchEntity.ShenheStatus).ToList(); |
| | | } |
| | | if (!string.IsNullOrEmpty(searchEntity.ExpertType)) |
| | | { |
| | |
| | | { |
| | | query = query.Where(m => m.Phone1.Contains(searchEntity.Phone1)).ToList(); |
| | | } |
| | | |
| | | if (!string.IsNullOrEmpty(searchEntity.Creater)) |
| | | { |
| | | query = query.Where(m => m.Creater == searchEntity.Creater).ToList(); |
| | | } |
| | | |
| | | |
| | | query = query.OrderByDescending(x => x.Modifytime).ToList(); |
| | | if (searchEntity.totalrows == 0) |
| | | //if (searchEntity.totalrows == 0) |
| | | searchEntity.totalrows = query.Count(); |
| | | var expertlist = query.Skip((searchEntity.page - 1) * searchEntity.rows).Take(searchEntity.rows).ToList(); |
| | | list = _mapper.Map<List<ExpertDTO>>(expertlist); |
| | | //list = _mapper.Map<List<ExpertDTO>>(expertlist); |
| | | |
| | | data.LoadData(searchEntity, list); |
| | | data.LoadData(searchEntity, expertlist); |
| | | return data; |
| | | |
| | | } |
| | |
| | | return result; |
| | | } |
| | | |
| | | public List<ExpertDTO> GetList() |
| | | public List<ExpertDTO> GetList(string[] id = null) |
| | | { |
| | | var listExperts = _context.Experts.Where(e => e.RecStatus == "A").ToList(); |
| | | var listExperts = _context.Experts.Where(e => e.RecStatus == "A" && e.ShenheStatus == "A").ToList(); |
| | | |
| | | if (id != null) |
| | | { |
| | | |
| | | listExperts = listExperts.Where(r => id.Contains(r.Id)).ToList(); |
| | | } |
| | | |
| | | |
| | | var list = _mapper.Map<List<ExpertDTO>>(listExperts); |
| | | return list; |
| | | } |
| | |
| | | query = query.Where(m => m.Creater.Contains(searchEntity.Creater)).ToList(); |
| | | } |
| | | query = query.OrderByDescending(x => x.Modifytime).ToList(); |
| | | if (searchEntity.totalrows == 0) |
| | | //if (searchEntity.totalrows == 0) |
| | | searchEntity.totalrows = query.Count(); |
| | | var expertlist = query.Skip((searchEntity.page - 1) * searchEntity.rows).Take(searchEntity.rows).ToList(); |
| | | list = _mapper.Map<List<ExpertPromoteDTO>>(expertlist); |
| | |
| | | && (string.IsNullOrWhiteSpace(searchEntity.OrderNo) || a.OrderNo.Contains(searchEntity.OrderNo.Trim())) |
| | | && (string.IsNullOrWhiteSpace(searchEntity.KhdwName) || ggg.Name.Contains(searchEntity.KhdwName.Trim())) |
| | | && (string.IsNullOrWhiteSpace(searchEntity.Khlx) || ggg.Khlx == searchEntity.Khlx.Trim()) |
| | | && (string.IsNullOrWhiteSpace(searchEntity.isDispatch) || (searchEntity.isDispatch == "1" && hod.Id!=null) || (searchEntity.isDispatch == "0" && hod.Id == null) ) |
| | | && (string.IsNullOrWhiteSpace(searchEntity.ExpertId) || hod.ExpertId == searchEntity.ExpertId.Trim()) |
| | | |
| | | |
| | | // && (string.IsNullOrWhiteSpace(searchEntity.HuifangStatus) || a.HuifangStatus.Contains(searchEntity.HuifangStatus.Trim())) |
| | | // && (string.IsNullOrWhiteSpace(searchEntity.PingjiaStatus) || a.PingjiaStatus.Contains(searchEntity.PingjiaStatus.Trim())) |
| | | |
| | |
| | | |
| | | |
| | | |
| | | 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); |
| | |
| | | if (string.IsNullOrEmpty(dispatch.Id)) |
| | | { |
| | | dispatch.Id = Guid.NewGuid().ToString(); |
| | | dipatchDTO.Id = dispatch.Id; |
| | | _context.ExpertOrderDispatches.Add(dispatch); |
| | | } |
| | | else |
| | | { |
| | | var model = _context.ExpertOrderDispatches.Find(dispatch.Id); |
| | | model.Orderid = dipatchDTO.OrderId; |
| | | model.ExpertId = dipatchDTO.ExpertId; |
| | | model.Money = dipatchDTO.Money; |
| | | model.RecStatus = dipatchDTO.RecStatus; |
| | | model.Modifier = dipatchDTO.Modifier; |
| | | model.Modifytime = dipatchDTO.Modifytime.Value; |
| | | model.Sort = dipatchDTO.sort; |
| | | } |
| | | _context.SaveChanges(); |
| | | resultEntity.ReturnID = dispatch.Id; |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region 专家结算 |
| | | /// <summary> |
| | | /// 查询专家结算 |
| | | /// </summary> |
| | | /// <param name="searchEntity"></param> |
| | | /// <returns></returns> |
| | | public ResultDataEntity<ExpertOrderDipatchDTO> SearchJiesuan(ExpertOrderDipatchDTOSearch searchEntity) |
| | | { |
| | | ResultDataEntity<ExpertOrderDipatchDTO> data = new ResultDataEntity<ExpertOrderDipatchDTO>(); |
| | | List<ExpertOrderDipatchDTO> list = new List<ExpertOrderDipatchDTO>(); |
| | | |
| | | var listCode = (from a in _context.SysCodeDtls |
| | | join b in _context.SysCodes |
| | | on a.CodeId equals b.Id |
| | | where a.RecStatus == "A" |
| | | && b.RecStatus == "A" |
| | | select new CodeDataEntity() |
| | | { |
| | | CodeId = b.Id, |
| | | CodeTable = b.CodeTable, |
| | | CodeField = b.CodeField, |
| | | CodeSn = a.CodeSn, |
| | | Comments = a.Comments, |
| | | Contents = a.Contents, |
| | | RecStatus = a.RecStatus, |
| | | Sort = a.Sort |
| | | } |
| | | ); |
| | | DateTime PdTimestart = DateTime.Now; |
| | | DateTime PdTimeend = DateTime.Now; |
| | | if (!string.IsNullOrWhiteSpace(searchEntity.PdTime)) |
| | | { |
| | | string[] PdTimes = searchEntity.PdTime.Split("|"); |
| | | DateTime.TryParse(PdTimes[0], out PdTimestart); |
| | | DateTime.TryParse(PdTimes[1], out PdTimeend); |
| | | PdTimeend = PdTimeend.AddDays(1); |
| | | } |
| | | |
| | | var query = (from hod in _context.ExpertOrderDispatches.Where(x => x.RecStatus == "A") |
| | | |
| | | |
| | | |
| | | |
| | | join a in _context.CooperOrders on hod.Orderid equals a.Id |
| | | |
| | | join b in listCode.Where(x => x.CodeTable == "CooperOrder" && x.CodeField == "shouli_status") |
| | | on a.ShouliStatus equals b.CodeSn |
| | | into bsss |
| | | from bbb in bsss.DefaultIfEmpty() |
| | | |
| | | join f in listCode.Where(x => x.CodeTable == "CooperVisit" && x.CodeField == "jtype") |
| | | on a.OrderType equals f.CodeSn |
| | | into fsssss |
| | | from fff in fsssss.DefaultIfEmpty() |
| | | |
| | | |
| | | join k in listCode.Where(x => x.CodeTable == "system" && x.CodeField == "shifou") |
| | | on hod.Sort equals k.CodeSn |
| | | into ksssss |
| | | from kkk in ksssss.DefaultIfEmpty() |
| | | |
| | | |
| | | join ggg in _context.CooperatecustomCustomers |
| | | on a.Khdw equals ggg.Id |
| | | |
| | | |
| | | |
| | | |
| | | join expt in _context.Experts |
| | | on hod.ExpertId equals expt.Id |
| | | |
| | | |
| | | |
| | | where a.RecStatus == "A" |
| | | && (string.IsNullOrWhiteSpace(searchEntity.PdTime) || (hod.Createtime >= PdTimestart && hod.Createtime <= PdTimeend)) |
| | | && (string.IsNullOrWhiteSpace(searchEntity.ExpertId) || hod.ExpertId == searchEntity.ExpertId.Trim()) |
| | | && (string.IsNullOrWhiteSpace(searchEntity.OrderNo) || a.OrderNo.Contains(searchEntity.OrderNo.Trim())) |
| | | |
| | | && (string.IsNullOrWhiteSpace(searchEntity.Sort) || hod.Sort == searchEntity.Sort.Trim()) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | select new ExpertOrderDipatchDTO |
| | | { |
| | | Id = hod.Id, |
| | | XdTime = a.XdTime, |
| | | XdTimeName = a.XdTime.ToString("yyyy-MM-dd"), |
| | | OrderId = a.Id, |
| | | OrderNo = a.OrderNo, |
| | | Khdw = a.Khdw, |
| | | KhdwName = ggg.Name, |
| | | OrderType = a.OrderType, |
| | | OrderTypeName = fff.Comments, |
| | | |
| | | //OrderPro = a.OrderPro, |
| | | //OrderProName = hhh.Name, |
| | | //OrderNum = a.OrderNum, |
| | | |
| | | Shr = a.Shr, |
| | | ShrAddress = a.ShrAddress, |
| | | ShrTel = a.ShrTel, |
| | | Money = hod.Money, |
| | | Creater = hod.Creater, |
| | | Createtime = hod.Createtime, |
| | | CreatetimeName = hod.Createtime.ToString("yyyy-MM-dd"), |
| | | ExpertId = hod.ExpertId, |
| | | ExpertName = expt.Name, |
| | | RecStatus = hod.RecStatus, |
| | | Modifier = hod.Modifier, |
| | | Modifytime = hod.Modifytime, |
| | | sort = kkk.Comments, |
| | | |
| | | } |
| | | ).OrderByDescending(x => x.XdTime).ToList(); |
| | | |
| | | |
| | | |
| | | //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); |
| | | return data; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | |
| | | public ExpertOrderDipatchDTO GetDispatch(string id) |
| | | { |
| | | var entity = _context.ExpertOrderDispatches.Find(id); |
| | | if (entity.RecStatus != "A") |
| | | { |
| | | entity = new ExpertOrderDispatch(); |
| | | } |
| | | var exDTO = _mapper.Map<ExpertOrderDipatchDTO>(entity); |
| | | return exDTO; |
| | | } |
| | | } |
| | | } |