From 6d56bf4daf08c4c7c6d193d98ed0b547dc473451 Mon Sep 17 00:00:00 2001
From: renmingwang <renmingwang@hnkhzn.com>
Date: 星期三, 25 三月 2026 16:59:14 +0800
Subject: [PATCH] 添加历史任务删除,大屏布局修改
---
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs | 90 ++++++++++++++++++++++----------------------
1 files changed, 45 insertions(+), 45 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
index b167a6d..ecad134 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
@@ -80,7 +80,7 @@
_roadwayInforepository = roadwayInforepository;
_dt_ApiInfoService = dt_ApiInfoService;
_locationStatusChangeRecordService = locationStatusChangeRecordService;
- _stationMangerService=stationMangerService;
+ _stationMangerService = stationMangerService;
}
public int GetTaskNum(string sequenceName)
{
@@ -127,7 +127,7 @@
return WebResponseContent.Instance.Error(ex.Message);
}
}
-
+
/// <summary>
@@ -158,11 +158,11 @@
//鑾峰彇鍒版繁搴撲綅缂栧彿
Dt_LocationInfo DeepLocation = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == Locatask);
- if(DeepLocation == null) return content.Error($"鏈壘鍒拌璐т綅淇℃伅,璐т綅缂栧彿:{Locatask}");
+ if (DeepLocation == null) return content.Error($"鏈壘鍒拌璐т綅淇℃伅,璐т綅缂栧彿:{Locatask}");
//杩涜鑾峰彇娴呭簱浣嶇紪鍙�
int locrow = DeepLocation.Row == 1 ? 2 : 3;
- Dt_LocationInfo ShallowLocation = _basicService.LocationInfoService.Repository.QueryFirst(x =>x.Row== locrow && x.Layer== DeepLocation.Layer && x.Column== DeepLocation.Column && x.RoadwayNo== DeepLocation.RoadwayNo);
+ Dt_LocationInfo ShallowLocation = _basicService.LocationInfoService.Repository.QueryFirst(x => x.Row == locrow && x.Layer == DeepLocation.Layer && x.Column == DeepLocation.Column && x.RoadwayNo == DeepLocation.RoadwayNo);
if (ShallowLocation == null) return content.Error($"鏈壘鍒拌揣浣嶇紪鍙�:{Locatask}鐨勬祬璐т綅");
if (ShallowLocation.LocationStatus == (int)LocationStatusEnum.Free)
@@ -294,7 +294,7 @@
return webResponse.Error($"绉诲簱浠诲姟瀹屾垚澶辫触锛屼换鍔d锛歿task.TaskNum}");
throw;
}
-
+
}
/// <summary>
@@ -371,9 +371,9 @@
stockInfo.StockStatus = StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt();
-
+
int beforeStatus = locationInfo.LocationStatus;
- locationInfo.LocationStatus =(int)LocationStatusEnum.Free;
+ locationInfo.LocationStatus = (int)LocationStatusEnum.Free;
task.TaskStatus = TaskOutStatusEnum.OutFinish.ObjToInt();
_unitOfWorkManage.BeginTran();
@@ -401,7 +401,7 @@
return webResponse.Error($"鍑哄簱浠诲姟瀹屾垚澶辫触锛屼换鍔d锛歿task.TaskNum},閿欒鍘熷洜锛歿ex.Message}");
throw;
}
-
+
}
@@ -449,24 +449,24 @@
string WCSReceiveTaskAPI = ConfigsAPIInfo.ApiAddress + ConfigsAPIInfo.ApiName;
if (WCSReceiveTaskAPI == null)
{
- return webResponse.Error($"鍑哄簱澶辫触锛屾湭閰嶇疆MES绉诲簱瀹屾垚鍙嶉鎺ュ彛");
+ return webResponse.Error($"鍑哄簱澶辫触锛屾湭閰嶇疆MES绉诲簱瀹屾垚鍙嶉鎺ュ彛");
}
var respon = HttpHelper.Post(WCSReceiveTaskAPI, JsonConvert.SerializeObject(transferRequest));
if (respon != null)
{
- var response = JsonConvert.DeserializeObject<ApiResponse<object>>(respon);
- if (response.Success)
- {
- return webResponse.OK();
- }
- else
- {
- return webResponse.Error($"璋冨彇鎺ュ彛澶辫触锛屽弽棣堝弬鏁板師鍥狅細{response.Message}");
- }
+ var response = JsonConvert.DeserializeObject<ApiResponse<object>>(respon);
+ if (response.Success)
+ {
+ return webResponse.OK();
+ }
+ else
+ {
+ return webResponse.Error($"璋冨彇鎺ュ彛澶辫触锛屽弽棣堝弬鏁板師鍥狅細{response.Message}");
+ }
}
else
{
- return webResponse.Error($"璋冨彇鎺ュ彛澶辫触锛屽弽棣堝弬鏁颁负绌�");
+ return webResponse.Error($"璋冨彇鎺ュ彛澶辫触锛屽弽棣堝弬鏁颁负绌�");
}
return webResponse.OK();
@@ -500,16 +500,16 @@
locationCode = dt_Task.TargetAddress;
}
TaskNotification transferRequest = new TaskNotification()
- {
- //涓氬姟id锛屼换鍔d鍚庣画杩涜鏇存敼
- taskId = dt_Task.MEStaskId, //浠诲姟id
- businessId = dt_Task.MESbusinessId, //涓氬姟id
- palletCode = dt_Task.PalletCode,
- subPalletCode = dt_Task.MESsubPalletCode,//瀛愭墭鐩樼紪鐮�
- locationCode = locationCode,
- errorStatus = "NORMAL",
- errorInfo = "",
- };
+ {
+ //涓氬姟id锛屼换鍔d鍚庣画杩涜鏇存敼
+ taskId = dt_Task.MEStaskId, //浠诲姟id
+ businessId = dt_Task.MESbusinessId, //涓氬姟id
+ palletCode = dt_Task.PalletCode,
+ subPalletCode = dt_Task.MESsubPalletCode,//瀛愭墭鐩樼紪鐮�
+ locationCode = locationCode,
+ errorStatus = "NORMAL",
+ errorInfo = "",
+ };
//鑾峰彇鎺ュ彛杩涜璋冨彇
var ConfigsAPIInfo = _dt_ApiInfoService.GetConfigsByAPIInfo(CateGoryConst.CONFIG_MES_IPAddress, SysConfigConst.MESTaskFeedback); //鑾峰彇鍒皐cs鍏ㄩ儴绫诲瀷鐨勬帴鍙�
@@ -518,12 +518,12 @@
{
return webResponse.Error($"浠诲姟鍙嶉MES澶辫触锛屾湭閰嶇疆MES浠诲姟瀹屾垚鍙嶉鎺ュ彛");
}
-
+
// 娣诲姞璋冭瘯淇℃伅
string requestJson = JsonConvert.SerializeObject(transferRequest);
//Console.WriteLine($"MES鍙嶉鎺ュ彛URL: {WCSReceiveTaskAPI}");
//Console.WriteLine($"MES鍙嶉璇锋眰鏁版嵁: {requestJson}");
-
+
// 浣跨敤淇鍚庣殑PostSync鏂规硶锛堝凡鍦≒ostSync涓缃粯璁よ姹傚ご锛�
var respon = HttpHelper.Post(WCSReceiveTaskAPI, requestJson);
if (respon != null)
@@ -550,7 +550,7 @@
}
}
- public ApiResponse<object> MESresponse(string Message, bool Success,int Code)
+ public ApiResponse<object> MESresponse(string Message, bool Success, int Code)
{
ApiResponse<object> apiResponse = new ApiResponse<object>();
apiResponse.Message = Message;
@@ -570,7 +570,7 @@
try
{
// 鏌ユ壘浠诲姟
- Dt_Task task = BaseDal.QueryFirst(x => x.PalletCode == palletTaskDTO && (x.TaskStatus == TaskOutStatusEnum.OutNew.ObjToInt()|| x.TaskStatus == TaskRelocationStatusEnum.RelocationNew.ObjToInt()|| x.TaskStatus == TaskInStatusEnum.Line_InExecuting.ObjToInt()));
+ Dt_Task task = BaseDal.QueryFirst(x => x.PalletCode == palletTaskDTO && (x.TaskStatus == TaskOutStatusEnum.OutNew.ObjToInt() || x.TaskStatus == TaskRelocationStatusEnum.RelocationNew.ObjToInt() || x.TaskStatus == TaskInStatusEnum.Line_InExecuting.ObjToInt()));
if (task == null)
{
return MESresponse($"鏈壘鍒拌揣浣嶄俊鎭�,鏉$爜锛歿palletTaskDTO}", false, 0);
@@ -607,7 +607,7 @@
.SetColumns(x => x.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt())
.Where(x => x.PalletCode == task.PalletCode)
.ExecuteCommand();
- if (stockmsseg<=0)
+ if (stockmsseg <= 0)
{
return MESresponse($"鏃犲簱瀛樹俊鎭�", false, 0);
}
@@ -634,7 +634,7 @@
stockmsseg = _stockRepository.DeleteData(stockInfo).ObjToInt();
taskmsseg = BaseDal.DeleteData(task);
}
- BaseDal.DeleteAndMoveIntoHty(task,OperateTypeEnum.浜哄伐鍒犻櫎);
+ BaseDal.DeleteAndMoveIntoHty(task, OperateTypeEnum.浜哄伐鍒犻櫎);
//鑾峰彇鎺ュ彛杩涜璋冨彇
var ConfigsAPIInfo = _dt_ApiInfoService.GetConfigsByAPIInfo(CateGoryConst.CONFIG_WCS_IPAddress, SysConfigConst.WCSCancelinventory); //鑾峰彇鍒皐cs鍏ㄩ儴绫诲瀷鐨勬帴鍙�
string WCSReceiveTaskAPI = ConfigsAPIInfo.ApiAddress + ConfigsAPIInfo.ApiName;
@@ -660,10 +660,10 @@
return MESresponse($"WCS璋冨彇鎺ュ彛澶辫触锛屽弽棣堝弬鏁板師鍥狅細{response.Message}", false, 0);
}
if (stockmsseg <= 0 && locationmsseg <= 0 && taskmsseg)
- {
+ {
_unitOfWorkManage.RollbackTran();
return MESresponse($"浠诲姟鍙栨秷澶辫触", false, 0);
- }
+ }
@@ -702,7 +702,7 @@
catch (Exception ex)
{
_unitOfWorkManage.RollbackTran();
- return MESresponse($"鍙栨秷浠诲姟澶辫触锛屽師鍥狅細{ex.Message}", false, 0);
+ return MESresponse($"鍙栨秷浠诲姟澶辫触锛屽師鍥狅細{ex.Message}", false, 0);
}
}
@@ -738,7 +738,7 @@
int res = _locationInfoRepository.AddData(dt_LocationInfoList);
if (res <= 0)
{
- return MESresponse($"鍒涘缓璐т綅澶辫触",false);
+ return MESresponse($"鍒涘缓璐т綅澶辫触", false);
}
return MESresponse($"", true);
}
@@ -771,7 +771,7 @@
.ExecuteCommand() > 0;
if (!res)
{
- return MESresponse($"淇敼璐т綅澶辫触",false);
+ return MESresponse($"淇敼璐т綅澶辫触", false);
}
return MESresponse($"", true);
}
@@ -788,7 +788,7 @@
int res = _locationInfoRepository.Db.Deleteable<Dt_LocationInfo>().Where(x => locationCode.Contains(x.LocationCode)).ExecuteCommand();
if (res <= 0)
{
- return MESresponse($"鍒犻櫎璐т綅澶辫触",false);
+ return MESresponse($"鍒犻櫎璐т綅澶辫触", false);
}
return MESresponse($"", true);
}
@@ -812,7 +812,7 @@
try
{
- Dt_StockInfo dt_StockInfo = _stockRepository.QueryFirst(x => x.LocationCode.StartsWith("SC01") && x.StockStatus == 6);
+ Dt_StockInfo dt_StockInfo = _stockRepository.QueryFirst(x => x.LocationCode.StartsWith("SC01") && x.StockStatus == 6);
int result = GetLastPart(dt_StockInfo.LocationCode).ObjToInt(); // 杩斿洖 "C03"
List<Dt_Task> dt_s = new List<Dt_Task>();
@@ -896,7 +896,7 @@
{
// 鏌ユ壘浠诲姟
Dt_Task task = BaseDal.QueryFirst(x => x.PalletCode == palletTaskDTO);
-
+
if (task == null)
{
return webResponse.Error($"鏈壘鍒版墭鐩樼紪鐮佷负銆恵palletTaskDTO}銆戠殑浠诲姟淇℃伅");
@@ -939,7 +939,7 @@
// if (locationmsseg1 == null) { webResponse.Error("鏈壘鍒拌揣浣嶄俊鎭�"); }
// locationmsseg1.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
// location1 = _locationInfoRepository.UpdateData(locationmsseg1);
-
+
// }
//}
//else
@@ -1031,7 +1031,7 @@
//鎵嬪姩涓嬪彂浠诲姟鍒癢CS
public WebResponseContent WCSTask(int task)
{
- List<Dt_Task> AddtaskList = BaseDal.QueryData(x=>x.TaskNum == task);
+ List<Dt_Task> AddtaskList = BaseDal.QueryData(x => x.TaskNum == task);
if (!AddtaskList.Any())
{
--
Gitblit v1.9.3