| | |
| | | public List<TChallengeletterDTO> GetListChallengeletter(string OrderId) |
| | | { |
| | | |
| | | var entity = _context.TChallengeletters.Where(x => x.Status == 1 && x.OrderId == OrderId).ToList(); |
| | | var entity = _context.TChallengeletters.Where(x =>/* x.Status == 1 && */x.OrderId == OrderId).ToList(); |
| | | |
| | | |
| | | |
| | |
| | | public List<TComplaintletterDTO> GetListComplaintletter(string OrderId) |
| | | { |
| | | |
| | | var entity = _context.TComplaintletters.Where(x => x.Status == 1 && x.OrderId == OrderId).ToList(); |
| | | var entity = _context.TComplaintletters.Where(x => /*x.Status == 1 &&*/ x.OrderId == OrderId).ToList(); |
| | | |
| | | |
| | | |
| | |
| | | _context.SaveChanges(); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | |
| | | public ResultDataEntity<CooperOrderDTO> SearchByPagingWenshu(CooperOrderDTOSearch searchEntity) |
| | | { |
| | | |
| | | |
| | | |
| | | ResultDataEntity<CooperOrderDTO> data = new ResultDataEntity<CooperOrderDTO>(); |
| | | List<CooperOrderDTO> list = new List<CooperOrderDTO>(); |
| | | |
| | | |
| | | |
| | | |
| | | 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 XdTimestart = DateTime.Now; |
| | | DateTime XdTimeend = DateTime.Now; |
| | | if (!string.IsNullOrWhiteSpace(searchEntity.XdTime)) |
| | | { |
| | | string[] XdTimes = searchEntity.XdTime.Split("|"); |
| | | DateTime.TryParse(XdTimes[0], out XdTimestart); |
| | | DateTime.TryParse(XdTimes[1], out XdTimeend); |
| | | XdTimeend = XdTimeend.AddDays(1); |
| | | } |
| | | |
| | | |
| | | var query2 = (from a in _context.CooperOrders |
| | | |
| | | join b in _context.TChallengeletters |
| | | on a.Id equals b.OrderId |
| | | |
| | | |
| | | |
| | | join g in _context.CooperatecustomCustomers.Where(x => x.RecStatus == "A") |
| | | on a.Khdw equals g.Id |
| | | into gsss |
| | | from ggg in gsss.DefaultIfEmpty() |
| | | |
| | | join l in _context.FiOrderrecievemoneys.Where(x => x.RecStatus == "A").GroupBy(q => new { q.OrderId }).Select(q => new |
| | | { |
| | | OrderId = q.Key.OrderId, |
| | | YishouMoney = q.Sum(x => x.Recievemoney), |
| | | } |
| | | ) |
| | | on a.Id equals l.OrderId |
| | | into lsss |
| | | from lll in lsss.DefaultIfEmpty() |
| | | |
| | | where a.RecStatus == "A" && a.OrderType1 == "代拟质疑函" |
| | | && (string.IsNullOrWhiteSpace(searchEntity.XdTime) || (b.Createtime >= XdTimestart && b.Createtime <= XdTimeend)) |
| | | && (string.IsNullOrWhiteSpace(searchEntity.Wenshuleixing) || a.OrderType1 == searchEntity.Wenshuleixing.Trim()) |
| | | && (string.IsNullOrWhiteSpace(searchEntity.XmName) || b.XmName.Contains(searchEntity.XmName.Trim())) |
| | | && (string.IsNullOrWhiteSpace(searchEntity.XmCode) || b.XmCode.Contains(searchEntity.XmCode.Trim())) |
| | | && (string.IsNullOrWhiteSpace(searchEntity.PurchaserName) || b.PurchaserName.Contains(searchEntity.PurchaserName.Trim())) |
| | | //&& (string.IsNullOrWhiteSpace(searchEntity.Agency) || b.Agency.Contains(searchEntity.Agency.Trim())) |
| | | && (string.IsNullOrWhiteSpace(searchEntity.KhdwName) || ggg.Name.Contains(searchEntity.KhdwName.Trim())) |
| | | && (searchEntity.Status <= 0 || b.Status == searchEntity.Status) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | select new CooperOrderDTO |
| | | { |
| | | Id = a.Id, |
| | | |
| | | XmCode = b.XmCode, |
| | | XmName = b.XmName, |
| | | PurchaserName = b.PurchaserName, |
| | | Agency = "", |
| | | KhdwName = ggg.Name, |
| | | XdTime = a.Createtime, |
| | | XdTimeName = a.Createtime.ToString("yyyy-MM-dd"), |
| | | YishouMoney = lll.YishouMoney ?? 0, |
| | | WeishouMoney = (a.Money ?? 0) /*- (a.Youhui ?? 0)*/ - (lll.YishouMoney ?? 0), |
| | | OrderType1 = a.OrderType1, |
| | | } |
| | | ).ToList(); |
| | | |
| | | |
| | | var query1 =(from a in _context.CooperOrders |
| | | join b in _context.TComplaintletters.Where(x => x.Status == 1) |
| | | on a.Id equals b.OrderId |
| | | |
| | | |
| | | join g in _context.CooperatecustomCustomers.Where(x => x.RecStatus == "A") |
| | | on a.Khdw equals g.Id |
| | | into gsss |
| | | from ggg in gsss.DefaultIfEmpty() |
| | | |
| | | join l in _context.FiOrderrecievemoneys.Where(x => x.RecStatus == "A").GroupBy(q => new { q.OrderId }).Select(q => new |
| | | { |
| | | OrderId = q.Key.OrderId, |
| | | YishouMoney = q.Sum(x => x.Recievemoney), |
| | | } |
| | | ) |
| | | on a.Id equals l.OrderId |
| | | into lsss |
| | | from lll in lsss.DefaultIfEmpty() |
| | | |
| | | where a.RecStatus == "A" && a.OrderType1 == "代拟投诉书" |
| | | && (string.IsNullOrWhiteSpace(searchEntity.XdTime) || (b.Createtime >= XdTimestart && b.Createtime <= XdTimeend)) |
| | | && (string.IsNullOrWhiteSpace(searchEntity.Wenshuleixing) || a.OrderType1 == searchEntity.Wenshuleixing.Trim()) |
| | | && (string.IsNullOrWhiteSpace(searchEntity.XmCode) || b.XmCode.Contains(searchEntity.XmCode.Trim())) |
| | | && (string.IsNullOrWhiteSpace(searchEntity.XmName) || b.XmName.Contains(searchEntity.XmName.Trim())) |
| | | && (string.IsNullOrWhiteSpace(searchEntity.PurchaserName) || b.PurchaserName.Contains(searchEntity.PurchaserName.Trim())) |
| | | && (string.IsNullOrWhiteSpace(searchEntity.Agency) || b.Agency.Contains(searchEntity.Agency.Trim())) |
| | | && (string.IsNullOrWhiteSpace(searchEntity.KhdwName) || ggg.Name.Contains(searchEntity.KhdwName.Trim())) |
| | | && (searchEntity.Status <= 0 || b.Status == searchEntity.Status) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | select new CooperOrderDTO |
| | | { |
| | | Id = a.Id, |
| | | |
| | | XmCode = b.XmCode, |
| | | XmName = b.XmName, |
| | | PurchaserName = b.PurchaserName, |
| | | Agency = b.Agency, |
| | | KhdwName = ggg.Name, |
| | | XdTime = b.Createtime.Value, |
| | | XdTimeName = b.Createtime.Value.ToString("yyyy-MM-dd"), |
| | | YishouMoney = lll.YishouMoney ?? 0, |
| | | WeishouMoney = (a.Money ?? 0) /*- (a.Youhui ?? 0)*/ - (lll.YishouMoney ?? 0), |
| | | OrderType1 = a.OrderType1, |
| | | } |
| | | ).ToList(); |
| | | |
| | | query2.AddRange(query1); |
| | | var query = query2.Where(x => x.WeishouMoney <= 0).OrderByDescending(x => x.Createtime).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; |
| | | } |
| | | } |
| | | } |