分支自 SuZhouGuanHong/TaiYuanTaiZhong

dengjunjie
2024-04-19 c862dd0756111a4264666f7e7636a5a062cce806
修改MES接口,优化托盘更换逻辑
已修改18个文件
265 ■■■■ 文件已修改
代码管理/PCS/WCS_Client/src/api/http.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_Entity/DomainModels/System/dt_inventory.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/Jobs/Task/AutoTaskJob.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/Jobs/equipment/PipelineJob.cs 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/GetStation/EmptyPalletStation.cs 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/OutboundTask.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/ReplaceTray.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/StationTask.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WebApi/appsettings.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_Comm/MES_Info/BasicSN.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_Comm/MES_Info/Request/agvInWarehousePara.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_Comm/MES_Info/Request/agvMoveWarehousePara.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_Entity/DomainModels/System/dt_inventory.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_WMS/Common/AGVTask/HandleTask.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_WMS/Common/AGVTask/HandleTask_Mes.cs 55 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_stationinfoService.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
´úÂë¹ÜÀí/PCS/WCS_Client/src/api/http.js
@@ -12,7 +12,7 @@
let loadingInstance;
let loadingStatus = false;
if (process.env.NODE_ENV == 'development') {
    axios.defaults.baseURL = 'http://127.0.0.1:8099/';
    axios.defaults.baseURL = 'http://192.168.12.101:8099/';
}
else if (process.env.NODE_ENV == 'debug') {
    axios.defaults.baseURL = 'http://192.168.12.101:8099/';
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_Entity/DomainModels/System/dt_inventory.cs
@@ -138,11 +138,19 @@
        [Editable(true)]
        public string area { get; set; }
        /// <summary>
        /// å·¥ä½œä»¤å·
        /// å·¥å•编号
        /// </summary>
        [Display(Name = "工单编号")]
        [Column(TypeName = "nvarchar(40)")]
        [Editable(true)]
        public string jobID { get; set; }
        /// <summary>
        /// å·¥ä½œä»¤å·
        /// </summary>
        [Display(Name = "工作令号")]
        [Column(TypeName = "nvarchar(40)")]
        [Editable(true)]
        public string workOrder { get; set; }
    }
}
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs
@@ -832,8 +832,14 @@
                                #region è§¦å‘NG任务
                                var NG = Stations.Where(x => x.enable && x.stationCode == NGStation && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).FirstOrDefault();
                                if (NG != null)
                                        agvtask(stationinfoRepository, NG, Work, "TaskType_OutsourceInbound");
                                {
                                    agvtask(stationinfoRepository, NG, Work, "TaskType_OutsourceInbound");
                                    continue;
                                }
                                #endregion
                                Stationinfo = Stations.Where(x => x.enable && x.stationCode == NGStation && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity == 0).FirstOrDefault();
                            }
                            if (Stationinfo != null)
                            {
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/Jobs/Task/AutoTaskJob.cs
@@ -23,6 +23,7 @@
            try
            {
                ExecuteJob(context, DoAction);
            }
            catch { }
            return Task.CompletedTask;
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/Jobs/equipment/PipelineJob.cs
@@ -264,32 +264,41 @@
                            continue;
                        }
                        var EmptyStation = GetStation.EmptyPalletStation(area);
                        #region ç©ºæ‰˜å ç›˜
                        var EmptyStations = stationinfoRepository.Find(x => x.stationCode.Contains("DD") && x.quantity < 5 && x.enable).ToList();
                        var EmptyStation = EmptyStations.Where(x => x.tray_type == station.tray_type && x.location_state == LocationStateEnum.Stroge.ToString()).FirstOrDefault();
                        if (EmptyStation == null)
                            EmptyStation = EmptyStations.Where(x => x.location_state == LocationStateEnum.Empty.ToString()).FirstOrDefault();
                        #endregion
                        if (EmptyStation == null)//查找库内空托盘
                            EmptyStation = GetStation.EmptyPalletStation(area);
                        #region æŸ¥æ‰¾åº“区一空托盘空货位
                       // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") && x.location_state != LocationStateEnum.Busy.ToString() && x.enable)
                       //.OrderBy(x => x.column).ThenByDescending(x => x.line).FirstOrDefault();//查找没有任务的空托盘货位
                        // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") && x.location_state != LocationStateEnum.Busy.ToString() && x.enable)
                        //.OrderBy(x => x.column).ThenByDescending(x => x.line).FirstOrDefault();//查找没有任务的空托盘货位
                       // if (EmptyStation != null)
                       // {
                       //     if (stationinfoRepository.Find(x => x.area == EmptyStation.area && x.stationCode.Contains("A") && x.column == EmptyStation.column && x.location_state.Contains("Busy")).Any())
                       //     {
                       //         EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") && x.column != EmptyStation.column && x.location_state != LocationStateEnum.Busy.ToString() && x.enable).OrderBy(x => x.column).ThenByDescending(x => x.line).FirstOrDefault();//排除当列存在任务的货位
                       //     }
                       //     if (EmptyStation != null && EmptyStation.line == 2)//如果任务存在第二行,排查第一行是否有货
                       //     {
                       //         if (stationinfoRepository.Find(x => x.area == EmptyStation.area && x.stationCode.Contains("A") && x.column == EmptyStation.column && x.line == 1 && x.location_state != LocationStateEnum.Empty.ToString()).Any()) EmptyStation = null;
                       //     }
                       // }
                        // if (EmptyStation != null)
                        // {
                        //     if (stationinfoRepository.Find(x => x.area == EmptyStation.area && x.stationCode.Contains("A") && x.column == EmptyStation.column && x.location_state.Contains("Busy")).Any())
                        //     {
                        //         EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") && x.column != EmptyStation.column && x.location_state != LocationStateEnum.Busy.ToString() && x.enable).OrderBy(x => x.column).ThenByDescending(x => x.line).FirstOrDefault();//排除当列存在任务的货位
                        //     }
                        //     if (EmptyStation != null && EmptyStation.line == 2)//如果任务存在第二行,排查第一行是否有货
                        //     {
                        //         if (stationinfoRepository.Find(x => x.area == EmptyStation.area && x.stationCode.Contains("A") && x.column == EmptyStation.column && x.line == 1 && x.location_state != LocationStateEnum.Empty.ToString()).Any()) EmptyStation = null;
                        //     }
                        // }
                       // if (EmptyStation == null)
                       // {
                       //     EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Busy.ToString() && x.enable).OrderByDescending(x => x.column).FirstOrDefault();//最后一个货位有任务则不能生成入库任务
                       //     if (EmptyStation != null) continue;
                       //     EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Stroge.ToString() && x.enable).OrderByDescending(x => x.column).FirstOrDefault();//找最外面没堆满5个的货位
                       //     if (EmptyStation == null)
                       //         EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.column).FirstOrDefault();
                       // }
                        // if (EmptyStation == null)
                        // {
                        //     EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Busy.ToString() && x.enable).OrderByDescending(x => x.column).FirstOrDefault();//最后一个货位有任务则不能生成入库任务
                        //     if (EmptyStation != null) continue;
                        //     EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Stroge.ToString() && x.enable).OrderByDescending(x => x.column).FirstOrDefault();//找最外面没堆满5个的货位
                        //     if (EmptyStation == null)
                        //         EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.column).FirstOrDefault();
                        // }
                        #endregion
