IPC-610
2025-01-02 286db121ac6b7e56b1b579ebcdd191526890f4af
修改问题
27个文件已修改
441 ■■■■ 已修改文件
Wms/Model/InterFaceModel/AsnModels.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Model/InterFaceModel/HttpModel.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Model/InterFaceModel/SoModel.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Model/ModelDto/BllAsnDto/BoxInfoDto.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Model/ModelDto/SysDto/MaterialsDto.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Model/ModelVm/SysVm/LocateVm.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllAsnServer/PalletBindServer.cs 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllCheckServer/StockCheckServer.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/DataServer/StockServer.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/SysServer/StorageAreaServer.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/SysServer/StorageLocatServer.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/SysServer/Token.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.DAL/SysInfrastructure/MaterialsRepository.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.DAL/SysInfrastructure/StorageLocatRepository.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.Entity/BllAsnEntity/BllBoxInfo.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.Entity/SysEntity/SysToken.cs 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.IBLL/IBllAsnServer/IPalletBindServer.cs 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.IDAL/ISysInterface/IStorageLocatRepository.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Wms/Controllers/BasisController.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Wms/Controllers/DownApiController.cs 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Wms/appsettings.json 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Model/InterFaceModel/AsnModels.cs
@@ -92,4 +92,10 @@
    }
    public class RequesIsBale
    {
        public string PalletNo { get; set; }
    }
}
Wms/Model/InterFaceModel/HttpModel.cs
@@ -121,7 +121,7 @@
        public string TaskNo { get; set; }
        /// <summary>
        /// 任务类型
        /// 任务类型 0:入库,1:出库,2:移库,3:入库裹包
        /// </summary>
        public string TaskType { get; set; }
Wms/Model/InterFaceModel/SoModel.cs
@@ -49,11 +49,11 @@
        /// <summary>
        /// 生产日期【yyyy-MM-dd
        /// </summary>
        public DateTime? producttime { get; set; }
        public string producttime { get; set; }
        /// <summary>
        /// 有效期至【yyyy-MM-dd
        /// </summary>
        public DateTime? expiry { get; set; }
        public string expiry { get; set; }
        /// <summary>
        /// 外箱吗【string(100)/非空】
        /// </summary>
Wms/Model/ModelDto/BllAsnDto/BoxInfoDto.cs
@@ -194,5 +194,10 @@
        /// 生成一维码路径
        /// </summary>
        public string ImgStr { get; set; }
        /// <summary>
        /// 数量的单位
        /// </summary>
        public string unit { get; set; }
    }
}
Wms/Model/ModelDto/SysDto/MaterialsDto.cs
@@ -147,5 +147,10 @@
        /// 更新人名称
        /// </summary>
        public string UpdateUserName { get; set; }
        /// <summary>
        /// 是否缠膜
        /// </summary>
        public string IsWrap { get; set; }
    }
}
Wms/Model/ModelVm/SysVm/LocateVm.cs
@@ -113,7 +113,12 @@
        /// </summary>
        [MaxLength(3)]
        public string Temperature { get; set; }
        /// <summary>
        /// 区域
        /// </summary>
        [MaxLength(3)]
        public string Area { get; set; }
    }
    /// <summary>
    /// 查询储位model
Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
@@ -22,6 +22,7 @@
using System.Security.Policy;
using WMS.Entity.DataEntity;
using WMS.Entity.BllQualityEntity;
using Microsoft.VisualBasic;
namespace WMS.BLL.BllAsnServer
{
@@ -344,6 +345,16 @@
                            continue;
                        }
                    }
                    if (!string.IsNullOrEmpty(detailModel.IsBale))
                    {
                        detailModel.IsBale = detailModel.IsBale == "是" ? "1" : "0";
                        if (detailModel.IsBale != "1" && detailModel.IsBale != "0")
                        {
                            //判断是否裹包
                            strMessage = "-1:裹包字段只能录入“是”或“否”;";
                            continue;
                        }
                    }
                    if (model.Type != "7")
                    {
                        if (!TypeLot.Contains(model.Type))
@@ -439,7 +450,7 @@
                        {
                            var time1 = DateTime.Now;//发送时间 .ToString("yyyy-MM-dd HH:mm:ss")
                            //给WCS下发入库单信息
                            response = HttpHelper.DoPost(url, jsonData, "下发给WCS出库命令", "WCS");
                            response = HttpHelper.DoPost(url, jsonData, "下发给WCS入库命令", "WCS");
                            //解析返回数据 
                            var wcsModel = JsonConvert.DeserializeObject<WcsModel>(response);
@@ -498,6 +509,7 @@
                    return strMessage;
                }
                sqlString += $"select * from BllArrivalNotice where ASNNo = '{model.ASNNo}' and isDel = '0';";
                var asnInfo = Db.Ado.SqlQuery<BllArrivalNotice>(sqlString).FirstOrDefault();
                if (asnInfo.Status != "0")
@@ -550,6 +562,16 @@
                    {
                        strMessage = "-1:批次号不可为空;";
                        continue;
                    }
                    if (!string.IsNullOrEmpty(detailModel.IsBale))
                    {
                        detailModel.IsBale = detailModel.IsBale == "是" ? "1" : "0";
                        if (detailModel.IsBale != "1" && detailModel.IsBale != "0")
                        {
                            //判断是否裹包
                            strMessage = "-1:裹包字段只能录入“是”或“否”;";
                            continue;
                        }
                    }
                    if (model.Type == "2")   // 2:中间品入库
@@ -997,11 +1019,11 @@
                    resultModel.Message = "单据类型不可为空!";
                    return resultModel;
                }
                if (string.IsNullOrEmpty(model.Customer))
                {
                    resultModel.Message = "客户不可为空!";
                    return resultModel;
                }
                //if (string.IsNullOrEmpty(model.Customer))
                //{
                //    resultModel.Message = "客户不可为空!";
                //    return resultModel;
                //}
                if (string.IsNullOrEmpty(model.OrderCode))
                {
                    resultModel.Message = "上游系统单号不可为空!";
@@ -1014,11 +1036,14 @@
                }
                // 根据客户编号获取客户名称
                var custname = "";
                var CustomerModel = Db.Queryable<SysCustomer>().First(it => it.CustomerNo == model.Customer && it.IsDel == "0");
                if (CustomerModel == null)
                if (CustomerModel != null)
                {
                    resultModel.Message = "客户编号不存在!";
                    return resultModel;
                    custname = CustomerModel.CustomerName;
                    //CustomerModel.CustomerName = "";
                    //resultModel.Message = "客户编号不存在!";
                    //return resultModel;
                }
                // 入库总表信息
