From 03e09a08f4609cc61e64ca16129db5a3ccb85c1d Mon Sep 17 00:00:00 2001
From: chenyong <chenyong@hnkhzn.com>
Date: 星期四, 22 五月 2025 14:32:31 +0800
Subject: [PATCH] Revert "三楼大屏"
---
CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs | 166 ++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 140 insertions(+), 26 deletions(-)
diff --git a/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs b/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
index f0049b5..d4991a2 100644
--- a/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
+++ b/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -3,6 +3,7 @@
using SixLabors.Fonts.Tables.AdvancedTypographic;
using SqlSugar;
using System.Text.RegularExpressions;
+using System.Threading.Tasks;
using WIDESEA_Cache;
using WIDESEA_Core;
using WIDESEA_Core.Const;
@@ -276,6 +277,36 @@
#endregion 鍑哄簱浠诲姟瀹屾垚
+ #region 鐏浠诲姟瀹屾垚
+ public async Task<WebResponseContent> CompleteOutFireAlarmTaskAsync(Dt_Task task, DtStockInfo stock)
+ {
+ WebResponseContent content = new WebResponseContent();
+ (var loc, var tas) = UpdateStockAndTaskStatus(stock, task);
+ var taskHty = task.Adapt<Dt_Task_Hty>();
+ taskHty.FinishTime = DateTime.Now;
+ taskHty.OperateType = App.User.UserName != null ? (int)OperateTypeEnum.浜哄伐瀹屾垚 : (int)OperateTypeEnum.鑷姩瀹屾垚;
+ taskHty.Creater = App.User.UserName != null ? App.User.UserName : "System";
+
+ DtStockInfo_Hty stockInfo_Hty = stock.Adapt<DtStockInfo_Hty>();
+ stockInfo_Hty.ModifyDate = DateTime.Now;
+
+ // 浜嬪姟澶勭悊
+ await _unitOfWorkManage.UseTranAsync(async () =>
+ {
+ if (task.TaskType != (int)TaskOutboundTypeEnum.OutQuality)
+ {
+ await DeleteStockInfoAsync(stock.Id);
+ await DeleteStockInfoDetailsAsync(stock.StockInfoDetails);
+ await AddStockInfoHtyAsync(stockInfo_Hty);
+ await UpdateLocationAsync(loc); //璐ㄦ浠诲姟闇�瑕佹寔缁攣瀹氬簱浣�
+ }
+ await DeleteTaskAsync(task.TaskId);
+ await AddTaskHtyAsync(taskHty);
+ });
+ return content.OK("浠诲姟瀹屾垚鎴愬姛", task.Remark);
+ }
+ #endregion
+
#region 绉诲簱浠诲姟瀹屾垚
/// <summary>
@@ -322,7 +353,7 @@
WebResponseContent content = new WebResponseContent();
try
{
- if (task.TaskType == (int)TaskInboundTypeEnum.InNG || task.TaskType == (int)TaskInboundTypeEnum.InQuality)
+ if (task.TaskType == (int)TaskInboundTypeEnum.InNG)
{
task.TaskState = (int)TaskInStatusEnum.SC_InFinish;
// 鍒涘缓鍘嗗彶浠诲姟瀹炰緥妯″瀷
@@ -389,6 +420,9 @@
Console.WriteLine(err.Message.ToString());
LogFactory.GetLog("浠诲姟瀹屾垚").Error(true, err);
content.Error(err.Message);
+ task.ErrorMessage = err.Message;
+ task.TaskState = (int)TaskInStatusEnum.SC_InExecuting;
+ await BaseDal.Update(task);
}
return content;
}
@@ -596,6 +630,11 @@
case (int)TaskOutboundTypeEnum.OutNG:
LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "鍑哄簱浠诲姟", "");
return await CompleteStackTaskAsync(task, stock);
+
+ case (int)TaskOutboundTypeEnum.OutFireAlarm:
+
+ LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "鐏浠诲姟", "");
+ return await CompleteOutFireAlarmTaskAsync(task, stock);
case (int)TaskRelocationTypeEnum.Relocation:
return await CompleteTransferTaskAsync(task, stock);
@@ -1611,6 +1650,28 @@
#endregion
+ #region 鏌ヨ闈欑疆绌洪棽搴撲綅
+ public WebResponseContent QueryLocationFreeJZ(string RoadwayNo)
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ var result = _locationRepository.QueryData(x => x.EnalbeStatus != (int)EnableEnum.Disable && x.LocationStatus == (int)LocationEnum.Free && x.RoadwayNo.Contains("JZSC"));
+ LogFactory.GetLog($"闈欑疆{RoadwayNo}鏌ヨ绌洪棽搴撲綅").Info(true, $"{JsonConvert.SerializeObject(result)}");
+ if (result.Count > 5)
+ {
+ return content.OK();
+ }
+ return content.Error("搴撲綅宸叉弧");
+ }
+ catch (Exception ex)
+ {
+ return content.Error(ex.Message);
+ }
+ }
+
+ #endregion
+
#region 澶у睆鎺ュ彛
/// <summary>
@@ -1641,7 +1702,10 @@
return content.Error(ex.Message);
}
}
-
+ /// <summary>
+ /// 鑾峰彇搴撳瓨淇℃伅
+ /// </summary>
+ /// <returns></returns>
public WebResponseContent GetStockInfo()
{
WebResponseContent content = new WebResponseContent();
@@ -1671,9 +1735,59 @@
return content.Error(ex.Message);
}
}
+ /// <summary>
+ /// 鑾峰彇璐т綅鐘舵��
+ /// </summary>
+ /// <returns></returns>
+ public WebResponseContent GetStockQuantity()
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ var location = _locationRepository.Db.Queryable<DtLocationInfo>().ToList();
+ return content.OK(data: location);
+ }
+ catch (Exception ex)
+ {
+ return content.Error(ex.Message);
+ }
+ }
+ public WebResponseContent Getproductionvolume()
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ var now = DateTime.Now;
+ var startOfDay = new DateTime(now.Year, now.Month, now.Day);
+ var endOfDay1 = startOfDay.AddDays(-7);
+ var taskHty = _task_HtyRepository.Db.Queryable<Dt_Task_Hty>().Where(it => it.CreateDate > endOfDay1).ToList();
+ return content.OK(data: taskHty);
+ }
+ catch (Exception ex)
+ {
+ return content.Error(ex.Message);
+ }
+ }
+
+ public WebResponseContent Getoutput()
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ var now = DateTime.Now;
+ var firstDayOfYear = new DateTime(now.Year, 1, 1);
+ var taskHty = _task_HtyRepository.Db.Queryable<Dt_Task_Hty>().Where(it => it.CreateDate > firstDayOfYear&&it.TaskType==100).ToList();
+ return content.OK(data: taskHty);
+ }
+ catch (Exception ex)
+ {
+ return content.Error(ex.Message);
+ }
+
+ }
#endregion
#endregion 澶栭儴鎺ュ彛鏂规硶
@@ -1969,32 +2083,32 @@
}
#region 鏇存柊搴撳瓨淇℃伅锛堟殏鏃朵笉闇�瑕侊級
- //if (stock.IsFull)
- //{
- // // 鏌ヨ绗﹀悎鏉′欢鐨勫簱瀛樹俊鎭�
- // var stocks = _stockInfoRepository.QueryData(x => x.AreaCode == stock.AreaCode && x.ProductionLine == stock.ProductionLine && x.SpecialParameterDuration != stock.SpecialParameterDuration);
+ if (stock.IsFull)
+ {
+ // 鏌ヨ绗﹀悎鏉′欢鐨勫簱瀛樹俊鎭�
+ var stocks = _stockInfoRepository.QueryData(x => x.AreaCode == stock.AreaCode && x.ProductionLine == stock.ProductionLine && x.SpecialParameterDuration != stock.SpecialParameterDuration);
- // // 鏌ヨ浠诲姟淇℃伅
- // var tasks = BaseDal.QueryData(x => x.PalletCode != stock.PalletCode && x.ProductionLine == stock.ProductionLine).Select(x => x.PalletCode).ToList();
+ // 鏌ヨ浠诲姟淇℃伅
+ var tasks = BaseDal.QueryData(x => x.PalletCode != stock.PalletCode && x.ProductionLine == stock.ProductionLine).Select(x => x.PalletCode).ToList();
- // if (stocks != null && stocks.Count > 0)
- // {
- // // 杩囨护鍑洪渶瑕佹洿鏂扮殑搴撳瓨淇℃伅
- // var stocksToUpdate = stocks.Where(item => !tasks.Contains(item.PalletCode)).ToList();
- // foreach (var item in stocksToUpdate)
- // {
- // // 鏇存柊搴撳瓨淇℃伅鐨勭壒瀹氬弬鏁�
- // item.SpecialParameterDuration = stock.SpecialParameterDuration;
- // item.ParameterInfos = stock.ParameterInfos;
- // item.OutboundTime = Convert.ToDateTime(item.LinedProcessFeedbackTime == null ? item.CreateDate : item.LinedProcessFeedbackTime).AddHours(Convert.ToDouble(stock.SpecialParameterDuration));
- // }
- // if (stocksToUpdate.Count > 0)
- // {
- // // 寮傛鏇存柊搴撳瓨淇℃伅
- // var isUpdates = await _stockInfoRepository.UpdateDataAsync(stocksToUpdate);
- // }
- // }
- //}
+ if (stocks != null && stocks.Count > 0)
+ {
+ // 杩囨护鍑洪渶瑕佹洿鏂扮殑搴撳瓨淇℃伅
+ var stocksToUpdate = stocks.Where(item => !tasks.Contains(item.PalletCode)).ToList();
+ foreach (var item in stocksToUpdate)
+ {
+ // 鏇存柊搴撳瓨淇℃伅鐨勭壒瀹氬弬鏁�
+ item.SpecialParameterDuration = stock.SpecialParameterDuration;
+ item.ParameterInfos = stock.ParameterInfos;
+ item.OutboundTime = Convert.ToDateTime(item.LinedProcessFeedbackTime == null ? item.CreateDate : item.LinedProcessFeedbackTime).AddHours(Convert.ToDouble(stock.SpecialParameterDuration));
+ }
+ if (stocksToUpdate.Count > 0)
+ {
+ // 寮傛鏇存柊搴撳瓨淇℃伅
+ var isUpdates = await _stockInfoRepository.UpdateDataAsync(stocksToUpdate);
+ }
+ }
+ }
#endregion
// 娣诲姞鍘嗗彶浠诲姟
--
Gitblit v1.9.3