From 06f5f3e474bb8d9e255a899b62d16f671cfdb940 Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期四, 26 六月 2025 17:34:33 +0800 Subject: [PATCH] 代码更新 --- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/阻焊仓/GroundStationJob_ZH.cs | 48 +++++------------------------------------------- 1 files changed, 5 insertions(+), 43 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\351\230\273\347\204\212\344\273\223/GroundStationJob_ZH.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\351\230\273\347\204\212\344\273\223/GroundStationJob_ZH.cs" index ed04228..a495090 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\351\230\273\347\204\212\344\273\223/GroundStationJob_ZH.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\351\230\273\347\204\212\344\273\223/GroundStationJob_ZH.cs" @@ -66,39 +66,29 @@ //device.SetValue(GroundStationDBName.W_TakeRequest, true, item.StationCode); //device.SetValue(GroundStationDBName.W_PutPalletType, 1, item.StationCode);//task.PalletType - - //device.SetValue(GroundStationDBName.W_TakeFinish, true, item.StationCode); ////鍒ゆ柇AGV浠诲姟瀹屾垚锛屽悗鍐欑粰鍦伴潰绔欏彇璐у畬鎴� //device.SetValue(GroundStationDBName.W_TakeRequest, false, item.StationCode); //device.SetValue(GroundStationDBName.W_TakeFinish, false, item.StationCode); - Dt_Task task = _taskRepository.QueryFirst(x => x.DeviceCode == item.StackerCraneCode && x.TaskState == TaskStatusEnum.SC_Execute.ObjToInt() && string.IsNullOrEmpty(x.NextAddress)); + Dt_Task task = _taskRepository.QueryFirst(x => x.DeviceCode == item.StackerCraneCode && x.TaskState == TaskStatusEnum.New.ObjToInt() && x.NextAddress==item.StationCode); if (task != null && isCanPut && !isCanTake && !putRequest && !putFinish && !takeRequest && !takeFinish) { - _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, nextAddress: item.StationCode); + _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, nextAddress: item.StackerCraneStationCode); } } if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt()) { - Dt_Task task = _taskRepository.QueryFirst(x => (x.TargetAddress == item.StackerCraneCode || string.IsNullOrEmpty(x.TargetAddress) || x.NextAddress == item.StackerCraneCode || string.IsNullOrEmpty(x.NextAddress)) && (x.TaskState == TaskStatusEnum.New.ObjToInt() || x.TaskState == TaskStatusEnum.AGV_Finish.ObjToInt()) && (x.SourceAddress == item.StationCode || x.CurrentAddress == item.AGVStationCode || x.CurrentAddress == item.StationCode)); + + Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress==item.StationCode && string.IsNullOrEmpty(x.TargetAddress) && string.IsNullOrEmpty(x.NextAddress) && x.TaskState == TaskStatusEnum.AGV_Finish.ObjToInt()); if (task != null) { - if (isCanPut) - { - device.SetValue(GroundStationDBName.W_PutRequest, true, item.StationCode); - device.SetValue(GroundStationDBName.W_PutPalletType, 1, item.StationCode);//task.PalletType - } - //鍒ゆ柇AGV浠诲姟瀹屾垚锛屽悗鍐欑粰鍦伴潰绔欐斁璐у畬鎴� - device.SetValue(GroundStationDBName.W_PutFinish, true, item.StationCode); - - string oldAddress = task.NextAddress; - int oldStatus = task.TaskState; Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == item.StationCode); if (stationManger == null) { WriteError(item.StationName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}"); continue; } + //string? locationCode = "SC01_ZH-001-027-001-02";// string? locationCode = _taskService.RequestAssignLocation(task.TaskNum, stationManger.StackerCraneCode); if (string.IsNullOrEmpty(locationCode)) { @@ -112,34 +102,6 @@ catch (Exception ex) { WriteError(device.DeviceCode, $"{item}浜や簰閿欒", ex); - } - } - - foreach (var item in stationMangers.Where(x => !deviceStations.Contains(x.StationCode))) - { - try - { - Dt_Task task = _taskRepository.QueryFirst(x => x.TaskState == TaskStatusEnum.New.ObjToInt() && x.SourceAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType)); - if (task != null) - { - Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == item.StationCode); - if (stationManger == null) - { - WriteError(item.StationName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}"); - continue; - } - string? locationCode = _taskService.RequestAssignLocation(task.TaskNum, stationManger.StackerCraneCode); - if (string.IsNullOrEmpty(locationCode)) - { - WriteError(item.StationName, $"璇锋眰鍒嗛厤璐т綅杩斿洖淇℃伅閿欒,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}"); - continue; - } - _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, currentAddress: stationManger.StackerCraneStationCode, targetAddress: locationCode, nextAddress: locationCode, deviceCode: stationManger.StackerCraneCode); - } - } - catch (Exception ex) - { - } } } -- Gitblit v1.9.3