123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.DataLogic.Common.TeachingMaterial;
- using EMIS.ViewModel.TeachingMaterial;
- using Bowin.Common.Linq.Entity;
- using EMIS.ViewModel;
- namespace EMIS.CommonLogic.TeachingMaterial
- {
- public class StockInDetailServices : BaseServices, IStockInDetailServices
- {
- public StockInDetailDAL StockInDetailDAL { get; set; }
- /// <summary>
- /// 加载列表项数据
- /// </summary>
- public IGridResultSet<StockInView> GetStockInDetailViewGrid(ViewModel.ConfiguretView configuretView, Guid? schoolyearID, Guid? supplierID, Guid? teachingMaterialID, int pageIndex, int pageSize)
- {
- var query = StockInDetailDAL.GetStockInDetailGridView(x => true);
- if (schoolyearID.HasValue)
- query = query.Where(x => x.SchoolyearID == schoolyearID);
- if (supplierID.HasValue)
- query = query.Where(x => x.SupplierID == supplierID);
- if (teachingMaterialID.HasValue)
- query = query.Where(x => x.TeachingMaterialPoolID == teachingMaterialID);
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- return query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue).OrderBy(x => x.TeachingMaterialCode.Length).ThenBy(x => x.TeachingMaterialCode).ToGridResultSet<StockInView>(pageIndex, pageSize);
- return query.OrderBy(x => x.TeachingMaterialCode).ToGridResultSet<StockInView>(pageIndex, pageSize);
- }
- /// <summary>
- /// Excel导出
- /// </summary>
- public IList<StockInView> GetStockInDetailViewList(ViewModel.ConfiguretView configuretView, Guid? stockId)
- {
- var query = StockInDetailDAL.GetStockInDetailGridView(x => x.StockInID == stockId);
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- return query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue).OrderBy(x => x.TeachingMaterialCode.Length).ThenBy(x => x.TeachingMaterialCode).ToList();
- return query.OrderBy(x => x.TeachingMaterialCode.Length).ThenBy(x => x.TeachingMaterialCode).ToList();
- }
- /// <summary>
- /// 删除明细数据
- /// </summary>
- /// <param name="stockInDetailIDs"></param>
- public void Delete(List<Guid> stockInDetailIDs)
- {
- StockInDetailDAL.Delete(stockInDetailIDs);
- }
- public IList<StockInView> GetStockInDetailByStockInViewGrid(Guid? stockIn){
- return StockInDetailDAL.GetStockInDetailGridView(x => x.StockInID == stockIn).OrderBy(x => x.TeachingMaterialCode.Length).ThenBy(x => x.TeachingMaterialCode).ToList();
- }
- public IGridResultSet<StockInView> GetStockInDetailViewGrid(Guid? stockIn, int pageIndex, int pageSize)
- {
- var query = StockInDetailDAL.GetStockInDetailGridView(x => x.StockInID == stockIn);
- return query.OrderBy(x => x.TeachingMaterialCode.Length).ThenBy(x=>x.TeachingMaterialCode).ToGridResultSet<StockInView>(pageIndex, pageSize);
- }
- public IList<StockInView> GetStockInDetailViewList(ViewModel.ConfiguretView configuretView, Guid? schoolyearID, Guid? supplierID, DateTime? stockInDJTimeStart, DateTime? stockInDJTimeEnd)
- {
- var query = StockInDetailDAL.GetStockInDetailGridView(x => true);
- if (schoolyearID.HasValue)
- query = query.Where(x => x.SchoolyearID == schoolyearID);
- if (supplierID.HasValue)
- query = query.Where(x => x.SupplierID == supplierID);
- //if (stockInDJTimeStart.HasValue)
- // query = query.Where(x => x.StockInDJTime >= stockInDJTimeStart);
- //if (stockInDJTimeEnd.HasValue)
- // query = query.Where(x => x.StockInDJTime <= stockInDJTimeEnd);
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- return query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue).OrderBy(x => x.StockInTime).ToList();
- return query.OrderBy(x => x.TeachingMaterialCode.Length).ThenBy(x => x.TeachingMaterialCode).ToList();
- }
- public IGridResultSet<StockInView> GetStockInStatisticsViewGrid(ViewModel.ConfiguretView configuretView, Guid? schoolyearID, Guid? supplierID, Guid? teachingMaterialID, int pageIndex, int pageSize)
- {
- var query = StockInDetailDAL.GetStockInStatisticsGridView(x => x.RecordStatus == (int)CF_GeneralPurpose.IsYes);
- if (schoolyearID.HasValue)
- query = query.Where(x => x.SchoolyearID == schoolyearID);
- if (supplierID.HasValue)
- query = query.Where(x => x.SupplierID == supplierID);
- if (teachingMaterialID.HasValue)
- query = query.Where(x => x.TeachingMaterialPoolID == teachingMaterialID);
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- return query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue).OrderBy(x => x.TeachingMaterialCode).ToGridResultSet<StockInView>(pageIndex, pageSize);
- return query.OrderBy(x => x.TeachingMaterialCode.Length).ThenBy(x => x.TeachingMaterialCode).ToGridResultSet<StockInView>(pageIndex, pageSize);
- }
- public IList<StockInView> GetStockInStatisticsVieList(ViewModel.ConfiguretView configuretView, Guid? schoolyearID, Guid? supplierID, Guid? teachingMaterialID)
- {
- var query = StockInDetailDAL.GetStockInStatisticsGridView(x => x.RecordStatus == (int)CF_GeneralPurpose.IsYes);
- if (schoolyearID.HasValue)
- query = query.Where(x => x.SchoolyearID == schoolyearID);
- if (supplierID.HasValue)
- query = query.Where(x => x.SupplierID == supplierID);
- if (teachingMaterialID.HasValue)
- query = query.Where(x => x.TeachingMaterialPoolID == teachingMaterialID);
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- return query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue).OrderBy(x => x.TeachingMaterialCode).ToList();
- return query.OrderBy(x => x.TeachingMaterialCode.Length).ThenBy(x => x.TeachingMaterialCode).ToList();
- }
- }
- }
|