Code/WCS/WIDESEAWCS_Client/src/views/taskinfo/task.vue
@@ -52,7 +52,7 @@ }, { title: "ä»»å¡ç¶æ", field: "taskState", field: "taskStatus", type: "selectList", dataKey: "taskState", data: [], @@ -111,7 +111,7 @@ bind: { key: "taskType", data: [] }, }, { field: "taskState", field: "taskStatus", title: "ä»»å¡ç¶æ", type: "int", width: 150, Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs
@@ -1,4 +1,6 @@ using System; using Magicodes.ExporterAndImporter.Core; using SqlSugar; using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -11,17 +13,17 @@ /// <summary> /// WMSä»»å¡ä¸»é® /// </summary> public int Id { get; set; } public int Id { get; set; } /// <summary> /// ä»»å¡å· /// </summary> public int TaskNum { get; set; } public int TaskNum { get; set; } /// <summary> /// æçå· /// </summary> public string PalletCode { get; set; } public string PalletCode { get; set; } /// <summary> /// å··éå· @@ -31,7 +33,7 @@ /// <summary> /// ä»»å¡ç±»å /// </summary> public int TaskType { get; set; } public int TaskType { get; set; } /// <summary> /// ä»»å¡ç¶æ @@ -41,16 +43,44 @@ /// <summary> /// èµ·ç¹ /// </summary> public string SourceAddress { get; set; } public string SourceAddress { get; set; } /// <summary> /// ç»ç¹ /// </summary> public string TargetAddress { get; set; } public string TargetAddress { get; set; } /// <summary> /// å½åä½ç½® /// </summary> public string CurrentAddress { get; set; } /// <summary> /// ä¸ä¸å°å /// </summary> public string NextAddress { get; set; } /// <summary> /// ä¼å 级 /// </summary> public int Grade { get; set; } public int Grade { get; set; } /// <summary> /// /// </summary> public int WarehouseId { get; set; } /// <summary> /// /// </summary> public string AGVArea { get; set; } /// <summary> /// /// </summary> public int PalletType { get; set; } } } } Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs
@@ -318,6 +318,28 @@ } #endregion #region TaskRobotStatusEnum { Type type = typeof(TaskRobotStatusEnum); List<int> enums = Enum.GetValues(typeof(TaskRobotStatusEnum)).Cast<int>().ToList(); int index = 0; foreach (var item in enums) { FieldInfo? fieldInfo = typeof(TaskRobotStatusEnum).GetField(((TaskRobotStatusEnum)item).ToString()); DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); if (description != null) { data.Add(new { key = item.ToString(), value = description.Description }); } else { data.Add(new { key = item.ToString(), value = item.ToString() }); } index++; } } #endregion result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; } break; @@ -369,7 +391,7 @@ result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; } break; case "dispatchId": case "dispatchId": { Type type = typeof(IJob); var basePath = AppContext.BaseDirectory; @@ -403,4 +425,4 @@ } } } } } Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json
@@ -32,7 +32,8 @@ //5.PostgreSQL "DBType": "SqlServer", //è¿æ¥å符串 "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWCS_ShanMei;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", //"ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWCS_ShanMei;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWCS_ShanMei;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", //è·¨å "Cors": { @@ -128,4 +129,4 @@ "MaxMemoryPolicy": "allkeys-lru" //å åæ·æ±°çç¥ï¼allkeys-lru, volatile-lru, noevictionç } } } } Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -112,6 +112,7 @@ InitializeTaskOnReceive(task, item); tasks.Add(task); } // TOOD: è¿éæ³¨ææ·»å é误è¦è¿åé误 BaseDal.AddData(tasks); _taskExecuteDetailService.AddTaskExecuteDetail(tasks.Select(x => x.TaskNum).ToList(), "æ¥æ¶WMSä»»å¡"); @@ -726,4 +727,4 @@ [DataLength(22)] public string Barcode { get; set; } } } } Code/WMS/WIDESEA_WMSClient/src/views/system/Sys_Log.vue
@@ -62,7 +62,7 @@ field: "beginDate", title: "å¼å§æ¶é´", type: "datetime", width: 140, width: 70, align: "left", sortable: true, }, @@ -70,7 +70,7 @@ field: "elapsedTime", title: "æ¶é¿", type: "int", width: 60, width: 40, align: "left", }, { @@ -86,14 +86,14 @@ field: "requestParam", title: "请æ±åæ°", type: "string", width: 70, width: 100, align: "left", }, { field: "responseParam", title: "ååºåæ°", type: "string", width: 70, width: 100, align: "left", }, { @@ -153,5 +153,4 @@ }; }, }); </script> </script> Code/WMS/WIDESEA_WMSClient/src/views/taskinfo/task_hty.vue
@@ -96,7 +96,7 @@ type: "int", width: 120, align: "left", bind: { key: "taskType", data: [] }, bind: { key: "taskTypeEnum", data: [] }, }, { field: "taskStatus", Code/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/LocationInfoService.cs
@@ -25,6 +25,7 @@ private readonly IRepository<Dt_Task> _taskRepository; private readonly IRepository<Dt_StockInfo> _stockInfoRepository; private readonly IRecordService _recordService; private readonly IRepository<Dt_Warehouse> _warehouseRepository; /// <summary> /// æé 彿° @@ -36,6 +37,7 @@ IRepository<Dt_LocationInfo> baseDal, IRepository<Dt_Task> taskRepository, IRepository<Dt_StockInfo> stockInfoRepository, IRepository<Dt_Warehouse> warehouseRepository, IMapper mapper, IRecordService recordService) : base(baseDal) { @@ -43,6 +45,7 @@ _stockInfoRepository = stockInfoRepository; _mapper = mapper; _recordService = recordService; _warehouseRepository = warehouseRepository; } /// <summary> @@ -141,10 +144,10 @@ x.LocationStatus == LocationStatusEnum.Free.GetHashCode()); return locations? .OrderBy(x => x.Layer) .ThenByDescending(x => x.Depth) .ThenBy(x => x.Column) .ThenBy(x => x.Row) .OrderByDescending(x => x.Depth) // 1. 深度ä¼å ï¼ä»å¤§å°å°ï¼ .ThenBy(x => x.Layer) // 2. 屿° .ThenBy(x => x.Column) // 3. å .ThenBy(x => x.Row) // 4. è¡ .FirstOrDefault(); } @@ -494,11 +497,18 @@ /// <param name="layer">屿°</param> /// <param name="depth">深度</param> /// <returns>è´§ä½ä¿¡æ¯å¯¹è±¡</returns> private static Dt_LocationInfo CreateLocationInfo(string roadwayNo, int row, int col, int layer, int depth) private Dt_LocationInfo CreateLocationInfo(string roadwayNo, int row, int col, int layer, int depth) { var warehouse = _warehouseRepository.QueryData(x => x.WarehouseCode == roadwayNo).FirstOrDefault(); if (warehouse == null) { throw new InvalidOperationException($"æªæ¾å°å··éç¼å·ä¸º {roadwayNo} çä»åºä¿¡æ¯"); } return new Dt_LocationInfo { WarehouseId = 0, WarehouseId = warehouse.WarehouseId, Row = row, Column = col, Layer = layer, @@ -507,7 +517,7 @@ EnableStatus = EnableStatusEnum.Normal.GetHashCode(), LocationStatus = LocationStatusEnum.Free.GetHashCode(), LocationType = LocationTypeEnum.Undefined.GetHashCode(), LocationCode = $"{row:D3}-{col:D3}-{layer:D3}", LocationCode = $"{roadwayNo}-{row:D3}-{col:D3}-{layer:D3}", LocationName = $"{roadwayNo}å··é{row:D3}è¡{col:D3}å{layer:D3}å±{depth:D2}æ·±" }; } Code/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs
@@ -52,6 +52,16 @@ public string TargetAddress { get; set; } /// <summary> /// å½åä½ç½® /// </summary> public string CurrentAddress { get; set; } /// <summary> /// ä¸ä¸å°å /// </summary> public string NextAddress { get; set; } /// <summary> /// ä¼å 级 /// </summary> public int Grade { get; set; } @@ -72,4 +82,4 @@ public int PalletType { get; set; } } } } Code/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs
@@ -172,24 +172,19 @@ public Task<WebResponseContent> OutTaskComplete(OutTaskCompleteDto outTaskCompleteDto); /// <summary> /// ä»»å¡å®ææ¥å£ /// </summary> /// <param name="wCSTask"></param> /// <returns></returns> //public Task<WebResponseContent> TaskCompleted(WCSTaskDTO wCSTask); /// <summary> /// ä»»å¡åæ¶ /// </summary> /// <param name="taskCancelDto">请æ±åæ°</param> /// <returns></returns> public Task<AGVResponse> TaskCancelAsync(TaskCancelDto taskCancelDto); /// <summary> /// åæ¾è´§å®æ /// </summary> /// <param name="taskCompleteDto">请æ±åæ°</param> /// <returns></returns> public Task<AGVResponse> TaskCompleteAsync(TaskCompleteDto taskCompleteDto); /// <summary> /// è¾é线ç³è¯·è¿å ¥ /// </summary> @@ -199,4 +194,4 @@ #endregion æå·åºä»»å¡æ¨¡å } } } Code/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryService.cs
@@ -204,12 +204,12 @@ List<object> data = new List<object>(); { Type type = typeof(TaskTypeEnum); List<int> enums = Enum.GetValues(typeof(TaskTypeEnum)).Cast<int>().ToList(); Type type = typeof(TaskInboundTypeEnum); List<int> enums = Enum.GetValues(typeof(TaskInboundTypeEnum)).Cast<int>().ToList(); int index = 0; foreach (var item in enums) { FieldInfo? fieldInfo = typeof(TaskTypeEnum).GetField(((TaskTypeEnum)item).ToString()); FieldInfo? fieldInfo = typeof(TaskInboundTypeEnum).GetField(((TaskInboundTypeEnum)item).ToString()); DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); if (description != null) { @@ -223,6 +223,65 @@ } } { Type type = typeof(TaskOutboundTypeEnum); List<int> enums = Enum.GetValues(typeof(TaskOutboundTypeEnum)).Cast<int>().ToList(); int index = 0; foreach (var item in enums) { FieldInfo? fieldInfo = typeof(TaskOutboundTypeEnum).GetField(((TaskOutboundTypeEnum)item).ToString()); DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); if (description != null) { data.Add(new { key = item.ToString(), value = description.Description }); } else { data.Add(new { key = item.ToString(), value = item.ToString() }); } index++; } } { Type type = typeof(TaskRelocationTypeEnum); List<int> enums = Enum.GetValues(typeof(TaskRelocationTypeEnum)).Cast<int>().ToList(); int index = 0; foreach (var item in enums) { FieldInfo? fieldInfo = typeof(TaskRelocationTypeEnum).GetField(((TaskRelocationTypeEnum)item).ToString()); DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); if (description != null) { data.Add(new { key = item.ToString(), value = description.Description }); } else { data.Add(new { key = item.ToString(), value = item.ToString() }); } index++; } } { Type type = typeof(RobotTaskTypeEnum); List<int> enums = Enum.GetValues(typeof(RobotTaskTypeEnum)).Cast<int>().ToList(); int index = 0; foreach (var item in enums) { FieldInfo? fieldInfo = typeof(RobotTaskTypeEnum).GetField(((RobotTaskTypeEnum)item).ToString()); DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); if (description != null) { data.Add(new { key = item.ToString(), value = description.Description }); } else { data.Add(new { key = item.ToString(), value = item.ToString() }); } index++; } } result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; } break; @@ -491,4 +550,4 @@ } } } } } Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_AGV.cs
@@ -14,13 +14,12 @@ { public partial class TaskService { #region æå·åºä»»å¡æ¨¡å public string AGV_OutTaskComplete = WIDESEA_Core.Helper.AppSettings.Configuration["AGV_OutTaskComplete"]; public string WCS_ReceiveTask = WIDESEA_Core.Helper.AppSettings.Configuration["WCS_ReceiveTask"]; /// <summary> /// åºå ¥åºç³è¯·ã /// æå·åºåºå ¥åºç³è¯· /// </summary> public async Task<AGVResponse> ApplyInOutAsync(ApplyInOutDto applyInOutDto) { @@ -32,7 +31,7 @@ if (validationMessage != null) return response.Error(validationMessage); var existingTask = await BaseDal.QueryFirstAsync(x => x.PalletCode == applyInOutDto.TrayNumber); var existingTask = await BaseDal.QueryFirstAsync(x => x.PalletCode == applyInOutDto.TrayNumber || x.OrderNo == applyInOutDto.TaskId); if (existingTask != null) return response.Error($"WMSå·²æå½åä»»å¡ï¼ä¸å¯éå¤ä¸åï¼ä»»å¡å·ï¼{applyInOutDto.TaskId}"); @@ -61,7 +60,7 @@ } /// <summary> /// æå¨åºåºå®æåé¦ç»AGVã /// æå¨åºåºå®æåé¦ç»AGV /// </summary> public async Task<WebResponseContent> OutTaskComplete(OutTaskCompleteDto outTaskCompleteDto) { @@ -83,7 +82,7 @@ return response.Error(httpResponse?.Msg ?? "AGVæ¥å£è°ç¨å¼å¸¸"); if (!httpResponse.Code) return response.Error(string.IsNullOrWhiteSpace(httpResponse.Msg) ? "AGVæ¥å£è°ç¨å¤±è´¥" : httpResponse.Msg); return response.Error(string.IsNullOrWhiteSpace(httpResponse.Msg) ? "AGVæ¥å£è°ç¨å¤±è´¥" : httpResponse.Msg); var syncResult = await CompleteLocalOutboundAfterAgvAckAsync(task); return syncResult.Status ? response.OK(httpResponse.Msg) : syncResult; @@ -96,7 +95,7 @@ } /// <summary> /// è¾é线ç³è¯·è¿å ¥ã /// è¾é线ç³è¯·è¿å ¥ /// </summary> public async Task<AGVResponse> ApplyEnterAsync(ApplyEnterDto applyEnterDto) { @@ -124,7 +123,7 @@ } /// <summary> /// åæ¾è´§å®æã /// åæ¾è´§å®æ /// </summary> public async Task<AGVResponse> TaskCompleteAsync(TaskCompleteDto taskCompleteDto) { @@ -152,7 +151,7 @@ } /// <summary> /// ä»»å¡åæ¶ã /// ä»»å¡åæ¶ /// </summary> public async Task<AGVResponse> TaskCancelAsync(TaskCancelDto taskCancelDto) { @@ -183,6 +182,7 @@ } } #region åæ°éªè¯ private static string? ValidateApplyInOutRequest(ApplyInOutDto dto) { if (dto == null) return "请æ±åæ°ä¸è½ä¸ºç©º"; @@ -231,7 +231,10 @@ if (string.IsNullOrWhiteSpace(dto.TaskId)) return "ä»»å¡å·ä¸è½ä¸ºç©º"; return null; } #endregion åæ°éªè¯ #region å ·ä½å®ç° // åºå ¥åºå ±ç¨åå»ºä»»å¡ private Dt_Task BuildAgvTask(ApplyInOutDto dto) { var task = new Dt_Task @@ -265,6 +268,7 @@ return task; } // æå»ºè¿åAGVåºå ¥åºè¯·æ±ä½ private AGVDataDto BuildAgvDataDto(Dt_Task task, ApplyInOutDto dto) { return new AGVDataDto @@ -287,6 +291,7 @@ }; } // å ¥åºå建 private async Task<AGVResponse?> CreateAgvInboundTaskAsync(Dt_Task task, ApplyInOutDto dto) { AGVResponse response = new AGVResponse(); @@ -302,6 +307,7 @@ return addResult ? null : response.Error("å ¥åºä»»å¡å建失败"); } // åºåºå建 private async Task<AGVResponse?> CreateAgvOutboundTaskAsync(Dt_Task task, ApplyInOutDto dto) { AGVResponse response = new AGVResponse(); @@ -309,13 +315,13 @@ if (stockInfo == null) return response.Error($"æªæ¾å°æç{dto.TrayNumber}çåºåä¿¡æ¯"); if (stockInfo.WarehouseId != dto.YinYang) return response.Error($"æç{dto.TrayNumber}ä¸å±äºå½å{(dto.YinYang == 1 ? "é´æ" : "鳿")}"); //if (stockInfo.WarehouseId != dto.YinYang) // return response.Error($"æç{dto.TrayNumber}ä¸å±äºå½å{(dto.YinYang == 1 ? "é´æ" : "鳿")}"); if (stockInfo.StockStatus != (int)StockStatusEmun.å ¥åºå®æ) return response.Error($"æç{dto.TrayNumber}æ£å¨ç§»å¨ä¸ï¼è¯·ç¨åï¼"); var locationInfo = await _locationInfoService.GetLocationInfoAsync(stockInfo.LocationCode); var locationInfo = await _locationInfoService.GetLocationInfo(stockInfo.LocationCode); if (locationInfo == null) return response.Error($"æªæ¾å°æç{stockInfo.LocationCode}çè´§ä½ä¿¡æ¯"); @@ -327,6 +333,14 @@ task.SourceAddress = stockInfo.LocationCode; task.CurrentAddress = stockInfo.LocationCode; task.TargetAddress = dto.YinYang == 1 ? "D10020" : "D10090"; var wmsTaskDto = _mapper.Map<WMSTaskDTO>(task); var taskList = new List<WMSTaskDTO> { wmsTaskDto }; var requestBody = JsonSerializer.Serialize(taskList); var httpResponse = _httpClientHelper.Post<WebResponseContent>(WCS_ReceiveTask, requestBody); if (httpResponse == null || httpResponse.Data == null || !httpResponse.Data.Status) return response.Error(httpResponse?.Data?.Message ?? "ä¸åWCS失败"); stockInfo.StockStatus = (int)StockStatusEmun.åºåºéå®; locationInfo.LocationStatus = (int)LocationStatusEnum.InStockLock; @@ -340,34 +354,22 @@ _unitOfWorkManage.RollbackTran(); return response.Error("åºåºä»»å¡å建失败"); } _unitOfWorkManage.CommitTran(); return null; } private async Task<WebResponseContent> CompleteLocalOutboundAfterAgvAckAsync(Dt_Task task) { var stockInfo = await _stockInfoService.GetStockInfoAsync(task.PalletCode); if (stockInfo == null) return WebResponseContent.Instance.Error($"æªæ¾å°æç{task.PalletCode}çåºåä¿¡æ¯"); var locationInfo = await _locationInfoService.GetLocationInfoAsync(stockInfo.LocationCode); if (locationInfo == null) return WebResponseContent.Instance.Error($"æªæ¾å°æç{stockInfo.LocationCode}çè´§ä½ä¿¡æ¯"); if (stockInfo.StockStatus != (int)StockStatusEmun.åºåºéå® || locationInfo.LocationStatus != (int)LocationStatusEnum.InStockLock) return WebResponseContent.Instance.Error($"å½ååºå{stockInfo.StockStatus}æè è´§ä½{locationInfo.LocationStatus}ç¶æä¿¡æ¯é误"); locationInfo.LocationStatus = (int)LocationStatusEnum.Free; task.TaskStatus = (int)TaskOutStatusEnum.Line_OutFinish; _unitOfWorkManage.BeginTran(); var deleteTaskResult = BaseDal.DeleteData(task); var updateLocationResult = _locationInfoService.UpdateData(locationInfo); var deleteStockResult = _stockInfoService.DeleteData(stockInfo); if (!deleteTaskResult || !updateLocationResult.Status || !deleteStockResult.Status) var updateResult = BaseDal.UpdateData(task); if (!updateResult) { _unitOfWorkManage.RollbackTran(); return WebResponseContent.Instance.Error("AGV宿åä¼ åï¼æ¬å°ä»»å¡/åºå/è´§ä½æ´æ°å¤±è´¥"); return WebResponseContent.Instance.Error("AGV宿åä¼ åï¼ä»»å¡æ´æ°å¤±è´¥"); } _unitOfWorkManage.CommitTran(); @@ -376,11 +378,62 @@ private bool CanApplyEnter(Dt_Task task, ApplyEnterDto dto) { return dto.InOut == 1 ? task.TaskType == (int)TaskInboundTypeEnum.Inbound && task.TaskStatus == (int)TaskInStatusEnum.InNew : task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.TaskStatus == (int)TaskStatusEnum.Line_Finish; if (dto.InOut == 1) { var hasExecutingOutTask = BaseDal.QueryFirst(x => x.TaskType == (int)TaskOutboundTypeEnum.Outbound && x.TargetAddress == task.SourceAddress && (x.TaskStatus == (int)TaskOutStatusEnum.SC_OutExecuting || x.TaskStatus == (int)TaskOutStatusEnum.Line_OutExecuting)); // å¦ææ²¡ææ£å¨æ§è¡çåºåºä»»å¡ï¼åå è®¸å ¥åº return hasExecutingOutTask == null; } else { return task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.TaskStatus == (int)TaskStatusEnum.Line_Finish; } } // WCSå ¥åºå®æ private async Task<WebResponseContent> CompleteAgvInboundTaskAsync(CreateTaskDto taskDto) { WebResponseContent response = new WebResponseContent(); var task = await BaseDal.QueryFirstAsync(x => x.PalletType == taskDto.PalletType); if (task == null) return response.Error($"没æå½åæç{taskDto.PalletType}å ¥åºä»»å¡"); var stockInfo = await _stockInfoService.GetStockInfoAsync(task.PalletCode); if (stockInfo == null) return response.Error($"æªæ¾å°æç{task.PalletCode}çåºåä¿¡æ¯"); var locationInfo = await _locationInfoService.GetLocationInfoAsync(task.TargetAddress); if (locationInfo == null) return response.Error($"æªæ¾å°è´§ä½{task.TargetAddress}çä¿¡æ¯"); if (locationInfo.LocationStatus == (int)LocationStatusEnum.InStock) return response.Error($"å½åè´§ä½{locationInfo.LocationStatus}ç¶æä¸æ¯ç©ºé²ç¶æï¼æ æ³å ¥åº"); // æ´æ°è´§ä½ç¶æä¸ºå ç¨ locationInfo.LocationStatus = (int)LocationStatusEnum.InStock; task.TaskStatus = (int)TaskInStatusEnum.InFinish; stockInfo.StockStatus = (int)StockStatusEmun.å ¥åºå®æ; _unitOfWorkManage.BeginTran(); var addStockResult = _stockInfoService.UpdateData(stockInfo); var updateLocationResult = _locationInfoService.UpdateData(locationInfo); BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); if (!addStockResult.Status || !updateLocationResult.Status) { _unitOfWorkManage.RollbackTran(); return response.Error("å ¥åºå®æåï¼æ·»å åºåæè´§ä½æ´æ°å¤±è´¥"); } _unitOfWorkManage.CommitTran(); return response.OK(); } // AGVåºåºå®æ private async Task<AGVResponse> CompleteAgvOutboundTaskAsync(Dt_Task task) { AGVResponse response = new AGVResponse(); @@ -400,9 +453,9 @@ _unitOfWorkManage.BeginTran(); var deleteStockResult = _stockInfoService.DeleteData(stockInfo); var updateLocationResult = await _locationInfoService.UpdateLocationInfoAsync(locationInfo); var updateLocationResult = _locationInfoService.UpdateData(locationInfo); BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); if (!deleteStockResult.Status || !updateLocationResult) if (!deleteStockResult.Status || !updateLocationResult.Status) { _unitOfWorkManage.RollbackTran(); return response.Error("åºåºå®æåï¼æ¬å°åºåæè´§ä½æ´æ°å¤±è´¥"); @@ -412,6 +465,7 @@ return response.OK(); } // AGVå·²æ¾è´§ï¼åå¤è¾éçº¿å ¥åº private async Task<AGVResponse> CompleteAgvInboundTaskAsync(Dt_Task task) { AGVResponse response = new AGVResponse(); @@ -421,12 +475,15 @@ task.TargetAddress = availableLocation.LocationCode; var wcsTaskDto = _mapper.Map<WCSTaskDTO>(task); var httpResponse = _httpClientHelper.Post<WebResponseContent>(WCS_ReceiveTask, JsonSerializer.Serialize(wcsTaskDto)); var wmsTaskDto = _mapper.Map<WMSTaskDTO>(task); var taskList = new List<WMSTaskDTO> { wmsTaskDto }; var requestBody = JsonSerializer.Serialize(taskList); var httpResponse = _httpClientHelper.Post<WebResponseContent>(WCS_ReceiveTask, requestBody); if (httpResponse == null || httpResponse.Data == null || !httpResponse.Data.Status) return response.Error(httpResponse?.Data?.Message ?? "ä¸åWCS失败"); task.TaskStatus = (int)TaskStatusEnum.Line_Executing; task.TaskStatus = (int)TaskInStatusEnum.Line_InExecuting; task.Dispatchertime = DateTime.Now; var locationInfo = await _locationInfoService.GetLocationInfoAsync(task.TargetAddress); @@ -435,6 +492,10 @@ if (locationInfo.LocationStatus != (int)LocationStatusEnum.Free) return response.Error($"å½åè´§ä½{locationInfo.LocationStatus}ç¶æä¿¡æ¯é误"); var existingStock = await _stockInfoService.GetStockInfoAsync(task.PalletCode); if (existingStock != null) return response.Error($"æç{task.PalletCode}çåºåä¿¡æ¯å·²åå¨ï¼è¯·å¿éå¤å ¥åº"); Dt_StockInfo stockInfo = new Dt_StockInfo { @@ -462,6 +523,7 @@ return response.OK(); } // AGVå ¥åºåæ¶ private AGVResponse CancelAgvInboundTask(Dt_Task task) { AGVResponse response = new AGVResponse(); @@ -473,6 +535,8 @@ return response.OK(); } // AGVåºåºåæ¶ private async Task<AGVResponse> CancelAgvOutboundTaskAsync(Dt_Task task) { AGVResponse response = new AGVResponse(); @@ -505,6 +569,6 @@ return response.OK(); } #endregion æå·åºä»»å¡æ¨¡å #endregion å ·ä½å®ç° } } } Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_WCS.cs
@@ -182,10 +182,11 @@ if (stockInfo == null) return WebResponseContent.Instance.Error("æªæ¾å°å¯¹åºåºåä¿¡æ¯"); // 夿æ¯ä¸æ¯æå·åºä»»å¡ //if (taskDto.WarehouseId == (int)WarehouseEnum.FJ1 || taskDto.WarehouseId == (int)WarehouseEnum.ZJ1) //{ // return WebResponseContent.Instance.OK(); //} if (taskDto.WarehouseId == (int)WarehouseEnum.FJ1 || taskDto.WarehouseId == (int)WarehouseEnum.ZJ1) { return await CompleteAgvInboundTaskAsync(taskDto); } return await ExecuteWithinTransactionAsync(async () => { @@ -809,4 +810,4 @@ #endregion WCSé»è¾å¤ç } } } Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs
@@ -29,7 +29,7 @@ /// </summary> /// <param name="taskDto"></param> /// <returns></returns> [HttpGet, HttpPost, Route("CreateTaskInbound"),AllowAnonymous] [HttpGet, HttpPost, Route("CreateTaskInbound"), AllowAnonymous] public async Task<WebResponseContent?> CreateTaskInboundAsync([FromBody] CreateTaskDto taskDto) { return await Service.CreateTaskInboundAsync(taskDto); @@ -212,6 +212,7 @@ { return await Service.ApplyInOutAsync(applyInOutDto); } /// <summary> /// æå¨åºåºå®æåé¦ç»AGV /// </summary> @@ -222,16 +223,7 @@ { return await Service.OutTaskComplete(outTaskCompleteDto); } ///// <summary> ///// ä»»å¡å®æ ///// </summary> ///// <param name="wCSTask">请æ±åæ°</param> ///// <returns></returns> //[HttpPost, Route("TaskCompleted"), AllowAnonymous] //public async Task<WebResponseContent?> TaskCompleted([FromBody] WCSTaskDTO wCSTask) //{ // return await Service.TaskCompleted(wCSTask); //} /// <summary> /// è¾é线ç³è¯·è¿å ¥ /// </summary> @@ -264,6 +256,7 @@ { return await Service.TaskCancelAsync(taskCancelDto); } #endregion æå·åºä»»å¡æ¨¡å } } } Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json
@@ -34,8 +34,8 @@ "MainDB": "DB_WIDESEA", //å½å项ç®ç主åºï¼æå¯¹åºçè¿æ¥å符串çEnabledå¿ é¡»ä¸ºtrue //è¿æ¥å符串 //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=", "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWMS_ShanMei;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", //"ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWMS_ShanMei;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", //"ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWMS_ShanMei;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWMS_ShanMei;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", //"ConnectionString": "Data Source=10.30.4.92;Initial Catalog=WMS_TC;User ID=sa;Password=duo123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", //æ§WMSæ°æ®åºè¿æ¥ //"TeConnectionString": "Data Source=10.30.4.92;Initial Catalog=TeChuang;User ID=sa;Password=duo123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", ÏîÄ¿×ÊÁÏ/¼«¾í¿âAGV½Ó¿Ú/~$¼«¾í¿â³öÈë¿â.docxBinary files differ