@@ -364,7 +373,7 @@
                        if (Station.location_state == LocationStateEnum.Stroge.ToString() && PalletSignal != 1)
                        {
                            Station.location_state = LocationStateEnum.Abnormal.ToString();
                            Station.remark = "货位有货,光电检测无托盘";
                            Station.remark = "光电检测无托盘";
                            stationinfoRepository.Update(Station, true);
                            client.WriteByOrder("W_AlarmSignal", (Int16)2, name);//报警
                            WriteDBLog.Error(name + "报警", $"货位编号:{Station.stationCode};错误信息:{Station.remark}", "PCS");
@@ -373,7 +382,7 @@
                        if (Station.location_state == LocationStateEnum.Empty.ToString() && (PalletSignal == 1 || MaterialSignal == 1))//系统货位为空,光电检测有料
                        {
                            Station.location_state = LocationStateEnum.Abnormal.ToString();
                            Station.remark = "货位无货,光电检测有料";
                            Station.remark = "光电检测有料";
                            stationinfoRepository.Update(Station, true);
                            client.WriteByOrder("W_AlarmSignal", (Int16)2, name);//报警
                            WriteDBLog.Error(name + "报警", $"货位编号:{Station.stationCode};错误信息:{Station.remark}", "PCS");
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/GetStation/EmptyPalletStation.cs
@@ -12,11 +12,34 @@
using WIDESEA_WCS.WCSClient;
using WIDESEA_WMS.IRepositories;
using WIDESEA_WMS.Repositories;
using static System.Collections.Specialized.BitVector32;
namespace WIDESEA_WCS.JobsPart.Common
{
    public class GetStation
    {
        /// <summary>
        /// æ‰¾å¯å…¥åº“空托位
        /// </summary>
        public static void EmptyStation()
        {
            try
            {
                VOLContext Context = new VOLContext();
                Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context);
                Idt_agvtaskRepository agvtaskService = new dt_agvtaskRepository(Context);
                var Stations = stationinfoRepository.Find(x => x.stationCode.Contains("DD") && x.quantity == 5 && x.enable).ToList();
                foreach (var Station in Stations)
                {
                    var area = Station.tray_type == "SmallTray" ? "11" : "10";
                }
            }
            catch (Exception ex)
            {
            }
        }
        /// <summary>
        /// èŽ·å–ç©ºæ‰˜ç›˜è´§ä½
        /// </summary>
@@ -42,14 +65,18 @@
                        EmptyStation = stationinfoRepository.Find(x => x.quantity > 0 && x.stationCode == "C01005001"/* && x.location_state == "Stroge"*/ && x.tray_status == "EmptyTray" && x.enable).FirstOrDefault();
                    if (EmptyStation != null)
                        EmptyStation = stationinfoRepository.Find(x => x.quantity > 0 && x.area == EmptyStation.area && x.line == EmptyStation.line /*&& x.location_state == "Stroge"*/ && x.tray_status == "EmptyTray" && x.enable).OrderByDescending(x => x.column).FirstOrDefault();
                    if (EmptyStation != null)
                        if (EmptyStation.location_state == LocationStateEnum.Busy.ToString()) EmptyStation = null;
                    if (EmptyStation != null)//空托货位不为空判断是否存在其他任务
                        if (stationinfoRepository.Find(x => x.line == EmptyStation.line && x.area == EmptyStation.area && x.location_state.Contains("Busy")).Any()) EmptyStation = null;
                    //if (EmptyStation.location_state == LocationStateEnum.Busy.ToString()) EmptyStation = null;
                }
                #endregion
                #region æŸ¥æ‰¾ç©ºæ‰˜åº“区
                if (EmptyStation == null)
                    EmptyStation = stationinfoRepository.Find(x => x.quantity > 0 && x.area == area /*&& x.location_state == "Stroge"*/ && x.tray_status == "EmptyTray" && x.enable).OrderBy(x => x.column).FirstOrDefault();
                if (EmptyStation != null)
                    if (EmptyStation.location_state == LocationStateEnum.Busy.ToString()) EmptyStation = null;
                    if (stationinfoRepository.Find(x => x.line == EmptyStation.line && x.area == EmptyStation.area && x.location_state.Contains("Busy")).Any()) EmptyStation = null;
                //if (EmptyStation.location_state == LocationStateEnum.Busy.ToString()) EmptyStation = null;
                if (EmptyStation != null)
                {
                    var PalletSignal = Pipeline_client.ReadByOrder<Int16>("R_PalletSignal", task.agv_toaddress);//读取托盘信号:1:有,2无
@@ -65,6 +92,8 @@
                        WriteDBLog.Success("更新空盘队列任务", $"任务编号:{task.agv_tasknum}", "PCS");
                    }
                }
                #endregion
            }
            catch (Exception ex)
            {
@@ -110,7 +139,7 @@
                Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context);
                #region æŸ¥æ‰¾ç©ºæ‰˜ç›˜åº“区
                if (stationinfoRepository.Find(x => x.area == area && x.location_state == LocationStateEnum.Busy.ToString()).Any())
                if (stationinfoRepository.Find(x => x.area == area && x.location_state == LocationStateEnum.Busy.ToString()).Any() && area != "10")
                {
                    var EmptyStation = stationinfoRepository.Find(x => x.stationCode == "C01005001" && x.location_state == LocationStateEnum.Empty.ToString()).FirstOrDefault();
                    if (EmptyStation != null)
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/OutboundTask.cs
@@ -105,7 +105,7 @@
                                    agv_toaddress = "",
                                    agv_userid = "系统",
                                    bindSN = stationinfo.bindSN,
                                    jobID = Mes_Work.jobID,
                                    jobID = Mes_Work.workOrder,
                                    agv_worktype = Convert.ToInt32(Mes_Work.processCode),
                                    agv_materbarcode = Mes_Work.materialCode,
                                    agv_Traytype = stationinfo.tray_type,
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/ReplaceTray.cs
@@ -57,9 +57,10 @@
                VOLContext context = new VOLContext();
                Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(context);
                Idt_agvtaskRepository agvtaskRepository = new dt_agvtaskRepository(context);
                var stations = stationinfoRepository.Find(x => x.stationCode.Contains("X") && x.location_state == "Abnormal" /*LocationStateEnum.Abnormal.ToString()*/ && (x.tray_type == "SmallTray/LargeTray" || x.tray_type == "LargeTray/SmallTray")).ToList();
                var stations = stationinfoRepository.Find(x => (x.stationCode.Contains("X")|| x.stationCode.Contains("W01001004") || x.stationCode.Contains("W01001005")) && x.location_state == "Abnormal" /*LocationStateEnum.Abnormal.ToString()*/ && (x.tray_type == "SmallTray/LargeTray" || x.tray_type == "LargeTray/SmallTray") && x.enable).ToList();
                foreach (var station in stations)
                {
                    if (agvtaskRepository.Find(x => x.agv_fromaddress == station.stationCode || x.agv_toaddress == station.stationCode).Any()) continue;
                    var types = station.tray_type.Split('/');
                    var area = types[0] == "SmallTray" ? "11" : "10";
                    //找1库区的空托位
@@ -93,6 +94,8 @@
                            agv_Traytype = types[0]
                        };
                        agvtaskRepository.Add(agvtask, true);
                        station.location_state = LocationStateEnum.Busy.ToString();
                        stationinfoRepository.Update(EmptyStation, true);
                        EmptyStation.location_state = LocationStateEnum.Busy.ToString();
                        stationinfoRepository.Update(EmptyStation, true);
                        WriteDBLog.Success("创建更换空盘任务", $"任务编号:{agvtask.agv_tasknum}", "PCS");
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs
@@ -43,7 +43,7 @@
                            if (task.agv_tasknum.Contains("_"))
                            {
                                string mainTaskNum = task.agv_tasknum.Split('_')[0];
                                if (agvtaskService.Find(x => x.agv_tasknum == mainTaskNum && (task.agv_taskstate == "Executing1" || task.agv_taskstate == "Complete1")).Any())
                                if (agvtaskService.Find(x => x.agv_tasknum == mainTaskNum && task.agv_taskstate != "Executing" && task.agv_taskstate != "Create").Any() || !agvtaskService.Find(x => x.agv_tasknum == mainTaskNum).Any())
                                    GetStation.EmptyPalletStation(task);
                            }
                            else
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/StationTask.cs
@@ -393,7 +393,21 @@
            }
            return TargetLocation;
        }
        /// <summary>
        /// ä¸´æ—¶ä½¿ç”¨
        /// </summary>
        /// <param name="stationinfoRepository"></param>
        /// <returns></returns>
        public static dt_stationinfo GetEmptyLocation1(Idt_stationinfoRepository stationinfoRepository)
        {
            return stationinfoRepository.Find(x => x.line == 1 && x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == "3").OrderBy(x => x.column).FirstOrDefault();//行和区域需写死
        }
        /// <summary>
        /// åŽ»å¤–å
        /// </summary>
        /// <param name="stationinfoRepository"></param>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        public static dt_stationinfo GetEmptyLocation(Idt_stationinfoRepository stationinfoRepository)
        {
            dt_stationinfo TargetLocation = null;
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WebApi/appsettings.json
@@ -16,7 +16,7 @@
  "Connection": {
    "DBType": "MsSql", //MySql/MsSql/PgSql  //数据库类型,如果使用的是sqlserver此处应设置为MsSql
    //sqlserver连接字符串P@ssw0rd
    "DbConnectionString": "Data Source=.;Initial Catalog=WIDESEA_DB;Persist Security Info=True;User ID=sa;Password=P@ssw0rd;Connect Timeout=500;",
    "DbConnectionString": "Data Source=192.168.12.101;Initial Catalog=WIDESEA_DB;Persist Security Info=True;User ID=sa;Password=123456;Connect Timeout=500;",
    //mysql连接字符串(升级EFCore3.1到时已将mysql连接字符串修改,2019-12-20)
    // "DbConnectionString": " Data Source=127.0.0.1;Database=netcoredev;AllowLoadLocalInfile=true;User ID=root;Password=123456;allowPublicKeyRetrieval=true;pooling=true;CharSet=utf8;port=3306;sslmode=none;",
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_Comm/MES_Info/BasicSN.cs
@@ -13,8 +13,27 @@
    {
        public class detail
        {
            /// <summary>
            /// è½¦è½®SN号
            /// </summary>
            public string sn { get; set; }
            /// <summary>
            /// å·¥å•号
            /// </summary>
            public string jobID { get; set; }
            /// <summary>
            /// å·¥å•类型 (17-机加工 28-检测线)
            /// </summary>
            public string processCode { get; set; }
        }
        public class detail1
        {
            /// <summary>
            /// è½¦è½®SN号
            /// </summary>
            public string sn { get; set; }
        }
    }
}
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_Comm/MES_Info/Request/agvInWarehousePara.cs
@@ -11,11 +11,11 @@
        /// <summary>
        /// å·¥å•编号
        /// </summary>
        public string JobID { get; set; }
        public string WorkOrder { get; set; }
        /// <summary>
        /// 17-机加工 28-检测线
        /// </summary>
        public string processCode { get; set; }
        //public string processCode { get; set; }
        /// <summary>
        /// è½¦è½®ä¿¡æ¯
@@ -42,5 +42,11 @@
        /// </summary>
        public int? layerNo { get; set; }
        /// <summary>
        /// æ“ä½œè€…
        /// </summary>
        public string Operator { get; set; }
    }
}
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_Comm/MES_Info/Request/agvMoveWarehousePara.cs
@@ -14,7 +14,7 @@
        /// <summary>
        /// è½¦è½®SN
        /// </summary>
        public List<detail> details { get; set; }
        public List<detail1> details { get; set; }
        /// <summary>
        /// æºåº“房名称
