lss
2025-05-16 a8baebe7ac7d7e03ae833815e8d94b996dfd3b5e
HH.WCS.Mobox3/HH.WCS.Mobox3.JiaTong/process/DeviceProcess.cs
@@ -4,6 +4,7 @@
using HH.WCS.JiaTong.util;
using HH.WCS.JiaTong.wms;
using Newtonsoft.Json;
using S7.Net;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -31,7 +32,7 @@
                    {
                        if (data == "")
                        {
                            Traystacker(plc);
                            // Traystacker(plc);
                        }
                    }
                }
@@ -45,13 +46,13 @@
        /// <summary>
        /// 叠盘机空托返回
        /// </summary>    
        internal static void Traystacker(Settings.deviceInfo device)
        internal static void Traystacker(string loc, int qty)
        {
            try
            {
                //上传数据
                Result<Traystacker> result1 = new Result<Traystacker>();
                Traystacker traystacker = new Traystacker() { station = device.TN_Location[0], taskSource = 1, Qty = 7 };
                Traystacker traystacker = new Traystacker() { station = loc, taskSource = 1, Qty = qty };
                result1.data.Add(traystacker);
                HttpHelper httpHelper = new HttpHelper();
                Result result = new Result();
@@ -106,10 +107,39 @@
                    }
                }
            }
        }
        internal static void KjTraffic()
        {
            var db = new SqlHelper<object>().GetInstance();
            List<string> locs = new List<string>() { "PMDDW-001" };
            var location = db.Queryable<Location>().Where(a => locs.Contains(a.S_CODE)).ToList();
            if (location.Count > 0)
            {
                // string cntrcode = "";
                foreach (var item in location)
                {
                    if (item.N_CURRENT_NUM >= 6)
                    {
                        //var cntr = db.Queryable<LocCntrRel>().Where(a => a.S_LOC_CODE.Trim() == item.S_CODE).ToList();
                        //if (cntr.Count > 0)
                        //{
                        //    var cntrcodes = cntr.Select(a => a.S_CNTR_CODE).ToArray();
                        //    cntrcode = string.Join(",", cntrcodes);
                        //}
                        //创建过未完成的任务不发起请求
                        var mst = WCSHelper.GetTaskByStartloc(item.S_CODE);
                        if (mst == null)
                        {
                            Traystacker(item.S_CODE, item.N_CURRENT_NUM);
                        }
                    }
                }
            }
        }
        /// <summary>
        /// 原材料库接口访问
        /// </summary>