czw
2025-06-23 e552f3366723d8a2392ca59e95e5d9589ad7a858
HH.WCS.QingXiNongfu/process/DeviceProcess.cs
@@ -1,28 +1,14 @@
using HH.WCS.QingXigongchang.core;
using HH.WCS.QingXigongchang.device;
using HH.WCS.QingXigongchang.device;
using HH.WCS.QingXigongchang.dispatch;
using HH.WCS.QingXigongchang.util;
using HH.WCS.QingXigongchang.wms;
using Microsoft.SqlServer.Server;
using Newtonsoft.Json;
using NLog.Time;
using SqlSugar;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics.Eventing.Reader;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Threading;
using System.Threading.Tasks;
using System.Timers;
using System.Web.Http.Results;
using System.Web.Security;
using System.Web.UI.WebControls;
using static HH.WCS.QingXigongchang.dispatch.NDC;
using static HH.WCS.QingXigongchang.util.Settings;
namespace HH.WCS.QingXigongchang.process
@@ -286,6 +272,7 @@
                        if (!string.IsNullOrEmpty(od.S_ROW))
                            list.Add(od.S_ROW);
                        ma = string.Join(",", list);
                        List<LocCntrRel> lcrl = new List<LocCntrRel>
                        {
                            new LocCntrRel
@@ -302,7 +289,7 @@
                            db.Insertable(lcrl).ExecuteCommand();
                            db.Insertable(new Container
                            {
                                S_CNTR_CODE=lirl.FirstOrDefault().S_CNTR_CODE,
                                S_CNTR_CODE = lirl.FirstOrDefault().S_CNTR_CODE,
                            }).ExecuteCommand();
                            db.Updateable(_cl).UpdateColumns(x => new { x.N_CURRENT_NUM }).ExecuteCommand();
                        });
@@ -326,7 +313,7 @@
                    si = "0";
                }
                else if (data.Contains("11") && (ods.Find(x => x.SQL_PLineNo.Contains("纸箱")) != null || plc.deviceName.Contains("T1")))
                else if (data.Contains("11"))// && (ods.Find(x => x.SQL_PLineNo.Contains("纸箱")) != null || plc.deviceName.Contains("T1"))
                {
                    //if (!ods.Any())
                    //    return;
@@ -335,16 +322,21 @@
                    {
                        LogHelper.Info($" time:{_clrel0?.T_CREATE} = s_type:{_clrel0.S_TYPE}");
                        if (_clrel.Any())
                            if (DateTime.Now.Subtract(_clrel0.T_CREATE).TotalSeconds < 10 || !string.IsNullOrEmpty(_clrel0.S_TYPE))
                            //if (DateTime.Now.Subtract(_clrel0.T_CREATE).TotalSeconds < 10 || !string.IsNullOrEmpty(_clrel0.S_TYPE))
                            //    goto ballll;
                            //plg 2025年6月23日  去除10秒时间限制
                            if (DateTime.Now.Subtract(_clrel0.T_CREATE).TotalSeconds < 3 || !string.IsNullOrEmpty(_clrel0.S_TYPE))
                                goto ballll;
                        LocationHelper.DoAction(db =>
                        {
                            db.Deleteable(_clrel).ExecuteCommand();
                            _cl.N_CURRENT_NUM = 0;
                            return db.Updateable(_cl).UpdateColumns(x => new { x.N_CURRENT_NUM }).ExecuteCommand() > 0;
                        });
                            {
                                db.Deleteable(_clrel).ExecuteCommand();
                                _cl.N_CURRENT_NUM = 0;
                                return db.Updateable(_cl).UpdateColumns(x => new { x.N_CURRENT_NUM }).ExecuteCommand() > 0;
                            });
                    }
                    if (!plc.deviceName.Contains("T1"))
                        goto ballll;
                    else if (!plc.deviceName.Contains("水线标签"))
                    {
                        LogHelper.Info(_cl.S_LOC_CODE + $"货位 找起点");