/// <summary> /// 导出商品信息 /// </summary> public Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO <Jinher.AMP.BTP.Deploy.CustomDTO.ListResult <Jinher.AMP.BTP.Deploy.JdCommodityDTO> > ExportYXCommodityDataExt(Jinher.AMP.BTP.Deploy.CustomDTO.YJEmployee.JdCommoditySearchDTO input) { var query = JdCommodity.ObjectSet().Where(p => p.AppId == input.AppId && p.State == 0 && p.IsDel == false).AsQueryable(); if (!string.IsNullOrWhiteSpace(input.JDCode)) { query = query.Where(p => p.JDCode == input.JDCode); } var count = query.Count(); var data = (from n in query select new Jinher.AMP.BTP.Deploy.JdCommodityDTO { Id = n.Id, JDCode = n.JDCode, CategoryName = n.CategoryName, TaxClassCode = n.TaxClassCode, //税收编码 TaxRate = n.TaxRate, //销项税 InputRax = n.InputRax, //进项税 VideoName = n.VideoName, SubTime = n.SubTime }).OrderByDescending(q => q.SubTime).ToList(); return(new ResultDTO <ListResult <Jinher.AMP.BTP.Deploy.JdCommodityDTO> > { isSuccess = true, Data = new ListResult <Jinher.AMP.BTP.Deploy.JdCommodityDTO> { List = data, Count = count } }); }
/// <summary> /// 查询列表信息 /// </summary> public Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO <Jinher.AMP.BTP.Deploy.CustomDTO.ListResult <Jinher.AMP.BTP.Deploy.JdCommodityDTO> > GetJdCommodityListExt(Jinher.AMP.BTP.Deploy.CustomDTO.YJEmployee.JdCommoditySearchDTO input) { try { var query = JdCommodity.ObjectSet().Where(p => p.AppId == input.AppId && p.State == 0 && p.IsDel == false).AsQueryable(); if (!string.IsNullOrWhiteSpace(input.JDCode)) { query = query.Where(p => p.JDCode == input.JDCode); } var count = query.Count(); var data = (from n in query select new Jinher.AMP.BTP.Deploy.JdCommodityDTO { Id = n.Id, JDCode = n.JDCode, Barcode = n.Barcode, TaxClassCode = n.TaxClassCode, //税收编码 TaxRate = n.TaxRate, //销项税 InputRax = n.InputRax, //进项税 CategoryName = n.CategoryName, VideoName = n.VideoName, SubTime = n.SubTime, Price = n.Price //商品售价(易派客) }).OrderByDescending(q => q.SubTime).Skip((input.PageIndex - 1) * input.PageSize).Take(input.PageSize).ToList(); return(new ResultDTO <ListResult <Jinher.AMP.BTP.Deploy.JdCommodityDTO> > { isSuccess = true, Data = new ListResult <Jinher.AMP.BTP.Deploy.JdCommodityDTO> { List = data, Count = count } }); } catch (Exception ex) { LogHelper.Error("JdCommodityBP.GetJdCommodityListExt 异常", ex); return(new ResultDTO <ListResult <Jinher.AMP.BTP.Deploy.JdCommodityDTO> > { isSuccess = false, Data = null }); } }