From 157abc191c34e57c1b958ae74fc3de6518ca8a30 Mon Sep 17 00:00:00 2001
From: zhaowc <526854230@qq.com>
Date: 星期五, 28 二月 2025 11:06:36 +0800
Subject: [PATCH] 修改客户需求
---
Wms/WMS.BLL/BllCheckServer/StockCheckServer.cs | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 56 insertions(+), 4 deletions(-)
diff --git a/Wms/WMS.BLL/BllCheckServer/StockCheckServer.cs b/Wms/WMS.BLL/BllCheckServer/StockCheckServer.cs
index 889ab1e..2e8dd5f 100644
--- a/Wms/WMS.BLL/BllCheckServer/StockCheckServer.cs
+++ b/Wms/WMS.BLL/BllCheckServer/StockCheckServer.cs
@@ -14,6 +14,7 @@
using SqlSugar.Extensions;
using Utility.Tools;
using WMS.BLL.LogServer;
+using WMS.BLL.SysServer;
using WMS.DAL;
using WMS.Entity.BllAsnEntity;
using WMS.Entity.BllCheckEntity;
@@ -994,7 +995,7 @@
}
}
- //鐢熸垚鐩樼偣璁板綍
+ //鐢熸垚鐩樼偣璁板綍
Db.Insertable(logList).ExecuteCommand();
}
// 鍌ㄤ綅鍙�
@@ -1295,7 +1296,7 @@
}
//AGV绉诲簱瀹屾垚
- public void MoveSuccess(string taskNo, int userId)
+ public void MoveSuccess(string taskNo,string mesTokenUrl, string mesUrl, int userId)
{
try
{
@@ -1337,6 +1338,7 @@
throw new Exception("鐩爣鍌ㄤ綅鐘舵�侀潪绉诲叆涓�");
}
}
+ var data = new List<RequertBeiliaoInfoModel>();
//鏇存敼搴撳瓨鏄庣粏
foreach (var item in stockDetail)
{
@@ -1376,8 +1378,31 @@
if (endLocate != null && endLocate.AreaNo == "B12") //鏄惁鏄�3妤肩紦瀛樺尯 鏄細鍒犻櫎搴撳瓨
{
- //搴撳瓨绠辩爜鏄庣粏鍒犻櫎
+ if (string.IsNullOrWhiteSpace(item.SONo))
+ {
+ throw new Exception("褰撳墠鎵樼洏涓嶆槸鎷兼墭鍑哄簱鎵樼洏");
+ }
+ //璁板綍鎵樼洏涓婁俊鎭粰MES
var boxInfo = Db.Queryable<DataBoxInfo>().Where(m => m.IsDel == "0" && m.StockDetailId == item.Id).ToList();
+ if (boxInfo.Count == 0)
+ {
+ throw new Exception("鎵樼洏涓婄墿鏂欑鐮佷俊鎭笉瀛樺湪,璇锋鏌�!");
+ }
+ foreach (var item2 in boxInfo)
+ {
+ data.Add(new RequertBeiliaoInfoModel()
+ {
+ no = item2.BoxNo,
+ materiel_no = item.SkuNo,
+ materiel_name = item.SkuName,
+ qty = item.Qty,
+ batch = item.LotNo,
+ producttime = item2.ProductionTime.ToString().Substring(1, 8),
+ expiry = item2.ExpirationTime.ToString().Substring(1, 8)
+
+ });
+ }
+ //搴撳瓨绠辩爜鏄庣粏鍒犻櫎
Db.Deleteable(boxInfo).ExecuteCommand();
//鍒犻櫎搴撳瓨鎵樼洏淇℃伅
Db.Deleteable(item).ExecuteCommand();
@@ -1400,8 +1425,35 @@
//鏇存敼鐩爣鍌ㄤ綅鐘舵��
endLocate.Status = "1";//鏈夌墿鍝�
Db.Updateable(endLocate).ExecuteCommand();
- }
+ }
+ //姝e紡杩愯绋嬪簭鏀惧紑
+ //if (endLocate!= null && endLocate.AreaNo == "B12")
+ //{
+ // //鑾峰彇浠ょ墝
+ // var token = new Token().GetMesToken(mesTokenUrl);
+ // Dictionary<string, string> mesDic = new Dictionary<string, string>()
+ // {
+ // {"Authorization",token }
+ // };
+ // var mesData = new RequertBeiliaoModel()
+ // {
+ // morder_no = stockDetail.First().SONo,
+ // pallet = stockDetail.First().PalletNo,
+ // layer_no = endLocate.LocatNo,
+ // items = data
+ // };
+ // var jsonData = JsonConvert.SerializeObject(mesData);
+ // //璋冪敤鎺ュ彛
+ // var response = HttpHelper.DoPost(mesUrl, jsonData, "澶囨枡瀹屾垚杩愯嚦缂撳瓨鍖哄弽棣堣嚦MES", "MES", mesDic);
+
+ // var obj = JsonConvert.DeserializeObject<MesModel>(response);//瑙f瀽杩斿洖鏁版嵁
+ // if (obj.status != "0")
+ // {
+ // throw new Exception("澶囨枡鍚屾MES澶辫触锛�" + obj.message);
+ // }
+
+ //}
if (userId != 0)
{
//娣诲姞鎿嶄綔鏃ュ織璁板綍
--
Gitblit v1.8.0