From 207071d20e664a1d50863418d852624760f8b6da Mon Sep 17 00:00:00 2001
From: yanjinhui <3306209981@qq.com>
Date: 星期六, 21 二月 2026 13:13:04 +0800
Subject: [PATCH] 添加wms基础代码
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 233 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 224 insertions(+), 9 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
index 9e30867..abb3c4b 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
@@ -18,12 +18,16 @@
using AutoMapper;
using SqlSugar;
using System.Diagnostics.CodeAnalysis;
+using System.Threading.Tasks;
+using WIDESEAWCS_BasicInfoService;
+using WIDESEAWCS_Common;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_DTO.TaskInfo;
+using WIDESEAWCS_DTO.WMS;
using WIDESEAWCS_IBasicInfoService;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
@@ -76,17 +80,42 @@
{
foreach (var item in taskDTOs)
{
- if (item.taskType == TaskTypeEnum.MLInbound.ObjToInt())
+ foreach (var task in item.tasks)
{
- foreach (var task in item.tasks)
+ content = TaskHelpMethods.isOkTaskInfo(task, true, true);
+ if (!content.Status) throw new Exception(content.Message);
+ if (BaseDal.QueryFirst(x => x.WMSTaskNum == task.taskCode || x.PalletCode == task.containerCode) != null)
{
- content = TaskHelpMethods.isOkTaskInfo(task, true, true);
- if (!content.Status) throw new Exception(content.Message);
- if (BaseDal.QueryFirst(x => x.WMSTaskNum == task.taskCode || x.PalletCode == task.containerCode) != null)
- {
- continue;
- }
- CreateNewInTask(task);
+ continue;
+ }
+ switch (item.taskType)
+ {
+ case (int)TaskTypeEnum.MLInbound:
+ CreateKLSNewInTask(task, item.taskType);
+ break;
+ case (int)TaskTypeEnum.MLOutbound:
+ CreateKLSNewOutTask(task, item.taskType);
+ break;
+ case (int)TaskTypeEnum.CPInbound:
+ CreateRGVNewInTask(task, item.taskType);
+ break;
+ case (int)TaskTypeEnum.CPOutbound:
+ CreateRGVNewOutTask(task, item.taskType);
+ break;
+ case (int)TaskTypeEnum.CJInbound:
+ CreateHKNewInTask(task, item.taskType);
+ break;
+ case (int)TaskTypeEnum.CJOutbound:
+ CreateHKNewOutTask(task, item.taskType);
+ break;
+ case (int)TaskTypeEnum.Carry:
+ CarryTask(task, item.taskType);
+ break;
+ case (int)TaskTypeEnum.CJCarry:
+ CJCarryTaske(task, item.taskType);
+ break;
+ default:
+ break;
}
}
}
@@ -97,6 +126,113 @@
}
return content;
}
+
+ /// <summary>
+ /// 鍙栨秷浠诲姟
+ /// </summary>
+ /// <param name="taskCode">浠诲姟鍙�</param>
+ /// <param name="containerCode">鏂欑鏉$爜</param>
+ /// <returns></returns>
+ public WebResponseContent CancelWMSTask(WMSCancelTask wMSCancelTask)
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ Dt_Task dt_Task = BaseDal.QueryFirst(x => x.WMSTaskNum == wMSCancelTask.TaskCode);
+ if (dt_Task == null) throw new Exception("鏈煡璇㈠埌浠诲姟鍙风浉鍏充换鍔�");
+ dt_Task.TaskType = TaskOutStatusEnum.OutCancel.ObjToInt();
+ BaseDal.UpdateData(dt_Task);
+ content.OK("鍙栨秷浠诲姟鎴愬姛",dt_Task);
+ }
+ catch (Exception ex)
+ {
+ content.Error(ex.Message);
+ }
+ return content;
+ }
+
+
+ /// <summary>
+ /// 淇敼浠诲姟浼樺厛绾�
+ /// </summary>
+ /// <param name="updateTaskPriority"></param>
+ /// <returns></returns>
+ public WebResponseContent UpdateWMSTaskPriority(WMSUpdateTaskPriority updateTaskPriority)
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ Dt_Task dt_Task = BaseDal.QueryFirst(x => x.WMSTaskNum == updateTaskPriority.taskCode);
+ if (dt_Task == null) throw new Exception("鏈煡璇㈠埌浠诲姟鍙风浉鍏充换鍔�");
+ dt_Task.Grade = updateTaskPriority.taskPriority;
+ BaseDal.UpdateData(dt_Task);
+ content.OK("淇敼浠诲姟浼樺厛绾ф垚鍔�", dt_Task);
+ }
+ catch (Exception ex)
+ {
+ content.Error(ex.Message);
+ }
+ return content;
+ }
+
+ /// <summary>
+ /// 淇敼搴撲綅鍒嗗尯
+ /// </summary>
+ /// <returns></returns>
+ ///
+
+ public WebResponseContent ModifyWMSLayoutZone(WMSUpdateLocationArea wMSUpdateLocationArea)
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ var rgv = new List<Dt_RGVLocationInfo>();
+ var kls=new List<Dt_KLSLocationInfo>();
+ var hk=new List<Dt_HKLocationInfo>();
+ if(wMSUpdateLocationArea.WarehouseId == 1)
+ {
+ foreach (var LocationCode in wMSUpdateLocationArea.LocationCodes)
+ {
+ Dt_RGVLocationInfo dt_RGVLocationInfo = _rGVLocationInfoService.Repository.QueryFirst(x => x.LocationCode == LocationCode);
+ rgv.Add(dt_RGVLocationInfo);
+ }
+ }
+ if (wMSUpdateLocationArea.WarehouseId == 2)
+ {
+ foreach (var LocationCode in wMSUpdateLocationArea.LocationCodes)
+ {
+ Dt_KLSLocationInfo dt_KLSLocationInfo = _kLSLocationInfoService.Repository.QueryFirst(x => x.LocationCode == LocationCode);
+ kls.Add(dt_KLSLocationInfo);
+ }
+ }
+ if (wMSUpdateLocationArea.WarehouseId == 3)
+ {
+ foreach (var LocationCode in wMSUpdateLocationArea.LocationCodes)
+ {
+ Dt_HKLocationInfo dt_HKLocationInfo = _hKLocationInfoService.Repository.QueryFirst(x => x.LocationCode == LocationCode);
+ hk.Add(dt_HKLocationInfo);
+ }
+ }
+ Db.Ado.BeginTran();
+ _rGVLocationInfoService.UpdateData(rgv);
+ _kLSLocationInfoService.UpdateData(kls);
+ _hKLocationInfoService.UpdateData(hk);
+ Db.Ado.CommitTran();
+ content.OK();
+ }
+ catch (Exception ex)
+ {
+ content.Error(ex.Message);
+ }
+ return content;
+ }
+
+ private void UpdateLocationCode(object LocationInfo, string updateAreaCode)
+ {
+
+ }
+
+
/// <summary>
/// 鎺ユ敹WMS浠诲姟淇℃伅
/// </summary>
@@ -625,5 +761,84 @@
}
return content;
}
+
+ static object lock_taskNum = new object();
+ public int GetTaskNum(string sequenceName)
+ {
+ lock (lock_taskNum)
+ {
+ return Db.Ado.GetScalar($"SELECT NEXT VALUE FOR {sequenceName}").ObjToInt();
+ }
+ }
+
+ /// <summary>
+ /// 瀹瑰櫒娴佸姩璇锋眰
+ /// </summary>
+ /// <param name="wMSContainerFlow"></param>
+ /// <returns></returns>
+ /// <exception cref="NotImplementedException"></exception>
+ public WebResponseContent ContainerFlow(WMSContainerFlow wMSContainerFlow)
+ {
+ return WebResponseContent.Instance.Error("璇ユ帴鍙f殏鏈疄鐜�");
+ }
+
+
+ /// <summary>
+ /// 鍖哄煙搴撲綅淇℃伅鏌ヨ
+ /// </summary>
+ /// <param name="AreaCode"></param>
+ /// <returns></returns>
+ /// <exception cref="NotImplementedException">鍖哄煙鍙�</exception>
+ public WebResponseContent LocationInquiry(string AreaCode)
+ {
+ if (AreaCode == null)
+ {
+ //鏌ヨ杈撻�佺嚎绌烘墭缂撳瓨淇℃伅鏃惰繑鍥炵┖浣嶆暟閲�
+ }
+ return WebResponseContent.Instance.OK();
+
+ }
+
+
+ /// <summary>
+ /// 鍦板浘鍚屾
+ /// </summary>
+ /// <param name="mapSynchronizationDto"></param>
+ /// <returns></returns>
+ public WebResponseContent MapSynchronize(MapSynchronizationDto mapSynchronizationDto)
+ {
+ return WebResponseContent.Instance;
+ }
+
+ /// <summary>
+ /// 鍑哄叆搴撳畬鎴�
+ /// </summary>
+ /// <param name=""></param>
+ /// <returns></returns>
+ /// <exception cref="NotImplementedException"></exception>
+ public WebResponseContent InandoutCompleted(WMSInOutBoundCompleteFeedback wMSInOutBoundCompleteFeedback)
+ {
+ throw new NotImplementedException();
+ }
+
+ /// <summary>
+ /// 鏂欑楠岃瘉
+ /// </summary>
+ /// <param name="taskCode">浠诲姟鍙�</param>
+ /// <param name="containerCode">瀹瑰櫒缂栫爜</param>
+ /// <returns></returns>
+ public WebResponseContent MaterialBoxInspection(string taskCode, string containerCode)
+ {
+ throw new NotImplementedException();
+ }
+
+ /// <summary>
+ /// wcs绉诲簱鏁版嵁鍥炰紶
+ /// </summary>
+ /// <param name="wMSMoveLocationFeedback"></param>
+ public WebResponseContent WcsMovingDataBack(WMSMoveLocationFeedback wMSMoveLocationFeedback)
+ {
+ throw new NotImplementedException();
+ }
}
}
--
Gitblit v1.9.3