/// <summary> /// 获取指定列的集合 /// </summary> /// <returns></returns> public List <ValuesOutputDto> GetList() { Expression <Func <Values, bool> > prediate = m => m.Id > 0; var selector = ExpExtension.GetSelector <Values, ValuesOutputDto>(); return(_iRepository.GetList <Values, ValuesOutputDto>(prediate, null, null, selector)); }
/// <summary> /// 获取指定列的分页信息 /// </summary> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> /// <returns></returns> public PageList <ValuesOutputDto> GetStockPageList(int pageIndex, int pageSize) { Expression <Func <Values, bool> > prediate = m => m.Id > 0; prediate = prediate.And(m => m.Id > 10); var selector = ExpExtension.GetSelector <Values, ValuesOutputDto>(); return(_iRepository.GetConditionPageList <Values, ValuesOutputDto>(prediate, pageIndex, pageSize, null, selector)); }
/// <summary> /// 返回有效的第三方平台的数据 /// </summary> /// <returns></returns> public OnlineOrdersResultDto <List <Ppc_PlatformConfigOutPutDto> > GetPlatform() { OnlineOrdersResultDto <List <Ppc_PlatformConfigOutPutDto> > res = new OnlineOrdersResultDto <List <Ppc_PlatformConfigOutPutDto> >() { StatusCode = 0, Message = "获取平台信息失败", Ext1 = new List <Ppc_PlatformConfigOutPutDto>() }; Expression <Func <Ppc_PlatformConfig, bool> > prediate = m => m.IsShow == 1; var selector = ExpExtension.GetSelector <Ppc_PlatformConfig, Ppc_PlatformConfigOutPutDto>(); var listplat = _iRepository.GetList <Ppc_PlatformConfig, Ppc_PlatformConfigOutPutDto>(prediate, null, null, selector); if (listplat == null || listplat.Count == 0 || listplat[0].ID.GetValueOrDefault(0) < 0) { return(res); } res.StatusCode = 1; res.Ext1 = listplat; res.Message = "获取平台信息成功"; return(res); }
/// <summary> /// 根据比价单号获取物料上传信息的详情 /// </summary> /// <param name="input"></param> /// <returns></returns> public OnlineOrdersResultDto <PageInfo <Ppc_StockInfoOutputPageListDto> > GetPageStock(Ppc_StockInfoInputPageListDto input) { OnlineOrdersResultDto <PageInfo <Ppc_StockInfoOutputPageListDto> > result = new OnlineOrdersResultDto <PageInfo <Ppc_StockInfoOutputPageListDto> >() { StatusCode = 0, Message = "获取信息失败", Ext1 = new PageInfo <Ppc_StockInfoOutputPageListDto>() }; if (string.IsNullOrWhiteSpace(input.UploadNo)) { result.Message = "上传比价单号不能为空"; return(result); } var updatetor = _iRepository.FindEntity <Ppc_UploadInfo>(m => m.UploadNO == input.UploadNo); if (updatetor == null) { result.Message = "上传记录未找到"; return(result); } if (updatetor.Status != 0) { result.StatusCode = 1; result.Message = "物料正在比对中"; return(result); } Expression <Func <Ppc_StockInfo, bool> > where = m => m.UploadNo == input.UploadNo; where = GetCommonWhere(where, input); var selector = ExpExtension.GetSelector <Ppc_StockInfo, Ppc_StockInfoOutputPageListDto>(); var pageEntity = _iRepository.GetConditionPageList <Ppc_StockInfo, Ppc_StockInfoOutputPageListDto>(where, input.PageIndex, input.PageSize, null, selector); var resultList = pageEntity.GetCommonPageEntityies <Ppc_StockInfoOutputPageListDto>(); if (resultList != null && resultList.ResultList != null && resultList.ResultList.Count > 0) { var list = GetExtendPropertities(resultList.ResultList); resultList.ResultList = list; } return(result); }
/// <summary> /// /// </summary> /// <param name="input"></param> /// <returns></returns> public OnlineOrdersResultDto <PageInfo <Ppc_UploadInfoOutPutPageListDto> > GetPageUploadinfo(Ppc_UploadInfoInputPageListDto input) { OnlineOrdersResultDto <PageInfo <Ppc_UploadInfoOutPutPageListDto> > list = new OnlineOrdersResultDto <PageInfo <Ppc_UploadInfoOutPutPageListDto> >() { StatusCode = 1, Message = "获取信息成功" }; if (string.IsNullOrEmpty(SessionDataResult.LoginUseID)) { list.StatusCode = 0; list.Message = "登录信息已过期"; return(list); } ComparePriceToCrmApiResultDto <List <CrmPurchaseOutPutDto> > crmOutPut = new ComparePriceToCrmApi(_apiRequest).GetPurchaseBelongsFromCrm(new PurchaseInputDto() { CRMUserId = SessionDataResult.LoginUseID }).Result; if (crmOutPut.State <= 0) { list.StatusCode = 0; list.Message = crmOutPut.Message; return(list); } string[] ennameArray = crmOutPut.ReValue.Where(m => !string.IsNullOrWhiteSpace(m.EName)).Select(m => m.EName).Distinct().ToArray(); Expression <Func <Ppc_UploadInfo, bool> > exp = m => 1 > 0; if (ennameArray != null && ennameArray.Length > 0) { exp = exp.And(m => ennameArray.Contains(m.CreateName)); } Dictionary <int, Expression <Func <Ppc_UploadInfo, object> > > dic = new Dictionary <int, Expression <Func <Ppc_UploadInfo, object> > >(); dic.Add(2, m => m.CreateTime); var selector = ExpExtension.GetSelector <Ppc_UploadInfo, Ppc_UploadInfoOutPutPageListDto>(); var pageEntity = _iRepository.GetConditionPageList <Ppc_UploadInfo, Ppc_UploadInfoOutPutPageListDto>(exp, input.PageIndex, input.PageSize, dic, selector); list.Ext1 = pageEntity.GetCommonPageEntityies <Ppc_UploadInfoOutPutPageListDto>(); return(list); }
/// <summary> /// 导出Excel供库存上传使用 /// </summary> /// <param name="UploadNo">上传的库存的操作流水号</param> /// <returns></returns> public List <StockUploadModel> ExportUploadOutData(string UploadNo) { List <StockUploadModel> resultList = new List <StockUploadModel>(); if (string.IsNullOrWhiteSpace(UploadNo)) { return(resultList); } Expression <Func <Ppc_StockInfo, bool> > where = m => m.UploadNo == UploadNo; var selector = ExpExtension.GetSelector <Ppc_StockInfo, Ppc_StockInfoExportDto>(); var pageEntity = _iRepository.GetList <Ppc_StockInfo, Ppc_StockInfoExportDto>(where, null, selector); if (resultList != null && pageEntity.Count > 0) { List <Ppc_StockinfoPrice> listPrice = new List <Ppc_StockinfoPrice>(); long?[] PIDArray = pageEntity.Where(m => m.PID.GetValueOrDefault(0) > 0).Select(m => m.PID).Distinct().ToArray(); if (PIDArray != null && PIDArray.Length > 0) { listPrice = _iRepository.GetEntitiesListByConditions <Ppc_StockinfoPrice>(m => PIDArray.Contains(m.StockID), null); } foreach (var item in pageEntity) { var modelListPrice = listPrice.FindAll(m => m.StockID == item.PID).OrderBy(m => m.MaxVal).ToList(); StockUploadModel model = new StockUploadModel() { Model = item.Model, Brand = item.Brand, BatchNo = item.BatchNo, Encapsulation = item.Encapsulation, Remark = item.Remark, InvQty = item.InvQty, SPQ = item.SPQ, MOQ = item.MOQ, SZDelivery = item.SZDelivery, HKDelivery = item.HKDelivery, AreaQty1 = modelListPrice != null && modelListPrice.Count > 0 ? modelListPrice[0].MaxVal : null, AreaPurchaseUnitPriceCNY1 = item.CostPrice, AreaSalesPriceCNY1 = modelListPrice != null && modelListPrice.Count > 0 ? modelListPrice[0].CNYPrice : null, AreaQty2 = modelListPrice != null && modelListPrice.Count > 1 ? modelListPrice[1].MaxVal : null, AreaSalesPriceCNY2 = modelListPrice != null && modelListPrice.Count > 1 ? modelListPrice[1].CNYPrice : null, AreaQty3 = modelListPrice != null && modelListPrice.Count > 2 ? modelListPrice[2].MaxVal : null, AreaSalesPriceCNY3 = modelListPrice != null && modelListPrice.Count > 2 ? modelListPrice[2].CNYPrice : null, AreaQty4 = modelListPrice != null && modelListPrice.Count > 3 ? modelListPrice[3].MaxVal : null, AreaSalesPriceCNY4 = modelListPrice != null && modelListPrice.Count > 3 ? modelListPrice[3].CNYPrice : null, AreaQty5 = modelListPrice != null && modelListPrice.Count > 4 ? modelListPrice[4].MaxVal : null, AreaSalesPriceCNY5 = modelListPrice != null && modelListPrice.Count > 4 ? modelListPrice[4].CNYPrice : null, AreaQty6 = modelListPrice != null && modelListPrice.Count > 5 ? modelListPrice[5].MaxVal : null, AreaSalesPriceCNY6 = modelListPrice != null && modelListPrice.Count > 5 ? modelListPrice[5].CNYPrice : null, AreaQty7 = modelListPrice != null && modelListPrice.Count > 6 ? modelListPrice[6].MaxVal : null, AreaSalesPriceCNY7 = modelListPrice != null && modelListPrice.Count > 6 ? modelListPrice[6].CNYPrice : null, AreaQty8 = modelListPrice != null && modelListPrice.Count > 7 ? modelListPrice[7].MaxVal : null, AreaSalesPriceCNY8 = modelListPrice != null && modelListPrice.Count > 7 ? modelListPrice[7].CNYPrice : null, AreaQty9 = modelListPrice != null && modelListPrice.Count > 8 ? modelListPrice[8].MaxVal : null, AreaSalesPriceCNY9 = modelListPrice != null && modelListPrice.Count > 8 ? modelListPrice[8].CNYPrice : null, }; resultList.Add(model); } ; } return(resultList); }