| | |
| | | { |
| | | entity.Id = Guid.NewGuid().ToString(); |
| | | dto.Id = entity.Id; |
| | | if (string.IsNullOrWhiteSpace(dto.OrderId)) |
| | | { |
| | | entity.OrderId = dto.Id; |
| | | } |
| | | _context.OrderBanciOrders.Add(entity); |
| | | |
| | | if (!string.IsNullOrEmpty(dto.SeatID)) |
| | | { |
| | | var orderBanciZuowei = _context.OrderBanciZuoweis.Where(x => x.RecStatus == "A" && x.BanciId == dto.BanciId && x.ZuoweiId == dto.SeatID).FirstOrDefault(); |
| | | if (orderBanciZuowei != null) |
| | | { |
| | | orderBanciZuowei.Status = "1"; |
| | | orderBanciZuowei.Modifier = dto.Creater; |
| | | orderBanciZuowei.Modifytime = dto.Createtime; |
| | | } |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | updateproject.Modifier = entity.Modifier; |
| | | updateproject.Modifytime = entity.Modifytime; |
| | | updateproject.Shenfenzheng = entity.Shenfenzheng; |
| | | updateproject.Jifen = entity.Jifen; |
| | | updateproject.OrderId = entity.OrderId; |
| | | updateproject.SeatID = entity.SeatID; |
| | | updateproject.SeatName = entity.SeatName; |
| | | } |
| | | |
| | | _context.SaveChanges(); |
| | |
| | | |
| | | && (string.IsNullOrWhiteSpace(searchEntity.BanciId) || a.BanciId == searchEntity.BanciId.Trim()) |
| | | |
| | | && (string.IsNullOrWhiteSpace(searchEntity.Quyu) || a.Shenfenzheng.Contains(searchEntity.Quyu.Trim())) |
| | | |
| | | && ((searchEntity.Kechengleixings==null|| searchEntity.Kechengleixings.Length == 0) || searchEntity.Kechengleixings.Split(new char[] { ',' }).Contains(a.KechengleixingId)) |
| | | |
| | | |
| | | |
| | |
| | | Id = a.Id, |
| | | |
| | | Baomingtime = a.Baomingtime, |
| | | BaomingtimeName = a.Baomingtime.ToString("yyyy-MM-dd"), |
| | | BaomingtimeName = a.Baomingtime.ToString("yyyy-MM-dd HH:mm"), |
| | | BanciId = a.BanciId, |
| | | Peixunbanci = a.Peixunbanci, |
| | | |
| | |
| | | Xuefei = a.Xuefei??0, |
| | | Baomingrenshu = a.Baomingrenshu??0, |
| | | Jine = a.Jine??0, |
| | | |
| | | |
| | | Jifen = a.Jifen ?? 0, |
| | | SeatID = a.SeatID, |
| | | SeatName = a.SeatName, |
| | | Creater = a.Creater, |
| | | Createtime = a.Createtime, |
| | | |
| | |
| | | |
| | | |
| | | |
| | | if (searchEntity.totalrows == 0) |
| | | //if (searchEntity.totalrows == 0) |
| | | searchEntity.totalrows = query.Count(); |
| | | data.Heji1 = Math.Round(query.Sum(x => x.Xuefei) ?? 0, 2); |
| | | data.Heji2 = Math.Round(new decimal(query.Sum(x => x.Baomingrenshu) ?? 0), 2); |
| | | |
| | | var lianlist = query.Skip((searchEntity.page - 1) * searchEntity.rows).Take(searchEntity.rows).ToList(); |
| | | data.DangyeHeji1 = Math.Round(lianlist.Sum(x => x.Xuefei) ?? 0, 2); |
| | | data.DangyeHeji2 = Math.Round(new decimal(lianlist.Sum(x => x.Baomingrenshu) ?? 0), 2); |
| | | data.LoadData(searchEntity, lianlist); |
| | | return data; |
| | | } |
| | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 修改主表状态 |
| | | /// </summary> |
| | | /// <param name="id">主id</param> |
| | | /// <param name="userid">用户</param> |
| | | /// <returns></returns> |
| | | public ResultEntity DeleteStatus(string OrderId) |
| | | { |
| | | ResultEntity result = new ResultEntity(); |
| | | result.Result = true; |
| | | |
| | | if (string.IsNullOrEmpty(OrderId)) |
| | | { |
| | | result.Result = false; |
| | | result.Message = "必须填写订单id"; |
| | | } |
| | | var model = _context.OrderBanciOrders.Where(x=>x.OrderId == OrderId).FirstOrDefault(); |
| | | if (model != null) |
| | | { |
| | | model.RecStatus = "D"; |
| | | model.Modifier = "1"; |
| | | model.Modifytime = DateTime.Now; |
| | | |
| | | if (!string.IsNullOrEmpty(model.SeatID)) |
| | | { |
| | | var orderBanciZuowei = _context.OrderBanciZuoweis.Where(x => x.RecStatus == "A" && x.BanciId == model.BanciId && x.ZuoweiId == model.SeatID).FirstOrDefault(); |
| | | if (orderBanciZuowei != null) |
| | | { |
| | | orderBanciZuowei.Status = "0"; |
| | | orderBanciZuowei.Modifier = model.Modifier; |
| | | orderBanciZuowei.Modifytime = model.Modifytime; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | _context.SaveChanges(); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | } |
| | | } |