CatMaoo 1 year ago
parent
commit
7bc31abbc4
  1. 10
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs
  2. 126
      ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs

10
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))

126
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();
/// <summary>
/// 多语言
/// </summary>
@ -678,18 +679,21 @@ namespace ICSSoft.WebAPI.Controllers
{
if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
{
List<LOTStockUpCreateIModel> model = new List<LOTStockUpCreateIModel>();
model = JsonConvert.DeserializeObject<List<LOTStockUpCreateIModel>>(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<LOTStockUpCreateIModel> model = new List<LOTStockUpCreateIModel>();
model = JsonConvert.DeserializeObject<List<LOTStockUpCreateIModel>>(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<LOTStockUpCreateIModel> model = new List<LOTStockUpCreateIModel>();
model = JsonConvert.DeserializeObject<List<LOTStockUpCreateIModel>>(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<LOTStockUpCreateIModel> model = new List<LOTStockUpCreateIModel>();
model = JsonConvert.DeserializeObject<List<LOTStockUpCreateIModel>>(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<LOTStockModel> model = new List<LOTStockModel>();
model = JsonConvert.DeserializeObject<List<LOTStockModel>>(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<LOTStockModel> model = new List<LOTStockModel>();
model = JsonConvert.DeserializeObject<List<LOTStockModel>>(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<LOTStockModel> model = new List<LOTStockModel>();
model = JsonConvert.DeserializeObject<List<LOTStockModel>>(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<LOTStockModel> model = new List<LOTStockModel>();
model = JsonConvert.DeserializeObject<List<LOTStockModel>>(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)

Loading…
Cancel
Save