| | |
| | | /// <param name="roadway">巷道号</param> |
| | | /// <param name="targetAddress">目标地址</param> |
| | | /// <returns>存在返回 true</returns> |
| | | bool HasExecutingTaskToTarget(string roadway, string targetAddress); |
| | | bool HasExecutingTaskToTarget(string roadway, string targetAddress);
|
| | |
|
| | | /// <summary> |
| | | /// 任务取消 |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns>
|
| | | WebResponseContent CancelTask(int taskNum);
|
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using System.Threading.Channels; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseController; |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | |
| | | public WebResponseContent RollbackTaskStatusToLast(int taskNum) |
| | | { |
| | | return Service.RollbackTaskStatusToLast(taskNum); |
| | | }
|
| | |
|
| | | /// <summary> |
| | | /// 任务取消 |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns>
|
| | | [HttpPost, Route("CancelTask"), AllowAnonymous] |
| | | public WebResponseContent CancelTask(int taskNum) |
| | | { |
| | | return Service.CancelTask(taskNum); |
| | | } |
| | | } |
| | | } |
| | |
| | | using MapsterMapper; |
| | | using SqlSugar; |
| | | using System.Diagnostics.CodeAnalysis; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core; |
| | |
| | | List<Dt_Task> tasks = BaseDal.QueryData(x => taskKeys.Contains(x.TaskId)); |
| | | BaseDal.DeleteAndMoveIntoHty(tasks, OperateTypeEnum.人工删除); |
| | | return WebResponseContent.Instance.OK($"成功删除{tasks.Count}条数据"); |
| | | }
|
| | |
|
| | | /// <summary> |
| | | /// 任务取消 |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent CancelTask(int taskNum) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try
|
| | | {
|
| | | if (taskNum <= 0) return content.Error("任务编号无效");
|
| | |
|
| | | Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum);
|
| | | if (task == null) return content.OK("任务不存在,强制取消");
|
| | |
|
| | | task.TaskStatus = (int)TaskOutStatusEnum.OutCancel;
|
| | |
|
| | | if (task.TaskStatus == (int)TaskInStatusEnum.InNew || task.TaskStatus == (int)TaskOutStatusEnum.OutNew)
|
| | | {
|
| | | bool deleteResult = BaseDal.DeleteAndMoveIntoHty(task, OperateTypeEnum.自动删除);
|
| | | if (!deleteResult) return content.Error("删除任务失败");
|
| | | return content.OK();
|
| | | }
|
| | | |
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | content.Error($"WCS任务取消接口失败,{ex.Message}");
|
| | | } |
| | | return content.Error("当前任务在执行中!"); |
| | | } |
| | | } |
| | |
| | |
|
| | | public string AGV_OutTaskComplete = WIDESEA_Core.Helper.AppSettings.Configuration["AGV_OutTaskComplete"];
|
| | | public string WCS_ReceiveTask = WIDESEA_Core.Helper.AppSettings.Configuration["WCS_ReceiveTask"];
|
| | | public string WCS_CancelTask = WIDESEA_Core.Helper.AppSettings.Configuration["WCS_CancelTask"]; |
| | |
|
| | | /// <summary>
|
| | | /// 极卷库出入库申请
|
| | |
| | | private async Task<AGVResponse> CancelAgvInboundTask(Dt_Task task)
|
| | | {
|
| | | AGVResponse response = new AGVResponse();
|
| | |
|
| | | var httpResponse = _httpClientHelper.Post<WebResponseContent>(WCS_ReceiveTask, task.TaskNum.ToString());
|
| | | if (httpResponse == null || httpResponse.Data == null || !httpResponse.Data.Status)
|
| | | return response.Error(httpResponse?.Data?.Message ?? "下发WCS取消失败");
|
| | |
|
| | | task.TaskStatus = (int)TaskInStatusEnum.InCancel;
|
| | |
|
| | | _unitOfWorkManage.BeginTran();
|
| | |
| | | private async Task<AGVResponse> CancelAgvOutboundTaskAsync(Dt_Task task)
|
| | | {
|
| | | AGVResponse response = new AGVResponse();
|
| | | var httpResponse = _httpClientHelper.Post<WebResponseContent>(WCS_ReceiveTask, task.TaskNum.ToString());
|
| | | if (httpResponse == null || httpResponse.Data == null || !httpResponse.Data.Status)
|
| | | return response.Error(httpResponse?.Data?.Message ?? "下发WCS失败");
|
| | |
|
| | | var stockInfo = await _stockInfoService.GetStockInfoAsync(task.PalletCode);
|
| | | if (stockInfo == null)
|
| | | return response.Error($"未找到托盘{task.PalletCode}的库存信息");
|
| | |
| | | "DBSeedEnable": false, |
| | | "PDAVersion": "4", |
| | | "WebSocketPort": 9296, |
| | | "AutoOutboundTask": { |
| | | "AutoOutboundTask": { |
| | | "Enable": true, /// 是否启用自动出库任务 |
| | | "CheckIntervalSeconds": 300, /// 检查间隔(秒) |
| | | "TargetAddresses": { /// 按巷道前缀配置目标地址(支持多出库口) |
| | |
| | | }, |
| | | |
| | | |
| | | "A0GV_OutTaskComplete": "http://localhost:9999/OutTaskComplete", // 上报AGV出库输送线完成 |
| | | "WCS_ReceiveTask": "http://localhost:9292/api/Task/ReceiveTask" // WMS输送线任务下发 |
| | | "AGV_OutTaskComplete": "http://localhost:9999/OutTaskComplete", // 上报AGV出库输送线完成 |
| | | "WCS_ReceiveTask": "http://localhost:9292/api/Task/ReceiveTask", // WMS输送线任务下发 |
| | | "WCS_CancelTask": "http://localhost:9292/api/Task/ReceiveTask" // WCS任务取消 |
| | | } |