From b20d329978a567b22a56f2ccdffa450b03391443 Mon Sep 17 00:00:00 2001
From: 南骏 池 <chiffly@163.com>
Date: 星期三, 13 八月 2025 13:58:48 +0800
Subject: [PATCH] 1.返工绑定
---
service/Wom/WomdaaManager.cs | 72 ++++++++++++++++++++++++++++++++++++
Controllers/Wom/WomdaaController.cs | 23 +++++++++++
2 files changed, 95 insertions(+), 0 deletions(-)
diff --git a/Controllers/Wom/WomdaaController.cs b/Controllers/Wom/WomdaaController.cs
index 5790a6b..7265fd9 100644
--- a/Controllers/Wom/WomdaaController.cs
+++ b/Controllers/Wom/WomdaaController.cs
@@ -636,5 +636,28 @@
}
}
+ /// <summary>
+ /// 杩斿伐缁戝畾
+ /// </summary>
+ [HttpPost("ScanFgbd")]
+ public ResponseResult ScanFgbd([FromBody] dynamic query)
+ {
+ try
+ {
+ dynamic resultInfos = new ExpandoObject();
+ resultInfos.tbBillList = m.ScanFgbd(query);
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = resultInfos
+ };
+ }
+ catch (Exception ex)
+ {
+ return ResponseResult.ResponseError(ex);
+ }
+ }
+
#endregion
}
\ No newline at end of file
diff --git a/service/Wom/WomdaaManager.cs b/service/Wom/WomdaaManager.cs
index f2ee0f5..33151bd 100644
--- a/service/Wom/WomdaaManager.cs
+++ b/service/Wom/WomdaaManager.cs
@@ -1219,4 +1219,76 @@
}
}
+ /// <summary>
+ /// 鍐呯鏍稿锛氭壂鐮佹牳瀵�
+ /// </summary>
+ /// <param name="query"></param>
+ /// <returns></returns>
+ /// <exception cref="ArgumentNullException"></exception>
+ /// <exception cref="ArgumentException"></exception>
+ /// <exception cref="Exception"></exception>
+ public dynamic ScanFgbd(dynamic query)
+ {
+ if (query == null) throw new ArgumentNullException(nameof(query), "鍙傛暟瀵硅薄涓嶈兘涓� null");
+
+ if (string.IsNullOrEmpty(query.userName?.ToString()))
+ throw new ArgumentException("鐢ㄦ埛鍚嶄笉鍏佽涓虹┖", nameof(query.userName));
+
+ if (string.IsNullOrEmpty(query.HgBar?.ToString()))
+ throw new ArgumentException("鍚庣洊鐮佷笉鍏佽涓虹┖", nameof(query.HgBar));
+
+ if (string.IsNullOrEmpty(query.FgBar?.ToString()))
+ throw new ArgumentException("杩斿伐鐮佷笉鍏佽涓虹┖", nameof(query.FgBar));
+
+ var _strMsg = "";
+ var _intSum = "";
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var cmd = new SqlCommand("prc_pda_Scan_Fgbd", conn))
+ {
+ try
+ {
+ conn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ SqlParameter[] parameters =
+ {
+ new("@pi_user", SqlDbType.NVarChar, 100) { Value = query.userName },
+ new("@pi_fg_barcode", SqlDbType.NVarChar, 100) { Value = query.FgBar },
+ new("@pi_ls_barcode", SqlDbType.NVarChar, 100) { Value = query.HgBar },//鍚庣洊/娴佹按
+ new("@po_outMsg", SqlDbType.NVarChar, 2000) { Direction = ParameterDirection.Output },
+ new("@po_outStatus", SqlDbType.Int) { Direction = ParameterDirection.Output }
+ };
+
+ foreach (var parameter in parameters)
+ cmd.Parameters.Add(parameter);
+
+ cmd.ExecuteNonQuery();
+
+ _strMsg = parameters[3].Value?.ToString() ?? "";
+ _intSum = parameters[4].Value?.ToString() ?? "-1";
+
+ var result = Convert.ToInt32(_intSum);
+ if (result <= 0) throw new Exception(_strMsg);
+
+ var dto = new
+ {
+ message = _strMsg,
+ status = result,
+ tracBarcode = query.ZsBar
+ };
+
+ return dto;
+ }
+ catch (Exception ex)
+ {
+ throw new Exception(ex.Message);
+ }
+ finally
+ {
+ conn.Close();
+ }
+ }
+ }
+ }
+
}
\ No newline at end of file
--
Gitblit v1.9.3