yyk
2024-07-18 bf1a9a818ffb721aea2709e9409fbb932b07e81d
Wms/WMS.BLL/BllSoServer/ExportNoticeDetailServer.cs
@@ -26,59 +26,53 @@
        }
        public async Task<List<ExportNoticeDetailDto>> GetExportNoticeDetailList(GetExportNoticeDetailVm model, RefAsync<int> count)
        {
            try
            if (string.IsNullOrWhiteSpace(model.SoNo))
            {
                if (string.IsNullOrWhiteSpace(model.SoNo))
                {
                    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("出库单号为空");
                }
                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;
                throw new Exception("出库单号为空");
            }
            catch (Exception e)
            var notice = DataContext.Db.Queryable<BllExportNotice>().Where(m => m.IsDel == "0" && m.SONo == model.SoNo).ToList().FirstOrDefault();
            if (notice == null)
            {
                throw new Exception(e.Message);
                throw new Exception("出库单号为空");
            }
            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,
                    IsMixBox = a.IsMixBox,
                    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)