From a35607160c054c110edcd6772e5967540a79c489 Mon Sep 17 00:00:00 2001
From: hwh <332078369@qq.com>
Date: 星期五, 19 七月 2024 15:56:03 +0800
Subject: [PATCH] 封装查看视觉盘点图片组件

---
 Wms/WMS.BLL/BllSoServer/ExportNoticeDetailServer.cs |  100 +++++++++++++++++++++++--------------------------
 1 files changed, 47 insertions(+), 53 deletions(-)

diff --git a/Wms/WMS.BLL/BllSoServer/ExportNoticeDetailServer.cs b/Wms/WMS.BLL/BllSoServer/ExportNoticeDetailServer.cs
index 81b648e..4ed4983 100644
--- a/Wms/WMS.BLL/BllSoServer/ExportNoticeDetailServer.cs
+++ b/Wms/WMS.BLL/BllSoServer/ExportNoticeDetailServer.cs
@@ -3,8 +3,10 @@
 using System.Linq;
 using System.Linq.Expressions;
 using System.Text;
+using System.Threading.Tasks;
 using Dm;
 using Model.ModelDto.BllSoDto;
+using Model.ModelVm.BllSoVm;
 using SqlSugar;
 using WMS.BLL.LogServer;
 using WMS.DAL;
@@ -22,62 +24,54 @@
         public ExportNoticeDetailServer():base(Db)
         {
         }
-        public List<ExportNoticeDetailDto> GetExportNoticeDetailList(string soNo, int page, int limit, out int count)
+        public async Task<List<ExportNoticeDetailDto>> GetExportNoticeDetailList(GetExportNoticeDetailVm model, RefAsync<int> count)
         {
-            try
+            if (string.IsNullOrWhiteSpace(model.SoNo))
             {
-                if (string.IsNullOrWhiteSpace(soNo))
-                {
-                    throw new Exception("鍑哄簱鍗曞彿涓虹┖");
-                }
-                var notice = DataContext.Db.Queryable<BllExportNotice>().Where(m => m.IsDel == "0" && m.SONo == soNo).ToList().FirstOrDefault();
-                if (notice == null)
-                {
-                    throw new Exception("鍑哄簱鍗曞彿涓虹┖");
-                }
-                var total = 0;
-                var data = GetAllWhereAsync(a=>a.SONo == soNo)
-                    .LeftJoin<SysPackag>((a,b)=> a.PackagNo == b.PackagNo)
-                    .LeftJoin<SysUserInfor>((a,b,c)=> a.CreateUser == c.Id)
-                    .LeftJoin<SysUserInfor>((a,b,c,d)=> a.UpdateUser == d.Id)
-                    .Select((a, b, c, d) => new ExportNoticeDetailDto()
-                    {
-                        Id = a.Id,
-                        Status = a.Status,
-                        Origin = notice.Origin,
-                        SONo = a.SONo,
-                        SkuNo = a.SkuNo,
-                        SkuName = a.SkuName,
-                        Standard = a.Standard,
-                        LotNo = a.LotNo,
-                        LotText = a.LotText,
-                        Qty = a.Qty,
-                        AllotQty = a.AllotQty,
-                        FactQty = a.FactQty,
-                        CompleteQty = a.CompleteQty,
-                        PackagNo = a.PackagNo,
-                        PackagName = b.PackagName,
-                        Price = a.Price,
-                        Money = a.Money,
-                        IsBale = a.IsBale,
-                        IsBelt = a.IsBelt,
-                        SupplierLot = a.SupplierLot,
-                        IsWave = a.IsWave,
-                        WaveNo = a.WaveNo,
+                throw new Exception("鍑哄簱鍗曞彿涓虹┖");
+            }
+            var notice = DataContext.Db.Queryable<BllExportNotice>().Where(m => m.IsDel == "0" && m.SONo == model.SoNo).ToList().FirstOrDefault();
+            if (notice == null)
+            {
+                throw new Exception("鍑哄簱鍗曞彿涓虹┖");
+            }
 
-                        CreateUserName = c.RealName,
-                        UpdateUserName = d.RealName,
-                        CreateTime = a.CreateTime,
-                        UpdateTime = a.UpdateTime
-                    }).ToOffsetPage(page,limit,ref total);
-                count = total;
-                
-                return data;
-            }
-            catch (Exception e)
-            {
-                throw new Exception(e.Message);
-            }
+            var data = await GetAllWhereAsync(a => a.SONo == model.SoNo)
+                .LeftJoin<SysPackag>((a, b) => a.PackagNo == b.PackagNo)
+                .LeftJoin<SysUserInfor>((a, b, c) => a.CreateUser == c.Id)
+                .LeftJoin<SysUserInfor>((a, b, c, d) => a.UpdateUser == d.Id)
+                .Select((a, b, c, d) => new ExportNoticeDetailDto()
+                {
+                    Id = a.Id,
+                    Status = a.Status,
+                    Origin = notice.Origin,
+                    SONo = a.SONo,
+                    SkuNo = a.SkuNo,
+                    SkuName = a.SkuName,
+                    Standard = a.Standard,
+                    LotNo = a.LotNo,
+                    LotText = a.LotText,
+                    Qty = a.Qty,
+                    AllotQty = a.AllotQty,
+                    FactQty = a.FactQty,
+                    CompleteQty = a.CompleteQty,
+                    PackagNo = a.PackagNo,
+                    PackagName = b.PackagName,
+                    Price = a.Price,
+                    Money = a.Money,
+                    IsBale = a.IsBale,
+                    IsBelt = a.IsBelt,
+                    SupplierLot = a.SupplierLot,
+                    IsWave = a.IsWave,
+                    WaveNo = a.WaveNo,
+
+                    CreateUserName = c.RealName,
+                    UpdateUserName = d.RealName,
+                    CreateTime = a.CreateTime,
+                    UpdateTime = a.UpdateTime
+                }).ToPageListAsync(model.Page, model.Limit, count);
+
+            return data;
         }
 
         public bool DelExportNoticeDetail(int id, int userId)

--
Gitblit v1.8.0