From 0cce10d0db3ea3786edf4b322925057ad87814cf Mon Sep 17 00:00:00 2001 From: chenyong <chenyong@hnkhzn.com> Date: 星期四, 15 五月 2025 09:16:19 +0800 Subject: [PATCH] 三楼大屏 --- CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs | 85 ++++++++++++++++++++++++++++++++++++++---- 1 files changed, 77 insertions(+), 8 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..195f8fc 100644 --- a/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs +++ b/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs @@ -276,6 +276,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> @@ -596,6 +626,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); @@ -1617,6 +1652,7 @@ /// 鑾峰彇浠诲姟淇℃伅 /// </summary> /// <returns></returns> + /// public WebResponseContent GetTaskInfo() { WebResponseContent content = new WebResponseContent(); @@ -1641,7 +1677,10 @@ return content.Error(ex.Message); } } - + /// <summary> + /// 鑾峰彇搴撳瓨淇℃伅 + /// </summary> + /// <returns></returns> public WebResponseContent GetStockInfo() { WebResponseContent content = new WebResponseContent(); @@ -1671,20 +1710,50 @@ 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); + } + } #endregion - #endregion 澶栭儴鎺ュ彛鏂规硶 + #endregion 澶栭儴鎺ュ彛鏂规硶 - #region 鍐呴儴璋冪敤鏂规硶 + #region 鍐呴儴璋冪敤鏂规硶 - /// <summary> - /// 鍒涘缓涓�涓柊鐨勪换鍔� - /// </summary> - /// <param name="model">浠诲姟妯″瀷</param> - /// <returns>鍒涘缓鐨勪换鍔�</returns> + /// <summary> + /// 鍒涘缓涓�涓柊鐨勪换鍔� + /// </summary> + /// <param name="model">浠诲姟妯″瀷</param> + /// <returns>鍒涘缓鐨勪换鍔�</returns> public async Task<Dt_Task> Create(Dt_Task model) { return await BaseDal.Create(model); -- Gitblit v1.9.3