From 423e7331f920f1e2d95a18f5a03fb2ca07535c99 Mon Sep 17 00:00:00 2001
From: yuyou_x <2336760928@qq.com>
Date: 星期四, 07 三月 2024 11:13:41 +0800
Subject: [PATCH] 排查并修改取消出库任务问题,注释向wcs下发任务代码。修改因未选出库口导致重复点击问题。编写出库移库任务完成逻辑代码。
---
Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs | 103 ++++++++++++++++++++++++++++++----
Wms/WMS.BLL/LogServer/TaskServer.cs | 18 ++++++
Wms/WMS.IBLL/IBllSoServer/IExportNoticeServer.cs | 7 ++
Wms/WMS.IBLL/ILogServer/ITaskServer.cs | 7 ++
Wms/Wms/Controllers/BllSoController.cs | 15 ++++
HTML/views/SOSetting/ExportNotice.html | 28 +++-----
6 files changed, 146 insertions(+), 32 deletions(-)
diff --git a/HTML/views/SOSetting/ExportNotice.html b/HTML/views/SOSetting/ExportNotice.html
index 63ca827..5b4f906 100644
--- a/HTML/views/SOSetting/ExportNotice.html
+++ b/HTML/views/SOSetting/ExportNotice.html
@@ -1398,25 +1398,19 @@
icon: 2,
time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
});
+ isChongFu= true;
return;
}
- if(isNeedUnpack=='1'){
- if(pa==''){
- layer.msg("璇烽�夋嫨鍑哄簱鍙�", {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- });
- return;
- }
- }
- }else{
- if(pa==''){
- layer.msg("璇烽�夋嫨鍑哄簱鍙�", {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- });
- return;
- }
+ }
+ console.log($("#PickingArea").val())
+ if($("#PickingArea").val() == '')
+ {
+ layer.msg("璇烽�夋嫨鍑哄簱鍙�", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
+ isChongFu= true;
+ return;
}
var param = {
soNo: soNo,
diff --git a/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs b/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
index d100c52..93f165c 100644
--- a/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
+++ b/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
@@ -1466,11 +1466,11 @@
toLocation = outMode;//鍑哄簱鍙�
}
}
- else
+ else
{
unstackingMode2 = "1";//闈炴垚鍝佸嚭搴撹蛋PDA鎷嗗灈
toLocation = outMode;//鍑哄簱鍙�
- }
+ }
#endregion
// 鍌ㄤ綅鍙�
@@ -2087,6 +2087,86 @@
}
}
+ /// <summary>
+ /// wcs杩斿洖鐨勬垚鍔熶俊鍙凤紙绉诲簱鎴愬姛锛�
+ /// </summary>
+ /// <param name="taskNo">浠诲姟鍙�</param>
+ /// <param name="userId">鎿嶄綔浜�</param>
+ /// <exception cref="Exception"></exception>
+ public void RelocationSuccess(string taskNo, int userId)
+ {
+ try
+ {
+ //褰撳墠浠诲姟淇℃伅
+ var task = Db.Queryable<LogTask>().First(m => m.TaskNo == taskNo && m.IsDel == "0");
+ if (task == null)
+ {
+ throw new Exception($"鏈煡璇㈠埌浠诲姟鍙蜂负锛氣�榹taskNo}鈥欑殑浠诲姟淇℃伅");
+ }
+ if (task.Status == "2")
+ {
+ throw new Exception("褰撳墠浠诲姟宸插畬鎴�");
+ }
+ Db.BeginTran();
+ //搴撳瓨涓綋鍓嶆墭鐩樼殑淇℃伅
+ var stockDetail = Db.Queryable<DataStockDetail>().Where(m => m.PalletNo == task.PalletNo).ToList();
+ //褰撳墠浠诲姟涓殑鐩爣鍌ㄤ綅淇℃伅
+ //褰撳墠浠诲姟涓殑鍘熷偍浣�
+ var locate = Db.Queryable<SysStorageLocat>().First(m => m.LocatNo == task.StartLocat);
+ if (locate == null)
+ {
+ throw new Exception($"WMS绯荤粺涓病鏈夎{task.StartLocat}鍌ㄤ綅瀵瑰簲鐨勪俊鎭�");
+ }
+ var locate2 = Db.Queryable<SysStorageLocat>().First(m => m.LocatNo == task.EndLocat);
+ if (locate2 == null)
+ {
+ throw new Exception($"WMS绯荤粺涓病鏈夎{task.EndLocat}鍌ㄤ綅瀵瑰簲鐨勪俊鎭�");
+ }
+
+ try
+ {
+ task.Status = "2";//浠诲姟鐘舵��
+ task.IsSend = 0;
+ task.IsCancel = 0;
+ task.IsFinish = 0;
+ task.FinishDate = DateTime.Now;//瀹屾垚鏃堕棿
+ Db.Updateable(task).ExecuteCommand();
+
+ #region 淇敼鍌ㄤ綅鐘舵��
+
+ //鍘熷偍浣嶆敼涓虹┖鍌ㄤ綅 0
+ locate.Status = "0";
+ Db.Updateable(locate).ExecuteCommand();
+
+ //鐩爣鍌ㄤ綅鏀逛负鏈夎揣鐗� 1
+ locate2.Status = "1";
+ Db.Updateable(locate2).ExecuteCommand();
+ foreach (var item in stockDetail)
+ {
+ item.WareHouseNo = locate2.WareHouseNo;
+ item.AreaNo = locate2.AreaNo;
+ item.RoadwayNo = locate2.RoadwayNo;
+ item.LocatNo = locate2.LocatNo;
+ }
+ Db.Updateable(stockDetail).ExecuteCommand();
+
+ #endregion
+
+ Db.CommitTran();
+ }
+ catch (Exception ex)
+ {
+ Db.RollbackTran();
+ throw new Exception(ex.Message);
+ }
+ }
+ catch (Exception ex)
+ {
+ throw new Exception("瀹屾垚鍙嶉澶辫触锛�" + ex.Message);
+ }
+ }
+
+
//閲嶆柊涓嬪彂鍑哄簱浠诲姟
public OutCommandDto AgainSendSoTask(string taskNo, int userId, string url)
{
@@ -2454,11 +2534,11 @@
{
stockDetail = stockDetail.Where(m => m.SkuNo == detail.SkuNo && m.LotNo == detail.LotNo && m.IsDel == "0").ToList();
}
-
+
}
else
{
- stockDetail = stockDetail.Where(m => m.SkuNo == detail.SkuNo && m.IsDel == "0").ToList(); //&& string.IsNullOrWhiteSpace(m.LotNo)
+ stockDetail = stockDetail.Where(m => m.SkuNo == detail.SkuNo && m.IsDel == "0").ToList(); //&& string.IsNullOrWhiteSpace(m.LotNo)
}
if (stockDetail.Count < 1)
@@ -2478,7 +2558,7 @@
{
stockDetail = stockDetail.Where(m => m.InspectStatus == "2").ToList();
}
-
+
#region 鍖呰淇℃伅
var pack = packList.FirstOrDefault(p => p.PackagNo == detail.PackagNo);
@@ -2575,17 +2655,17 @@
if (string.IsNullOrWhiteSpace(detail.LotNo))
{
detail.LotNo = s.LotNo;
-
+
}
else
{
if (!detail.LotNo.Contains(s.LotNo))
{
- detail.LotNo += ";" + s.LotNo;
+ detail.LotNo += ";" + s.LotNo;
}
}
}
-
+
}
detail.AllotQty += qty;
detail.UpdateUser = userId;
@@ -2594,7 +2674,7 @@
{
detail.Status = "1";
}
-
+
//搴撳瓨鎬昏〃
//var stock = Db.Queryable<DataStock>().First(d => d.IsDel == "0" && d.SkuNo == detail.SkuNo && d.LotNo == detail.LotNo);
//stock.LockQty += qty;
@@ -3071,10 +3151,7 @@
var lie = int.Parse(oldAddress.Substring(2, 2));
var ceng = int.Parse(oldAddress.Substring(4, 2));
- var sqlString = $@"select LocatNo,[Row],[Column],Layer, (ABS(Row-{row}) + ABS([Column]-{lie}) + ABS(Layer-{ceng})) as distNum
- from SysStorageLocat
- where Flag = '0' and Status = '0' and Depth = '02' and RoadwayNo = '{roadWay}' and AreaNo in '{category}'
- order by distNum;";
+ var sqlString = $@"select LocatNo,[Row],[Column],Layer, (ABS(Row-{row}) + ABS([Column]-{lie}) + ABS(Layer-{ceng})) as distNum from SysStorageLocat where Flag = '0' and Status = '0' and Depth = '02' and RoadwayNo = '{roadWay}' and AreaNo in ('{category.AreaNo}') order by distNum;";
var addressModels = Db.Ado.SqlQuery<AddressCls>(sqlString).ToList();
if (addressModels.Count > 0) // 鍒ゆ柇鍚屽贩閬撳唴鎺掔┖搴撲綅
diff --git a/Wms/WMS.BLL/LogServer/TaskServer.cs b/Wms/WMS.BLL/LogServer/TaskServer.cs
index c49a452..7f5958b 100644
--- a/Wms/WMS.BLL/LogServer/TaskServer.cs
+++ b/Wms/WMS.BLL/LogServer/TaskServer.cs
@@ -136,5 +136,23 @@
throw new Exception(e.Message);
}
}
+
+ public string GetTaskType(string taskNo)
+ {
+ try
+ {
+ var task = Db.Queryable<LogTask>().First(m => m.TaskNo == taskNo);
+ if (task == null)
+ {
+ throw new Exception($"鏈煡璇㈠埌{taskNo}浠诲姟鍙风殑浠诲姟淇℃伅");
+ }
+
+ return task.Type;
+ }
+ catch (Exception e)
+ {
+ throw new Exception(e.Message);
+ }
+ }
}
}
diff --git a/Wms/WMS.IBLL/IBllSoServer/IExportNoticeServer.cs b/Wms/WMS.IBLL/IBllSoServer/IExportNoticeServer.cs
index df0233b..b5bd275 100644
--- a/Wms/WMS.IBLL/IBllSoServer/IExportNoticeServer.cs
+++ b/Wms/WMS.IBLL/IBllSoServer/IExportNoticeServer.cs
@@ -136,6 +136,13 @@
void ExportSuccess(string taskNo,int userId);
/// <summary>
+ /// wcs杩斿洖鐨勬垚鍔熶俊鍙锋垨鎵嬪姩瀹屾垚锛堢Щ搴撴垚鍔燂級
+ /// </summary>
+ /// <param name="taskNo"></param>
+ /// <param name="userId"></param>
+ void RelocationSuccess(string taskNo, int userId);
+
+ /// <summary>
/// 閲嶆柊涓嬪彂鍑哄簱浠诲姟
/// </summary>
/// <param name="taskNo">浠诲姟鍙�</param>
diff --git a/Wms/WMS.IBLL/ILogServer/ITaskServer.cs b/Wms/WMS.IBLL/ILogServer/ITaskServer.cs
index 65d3448..2e03ac9 100644
--- a/Wms/WMS.IBLL/ILogServer/ITaskServer.cs
+++ b/Wms/WMS.IBLL/ILogServer/ITaskServer.cs
@@ -44,5 +44,12 @@
/// <param name="taskNo">浠诲姟鍙�</param>
/// <returns>0 鍏ュ簱鍗� 1 鍑哄簱鍗� 2 鐩樼偣鍗� 3 绉诲簱鍗�</returns>
string GetTaskOrderType(string taskNo);
+
+ /// <summary>
+ /// 鑾峰彇浠诲姟鐨勭被鍨�
+ /// </summary>
+ /// <param name="taskNo">浠诲姟鍙�</param>
+ /// <returns>0 鍏ュ簱浠诲姟 1 鍑哄簱浠诲姟 2绉诲簱浠诲姟</returns>
+ public string GetTaskType(string taskNo);
}
}
diff --git a/Wms/Wms/Controllers/BllSoController.cs b/Wms/Wms/Controllers/BllSoController.cs
index cfe804a..a63e4d6 100644
--- a/Wms/Wms/Controllers/BllSoController.cs
+++ b/Wms/Wms/Controllers/BllSoController.cs
@@ -697,8 +697,19 @@
{
return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
}
- _exNoticeSvc.ExportSuccess(taskNo, int.Parse(userId));
-
+ var type = _taskSvc.GetTaskType(taskNo);
+ if (type == "1")//鍑哄簱瀹屾垚
+ {
+ _exNoticeSvc.ExportSuccess(taskNo, int.Parse(userId));
+ }
+ else if (type == "2")//鍑哄簱鏃朵骇鐢熺殑绉诲簱浠诲姟瀹屾垚
+ {
+ _exNoticeSvc.RelocationSuccess(taskNo, int.Parse(userId));
+ }
+ else
+ {
+ return Ok(new { code = 1, msg = "浠诲姟绫诲瀷閿欒锛岃鏍稿疄锛�" });
+ }
return Ok(new { code = 0, msg = "鎴愬姛瀹屾垚浠诲姟", data = "" });
--
Gitblit v1.8.0