From ff6a0b066a84dee4ba1b11512f6f34896a3c7dc7 Mon Sep 17 00:00:00 2001
From: 啊鑫 <t2856754968@163.com>
Date: 星期三, 08 一月 2025 13:28:19 +0800
Subject: [PATCH] 期初入库
---
service/Warehouse/WomdaaManager.cs | 100 +++++++++++++++++--------------------------------
1 files changed, 35 insertions(+), 65 deletions(-)
diff --git a/service/Warehouse/WomdaaManager.cs b/service/Warehouse/WomdaaManager.cs
index b4d4e28..3174d1a 100644
--- a/service/Warehouse/WomdaaManager.cs
+++ b/service/Warehouse/WomdaaManager.cs
@@ -32,25 +32,15 @@
public ProductionPickDto ScanCode(WarehouseQuery query)
{
- string _strMsg = "";
- string _intSum = "";
+ var _strMsg = "";
+ var _intSum = "";
using (var conn = new SqlConnection(DbHelperSQL.strConn))
{
-
- if (query.userName.IsNullOrEmpty())
- {
- throw new Exception("鐢ㄦ埛鍚嶄笉鍏佽涓虹┖");
- }
- if (query.daa001.IsNullOrEmpty())
- {
- throw new Exception("棰嗘枡鍗曞彿涓嶅厑璁镐负绌�");
- }
- if (query.barcode.IsNullOrEmpty())
- {
- throw new Exception("鏉$爜涓嶅厑璁镐负绌�");
- }
-
- using (var cmd =new SqlCommand("[prc_pda_SCLL]", conn))
+ if (query.userName.IsNullOrEmpty()) throw new Exception("鐢ㄦ埛鍚嶄笉鍏佽涓虹┖");
+ if (query.daa001.IsNullOrEmpty()) throw new Exception("棰嗘枡鍗曞彿涓嶅厑璁镐负绌�");
+ if (query.barcode.IsNullOrEmpty()) throw new Exception("鏉$爜涓嶅厑璁镐负绌�");
+
+ using (var cmd = new SqlCommand("[prc_pda_SCLL]", conn))
{
try
{
@@ -73,18 +63,15 @@
foreach (var parameter in parameters)
cmd.Parameters.Add(parameter);
cmd.ExecuteNonQuery();
- _strMsg = parameters[0].Value.ToString();
+ _strMsg = parameters[0].Value.ToString();
_intSum = parameters[1].Value.ToString();
-
+
var barcodeNum = parameters[2].Value.ToString();
var splitNum = parameters[3].Value.ToString();
var result = Convert.ToInt32(_intSum);
- if (result <= 0)
- {
- throw new Exception(_strMsg);
- }
-
+ if (result <= 0) throw new Exception(_strMsg);
+
var dto = new ProductionPickDto
{
daa001 = query.daa001,
@@ -94,7 +81,6 @@
};
return dto;
-
}
catch (Exception ex)
{
@@ -111,30 +97,17 @@
//prC_pda_SCLL_CF
public ProductionPickDto ScanCodeCF(WarehouseQuery query)
{
-
- if (query.userName.IsNullOrEmpty())
- {
- throw new Exception("鐢ㄦ埛鍚嶄笉鍏佽涓虹┖");
- }
- if (query.daa001.IsNullOrEmpty())
- {
- throw new Exception("棰嗘枡鍗曞彿涓嶅厑璁镐负绌�");
- }
- if (query.barcode.IsNullOrEmpty())
- {
- throw new Exception("鏉$爜涓嶅厑璁镐负绌�");
- }
-
- if (query.Num is null or 0)
- {
- throw new Exception("鏉$爜鎷嗗垎鏁颁笉鍏佽涓虹┖鎴栬�呬负0");
- }
-
- string _strMsg = "";
- string _intSum = "";
+ if (query.userName.IsNullOrEmpty()) throw new Exception("鐢ㄦ埛鍚嶄笉鍏佽涓虹┖");
+ if (query.daa001.IsNullOrEmpty()) throw new Exception("棰嗘枡鍗曞彿涓嶅厑璁镐负绌�");
+ if (query.barcode.IsNullOrEmpty()) throw new Exception("鏉$爜涓嶅厑璁镐负绌�");
+
+ if (query.Num is null or 0) throw new Exception("鏉$爜鎷嗗垎鏁颁笉鍏佽涓虹┖鎴栬�呬负0");
+
+ var _strMsg = "";
+ var _intSum = "";
using (var conn = new SqlConnection(DbHelperSQL.strConn))
{
- using (var cmd =new SqlCommand("[prc_pda_SCLL_CF]", conn))
+ using (var cmd = new SqlCommand("[prc_pda_SCLL_CF]", conn))
{
try
{
@@ -147,23 +120,20 @@
new("@c_User", query.userName),
new("@p_biLL_no", query.daa001),
new("@p_item_barcode", query.barcode),
- new("@num", query.Num),
+ new("@num", query.Num)
};
parameters[0].Direction = ParameterDirection.Output;
parameters[1].Direction = ParameterDirection.Output;
foreach (var parameter in parameters)
cmd.Parameters.Add(parameter);
cmd.ExecuteNonQuery();
- _strMsg = parameters[0].Value.ToString();
+ _strMsg = parameters[0].Value.ToString();
_intSum = parameters[1].Value.ToString();
-
+
var result = Convert.ToInt32(_intSum);
- if (result <= 0)
- {
- throw new Exception(_strMsg);
- }
-
+ if (result <= 0) throw new Exception(_strMsg);
+
var dto = new ProductionPickDto
{
daa001 = query.daa001,
@@ -171,7 +141,6 @@
};
return dto;
-
}
catch (Exception ex)
{
@@ -195,7 +164,7 @@
.Where((a, i) => a.Daa001 == query.daa001)
.Select((a, i) => new
{
- a.Daa001,a.CaaGuid
+ a.Daa001, a.CaaGuid
}).First();
if (womdaa?.Daa001 == null) throw new Exception("宸ュ崟鍙蜂笉瀛樺湪");
@@ -228,13 +197,13 @@
var mesInvItemOutCDetailsList = Db
.Queryable<MesInvItemOutCDetails, MesItems, MesDepots>
- ((a, b, c) =>
- new JoinQueryInfos(
- JoinType.Inner,a.ItemId == b.Id,
- JoinType.Inner,c.DepotId == a.DepotId
- ))
+ ((a, b, c) =>
+ new JoinQueryInfos(
+ JoinType.Inner, a.ItemId == b.Id,
+ JoinType.Inner, c.DepotId == a.DepotId
+ ))
.Where((a, b, c) => a.WorkNo == query.daa001)
- .Select((a, b, c)=> new MesInvItemOutCDetails
+ .Select((a, b, c) => new MesInvItemOutCDetails
{
ItemName = b.ItemName,
ItemNo = b.ItemNo,
@@ -242,11 +211,12 @@
DepotId = a.DepotId,
WorkNo = a.WorkNo,
DepotName = c.DepotName,
- Quantity = a.Quantity,
+ Quantity = a.Quantity
})
.ToList();
- var womcaa = Db.Queryable<Womcaa>().Where(s=>s.Guid == womdaa.CaaGuid).First();
+ var womcaa = Db.Queryable<Womcaa>().Where(s => s.Guid == womdaa.CaaGuid)
+ .First();
var dto = new ProductionPickDto
{
--
Gitblit v1.9.3