@@ -55,5 +55,10 @@
        /// ç›®æ ‡å±‚号
        /// </summary>
        public string toLayerNo { get; set;}
        /// <summary>
        /// æ“ä½œè€…
        /// </summary>
        public string Operator { get; set; }
    }
}
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_Entity/DomainModels/System/dt_inventory.cs
@@ -136,11 +136,19 @@
        [Editable(true)]
        public string area { get; set; }
        /// <summary>
        /// å·¥å•编号/工作令号
        /// å·¥å•编号
        /// </summary>
        [Display(Name = "工单编号")]
        [Column(TypeName = "nvarchar(40)")]
        [Editable(true)]
        public string jobID { get; set; }
        /// <summary>
        /// å·¥ä½œä»¤å·
        /// </summary>
        [Display(Name = "工作令号")]
        [Column(TypeName = "nvarchar(40)")]
        [Editable(true)]
        public string workOrder { get; set; }
    }
}
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WMS/Common/AGVTask/HandleTask.cs
@@ -116,7 +116,8 @@
                        Operator = "admin",
                        stationCode = task.agv_toaddress,
                        area = station.area,
                        jobID = mes_Work.workOrder,
                        jobID = mes_Work.jobID,
                        workOrder = mes_Work.workOrder,
                        ID = Guid.NewGuid()
                    };
                    inventorys.Add(inventory);
