111
lss
11 小时以前 23c28e3c0437081a78a48e54dc066c87500fa8bc
HH.WCS.Mobox3 - ´ó³µ¼ä/HH.WCS.Mobox3.JiaTong/core/WCSCore.cs
@@ -1,7 +1,7 @@
using HH.WCS.JiaTong.dispatch;
using HH.WCS.JiaTong.process;
using HH.WCS.JiaTong.util;
using HH.WCS.JiaTong.wms;
using HH.WCS.JiaTong_DCJ.dispatch;
using HH.WCS.JiaTong_DCJ.process;
using HH.WCS.JiaTong_DCJ.util;
using HH.WCS.JiaTong_DCJ.wms;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
@@ -10,10 +10,10 @@
using System.Net.NetworkInformation;
using System.Security.Policy;
using System.Threading.Tasks;
using static HH.WCS.JiaTong.api.ApiModel;
using static HH.WCS.JiaTong.util.Settings;
using static HH.WCS.JiaTong_DCJ.api.ApiModel;
using static HH.WCS.JiaTong_DCJ.util.Settings;
namespace HH.WCS.JiaTong.core
namespace HH.WCS.JiaTong_DCJ.core
{
    internal class WCSCore
    {
@@ -74,15 +74,12 @@
                        }
                        WCSHelper.AddActionRecord(model.task_no, model.state, model.forklift_no, model.ext_data);
                        //任务回报  5.mes下发
                        if (TN_Task.Z_TYPE == 5)
                        {
                            //TN_Task = WCSHelper.GetTask(TN_Task.S_CODE);
                            string urlstate = Settings.tableUrls.Find(a => a.id == 1).url;
                            TaskProcess.MESReportback(TN_Task, model.state, urlstate);
                        }
                        else
                        {
                            //立库与wms任务回报
                            TableUrl url = null;
                            switch (TN_Task.Z_TYPE)
@@ -110,9 +107,9 @@
                                        LogHelper.Info("原材料任务回报,根据id=9未找到地址配置文件,请检查配置文件");
                                    }
                                    break;
                            }
                        }
                    }
                    else
                    {
@@ -122,10 +119,29 @@
                        {
                            WCSHelper.AddActionRecord(model.task_no, model.state, model.forklift_no, model.ext_data);
                        }
                        //安全请求等
                        string url = Settings.tableUrls.Find(a => a.id == 2).url;
                        string name = "Mes";
                        string url = "";
                        string name = "";
                        if (TN_Task.Z_TYPE == 1)
                        {
                            url = Settings.tableUrls.Find(a => a.id == 6).url;
                            name = "ML";
                        }
                        else if (TN_Task.Z_TYPE == 2)
                        {
                            url = Settings.tableUrls.Find(a => a.id == 7).url;
                            name = "YBK";
                        }
                        else if (TN_Task.Z_TYPE == 5)
                        {
                            url = Settings.tableUrls.Find(a => a.id == 2).url;
                            name = "Mes";
                        }
                        else
                        {
                            LogHelper.Info($"安全请求:任务类型错误,当前任务类型{TN_Task.Z_TYPE}");
                        }
                        if (!string.IsNullOrEmpty(url))
                        {
                            TaskProcess.OperateReq(model, url, TN_Task, name);
@@ -161,7 +177,7 @@
                        {
                            var AreaCodes = AreasByGroup.Select(a => a.S_CODE).ToList();
                            LogHelper.Info($"任务{mst.S_CODE},根据终点区域获取库区编码:{JsonConvert.SerializeObject(AreaCodes)}");
                            var updateMst = db.Queryable<WCSTask>().Where(a => AreaCodes.Contains(a.S_END_AREA.Trim()) && a.S_B_STATE == "等待推送").OrderBy(a=>a.T_CREATE).First();
                            var updateMst = db.Queryable<WCSTask>().Where(a => AreaCodes.Contains(a.S_END_AREA.Trim()) && a.S_B_STATE == "等待推送").OrderBy(a => a.T_CREATE).First();
                            updateMst.S_B_STATE = "等待";
                            db.Updateable(updateMst).UpdateColumns(it => new { it.S_B_STATE }).ExecuteCommand();
                        }
@@ -212,6 +228,7 @@
                });
            }
            else { Console.WriteLine($"无可推送任务"); }
        }
        /// <summary>