From 4e839ad077304eaecb6dfb35fdc9b0d30a209a76 Mon Sep 17 00:00:00 2001
From: yanjinhui <3306209981@qq.com>
Date: 星期六, 28 二月 2026 13:21:55 +0800
Subject: [PATCH] 优化
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs | 101 ++++++--------------------------------------------
1 files changed, 12 insertions(+), 89 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs"
index 6b91064..b799926 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs"
@@ -27,13 +27,12 @@
{
int containerType = taskDTO.containerCode.Contains("LLM") ? LocationTypeEnum.LargePallet.ObjToInt() : LocationTypeEnum.SmallPallet.ObjToInt();
//鑾峰彇璐т綅淇℃伅
- Dt_KLSLocationInfo? kLSLocationInfo = _kLSLocationInfoService.Repository.QueryFirst(x => x.WarehouseId.ToString() == taskDTO.toAreaCode && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == containerType);
- if (kLSLocationInfo == null) throw new Exception($"鏈壘鍒扮粓鐐瑰簱鍖恒�恵taskDTO.toAreaCode}銆戝彲鐢ㄧ┖璐т綅锛�");
- Dt_Task dt_Task = new Dt_Task()
+ Dt_KLSLocationInfo? kLSLocationInfo = _kLSLocationInfoService.GetFreeLocationInfo(taskDTO.toAreaCode, containerType) ?? throw new Exception($"鏈壘鍒扮粓鐐瑰簱鍖恒�恵taskDTO.toAreaCode}銆戝彲鐢ㄧ┖璐т綅锛�");
+ Dt_Task dt_Task = new()
{
TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
WMSTaskNum = taskDTO.taskCode,
- WMSId = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
+ //WMSId = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
Grade = taskDTO.taskPriority,
PalletCode = taskDTO.containerCode,
Roadway = kLSLocationInfo.RoadwayNo,
@@ -68,14 +67,13 @@
{
try
{
- Dt_KLSLocationInfo? kLSLocationInfo = _kLSLocationInfoService.Repository.QueryFirst(x => x.LocationCode == taskDTO.fromLocationCode);
- if (kLSLocationInfo == null) throw new Exception($"鏈壘鍒拌捣鐐瑰簱浣嶃�恵taskDTO.fromLocationCode}銆戯紒");
+ Dt_KLSLocationInfo? kLSLocationInfo = _kLSLocationInfoService.Repository.QueryFirst(x => x.LocationCode == taskDTO.fromLocationCode) ?? throw new Exception($"鏈壘鍒拌捣鐐瑰簱浣嶃�恵taskDTO.fromLocationCode}銆戯紒");
if (kLSLocationInfo.LocationStatus != LocationStatusEnum.InStock.ObjToInt()) throw new Exception($"璧风偣搴撲綅銆恵taskDTO.fromLocationCode}銆戝綋鍓嶅簱浣嶇姸鎬佷笉鍙嚭搴擄紒");
- Dt_Task dt_Task = new Dt_Task()
+ Dt_Task dt_Task = new()
{
TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
WMSTaskNum = taskDTO.taskCode,
- WMSId = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
+ //WMSId = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
Grade = taskDTO.taskPriority,
PalletCode = taskDTO.containerCode,
Roadway = kLSLocationInfo.RoadwayNo,
@@ -102,93 +100,18 @@
}
#endregion
- #region RGV浠诲姟鍒涘缓
- /// <summary>
- /// 鍒涘缓鍥涘悜杞﹀叆搴撲换鍔�
- /// </summary>
- /// <param name="taskDTO"></param>
- /// <param name="taskType"></param>
- /// <returns></returns>
- public WebResponseContent CreateRGVNewInTask(TaskDTO taskDTO, int taskType)
+ #region 5 璺ㄦゼ灞傝繍杈撲换鍔″垱寤�
+ public WebResponseContent CarryTask(TaskDTO taskDTO, int taskType)
{
- try
- {
- Db.Ado.BeginTran();
-
- Db.Ado.CommitTran();
- return WebResponseContent.Instance.OK();
- }
- catch (Exception ex)
- {
- Db.Ado.RollbackTran();
- return WebResponseContent.Instance.Error(ex.Message);
- }
- }
- /// <summary>
- /// 鍒涘缓鍥涘悜杞﹀嚭搴撲换鍔�
- /// </summary>
- /// <param name="taskDTO"></param>
- /// <param name="taskType"></param>
- /// <returns></returns>
- public WebResponseContent CreateRGVNewOutTask(TaskDTO taskDTO, int taskType)
- {
- try
- {
- Db.Ado.BeginTran();
-
- Db.Ado.CommitTran();
- return WebResponseContent.Instance.OK();
- }
- catch (Exception ex)
- {
- Db.Ado.RollbackTran();
- return WebResponseContent.Instance.Error(ex.Message);
- }
+ return WebResponseContent.Instance.OK();
}
#endregion
- #region 娴峰悍AGV浠诲姟鍒涘缓
- /// <summary>
- /// 鍒涘缓娴峰悍AGV鍏ュ簱浠诲姟
- /// </summary>
- /// <param name="taskDTO"></param>
- /// <param name="taskType"></param>
- /// <returns></returns>
- public WebResponseContent CreateHKNewInTask(TaskDTO taskDTO, int taskType)
- {
- try
- {
- Db.Ado.BeginTran();
- Db.Ado.CommitTran();
- return WebResponseContent.Instance.OK();
- }
- catch (Exception ex)
- {
- Db.Ado.RollbackTran();
- return WebResponseContent.Instance.Error(ex.Message);
- }
- }
- /// <summary>
- /// 鍒涘缓娴峰悍AGV鍑哄簱浠诲姟
- /// </summary>
- /// <param name="taskDTO"></param>
- /// <param name="taskType"></param>
- /// <returns></returns>
- public WebResponseContent CreateHKNewOutTask(TaskDTO taskDTO, int taskType)
+ #region 6 瑁佸壀閫佽揣
+ public WebResponseContent CJCarryTaske(TaskDTO taskDTO, int taskType)
{
- try
- {
- Db.Ado.BeginTran();
-
- Db.Ado.CommitTran();
- return WebResponseContent.Instance.OK();
- }
- catch (Exception ex)
- {
- Db.Ado.RollbackTran();
- return WebResponseContent.Instance.Error(ex.Message);
- }
+ return WebResponseContent.Instance.OK();
}
#endregion
}
--
Gitblit v1.9.3