@@ -1029,7 +1054,7 @@
                    Type = model.AsnType,
                    Origin = string.IsNullOrEmpty(model.Origin) ? "ERP" : model.Origin,
                    CustomerNo = model.Customer,
                    CustomerName = CustomerModel.CustomerName,
                    CustomerName = custname,
                    OrderCode = model.OrderCode,
                };
@@ -1177,7 +1202,8 @@
                if (mesList.Contains(notice.Type)) // mes 
                {
                    //获取令牌
                    var token = new Token().GetMesToken(mesTokenUrl);
                    //var token = new Token().GetMesToken(mesTokenUrl); //测试不使用TOKEN,正式运行时放开
                    var token = "";
                    Dictionary<string, string> mesDic = new Dictionary<string, string>()
                    {
                        {"Authorization",token }
@@ -1192,7 +1218,7 @@
                    var response = HttpHelper.DoPost(mesUrl, jsonData, "入库单完成上传", "MES", mesDic);
                    var obj = JsonConvert.DeserializeObject<MesModel>(response);//解析返回数据
                    if (obj.status != "0")
                    if (obj.status != "success")
                    {
                        throw new Exception("上传失败" + obj.message);
                    }
Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs
@@ -16,6 +16,9 @@
using WMS.Entity.SysEntity;
using WMS.IBLL.IBllAsnServer;
using ZXing;
using Model.ModelDto.BllCheckDto;
using WMS.Entity.BllCheckEntity;
using System.Data.SqlTypes;
namespace WMS.BLL.BllAsnServer
{
@@ -424,7 +427,9 @@
                var data = GetAllWhereAsync(item)
                    .LeftJoin<SysUserInfor>((a, b) => a.CreateUser == b.Id)
                    .LeftJoin<SysUserInfor>((a, b, c) => a.UpdateUser == c.Id)
                    .Select((a, b, c) => new BoxInfoDto()
                    .LeftJoin<SysMaterials>((a, b, c,d) => a.SkuNo == d.SkuNo)
                    .LeftJoin<SysUnit>((a, b, c, d,e) => d.UnitNo == e.UnitNo)
                    .Select((a, b, c,d,e) => new BoxInfoDto()
                    {
                        Id = a.Id,
                        ASNNo = a.ASNNo,
@@ -442,6 +447,8 @@
                        LotNo = a.LotNo,
                        LotText = a.LotText,
                        unit =  e.UnitName,
                        
                        Status = a.Status,
                        SupplierLot = a.SupplierLot,
@@ -1087,6 +1094,8 @@
                //List<WmsLabelPrintLog> printlog = new List<WmsLabelPrintLog>();
                //标签表数据信息
                var list = Db.Queryable<BllBoxInfo>().Where(m => m.IsDel == "0" && m.Origin == "WMS生成").ToList();
                #region MyRegion
@@ -1107,6 +1116,9 @@
                            {
                                throw new Exception($"未查询到{boxNo}信息");
                            }
                            //单位
                            var sqlString = "select a.UnitName as unit from  SysUnit a left join SysMaterials b on a.UnitNo = b.UnitNo where b.SkuNo = '" + data.SkuNo + "'";
                            var unitname = Db.Ado.SqlQuery<BoxInfoDto>(sqlString).FirstOrDefault() ;
                            // 物料条码信息赋值
                            BoxInfoDto model = new BoxInfoDto();
                            model.SkuNo = data.SkuNo;
@@ -1120,6 +1132,7 @@
                            model.StoreTime = data.StoreTime;                     // 储存期至 
                            model.Qty = dataList.Sum(m=>m.Qty);// 数量
                            model.unit = unitname.unit;
                            model.BoxNo = data.BoxNo;                 // 箱号     
@@ -1162,6 +1175,9 @@
                                {
                                    throw new Exception($"未查询到{item}信息");
                                }
                                //单位
                                var sqlString = "select a.UnitName as unit from  SysUnit a left join SysMaterials b on a.UnitNo = b.UnitNo where b.SkuNo = '" + data.SkuNo + "'";
                                var unitname = Db.Ado.SqlQuery<BoxInfoDto>(sqlString).FirstOrDefault();
                                // 物料条码信息赋值
                                BoxInfoDto model = new BoxInfoDto();
                                model.SkuNo = data.SkuNo;
@@ -1175,6 +1191,7 @@
                                model.StoreTime = data.StoreTime;                     // 储存期至 
                                model.Qty = data1.Sum(m => m.Qty);// 数量
                                model.unit = unitname.unit;
                                model.BoxNo = data.BoxNo;                 // 箱号     
@@ -1214,6 +1231,9 @@
                            {
                                throw new Exception($"未查询到{boxNo2}信息");
                            }
                            //单位
                            var sqlString = "select a.UnitName as unit from  SysUnit a left join SysMaterials b on a.UnitNo = b.UnitNo where b.SkuNo = '" + data.SkuNo + "'";
                            var unitname = Db.Ado.SqlQuery<BoxInfoDto>(sqlString).FirstOrDefault();
                            // 物料条码信息赋值
                            BoxInfoDto model = new BoxInfoDto();
                            model.SkuNo = data.SkuNo;
@@ -1227,6 +1247,7 @@
                            model.StoreTime = data.StoreTime;                     // 储存期至 
                            model.Qty = data.Qty;// 数量
                            model.unit = unitname.unit;
                            model.BoxNo = data.BoxNo3;                 // 支号     
@@ -1266,6 +1287,9 @@
                            var i = 0;
                            foreach (var data in data2)
                            {
                                //单位
                                var sqlString = "select a.UnitName as unit from  SysUnit a left join SysMaterials b on a.UnitNo = b.UnitNo where b.SkuNo = '" + data.SkuNo + "'";
                                var unitname = Db.Ado.SqlQuery<BoxInfoDto>(sqlString).FirstOrDefault();
                                // 物料条码信息赋值
                                BoxInfoDto model = new BoxInfoDto();
                                model.SkuNo = data.SkuNo;
@@ -1279,6 +1303,7 @@
                                model.StoreTime = data.StoreTime;                     // 储存期至 
                                model.Qty = data.Qty;// 数量
                                model.unit = unitname.unit;
                                model.BoxNo = data.BoxNo3;                 // 箱号     
@@ -1330,8 +1355,10 @@
                                    {
                                        throw new Exception($"当前支码不是箱码内");
                                    }
                                    //单位
                                    var sqlString = "select a.UnitName as unit from  SysUnit a left join SysMaterials b on a.UnitNo = b.UnitNo where b.SkuNo = '" + data.SkuNo + "'";
                                    var unitname = Db.Ado.SqlQuery<BoxInfoDto>(sqlString).FirstOrDefault();
                                    // 物料条码信息赋值 箱码
                                    BoxInfoDto model1 = new BoxInfoDto();
                                    model1.SkuNo = data.SkuNo;
@@ -1344,6 +1371,7 @@
                                    model1.ExpirationTime = data.ExpirationTime;                  // 有效期至
                                    model1.StoreTime = data.StoreTime;                     // 储存期至 
                                    model1.Qty = dataList.Sum(m=>m.Qty);// 数量
                                    model1.unit = unitname.unit;
                                    model1.BoxNo = data.BoxNo;                 // 箱号     
                                    model1.ImgStr = BarcodeHelper.GetCodeBarBase64(model1.BoxNo, 160, 40, false);
@@ -1363,6 +1391,7 @@
                                    model.ExpirationTime = data.ExpirationTime;                  // 有效期至
                                    model.StoreTime = data.StoreTime;                     // 储存期至 
                                    model.Qty = data.Qty;// 数量
                                    model.unit = unitname.unit;
                                    model.BoxNo = data.BoxNo3;                 // 支号     
                                    model.ImgStr = BarcodeHelper.GetCodeBarBase64(model.BoxNo, 160, 40, false);
@@ -1398,6 +1427,9 @@
                                    var data = list.Where(m => m.BoxNo == boxNo);
                                    var boxData = data2.FirstOrDefault();
                                    //单位
                                    var sqlString = "select a.UnitName as unit from  SysUnit a left join SysMaterials b on a.UnitNo = b.UnitNo where b.SkuNo = '" + boxData.SkuNo + "'";
                                    var unitname = Db.Ado.SqlQuery<BoxInfoDto>(sqlString).FirstOrDefault();
                                    // 物料条码信息赋值
                                    BoxInfoDto model = new BoxInfoDto();
                                    model.SkuNo = boxData.SkuNo;
@@ -1410,6 +1442,7 @@
                                    model.ExpirationTime = boxData.ExpirationTime;                  // 有效期至
                                    model.StoreTime = boxData.StoreTime;                     // 储存期至 
                                    model.Qty = data.Sum(m => m.Qty);     // 数量
                                    model.unit = unitname.unit;
                                    model.BoxNo = boxData.BoxNo;                 // 支号     
                                    model.ImgStr = BarcodeHelper.GetCodeBarBase64(model.BoxNo, 160, 40, false);
@@ -1420,6 +1453,9 @@
                                    var i = 0;
                                    foreach (var item in data2)
                                    {
                                        //单位
                                        sqlString = "select a.UnitName as unit from  SysUnit a left join SysMaterials b on a.UnitNo = b.UnitNo where b.SkuNo = '" + item.SkuNo + "'";
                                        unitname = Db.Ado.SqlQuery<BoxInfoDto>(sqlString).FirstOrDefault();
                                        // 物料条码信息赋值
                                        BoxInfoDto model1 = new BoxInfoDto();
                                        model1.SkuNo = item.SkuNo;
@@ -1432,6 +1468,7 @@
                                        model1.ExpirationTime = item.ExpirationTime;                  // 有效期至
                                        model1.StoreTime = item.StoreTime;                     // 储存期至 
                                        model1.Qty = item.Qty;// 数量
                                        model1.unit = unitname.unit;
                                        model1.BoxNo = item.BoxNo3;                 // 支号     
                                        model.ImgStr = BarcodeHelper.GetCodeBarBase64(model1.BoxNo, 160, 40, false);
@@ -1466,6 +1503,9 @@
                                {
                                    throw new Exception($"未查询到{boxNo}箱码信息");
                                }
                                //单位
                                var sqlString = "select a.UnitName as unit from  SysUnit a left join SysMaterials b on a.UnitNo = b.UnitNo where b.SkuNo = '" + boxData.SkuNo + "'";
                                var unitname = Db.Ado.SqlQuery<BoxInfoDto>(sqlString).FirstOrDefault();
                                // 物料条码信息赋值
                                BoxInfoDto model = new BoxInfoDto();
                                model.SkuNo = boxData.SkuNo;
@@ -1478,6 +1518,7 @@
                                model.ExpirationTime = boxData.ExpirationTime;                  // 有效期至
                                model.StoreTime = boxData.StoreTime;                     // 储存期至 
                                model.Qty = data.Sum(m => m.Qty);     // 数量
                                model.unit = unitname.unit;
                                model.BoxNo = boxData.BoxNo;                 // 支号     
                                model.ImgStr = BarcodeHelper.GetCodeBarBase64(model.BoxNo, 160, 40, false);
@@ -1490,6 +1531,9 @@
                                    var i = 0;
                                    foreach (var item in data)
                                    {
                                        //单位
                                        sqlString = "select a.UnitName as unit from  SysUnit a left join SysMaterials b on a.UnitNo = b.UnitNo where b.SkuNo = '" + item.SkuNo + "'";
                                        unitname = Db.Ado.SqlQuery<BoxInfoDto>(sqlString).FirstOrDefault();
                                        // 物料条码信息赋值
                                        BoxInfoDto model1 = new BoxInfoDto();
                                        model1.SkuNo = item.SkuNo;
@@ -1502,6 +1546,7 @@
                                        model1.ExpirationTime = item.ExpirationTime;                  // 有效期至
                                        model1.StoreTime = item.StoreTime;                     // 储存期至 
                                        model1.Qty = item.Qty;     // 数量
                                        model1.unit = unitname.unit;
                                        model1.BoxNo = item.BoxNo3;                 // 支号     
                                        model1.ImgStr = BarcodeHelper.GetCodeBarBase64(model1.BoxNo, 160, 40, false);
@@ -1558,6 +1603,9 @@
                                {
                                    throw new Exception($"未查询到{demo}箱码信息");
                                }
                                //单位
                                var sqlString = "select a.UnitName as unit from  SysUnit a left join SysMaterials b on a.UnitNo = b.UnitNo where b.SkuNo = '" + boxData.SkuNo + "'";
                                var unitname = Db.Ado.SqlQuery<BoxInfoDto>(sqlString).FirstOrDefault();
                                // 物料条码信息赋值
                                BoxInfoDto model = new BoxInfoDto();
                                model.SkuNo = boxData.SkuNo;
@@ -1570,6 +1618,7 @@
                                model.ExpirationTime = boxData.ExpirationTime;                  // 有效期至
                                model.StoreTime = boxData.StoreTime;                     // 储存期至 
                                model.Qty = data.Sum(m => m.Qty);     // 数量
                                model.unit = unitname.unit;
                                model.BoxNo = boxData.BoxNo;                 // 支号     
                                model.ImgStr = BarcodeHelper.GetCodeBarBase64(model.BoxNo, 160, 40, false);
@@ -1586,6 +1635,9 @@
                                {
                                    foreach (var item in data.OrderBy(m => m.BoxNo3).ToList())
                                    {
                                        //单位
                                        sqlString = "select a.UnitName as unit from  SysUnit a left join SysMaterials b on a.UnitNo = b.UnitNo where b.SkuNo = '" + item.SkuNo + "'";
                                        unitname = Db.Ado.SqlQuery<BoxInfoDto>(sqlString).FirstOrDefault();
                                        // 物料条码信息赋值
                                        BoxInfoDto model1 = new BoxInfoDto();
                                        model1.SkuNo = item.SkuNo;
@@ -1598,6 +1650,7 @@
                                        model1.ExpirationTime = item.ExpirationTime;                  // 有效期至
                                        model1.StoreTime = item.StoreTime;                     // 储存期至 
                                        model1.Qty = item.Qty;// 数量
                                        model1.unit = unitname.unit;
                                        model1.BoxNo = item.BoxNo3;                 // 支号     
                                        model1.ImgStr = BarcodeHelper.GetCodeBarBase64(model1.BoxNo, 160, 40, false);
@@ -1630,6 +1683,8 @@
                }
                #endregion
                return printModelList;
            }
Wms/WMS.BLL/BllAsnServer/PalletBindServer.cs
@@ -21,6 +21,7 @@
using WMS.Entity.SysEntity;
using WMS.IBLL.IBllAsnServer;
using WMS.Entity.BllQualityEntity;
using WMS.Entity.BllCheckEntity;
namespace WMS.BLL.BllAsnServer
{
@@ -1186,7 +1187,7 @@
                            EndLocate = beingTask.EndLocat, // 目标位置
                            EndRoadway = beingTask.EndRoadway, //  目标巷道
                            TaskNo = beingTask.TaskNo, // 任务号
                            TaskType = "0",// 任务类型 (出库)
                            TaskType = "0",// 任务类型 (入库)
                            OutMode = "",  //目标地址
                            Order = 1
                        };
@@ -1908,9 +1909,9 @@
                                EndLocate = beingTask.EndLocat, // 目标位置
                                EndRoadway = beingTask.EndRoadway,                           //  目标巷道
                                TaskNo = beingTask.TaskNo, // 任务号
                                TaskType = "0",// 任务类型 (出库)
                                TaskType = "0",// 任务类型 (出库)
                                OutMode = "",  //目标地址
                                Order = 1
                                Order = 1
                            };
                            if (beingTask.IsSuccess == 0)
                            {
@@ -3187,6 +3188,86 @@
        }
        //申请缠膜入库
        public int RequestPackWcs(string palletNo)
        {
            try
            {
                int t = -1;
                //验证托盘条码是否为空
                if (string.IsNullOrEmpty(palletNo))
                {
                    throw new Exception("未找到该托盘条码:"+ palletNo);
                }
                var palletBindList = Db.Queryable<BllPalletBind>().Where(m => m.IsDel == "0" && m.PalletNo == palletNo && m.Status == "1").OrderByDescending(m=>m.CreateTime).First();
                if (palletBindList.IsBale == "1")
                {
                    t = 1;
                }
                return t;
            }
            catch  (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
        //申请拆膜出库
        public int RequestUnPackWcs(string palletNo)
        {
            try
            {
                int t = -1;
                //验证托盘条码是否为空
                if (string.IsNullOrEmpty(palletNo))
                {
                    throw new Exception("未找到该托盘条码:" + palletNo);
                }
                var palletBindList = Db.Queryable<DataStockDetail>().Where(m => m.IsDel == "0" && m.PalletNo == palletNo && m.LocatNo.Substring(0,1) != "B").First();
                if (palletBindList.IsBelt == "1")
                {
                    palletBindList.IsBelt = "0";
                    Db.Updateable(palletBindList).ExecuteCommand();
                    t = 1;
                }
                return t;
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
        //缠膜完成
        public int RequestPackedWcs(string palletNo)
        {
            try
            {
                int t = -1;
                //验证托盘条码是否为空
                if (string.IsNullOrEmpty(palletNo))
                {
                    throw new Exception("未找到该托盘条码:" + palletNo);
                }
                var palletBindList = Db.Queryable<BllPalletBind>().Where(m => m.IsDel == "0" && m.PalletNo == palletNo && m.Status == "1").OrderByDescending(m => m.CreateTime).First();
                if (palletBindList.IsBale == "1")
                {
                    palletBindList.IsBelt = "1";
                    Db.Updateable(palletBindList).ExecuteCommand();
                }
                return t;
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
        ////重新下发入库任务
        //public OutCommandDto AgainSendAsnTask(string taskNo, int userId, string url)
Wms/WMS.BLL/BllCheckServer/StockCheckServer.cs
@@ -1397,8 +1397,8 @@
                                materiel_name = item.SkuName,
                                qty = item.Qty,
                                batch = item.LotNo,
                                producttime = item.ProductionTime,
                                expiry = item.ExpirationTime
                                producttime = item.ProductionTime.ToString().Substring(1, 8),
                                expiry = item.ExpirationTime.ToString().Substring(1, 8)
                            });
                        }
Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
@@ -1762,8 +1762,8 @@
                    SupplierLot = "",
                    InspectMark = "0",
                    BitPalletMark = "1",
                    IsBale = "0",
                    IsBelt = "0",
                    IsBale = arrivalnotice.IsBale,
                    IsBelt = arrivalnotice.IsBelt,
                    CreateUser = userId
                };
                // 插入托盘绑定表
@@ -1836,8 +1836,8 @@
                        BitPalletMark = "1",
                        InspectStatus = sku.IsInspect,// 组盘的时候就要默认设定好是否合格
                        PackagNo = sku.PackagNo,
                        IsBale = null,
                        IsBelt = null,
                        IsBale = arrivalnotice.IsBale,
                        IsBelt = arrivalnotice.IsBelt,
                        CreateUser = userId,
                        CreateTime = serverTime
                    };
@@ -2574,8 +2574,8 @@
                        SupplierLot = detail.SupplierLot,
                        InspectMark = "0",
                        BitPalletMark = "1",
                        IsBale = "0",
                        IsBelt = "0",
                        IsBale = detail.IsBale,
                        IsBelt = detail.IsBelt,
                        CreateUser = userId,
                        Demo = model.Demo,
Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs
@@ -1358,6 +1358,8 @@
            try
            {
                #region 判断信息
                //开启事务
                Db.BeginTran();
                var stockDetail = Db.Queryable<DataStockDetail>().Where(w => w.IsDel == "0" && w.PalletNo == palletNo).ToList();
                if (stockDetail.Count == 0)
@@ -1374,6 +1376,8 @@
                    throw new Exception("该托盘未在平库内,请检查!");
                }
                //起始储位信息
                var storageLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == locatNo);
                if (storageLocat == null)
@@ -1389,8 +1393,7 @@
                #endregion
                //开启事务
                Db.BeginTran();
                //需先判断目标地址前方是否有空储位
@@ -1422,8 +1425,18 @@
                        {
                            throw new Exception("托盘上物料箱码信息不存在,请检查!");
                        }
                        //var boxno = boxInfo.GroupBy(w => w.BoxNo).ToList();
                        var boxno = Db.Queryable<DataBoxInfo>().Where(m => m.IsDel == "0" && m.StockDetailId == item.Id).GroupBy(m => new
                        {
                            m.BoxNo
                        }).Select(it => new DataBoxInfo()
                        {
                            BoxNo = it.BoxNo
                        }).ToList();
                        //记录托盘上信息给MES
                        foreach (var item2 in boxInfo) {
                        foreach (var item2 in boxno) {
                            var a = item.ProductionTime.ToString();
                            data.Add(new RequertBeiliaoInfoModel()
                            {
                                no = item2.BoxNo,
@@ -1431,8 +1444,8 @@
                                materiel_name = item.SkuName,
                                qty = item.Qty,
                                batch = item.LotNo,
                                producttime = item.ProductionTime,
                                expiry = item.ExpirationTime
                                producttime = item.ProductionTime.ToString().Substring(0,10),
                                expiry = item.ExpirationTime.ToString().Substring(0, 10)
                            });
                        }
@@ -1459,14 +1472,16 @@
                if (EndLocat != null && EndLocat.AreaNo == "B12")
                {
                    //获取令牌
                    var token = new Token().GetMesToken(mesTokenUrl);
                    //var token = new Token().GetMesToken(mesTokenUrl);
                    var token = "";
                    Dictionary<string, string> mesDic = new Dictionary<string, string>()
                    {
                        {"Authorization",token }
                    };
                    var mescode = Db.Queryable<BllExportNotice>().Where(w => w.SONo == stockDetail.First().SONo).First();
                    var mesData = new RequertBeiliaoModel()
                    {
                        morder_no = stockDetail.First().SONo,
                        morder_no = mescode.OrderCode,
                        pallet = stockDetail.First().PalletNo,
                        layer_no = EndLocat.LocatNo,
                        items = data
@@ -1476,7 +1491,7 @@
                    var response = HttpHelper.DoPost(mesUrl, jsonData, "备料完成运至缓存区反馈至MES", "MES", mesDic);
                    var obj = JsonConvert.DeserializeObject<MesModel>(response);//解析返回数据
                    if (obj.status != "0")
                    if (obj.status != "success")
                    {
                        throw new Exception("备料同步MES失败:" + obj.message);
                    }
@@ -1501,7 +1516,6 @@
             
        }
        #endregion
        #region 箱码查询
Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs
@@ -4177,11 +4177,11 @@
                            throw new Exception("该箱码内存在支码不能进行数量拣货");
                        }
                        decimal boxQty = boxInfo.First().Qty;
                        if (Convert.ToInt32(pickQty1) > boxQty)
                        if (decimal.Parse(pickQty1) > boxQty)
                        {
                            throw new Exception("拣货数量不能大于箱内数量");
                        }
                        if (Convert.ToInt32(pickQty1) > needQty)
                        if (decimal.Parse(pickQty1) > needQty)
                        {
                            throw new Exception("拣货数量不能大于剩余待拣数量");
                        }
Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
@@ -230,6 +230,7 @@
                        Type = model.SoType,
                        Status = "0",
                        Origin = model.Origin,
                        OrderCode = model.OrderNo,
                        //CustomerNo = model.Customer,
                        //CustomerName = customer.CustomerName,
                        LogisticsId = logisticsId,
@@ -594,7 +595,7 @@
                    //添加出库单
                    foreach (var d in model.Detail)
                    {
                        if (d.Qty < 1)
                        if (d.Qty <=0)
                        {
                            throw new Exception("出库数量必须大于0");
                        }
@@ -1760,7 +1761,7 @@
                            if (unstackingMode2 == "0")//机器人拆垛
                            {
                                toLocation = loadingAddre;//装车口
                                toLocation = "009";//机器人拆垛统一发送到009工位,由PLC自动分配拆垛位
                            }
                            else //PDA拆垛
                            {
Wms/WMS.BLL/DataServer/StockServer.cs
@@ -203,7 +203,7 @@
            }
            if (!string.IsNullOrEmpty(categoryNo))
            {
                str += " and area.CategoryNo = @categoryNo";
                str += " and cat.CategoryNo = @categoryNo";
            }
            if (!string.IsNullOrEmpty(type))
            {
Wms/WMS.BLL/SysServer/StorageAreaServer.cs
@@ -326,6 +326,12 @@
                    case "4":
                        str = "空托区";
                        break;
                    case "5":
                        str = "耗材区";
                        break;
                    case "6":
                        str = "中间品区";
                        break;
                    default:
                        str = "";
                        break;
Wms/WMS.BLL/SysServer/StorageLocatServer.cs
@@ -145,7 +145,7 @@
        {
            try
            {
                var bl = LocatRst.EditStorageLocat(model.Id, model.Status, model.Flag, model.Temperature, userId);
                var bl = LocatRst.EditStorageLocat(model.Id, model.Status, model.Flag, model.Temperature,model.Area, userId);
                return bl;
            }
Wms/WMS.BLL/SysServer/Token.cs
@@ -67,6 +67,7 @@
                var obj = JsonConvert.DeserializeObject<MesTokenModel>(response);//解析返回数据
                
                if (obj.status != "success")
                {
                    throw new Exception("上传失败" + obj.message);
@@ -97,7 +98,7 @@
                        return token;
                    }
                }
                #endregion 
            }
            catch (Exception)
Wms/WMS.DAL/SysInfrastructure/MaterialsRepository.cs
@@ -114,7 +114,7 @@
        /// <returns></returns>
        public List<SysMaterials> GetMateByNo(string SkuNo)
        {
            string str = "select * from SysMaterials where SkuNo = @skuno";
            string str = "select * from SysMaterials where SkuNo = @skuno and isdel = '0'";
            List<SysMaterials> mate = Db.Ado.SqlQuery<SysMaterials>(str, new
            {
                skuno = SkuNo //物料编号
Wms/WMS.DAL/SysInfrastructure/StorageLocatRepository.cs
@@ -29,7 +29,7 @@
        /// <param name="temperature">存储环境</param>
        /// <param name="userId">操作人</param>
        /// <returns></returns>
        public bool EditStorageLocat(int id, string status, string flag, string temperature, int userId)
        public bool EditStorageLocat(int id, string status, string flag, string temperature,string area, int userId)
        {
            try
            {
@@ -69,6 +69,7 @@
                locate.Temperature = temperature;
                locate.UpdateUser = userId;
                locate.UpdateTime = DateTime.Now;
                locate.AreaNo = area;
                var i = Edit(locate);
                Db.CommitTran();
                return i > 0;
Wms/WMS.Entity/BllAsnEntity/BllBoxInfo.cs
@@ -221,6 +221,5 @@
        /// Nullable:True
        /// </summary>           
        public int QtyOrd { get; set; }
    }
}
Wms/WMS.Entity/SysEntity/SysToken.cs
@@ -30,5 +30,32 @@
        /// </summary>
        public DateTime? ExpireTime { get; set; }
        /// <summary>
        /// 删除标记
        /// Nullable:true
        /// </summary>
        public string IsDel { get; set; }
        /// <summary>
        /// 创建人
        /// Nullable:true
        /// </summary>
        public int? CreateUser { get; set; }
        /// <summary>
        /// 创建时间
        /// Nullable:true
        /// </summary>
        public DateTime? CreateTime { get; set; }
        /// <summary>
        /// 修改人
        /// Nullable:true
        /// </summary>
        public int? UpdateUser { get; set; }
        /// <summary>
        /// 修改时间
        /// Nullable:true
        /// </summary>
        public DateTime? UpdateTime { get; set; }
    }
}
Wms/WMS.IBLL/IBllAsnServer/IPalletBindServer.cs
@@ -136,6 +136,28 @@
        /// <returns></returns>
        OutCommandDto FullException(ReceiveWcsSignal model);
        /// <summary>
        /// WCS申请缠膜入库
        /// </summary>
        /// <param name="palletNo">托盘号</param>
        /// <returns></returns>
        int RequestPackWcs(string palletNo);
        /// <summary>
        /// WCS申请拆膜出库
        /// </summary>
        /// <param name="palletNo">托盘号</param>
        /// <returns></returns>
        int RequestUnPackWcs(string palletNo);
        /// <summary>
        /// WCS申请缠膜完成
        /// </summary>
        /// <param name="palletNo">托盘号</param>
        /// <returns></returns>
        int RequestPackedWcs(string palletNo);
        ///// <summary>
        ///// 重新下发入库任务
Wms/WMS.IDAL/ISysInterface/IStorageLocatRepository.cs
@@ -19,7 +19,7 @@
        /// <param name="temperature">存储环境</param>
        /// <param name="userId">操作人</param>
        /// <returns></returns>
        bool EditStorageLocat(int id, string status, string flag, string temperature, int userId);
        bool EditStorageLocat(int id, string status, string flag, string temperature,string area, int userId);
        /// <summary>
        /// 编辑储位信息集合
        /// </summary>
Wms/Wms/Controllers/BasisController.cs
@@ -1285,7 +1285,7 @@
                int i = await _mate.AddMate(matedto);
                await _operation.InsertOperation("基础信息", "物料管理", matedto.SkuNo, "添加", "添加物料信息 物料号:" + matedto.SkuNo, uid);
                return Ok(new { data = i, code = 0, msg = "成功" });
                return Ok(new { data = i, code = i, msg = "成功" });
            }
            catch (Exception ex)
Wms/Wms/Controllers/DownApiController.cs
@@ -429,7 +429,7 @@
                var bl = _exNoticeSvc.EmptyException(model);
                LogFile.SaveLogToFile($"空取异常:(执行结果成功),", logStr);
                return Ok(new { Success = 0, Message = "" });
                return Ok(new { Success = 0,StatusCode = 0, Message = "" });
            }
            catch (Exception e)
            {
@@ -454,7 +454,7 @@
                var list = _asnPalletBindSvc.FullException(model);
                LogFile.SaveLogToFile($"满入异常:( {JsonConvert.SerializeObject(list)} ),", logStr);
                return Ok(new { Success = 0, Message = "", TaskList = list });
                return Ok(new { Success = 0, StatusCode = 0, Message = "", TaskList = list });
            }
            catch (Exception e)
            {
@@ -588,6 +588,78 @@
            }
        }
        /// <summary>
        /// WCS申请是否缠膜
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [AllowAnonymous]
        [HttpPost]
        public IActionResult RequestPackWcs(RequesIsBale model)
        {
            var logStr = $@".\log\WCS\WCS申请缠膜拆膜" + DateTime.Now.ToString("yyyyMMdd") + ".txt";
            try
            {
               int t = _asnPalletBindSvc.RequestPackWcs(model.PalletNo);
                LogFile.SaveLogToFile($"WCS申请缠膜入库请求,请求托盘呈:( {model.PalletNo} ),", logStr);
                return Ok(new { Success = t, Message = "缠膜指令发送成功" });
            }
            catch (Exception e)
            {
                LogFile.SaveLogToFile($"WCS申请缠膜入库异常返回:( {e.Message} ),", logStr);
                return Ok(new ErpModel { Success = -1, Message = e.Message });
            }
        }
        /// <summary>
        /// WCS申请是否拆膜
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [AllowAnonymous]
        [HttpPost]
        public IActionResult RequestUnPackWcs(RequesIsBale model)
        {
            var logStr = $@".\log\WCS\WCS申请缠膜拆膜" + DateTime.Now.ToString("yyyyMMdd") + ".txt";
            try
            {
                int t = _asnPalletBindSvc.RequestUnPackWcs(model.PalletNo);
                return Ok(new { Success = t, Message = "拆膜指令发送成功" });
            }
            catch (Exception e)
            {
                LogFile.SaveLogToFile($"WCS申请拆膜出库异常返回:( {e.Message} ),", logStr);
                return Ok(new ErpModel { Success = -1, Message = e.Message });
            }
        }
        /// <summary>
        /// WCS反馈缠膜完成
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [AllowAnonymous]
        [HttpPost]
        public IActionResult RequestPackedWcs(RequesIsBale model)
        {
            var logStr = $@".\log\WCS\WCS申请缠膜拆膜" + DateTime.Now.ToString("yyyyMMdd") + ".txt";
            try
            {
                int t = _asnPalletBindSvc.RequestPackedWcs(model.PalletNo);
                return Ok(new { Success = t, Message = "缠膜完成指令发送成功" });
            }
            catch (Exception e)
            {
                LogFile.SaveLogToFile($"WCS申请缠膜完成异常返回:( {e.Message} ),", logStr);
                return Ok(new ErpModel { Success = -1, Message = e.Message });
            }
        }
        ///// <summary>
        ///// 成品箱码拆垛拣货
@@ -652,6 +724,7 @@
                switch (orderType)
                {
                    case "0"://入库任务执行
                    case "1"://出库任务执行
                    case "2"://盘库任务执行
                    case "3"://移库任务执行
Wms/Wms/appsettings.json
@@ -24,8 +24,8 @@
  },
  "ApiUrlConfig": {
    "ErpHost": "http://10.110.24.30:8081", //erpIP
    "MesHost": "http://10.110.24.30:8081", //mesIP
    "WcsHost": "http://10.18.52.10:5005", // "http://localhost:57061", //wcsIPhttp://localhost:57061/
    "MesHost": "http://10.18.99.67:3000", //mesIP
    "WcsHost": "http://10.60.16.10:5005", // "http://localhost:57061", //wcsIPhttp://localhost:57061/
    "BoxHost": "http://10.110.24.30:8081", //boxIP
    "AgvHost": "http://10.110.24.30:8081", //agvIP
@@ -41,9 +41,9 @@
    "GetBoxUrl": "/api/wmsInterface/OutStockTask", //获取箱码信息
    //MES
    "MesAsnFinishUrl": "/port/mes/service/mes/save_worder_feedback", //入库单关单反馈
    "MesBeiLiaoUrl": "/port/mes/service/mes/save_morder_feedback", //备料反馈(原料备料到生产车间缓存区)
    "MesGetTokenUrl": "/port/mes/service/system/sign_login", //获取令牌
    "MesAsnFinishUrl": "/mes/service/mes/save_worder_feedback", //入库单关单反馈
    "MesBeiLiaoUrl": "/mes/service/mes/save_morder_feedback", //备料反馈(原料备料到生产车间缓存区)
    "MesGetTokenUrl": "/mes/service/system/sign_login", //获取令牌
    // 赋码
    "FuMaGetBoxUrl": "/port/mes/service/system/sign_login", //获取赋码箱码信息
    "FuMaGetTokenUrl": "/port/mes/service/system/sign_login", //获取令牌