lss
2025-06-16 663ffc09a8fc33eb7d2346e6ed10c08679f0006c
HH.WCS.Mobox3/HH.WCS.Mobox3.JiaTong/wms/WCSHelper.cs
@@ -21,7 +21,8 @@
            var res = false;
            var db = new SqlHelper<WCSTask>().GetInstance();
            task.S_B_STATE = status;
            db.Updateable(task).UpdateColumns(it => new { it.S_B_STATE }).ExecuteCommand();
            task.T_START_TIME = DateTime.Now;
            db.Updateable(task).UpdateColumns(it => new { it.S_B_STATE,it.T_START_TIME }).ExecuteCommand();
            return res;
        }
        internal static bool UpdateStatus(WCSTask task)
@@ -172,6 +173,7 @@
        internal static bool AddActionRecord(string no, int state, string forkliftNo, string extData)
        {
            var db = new SqlHelper<TaskAction>().GetInstance();
            var action = new TaskAction()
            {
                N_ACTION_CODE = state,
@@ -198,7 +200,7 @@
                    task.S_B_STATE = WCSTask.GetStateStr(task.N_B_STATE);
                    task.T_START_TIME = DateTime.Now;
                    task.S_WORKSHOP_NO = agvno;
                    db.Updateable(task).UpdateColumns(it => new { it.N_B_STATE, it.S_B_STATE, it.T_START_TIME, it.S_WORKSHOP_NO }).ExecuteCommand();
                    db.Updateable(task).UpdateColumns(it => new { it.N_B_STATE, it.S_B_STATE,  it.S_WORKSHOP_NO }).ExecuteCommand();
                }
            }
@@ -232,9 +234,10 @@
            try
            {
                bool res = false;
                LogHelper.Info($"任务:{TN_Task.S_CODE}开始创建");
                db.BeginTran();
                res = db.Insertable(TN_Task).ExecuteCommand() > 0;
                if (res)
                if (res)
                {
                    var Startmodel = db.Queryable<Location>().Where(a => a.S_CODE.Trim() == TN_Task.S_START_LOC).First();
                    var Endmodel = db.Queryable<Location>().Where(a => a.S_CODE.Trim() == TN_Task.S_END_LOC).First();
@@ -243,6 +246,12 @@
                        Startmodel.N_LOCK_STATE = 2;
                        Startmodel.S_LOCK_STATE = Location.GetLockStateStr(2);
                        res = db.Updateable(Startmodel).UpdateColumns(it => new { it.N_LOCK_STATE, it.S_LOCK_STATE }).ExecuteCommand() > 0;
                    }
                    else
                    {
                        LogHelper.Info($"任务:{TN_Task.S_CODE}生成失败,起点货位不可用");
                        db.RollbackTran();
                        return false;
                    }
                    if (Endmodel != null && Endmodel.S_LOCK_STATE.Trim() == "无")
                    {
@@ -266,7 +275,7 @@
                    LogHelper.Info($"任务:{TN_Task.S_CODE}生成失败");
                    db.RollbackTran();
                }
                return res;
                return res;
            }
            catch (Exception ex)
            {