admin
2 天以前 4eb3fe2b28f1ae4c4623ae5f7d7750bd265b5fc5
Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs
@@ -1,29 +1,30 @@
using System;
using System.Collections.Generic;
using SqlSugar;
using System.Linq;
using System.Linq.Expressions;
using Model.InterFaceModel;
using Model.InterFaceModel;
using Model.ModelDto;
using SqlSugar.Extensions;
using WMS.Entity.BllSoEntity;
using WMS.Entity.Context;
using WMS.Entity.DataEntity;
using WMS.Entity.SysEntity;
using WMS.IBLL.IPdaServer;
using Model.ModelVm;
using Model.ModelVm.PdaVm;
using Newtonsoft.Json;
using SqlSugar;
using SqlSugar.Extensions;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using System.Web;
using Utility;
using Utility.Tools;
using WMS.BLL.Logic;
using WMS.BLL.LogServer;
using WMS.DAL;
using WMS.Entity.LogEntity;
using WMS.Entity.BllQualityEntity;
using WMS.Entity.BllAsnEntity;
using System.Threading.Tasks;
using Utility;
using WMS.BLL.Logic;
using System.Web;
using WMS.Entity.BllQualityEntity;
using WMS.Entity.BllSoEntity;
using WMS.Entity.Context;
using WMS.Entity.DataEntity;
using WMS.Entity.LogEntity;
using WMS.Entity.SysEntity;
using WMS.IBLL.IPdaServer;
namespace WMS.BLL.BllPdaServer
{
@@ -80,9 +81,15 @@
                {
                    throw Oops.Bah("未查询到该出库单的信息");
                }
                if (notice.Status != "3")
                //if (notice.Status != "3")
                //{
                //    throw Oops.Bah("出库单的状态不是正在执行,不能拣货");
                //}
                //2025年12月05日甲方要求超捡,出库单调整为执行完毕也可以超捡
                List<string> statusList = new List<string>() { "3", "4" };
                if (!statusList.Contains(notice.Status))
                {
                    throw Oops.Bah("出库单的状态不是正在执行,不能拣货");
                    throw Oops.Bah("出库单的状态非正在执行,不能拣货");
                }
                //出库单明细
                var noticeDetail = await Db.Queryable<BllExportNoticeDetail>().FirstAsync(m => m.IsDel == "0" && m.Id == int.Parse(soDetailId));
@@ -1561,9 +1568,12 @@
                string skuNo = boxInfos.First().SkuNo;
                string skuName = boxInfos.First().SkuName;
                // 验证是否车间线边仓库
                var areaList = new List<string>() { "B06", "B07", "B09", "B24" };
                if (!areaList.Contains(stockDetail.AreaNo))
                //验证是否车间线边仓库
                string areaNoSql = $@"select AreaNo from SysStorageArea where IsDel='0' and AreaType='1'";
                DataTable areaNoDt = Db.Ado.GetDataTable(areaNoSql);
                List<string> areaNoList = areaNoDt.Rows.Cast<DataRow>().Select(e => e["AreaNo"] + "").ToList();
                if (!areaNoList.Contains(stockDetail.AreaNo))
                {
                    throw Oops.Bah("托盘不是车间托盘!");
                }
@@ -1719,9 +1729,12 @@
                    throw Oops.Bah("未查询到该托盘上货物的库存明细信息!");
                }
                // 验证是否车间线边仓库
                var areaList = new List<string>() { "B06", "B07", "B09", "B24" };
                if (!areaList.Contains(stockDetail.AreaNo))
                //验证是否车间线边仓库
                string areaNoSql = $@"select AreaNo from SysStorageArea where IsDel='0' and AreaType='1'";
                DataTable areaNoDt = Db.Ado.GetDataTable(areaNoSql);
                List<string> areaNoList = areaNoDt.Rows.Cast<DataRow>().Select(e => e["AreaNo"] + "").ToList();
                if (!areaNoList.Contains(stockDetail.AreaNo))
                {
                    throw Oops.Bah("托盘不是车间托盘!");
                }
@@ -1918,10 +1931,12 @@
                throw Oops.Bah("出库明细为空,请选择物料-批次");
            }
            var allotList = await Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.Status == "0" && m.SONo == soNo && m.SODetailNo == int.Parse(soDetailId)).Select(m => m.PalletNo).Distinct().Where(m => !string.IsNullOrWhiteSpace(m)).ToListAsync();
            //var allotList = await Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.Status == "0" && m.SONo == soNo && m.SODetailNo == int.Parse(soDetailId)).Select(m => m.PalletNo).Distinct().Where(m => !string.IsNullOrWhiteSpace(m)).ToListAsync();
            //获取状态为0待下发、1任务下发、2待拣货、3部分拣货的出库单
            List<string> statusList = new List<string>() { "0", "1", "2", "3" };
            var allotList = await Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && statusList.Contains(m.Status) && m.SONo == soNo && m.SODetailNo == int.Parse(soDetailId)).Select(m => m.PalletNo).Distinct().Where(m => !string.IsNullOrWhiteSpace(m)).ToListAsync();
            return allotList;
        }
@@ -1931,7 +1946,8 @@
        {
            if (type == "1")//平库出库获取单据
            {
                var allotList = await Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && (m.Status == "1" || m.Status == "0")).Select(m => m.SONo).Distinct().Where(m => !string.IsNullOrWhiteSpace(m)).ToListAsync();
                List<string> statusList = new List<string>() { "0", "1", "2", "3" };
                var allotList = await Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && statusList.Contains(m.Status)).Select(m => m.SONo).Distinct().Where(m => !string.IsNullOrWhiteSpace(m)).ToListAsync();
                return allotList;
            }
            //获取状态为待拣货或者部分拣货的出库单
@@ -1951,8 +1967,9 @@
            {
                throw Oops.Bah("单据为空,请选择单据");
            }
            //获取状态为待拣货或者部分拣货的出库单
            var allotList = Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.SONo == soNo && (m.Status == "0" || m.Status == "1"));
            //获取状态为0待下发、1任务下发、2待拣货、3部分拣货的出库单
            List<string> statusList = new List<string>() { "0", "1", "2", "3" };
            var allotList = Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.SONo == soNo && (statusList.Contains(m.Status)));
            var list = await allotList.GroupBy(m => new { m.SODetailNo, m.SkuNo, m.SkuName, m.LotNo }).Select(m => new DetailIdSkuLotNo()
            {