From 53d6a24cb335b0c9b4449e1211ce8ea644d68d67 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期五, 31 五月 2024 20:48:53 +0800
Subject: [PATCH] 可根据图号更改下料口车轮数量入库条件
---
代码管理/WMS/WMS_Server/WIDESEA_WMS/Common/AGVTask/EmptyPalletTask.cs | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Common/AGVTask/EmptyPalletTask.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Common/AGVTask/EmptyPalletTask.cs"
index ea0743b..861e852 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Common/AGVTask/EmptyPalletTask.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Common/AGVTask/EmptyPalletTask.cs"
@@ -8,7 +8,9 @@
using WIDESEA_Common;
using WIDESEA_Core.EFDbContext;
using WIDESEA_Entity.DomainModels;
+using WIDESEA_WCS.IRepositories;
using WIDESEA_WCS.JobsPart.Common;
+using WIDESEA_WCS.Repositories;
using WIDESEA_WMS.IRepositories;
using WIDESEA_WMS.Repositories;
using static System.Collections.Specialized.BitVector32;
@@ -28,12 +30,15 @@
VOLContext Context = new VOLContext();
Idt_agvtaskRepository agvtaskRepository = new dt_agvtaskRepository(Context);
Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context);
+ Idt_management_timeRepository timeRepository = new dt_management_timeRepository(Context);
#region 鍙犵洏鍖烘弧5涓叆搴� 闇�浼樺寲
var EmptyStations = stationinfoRepository.Find(x => x.stationCode.Contains("DD") && x.enable).ToList();
var EmptyD = EmptyStations.Where(x => x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity == 5).FirstOrDefault();
if (EmptyD != null) EmptyTray.CreateEmptyTrayIn(stationinfoRepository, EmptyD);
- //EmptyD = EmptyStations.Where(x => x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0&&x.lastUpdateTime.).FirstOrDefault();//鏃堕棿瓒呰繃6灏忔椂鍏ュ簱
+ var val = timeRepository.Find(x => x.management_name == "StackingArea").FirstOrDefault().management_numericalvalue;
+ EmptyD = EmptyStations.Where(x => x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity < 5 && x.lastUpdateTime.AddHours(val) < DateTime.Now).FirstOrDefault();
+ if (EmptyD != null) EmptyTray.CreateEmptyTrayIn(stationinfoRepository, EmptyD);
#endregion
var agv_tasks = agvtaskRepository.Find(x => x.agv_taskstate == AGVTaskStateEnum.Queue.ToString() && x.agv_tasktype == AGVTaskTypeEnum.TaskType_EmptyPallet.ToString() && string.IsNullOrEmpty(x.agv_toaddress)).OrderByDescending(x => x.agv_grade).ThenBy(x => x.agv_createtime).ToList();
@@ -89,6 +94,7 @@
agv_task.agv_toaddress = EmptyStation.stationCode;
agvtaskRepository.Update(agv_task, true);
EmptyStation.location_state = LocationStateEnum.Busy.ToString();
+ EmptyStation.tray_status = TrayStateEnum.EmptyTray.ToString();
stationinfoRepository.Update(EmptyStation, true);
WriteDBLog.Success("鏇存柊鑷姩鍙栫┖鎵橀槦鍒椾换鍔�", $"浠诲姟缂栧彿锛歿agv_task.agv_tasknum}", "WMS");
}
--
Gitblit v1.9.3