@@ -171,7 +172,7 @@
                ////空托任务需修改逻辑
                if (station2.stationCode.Contains("X"))
                    station2.quantity = 0;// task.agv_tasktype.Contains("TaskType_EmptyPallet") ? 0 : task.agv_qty; //task.agv_qty;
                else if (station2.area == "10" || station2.area == "11" || (station2.stationCode.Contains("C") && task.agv_tasktype == "TaskType_EmptyPallet")) //入库空托任务
                else if (station2.area == "10" || station2.area == "11" || (station2.stationCode.Contains("C") && task.agv_tasktype == "TaskType_EmptyPallet") || station2.stationCode.Contains("DD")) //入库空托任务
                    station2.quantity = station2.quantity + task.agv_qty;
                else
                    station2.quantity = task.agv_qty;
@@ -198,8 +199,12 @@
                //else
                //    station1.quantity = 0;
                #endregion
                if (station1.area == "10" || station1.area == "11" || (station1.stationCode.Contains("C") && task.agv_tasktype == "TaskType_EmptyPallet")) //出库空托任务
                if (station1.stationCode.Contains("DD"))//叠盘库位
                {
                    station1.quantity = station1.quantity - task.agv_qty;
                    station1.location_state = LocationStateEnum.Stroge.ToString();
                }
                else if (station1.area == "10" || station1.area == "11" || (station1.stationCode.Contains("C") && task.agv_tasktype == "TaskType_EmptyPallet")) //出库空托任务
                {
                    station1.location_state = LocationStateEnum.Stroge.ToString();
                    station1.quantity = station1.quantity - 1;
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WMS/Common/AGVTask/HandleTask_Mes.cs
@@ -1,13 +1,17 @@
using Confluent.Kafka;
using Newtonsoft.Json;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
using OfficeOpenXml.FormulaParsing.Excel.Operators;
using WIDESEA_Comm.LogInfo;
using WIDESEA_Comm.MES_Info;
using WIDESEA_Comm.MES_Info.Request;
using WIDESEA_Common;
using WIDESEA_Core.EFDbContext;
using WIDESEA_Core.FreeDB;
using WIDESEA_Entity.DomainModels;
using WIDESEA_Entity.ToAGV;
using WIDESEA_WMS.IRepositories;
using WIDESEA_WMS.Repositories;
using static WIDESEA_Comm.MES_Info.BasicSN;
namespace WIDESEA_WMS.Common.AGVTask
@@ -34,24 +38,45 @@
                {
                    throw new Exception("无任务数据");
                }
                VOLContext context = new VOLContext();
                IVV_Mes_WorkinfoRepository workinfoRepository = new VV_Mes_WorkinfoRepository(context);
                if (task.agv_tasktype == AGVTaskTypeEnum.TaskType_Outbound.ToString() /*|| task.agv_tasktype == AGVTaskTypeEnum.TaskType_OutsourceOutbound.ToString()*/|| task.agv_tasktype == AGVTaskTypeEnum.TaskType_OutsourceCarry.ToString())
                {
                    foreach (var item in task.bindSN.Split(","))
                    if(task.agv_tasktype == AGVTaskTypeEnum.TaskType_Outbound.ToString())
                    {
                        detail detail = new detail();
                        detail.sn = item;
                        list.Add(detail);
                        foreach (var item in task.bindSN.Split(","))
                        {
                            var work = workinfoRepository.Find(x => x.SN == item && x.processCode == task.agv_worktype.ToString()).FirstOrDefault();
                            detail detail = new detail();
                            detail.sn = item;
                            detail.jobID = work.jobID;
                            detail.processCode = work.processCode;
                            list.Add(detail);
                        }
                    }
                    else
                    {
                        foreach (var item in task.bindSN.Split(","))
                        {
                            //var work = workinfoRepository.Find(x => x.SN == item && x.processCode == "28").FirstOrDefault();
                            detail detail = new detail();
                            detail.sn = item;
                            detail.jobID = task.jobID;
                            detail.processCode = task.agv_worktype.ToString();
                            list.Add(detail);
                        }
                    }
                    agvInWarehousePara outWarehousePara = new agvInWarehousePara()
                    {
                        JobID = task.jobID,
                        WorkOrder = task.jobID,
                        zoneID = task.agv_fromaddress,
                        processCode = task.agv_worktype.ToString(),
                        //processCode = task.agv_worktype.ToString(),
                        details = list,
                        layerNo = 1,
                        stackID = "1",
                        warehouseName = "Agv库",
                        Operator="AGV自动",
                    };
                    obj = outWarehousePara;
                    ActionName = "agvOutWarehouse";//AGV->MES车轮出库
@@ -61,19 +86,23 @@
                {
                    foreach (var item in task.bindSN.Split(","))
                    {
                        var work = workinfoRepository.Find(x => x.SN == item && x.processCode == task.agv_worktype.ToString()).FirstOrDefault();
                        detail detail = new detail();
                        detail.sn = item;
                        detail.jobID = work.jobID;
                        detail.processCode = work.processCode;
                        list.Add(detail);
                    }
                    agvInWarehousePara inWarehousePara = new agvInWarehousePara()
                    {
                        JobID = task.jobID,
                        WorkOrder = task.jobID,
                        zoneID = task.agv_toaddress,
                        processCode = task.agv_worktype.ToString(),
                        //processCode = task.agv_worktype.ToString(),
                        details = list,
                        layerNo = 1,
                        stackID = "1",
                        warehouseName = "Agv库",
                        Operator = "AGV自动",
                    };
                    obj = inWarehousePara;
                    ActionName = "agvInWarehouse";//AGV->MES车轮入库
@@ -82,23 +111,25 @@
                //else if (task.agv_tasktype == "Transfer")  //移库区分  åº“内移库
                else if (task.agv_tasktype == AGVTaskTypeEnum.TaskType_Carry.ToString())  //移库区分  åº“内移库
                {
                    List<detail1> list1 = new List<detail1>(); //车轮信息
                    foreach (var item in task.bindSN.Split(","))
                    {
                        detail detail = new detail();
                        detail1 detail = new detail1();
                        detail.sn = item;
                        list.Add(detail);
                        list1.Add(detail);
                    }
                    agvMoveWarehousePara moveWarehousePara = new agvMoveWarehousePara()
                    {
                        fromZoneID = task.agv_fromaddress,
                        toZoneID = task.agv_toaddress,
                        details = list,
                        details = list1,
                        fromLayerNo = "1",
                        fromStackID = "1",
                        fromWarehouseName = "Agv库",
                        toLayerNo = "1",
                        toStackID = "1",
                        toWarehouseName = "Agv库",
                        Operator = "AGV自动",
                    };
                    obj = moveWarehousePara;
                    ActionName = "agvMoveWarehouse";//AGV->MES车轮移库
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_stationinfoService.cs
@@ -146,7 +146,8 @@
                station.heatNumber = string.Empty;
                station.Number = string.Empty;
            }
            station.tray_status = list.Count == 0 ? "EmptyTray" : "StrogeTray";
            station.tray_status = string.IsNullOrEmpty(station.stationType) ? "EmptyTray" : "StrogeTray";
            //station.tray_status = list.Count == 0 ? "EmptyTray" : "StrogeTray";
            if (station.location_state == "Empty")
            {
                station.stationType = string.Empty;
@@ -156,8 +157,8 @@
                station.tray_status = string.Empty;
                station.bindSN = string.Empty;
                station.quantity = 0;
                if (!station.stationCode.Contains("S") && !station.stationCode.Contains("X") && !station.stationCode.Contains("W01001004") && !station.stationCode.Contains("W01001005"))
                    station.tray_type = string.Empty;
                //if (!station.stationCode.Contains("S") && !station.stationCode.Contains("X") && !station.stationCode.Contains("W01001004") && !station.stationCode.Contains("W01001005"))
                //    station.tray_type = string.Empty;
            }
            var count = _repository.Update(station, true);
            if (count > 0)