From 7bc31abbc45fc57109d8b6bcabd69d1cd7b9bd7a Mon Sep 17 00:00:00 2001
From: CatMaoo <1205395967@qq.com>
Date: Mon, 18 Mar 2024 14:17:03 +0800
Subject: [PATCH] 1
---
.../ICSWareHouseLotInfoService.cs | 10 +-
.../Controllers/WMSBarCoreController.cs | 126 ++++++++++--------
2 files changed, 78 insertions(+), 58 deletions(-)
diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs
index 2cd942d..9342e93 100644
--- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs
+++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs
@@ -3461,9 +3461,10 @@ namespace ICSSoft.DataProject
END
UPDATE ICSWareHouseLotInfo SET Quantity=ISNULL(Quantity,0)+'{2}' WHERE LotNo='{0}' AND WorkPoint='{1}'
- UPDATE ICSInventoryLot SET Amount=(ISNULL(Amount,0)+(select Amount from
- ICSInventoryLot where LotNo='{3}' AND WorkPoint='{1}')) WHERE LotNo='{0}' AND WorkPoint='{1}'
";
+
+ //UPDATE ICSInventoryLot SET Amount=(ISNULL(Amount,0)+(select Amount from
+ //ICSInventoryLot where LotNo='{3}' AND WorkPoint='{1}')) WHERE LotNo='{0}' AND WorkPoint='{1}'
sql = string.Format(sql, LotNo, WorkPoint, Quantity, CurrentLotNo);
if (!DBHelper.ExecuteNonQuery(sql, cmd))
@@ -3473,14 +3474,15 @@ namespace ICSSoft.DataProject
///更新原条码库存
sql = @"UPDATE ICSWareHouseLotInfo SET Quantity=ISNULL(Quantity,0)-'{2}' WHERE LotNo='{0}' AND WorkPoint='{1}'
- UPDATE ICSInventoryLot SET Amount=(ISNULL(Amount,0)-(select Amount from
- ICSInventoryLot where LotNo='{0}' AND WorkPoint='{1}')) WHERE LotNo='{0}' AND WorkPoint='{1}'
+
IF EXISTS(SELECT a.LotNo FROM ICSWareHouseLotInfo a WHERE a.LotNo='{0}' AND a.WorkPoint='{1}' AND Quantity<0)
BEGIN
RAISERROR('" + language.GetNameByCode("WMSAPIInfo167") + @"',16,1);
RETURN
END";
+ //UPDATE ICSInventoryLot SET Amount=(ISNULL(Amount,0)-(select Amount from
+ //ICSInventoryLot where LotNo='{0}' AND WorkPoint='{1}')) WHERE LotNo='{0}' AND WorkPoint='{1}'
sql = string.Format(sql, CurrentLotNo, WorkPoint, Quantity);
if (!DBHelper.ExecuteNonQuery(sql, cmd))
diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs b/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs
index 3ab5877..7d19fdc 100644
--- a/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs
+++ b/ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs
@@ -23,6 +23,7 @@ namespace ICSSoft.WebAPI.Controllers
HttpResponseMessage result = new HttpResponseMessage();
Result res = new Result();
string str = string.Empty;
+ private static object key = new object();
///
/// 多语言
///
@@ -678,18 +679,21 @@ namespace ICSSoft.WebAPI.Controllers
{
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
{
-
- List model = new List();
- model = JsonConvert.DeserializeObject>(JsonData.ToString());
- //WMSBarCoreService action = new WMSBarCoreService();
- //var resultStr = action.LOTStockCreate(model);
- var resultStr = ICSSubmitService.LOTStockCreate(model);
- res.Success = true;
- res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
- if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
+ lock (key)
{
- res.Data = resultStr;
+ List model = new List();
+ model = JsonConvert.DeserializeObject>(JsonData.ToString());
+ //WMSBarCoreService action = new WMSBarCoreService();
+ //var resultStr = action.LOTStockCreate(model);
+ var resultStr = ICSSubmitService.LOTStockCreate(model);
+ res.Success = true;
+ res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
+ if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
+ {
+ res.Data = resultStr;
+ }
}
+
}
}
catch (Exception ex)
@@ -721,18 +725,22 @@ namespace ICSSoft.WebAPI.Controllers
{
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
{
-
- List model = new List();
- model = JsonConvert.DeserializeObject>(JsonData.ToString());
- //WMSBarCoreService action = new WMSBarCoreService();
- //var resultStr = action.LOTStockCreate(model);
- var resultStr = ICSSubmitService.LOTStockCreateAM(model);
- res.Success = true;
- res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
- if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
+ lock (key)
{
- res.Data = resultStr;
+ List model = new List();
+ model = JsonConvert.DeserializeObject>(JsonData.ToString());
+ //WMSBarCoreService action = new WMSBarCoreService();
+ //var resultStr = action.LOTStockCreate(model);
+ var resultStr = ICSSubmitService.LOTStockCreateAM(model);
+ res.Success = true;
+ res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
+ if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
+ {
+ res.Data = resultStr;
+ }
}
+
+
}
}
catch (Exception ex)
@@ -889,25 +897,30 @@ namespace ICSSoft.WebAPI.Controllers
{
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
{
- List model = new List();
- model = JsonConvert.DeserializeObject>(JsonData.ToString());
- //WMSBarCoreService action = new WMSBarCoreService();
- //var resultStr = action.LOTStockDownCreate(model);
- var resultStr = ICSSubmitService.LOTStockDownCreate(model);
- res.Success = true;
- //if (resultStr.Columns.Contains("OLDLotNo"))
- //{
- // res.PrintStr = DBHelper.ReadFileStream();
- //}else
- //{a
- res.PrintStr = "";
- //}
-
- res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
- if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
+ lock (key)
{
- res.Data = resultStr;
+ List model = new List();
+ model = JsonConvert.DeserializeObject>(JsonData.ToString());
+ //WMSBarCoreService action = new WMSBarCoreService();
+ //var resultStr = action.LOTStockDownCreate(model);
+ var resultStr = ICSSubmitService.LOTStockDownCreate(model);
+ res.Success = true;
+ //if (resultStr.Columns.Contains("OLDLotNo"))
+ //{
+ // res.PrintStr = DBHelper.ReadFileStream();
+ //}else
+ //{a
+ res.PrintStr = "";
+ //}
+
+ res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
+ if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
+ {
+ res.Data = resultStr;
+ }
}
+
+
}
}
catch (Exception ex)
@@ -939,25 +952,30 @@ namespace ICSSoft.WebAPI.Controllers
{
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
{
- List model = new List();
- model = JsonConvert.DeserializeObject>(JsonData.ToString());
- //WMSBarCoreService action = new WMSBarCoreService();
- //var resultStr = action.LOTStockDownCreate(model);
- var resultStr = ICSSubmitService.LOTStockDownAMCreate(model);
- res.Success = true;
- //if (resultStr.Columns.Contains("OLDLotNo"))
- //{
- // res.PrintStr = DBHelper.ReadFileStream();
- //}else
- //{a
- res.PrintStr = "";
- //}
-
- res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
- if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
+ lock (key)
{
- res.Data = resultStr;
+ List model = new List();
+ model = JsonConvert.DeserializeObject>(JsonData.ToString());
+ //WMSBarCoreService action = new WMSBarCoreService();
+ //var resultStr = action.LOTStockDownCreate(model);
+ var resultStr = ICSSubmitService.LOTStockDownAMCreate(model);
+ res.Success = true;
+ //if (resultStr.Columns.Contains("OLDLotNo"))
+ //{
+ // res.PrintStr = DBHelper.ReadFileStream();
+ //}else
+ //{a
+ res.PrintStr = "";
+ //}
+
+ res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
+ if (resultStr != null && resultStr.Rows.Count > 0 && resultStr.ToString() != "[]")
+ {
+ res.Data = resultStr;
+ }
}
+
+
}
}
catch (Exception ex)