| | |
| | | |
| | | |
| | | 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); |
| | |
| | | |
| | | public List<ExpertDTO> GetList() |
| | | { |
| | | var listExperts = _context.Experts.Where(e => e.RecStatus == "A").ToList(); |
| | | var listExperts = _context.Experts.Where(e => e.RecStatus == "A" && e.ShenheStatus == "A").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; |
| | | } |
| | | } |
| | | } |