From 7c67d60d2233f71547bcff90e03f9343dd4f13a2 Mon Sep 17 00:00:00 2001
From: 南骏 池 <chiffly@163.com>
Date: 星期一, 14 四月 2025 14:29:55 +0800
Subject: [PATCH] 1.产品绑定,核对送检
---
service/Wom/WomdaaManager.cs | 57 ++++++++++++++++++++++++++++
Controllers/Wom/WomdaaController.cs | 26 +++++++++++++
2 files changed, 83 insertions(+), 0 deletions(-)
diff --git a/Controllers/Wom/WomdaaController.cs b/Controllers/Wom/WomdaaController.cs
index 796871a..c3fb79b 100644
--- a/Controllers/Wom/WomdaaController.cs
+++ b/Controllers/Wom/WomdaaController.cs
@@ -399,5 +399,31 @@
}
}
+ /// <summary>
+ /// 鏍稿閫佹
+ /// </summary>
+ /// <returns></returns>
+ [HttpPost("submitInspection")]
+ public ResponseResult submitInspection([FromBody] dynamic query)
+ {
+ try
+ {
+ dynamic resultInfos = new ExpandoObject();
+ // 鍏堝垵濮嬪寲tbBillList灞炴��
+ resultInfos.tbBillList = new ExpandoObject();
+ resultInfos.tbBillList = m.SubmitKbInspection(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 2cbe9c2..3351413 100644
--- a/service/Wom/WomdaaManager.cs
+++ b/service/Wom/WomdaaManager.cs
@@ -532,4 +532,61 @@
}
}
}
+
+ public dynamic SubmitKbInspection(dynamic query)
+ {
+ if (query == null) throw new ArgumentNullException(nameof(query), "鍙傛暟瀵硅薄涓嶈兘涓� null");
+
+ // 鍙傛暟鏍¢獙
+ if (string.IsNullOrEmpty(query.userAccount?.ToString()))
+ throw new ArgumentException("鐢ㄦ埛鍚嶄笉鍏佽涓虹┖", nameof(query.userAccount));
+
+ if (string.IsNullOrEmpty(query.KbBar?.ToString()))
+ throw new ArgumentException("鍗℃澘鏉$爜涓嶅厑璁镐负绌�", nameof(query.KbBar));
+
+ var _strMsg = "";
+ var _status = -1;
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ using (var cmd = new SqlCommand("prc_pda_KBbar_submitInspection", conn))
+ {
+ try
+ {
+ conn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ SqlParameter[] parameters =
+ {
+ new("@pi_user", SqlDbType.NVarChar, 100) { Value = query.userAccount },
+ new("@pi_kb_barcode", SqlDbType.NVarChar, 100) { Value = query.KbBar },
+ 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[2].Value?.ToString() ?? "";
+ _status = Convert.ToInt32(parameters[3].Value ?? -1);
+
+ if (_status <= 0) throw new Exception(_strMsg);
+
+ return new {
+ message = _strMsg,
+ status = _status,
+ kbBarcode = query.KbBar
+ };
+ }
+ catch (Exception ex)
+ {
+ throw new Exception($"鍗℃澘閫佹澶辫触锛歿ex.Message}");
+ }
+ finally
+ {
+ conn.Close();
+ }
+ }
+ }
+ }
}
\ No newline at end of file
--
Gitblit v1.9.3