From d0c1502a17c8d945e16b498792bd8e50ea9fea9f Mon Sep 17 00:00:00 2001 From: jinxin <1013386558@qq.com> Date: 星期二, 03 六月 2025 14:11:04 +0800 Subject: [PATCH] 111 --- HH.WCS.Mobox3.WeiLi/wms/WCSHelper.cs | 22 ++++++++++++++-------- 1 files changed, 14 insertions(+), 8 deletions(-) diff --git a/HH.WCS.Mobox3.WeiLi/wms/WCSHelper.cs b/HH.WCS.Mobox3.WeiLi/wms/WCSHelper.cs index 7ac9f37..f31896d 100644 --- a/HH.WCS.Mobox3.WeiLi/wms/WCSHelper.cs +++ b/HH.WCS.Mobox3.WeiLi/wms/WCSHelper.cs @@ -104,15 +104,21 @@ internal static bool AddActionRecord(string no, int state, string forkliftNo, string extData) { var db = new SqlHelper<TaskAction>().GetInstance(); - var action = new TaskAction() + var result = true; + var info = db.Queryable<TaskAction>().Where(a => a.S_TASK_CODE == no && a.N_ACTION_CODE == state).First(); + if (info == null) { - N_ACTION_CODE = state, - S_TASK_CODE = no, - S_EQ_CODE = forkliftNo, - S_EQ_TYPE = "agv", - S_DATA = extData - }; - return db.Insertable(action).ExecuteCommand() > 0; + var action = new TaskAction() + { + N_ACTION_CODE = state, + S_TASK_CODE = no, + S_EQ_CODE = forkliftNo, + S_EQ_TYPE = "agv", + S_DATA = extData + }; + result= db.Insertable(action).ExecuteCommand() > 0; + } + return result; } internal static bool CheckActionRecordExist(string no, int code) { var db = new SqlHelper<TaskAction>().GetInstance(); -- Gitblit v1.9.1