yyk
2024-07-18 bf1a9a818ffb721aea2709e9409fbb932b07e81d
Wms/WMS.BLL/BllSoServer/ExportAllotServer.cs
@@ -3,7 +3,9 @@
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using Model.ModelDto.BllSoDto;
using Model.ModelVm.BllSoVm;
using SqlSugar;
using WMS.BLL.LogServer;
using WMS.DAL;
@@ -24,29 +26,27 @@
        }
        //查询出库分配表信息
        public List<ExportAllotDto> GetExportAllotList(string no, string waveNo, string palletNo, string skuNo, string skuName, string lotNo, string status, string boxNo, int page, int limit, out int count)
        {
            try
        public async Task<List<ExportAllotDto>> GetExportAllotList(GetExportAllotVm model, RefAsync<int> count)
            {
                var strList = new List<int>();
                if (!string.IsNullOrWhiteSpace(boxNo))
            if (!string.IsNullOrWhiteSpace(model.BoxNo))
                {
                    var detailList = Db.Queryable<BllCompleteDetail>().Where(m => m.IsDel == "0" && m.BoxNo.Contains(boxNo.Trim())).Select(m => m.ExportAllotId).Distinct().ToList();
                var detailList = Db.Queryable<BllCompleteDetail>().Where(m => m.IsDel == "0" && m.BoxNo.Contains(model.BoxNo.Trim())).Select(m => m.ExportAllotId).Distinct().ToList();
                    strList = detailList;
                }
                Expression<Func<BllExportAllot, bool>> item = Expressionable.Create<BllExportAllot>()
                    .AndIF(!string.IsNullOrWhiteSpace(no), it => it.SONo.Contains(no.Trim()))
                    .AndIF(!string.IsNullOrWhiteSpace(waveNo), it => it.WaveNo.Contains(waveNo.Trim()))
                    .AndIF(!string.IsNullOrWhiteSpace(palletNo), it => it.PalletNo.Contains(palletNo.Trim()))
                    .AndIF(!string.IsNullOrWhiteSpace(skuNo), it => it.SkuNo.Contains(skuNo.Trim()))
                    .AndIF(!string.IsNullOrWhiteSpace(skuName), it => it.SkuName.Contains(skuName.Trim()))
                    .AndIF(!string.IsNullOrWhiteSpace(lotNo), it => it.LotNo.Contains(lotNo.Trim()))
                    .AndIF(!string.IsNullOrWhiteSpace(status), it => it.Status == status)
                    .AndIF(!string.IsNullOrWhiteSpace(boxNo), m => strList.Contains(m.Id))
                .AndIF(!string.IsNullOrWhiteSpace(model.SoNo), it => it.SONo.Contains(model.SoNo.Trim()))
                .AndIF(!string.IsNullOrWhiteSpace(model.WaveNo), it => it.WaveNo.Contains(model.WaveNo.Trim()))
                .AndIF(!string.IsNullOrWhiteSpace(model.PalletNo), it => it.PalletNo.Contains(model.PalletNo.Trim()))
                .AndIF(!string.IsNullOrWhiteSpace(model.SkuNo), it => it.SkuNo.Contains(model.SkuNo.Trim()))
                .AndIF(!string.IsNullOrWhiteSpace(model.SkuName), it => it.SkuName.Contains(model.SkuName.Trim()))
                .AndIF(!string.IsNullOrWhiteSpace(model.LotNo), it => it.LotNo.Contains(model.LotNo.Trim()))
                .AndIF(!string.IsNullOrWhiteSpace(model.Status), it => it.Status == model.Status)
                .AndIF(!string.IsNullOrWhiteSpace(model.BoxNo), m => strList.Contains(m.Id))
                    .ToExpression();//注意 这一句 不能少
                var total = 0;
                var data = GetAllWhereAsync(item)
            var data = await GetAllWhereAsync(item)
                    .LeftJoin<SysLogisticsInfo>((a, b) => a.LogisticsId == b.Id)
                    .LeftJoin<SysUserInfor>((a, b, c) => a.CreateUser == c.Id)
                    .LeftJoin<SysUserInfor>((a, b, c, d) => a.CreateUser == d.Id)
@@ -82,14 +82,10 @@
                        UpdateUserName = d.RealName,
                        CreateTime = a.CreateTime,
                        UpdateTime = a.UpdateTime
                    }).OrderByDescending(a => a.CreateTime).OrderBy(a => a.Status).OrderBy(a => a.SkuNo).ToOffsetPage(page, limit, ref total);
                }).OrderByDescending(a => a.CreateTime).OrderBy(a => a.Status).OrderBy(a => a.SkuNo)
                .ToPageListAsync(model.Page, model.Limit, count);
                count = total;
                return data;
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
        //撤销分配(删除)