From bdd84cc48ba7b2527584c44d174da8e7d20c5375 Mon Sep 17 00:00:00 2001
From: zhaowc <526854230@qq.com>
Date: 星期三, 18 九月 2024 16:37:13 +0800
Subject: [PATCH] 增加对申请入库时对平库库位的校验
---
Wms/WMS.DAL/SysInfrastructure/StorageLocatRepository.cs | 76 ++++++++++++++++++++-----------------
1 files changed, 41 insertions(+), 35 deletions(-)
diff --git a/Wms/WMS.DAL/SysInfrastructure/StorageLocatRepository.cs b/Wms/WMS.DAL/SysInfrastructure/StorageLocatRepository.cs
index 509133c..643771e 100644
--- a/Wms/WMS.DAL/SysInfrastructure/StorageLocatRepository.cs
+++ b/Wms/WMS.DAL/SysInfrastructure/StorageLocatRepository.cs
@@ -27,12 +27,13 @@
/// 缂栬緫鍌ㄤ綅淇℃伅
/// </summary>
/// <param name="id"></param>
+ /// <param name="areaNo">鎵�灞炲尯鍩�</param>
/// <param name="status">鐘舵��</param>
/// <param name="flag">鏍囪瘑</param>
/// <param name="temperature">瀛樺偍鐜</param>
/// <param name="userId">鎿嶄綔浜�</param>
/// <returns></returns>
- public bool EditStorageLocat(int id, string status, string flag, string temperature,string url, int userId)
+ public bool EditStorageLocat(int id, string areaNo,string status, string flag, string temperature,string url, int userId)
{
try
{
@@ -54,6 +55,7 @@
locate2.Flag = "1";
locate2.UpdateUser = userId;
locate2.UpdateTime = DateTime.Now;
+ locate2.AreaNo = areaNo;
var m = Edit(locate2);
WcsLocat locatEntry = new WcsLocat();
@@ -79,6 +81,7 @@
locate.Status = status;
locate.Flag = flag;
locate.Temperature = temperature;
+ locate.AreaNo = areaNo;
locate.UpdateUser = userId;
locate.UpdateTime = DateTime.Now;
var i = Edit(locate);
@@ -93,23 +96,23 @@
outDtoList.Add(locatEntry2);
// 姝e紡杩愯绋嬪簭鏀惧紑
- var jsonData = JsonConvert.SerializeObject(outDtoList);
- string response = "";
+ //var jsonData = JsonConvert.SerializeObject(outDtoList);
+ //string response = "";
- try
- {
- response = HttpHelper.DoPost(url, jsonData, "涓嬪彂缁橶CS鍚屾鍌ㄤ綅淇℃伅", "WCS");
- //瑙f瀽杩斿洖鏁版嵁
- var wcsModel = JsonConvert.DeserializeObject<WcsModel>(response);
- if (wcsModel.StatusCode == -1)
- {
- throw new Exception(wcsModel.Msg);
- }
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
+ //try
+ //{
+ // response = HttpHelper.DoPost(url, jsonData, "涓嬪彂缁橶CS鍚屾鍌ㄤ綅淇℃伅", "WCS");
+ // //瑙f瀽杩斿洖鏁版嵁
+ // var wcsModel = JsonConvert.DeserializeObject<WcsModel>(response);
+ // if (wcsModel.StatusCode == -1)
+ // {
+ // throw new Exception(wcsModel.Msg);
+ // }
+ //}
+ //catch (Exception ex)
+ //{
+ // throw new Exception(ex.Message);
+ //}
}
Db.CommitTran();
@@ -125,15 +128,16 @@
/// 缂栬緫鍌ㄤ綅淇℃伅
/// </summary>
/// <param name="id"></param>
+ /// <param name="areaNo">鎵�灞炲尯鍩�</param>
/// <param name="status">鐘舵��</param>
/// <param name="flag">鏍囪瘑</param>
/// <param name="userId">鎿嶄綔浜�</param>
/// <returns></returns>
- public bool EditStorageLocatList(List<int> id, string status, string flag,string temperature,string url ,int userId)
+ public bool EditStorageLocatList(List<int> id,string areaNo, string status, string flag,string temperature,string url ,int userId)
{
try
{
- var locateList = GetAllWhereAsync(m => id.Contains(m.Id)).ToList();
+ var locateList = GetAllWhere(m => id.Contains(m.Id)).ToList();
if (locateList.Count == 0)
{
throw new Exception($"涓烘煡璇㈠埌id涓簕id}鐨勫偍浣嶄俊鎭�");
@@ -154,6 +158,7 @@
locate2.Flag = "1";
locate2.UpdateUser = userId;
locate2.UpdateTime = DateTime.Now;
+ locate2.AreaNo = areaNo;
var m = Edit(locate2);
WcsLocat locatEntry = new WcsLocat();
@@ -183,6 +188,7 @@
}
locate.UpdateUser = userId;
locate.UpdateTime = DateTime.Now;
+ locate.AreaNo = areaNo;
i = Edit(locate);
WcsLocat locatEntry2 = new WcsLocat();
@@ -195,23 +201,23 @@
if (i > 0)
{
// 姝e紡杩愯绋嬪簭鏀惧紑
- var jsonData = JsonConvert.SerializeObject(outDtoList);
- string response = "";
+ //var jsonData = JsonConvert.SerializeObject(outDtoList);
+ //string response = "";
- try
- {
- response = HttpHelper.DoPost(url, jsonData, "涓嬪彂缁橶CS鍑哄簱鍛戒护", "WCS");
- //瑙f瀽杩斿洖鏁版嵁
- var wcsModel = JsonConvert.DeserializeObject<WcsModel>(response);
- if (wcsModel.StatusCode == -1)
- {
- throw new Exception(wcsModel.Msg);
- }
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
+ //try
+ //{
+ // response = HttpHelper.DoPost(url, jsonData, "涓嬪彂缁橶CS鍑哄簱鍛戒护", "WCS");
+ // //瑙f瀽杩斿洖鏁版嵁
+ // var wcsModel = JsonConvert.DeserializeObject<WcsModel>(response);
+ // if (wcsModel.StatusCode == -1)
+ // {
+ // throw new Exception(wcsModel.Msg);
+ // }
+ //}
+ //catch (Exception ex)
+ //{
+ // throw new Exception(ex.Message);
+ //}
}
Db.CommitTran();
return i > 0;
--
Gitblit v1.8.0