From 5da3a276b7847187a7c155ee069d3cd4c9e58074 Mon Sep 17 00:00:00 2001
From: HuBingJie <3146306518@qq.com>
Date: 星期日, 07 十二月 2025 23:28:14 +0800
Subject: [PATCH] 1
---
代码管理/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SpeStackerCraneJob/SpeStackerCraneJob.cs | 187 +++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 164 insertions(+), 23 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SpeStackerCraneJob/SpeStackerCraneJob.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SpeStackerCraneJob/SpeStackerCraneJob.cs"
index c47f71c..126bd1f 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SpeStackerCraneJob/SpeStackerCraneJob.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SpeStackerCraneJob/SpeStackerCraneJob.cs"
@@ -20,6 +20,7 @@
using WIDESEA_Common.Log;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
+using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Core.Enums;
using WIDESEAWCS_DTO.Enum;
using WIDESEAWCS_ISystemServices;
@@ -48,15 +49,19 @@
private readonly ITaskRepository _taskRepository;
private readonly IRouterService _routerService;
private readonly IAgvStationService _agvStationService;
+ IRepository<AbnormalTask> _abnormalTask;
+ IRgvoperainformService _rgvoperainformService;
- public SpeStackerCraneJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IAgvStationService agvStationService)
+ public SpeStackerCraneJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IAgvStationService agvStationService, IRepository<AbnormalTask> abnormalTask, IRgvoperainformService rgvoperainformService)
{
_taskService = taskService;
_taskExecuteDetailService = taskExecuteDetailService;
_taskRepository = taskRepository;
_routerService = routerService;
_agvStationService = agvStationService;
+ _abnormalTask = abnormalTask;
+ _rgvoperainformService = rgvoperainformService;
}
@@ -64,10 +69,15 @@
{
try
{
+ //WriteLog.Write_Log("23");
+
SpeStackerCrane speStackerCrane = (SpeStackerCrane)context.JobDetail.JobDataMap.Get("JobParams");
if (speStackerCrane != null)
{
GetStackerObject getStackerObject = new GetStackerObject(speStackerCrane);
+
+ _rgvoperainformService.LogAlarmToDatabase(speStackerCrane.DeviceCode);
+
if (getStackerObject.RGVInitializationValue == RGVInitialize.Initialized)
{
@@ -76,6 +86,25 @@
{
CommonStackerCrane_AGVTaskCompletedEventHandler(getStackerObject, speStackerCrane);
}
+
+ //鍒ゆ柇褰撳墠璁惧鏄叆搴撹繕鏄嚭搴�
+ if (GetDeviceAddress.OutbounMotherChildCartbool(speStackerCrane.DeviceCode))
+ {
+ //鍒ゆ柇褰撳墠瀹夊叏闂ㄦ槸鍚︿负缁胯壊鐏�
+ if (GetDeviceAddress.ReadAqmDecicStice(1))
+ {
+ return null;
+ }
+ }
+ else
+ {
+ //鍒ゆ柇鍏ュ簱绔畨鍏ㄩ棬鏄惁姝e父
+ if (GetDeviceAddress.ReadAqmDecicStice(2))
+ {
+ return null;
+ }
+ }
+
if (getStackerObject.RgvCraneAutoStatusValue == RgvCraneAutoStatus.Automatic &&
getStackerObject.StaclerkJobJobStatusValue == RGV_Rgvtaskstutas.Ready && getStackerObject.RgvCraneWorkStatusValue == RGVStepprocess.NoAction)
@@ -139,8 +168,25 @@
}
else if (getStackerObject.StaclerkJobJobStatusValue == RGV_Rgvtaskstutas.AbnormalCompletion && getStackerObject.CurrentRgvtaskid != 0 && getStackerObject.CurrentRgvtaskid != 30001)
{
+ string ErrorContent = RgvOperationService.AQMReadAlarminform();
+ if (ErrorContent != null && ErrorContent != "")
+ {
+ _abnormalTask.AddData(new AbnormalTask
+ {
+ TaskNum = getStackerObject.CurrentRgvtaskid,
+ ErrorContent = ErrorContent,
+ CreateDate = DateTime.Now,
+ Creater = "system",
+ });
+ }
+ //淇敼浠诲姟鐘舵�佷负寮傚父瀹屾垚
+ _taskService.HandleInAbnormal(getStackerObject.CurrentRgvtaskid);
+
//鍐欏叆寮傚父瀹屾垚鎶ヨ淇℃伅
- speStackerCrane.Communicator.Write<short>("DB101.36", 1);
+ //speStackerCrane.Communicator.Write<short>("DB101.36", 1); //鍐欏叆鎶ヨ
+
+ speStackerCrane.SetValue(RGV_taskcoDBName.RGV_taskcomplete, 1);
+ speStackerCrane.SetValue(RGV_taskcoDBName.RGV_taskcomplete, 0);
}
}
#endregion
@@ -179,7 +225,7 @@
=> GoodsPlacedCorridor(RGVTaskdevice), //瀛愯溅鏀捐揣浠诲姟(宸插畬鎴�)
((int)RGVEquipment.Mothertrailer, RgvEquipmentStatus.HasCargo)
- => MotherVehicleMovement(RGVTaskdevice), //锛堝凡瀹屾垚锛�
+ => MotherVehicleMovement(RGVTaskdevice), //姣嶈溅绉诲姩锛堝凡瀹屾垚锛�
_ => null
};
@@ -190,23 +236,32 @@
public Dt_Task? ForkliftUnloading(AGVStation RGVTaskdevice)
{
Dt_Task dt_Task = _taskService.GetInkouFinhuoTask(RGVTaskdevice.ChildPosiDeviceCode);
-
+ if (dt_Task == null) return null;
//鍒ゆ柇HCJ鏄惁鏈夎揣
if (GetDeviceAddress.HCJIsstock(dt_Task.NextAddress))
{
//鍒ゆ柇瀛愯溅鏄惁鍦ㄦ帴椹冲彴涓�
var zichestation = _agvStationService.OutGetZicheDeepHCJ(1061);
int ziche = GetDeviceAddress.GetEquipmentlocation(zichestation.ChildPosiDeviceCode);
- if ((ziche == zichestation.WaitmomentOne || ziche == zichestation.WaitmomentTwo || ziche == zichestation.MotherCarDeviceCode || ziche == zichestation.MotherCardeputy || ziche == zichestation.HCJStorageaddress) && ziche != 1021)
+ if ((ziche == zichestation.WaitmomentOne || ziche == zichestation.WaitmomentTwo || ziche == zichestation.MotherCarDeviceCode || ziche == zichestation.MotherCardeputy || ziche == zichestation.HCJStorageaddress) && ziche != 1021 && ziche !=0)
{
//鑾峰彇杩欎釜鎺ラ┏鍙版槸鍚︽湁鍙栬揣浠诲姟
Dt_Task zitask = _taskService.ViceChariotPickupTask2(RGVTaskdevice.ChildPosiDeviceCode);
if (zitask == null)
{
-
return dt_Task;
}
}
+ else
+ {
+ //濡傛灉娌¤揣锛屽垯涓嬪彂绉诲姩浠诲姟
+ RGVMovetask(RGVTaskdevice.HCJStorageaddress, RGVTaskdevice.ChildPosiDeviceCode);
+ }
+ }
+ else
+ {
+ //濡傛灉娌¤揣锛屽垯涓嬪彂绉诲姩浠诲姟
+ RGVMovetask(RGVTaskdevice.HCJStorageaddress, RGVTaskdevice.ChildPosiDeviceCode);
}
return null;
}
@@ -218,6 +273,10 @@
//鑾峰彇瀛愯溅鍙栬揣浠诲姟
Dt_Task dt_Task = _taskService.ViceChariotPickupTask(RGVTaskdevice.ChildPosiDeviceCode);
if (dt_Task == null) return null;
+
+ //鍒ゆ柇HCJ绔欏彴鏄惁鏈夎揣
+ if (GetDeviceAddress.HCJIsstock(dt_Task.CurrentAddress)) return null;
+
if (RGVTaskdevice.Station_Area == 6) //澶栦晶杩涘彇璐э紝鍒欓渶瑕佸垽鏂瓙杞﹀綋鍓嶄綅缃�
{
if (getStackerObject.RGVCurrentlocation == RGVTaskdevice.WaitmomentOne)
@@ -244,27 +303,24 @@
}
else if (mu2 == InMotherVehicle.Motherinlaw)
{
- RGVMovetask(InMotherVehicle.ZicheMotherinlaw, InMotherVehicle.ChildPosiDeviceCode);
+
+ //鍒ゆ柇姣嶈溅鏄惁鏈変换鍔�
+ Dt_Task muche1task = _taskService.MothermachinemovementTask2(InMotherVehicle.ChildPosiDeviceCode);
+ if (muche1task == null)
+ {
+ RGVMovetask(InMotherVehicle.ZicheMotherinlaw, InMotherVehicle.ChildPosiDeviceCode);
+ }
}
}
}
//=============================鏂板褰撳幓鍙栬揣鏃惰繘琛屽垽鏂贩閬擄紝鐪嬭兘涓嶈兘鎻愬墠鎷夊嚭姣嶈溅
return dt_Task;
}
- //鍘绘帀鍘熷洜锛氬湪璇ュ嚭瀛愯溅鍘诲彇璐э紝鍙洿鎺ョ┛杩囨棤璐ф瘝杞︼紝鎷栬溅
- /*else
- {
- Dt_Task task = _taskService.MothermachinemovementTask2(RGVTaskdevice.ChildPosiDeviceCode);
- if (task == null)
- {
- RGVMovetask(mu1rgv.Motherinlaw, mu1rgv.ChildPosiDeviceCode);
- }
- }*/
}
else if (getStackerObject.RGVCurrentlocation == RGVTaskdevice.WaitmomentTwo) //鍒欓渶瑕佸垽鏂袱涓瘝杞︾殑浣嶅瓙
{
- //鍒ゆ柇涓や釜瀛愯溅鏄惁鍦ㄥ爢鍨涙満鍙栬揣鍙�
+ //鍒ゆ柇涓や釜姣嶈溅鏄惁鍦ㄥ爢鍨涙満鍙栬揣鍙�
//姣嶈溅1
var mu1rgv = _agvStationService.GetMothervehicle(RGVTaskdevice.MotherCarDeviceCode);
@@ -324,6 +380,29 @@
{
return dt_Task;
}
+
+ //鍒ゆ柇鍐呬晶鏄惁鏈夎揣锛屾槸鍚︽湁浠诲姟
+
+ if (int.Parse(dt_Task.TargetAddress) == (int)StorageAisleEnum.LaneThree || int.Parse(dt_Task.TargetAddress) == (int)StorageAisleEnum.LaneFour)
+ {
+ int taraddress = int.Parse(dt_Task.TargetAddress);
+ var InMotherVehicle = _agvStationService.ObtainCcordingTunnel(taraddress); //鑾峰彇鍒伴渶瑕佸叆搴撶殑姣嶈溅(2宸烽亾)
+ int mu2 = GetDeviceAddress.GetEquipmentlocation(InMotherVehicle.ChildPosiDeviceCode); //姝ゆ椂鐨凴GV搴旇鏃犺揣
+ if (GetDeviceAddress.Mucheywhaddres(InMotherVehicle.ChildPosiDeviceCode)) //鍒ゆ柇鏃犺揣
+ {
+ if (mu2 == InMotherVehicle.Motherinlaw)
+ {
+ //鍒ゆ柇姣嶈溅鏄惁鏈変换鍔�
+ Dt_Task muche1task = _taskService.MothermachinemovementTask2(InMotherVehicle.ChildPosiDeviceCode);
+ if (muche1task == null)
+ {
+ RGVMovetask(InMotherVehicle.ZicheMotherinlaw, InMotherVehicle.ChildPosiDeviceCode);
+ }
+ }
+
+ }
+ }
+
}
else if (getStackerObject.RGVCurrentlocation == RGVTaskdevice.WaitmomentTwo) //闇�瑕佸垽鏂�3宸烽亾姣嶈溅鏄惁鍦ㄥ彇璐х珯鍙�
@@ -434,7 +513,13 @@
}
else
{
- RGVMovetask(Muche.ZicheMotherinlaw, Muche.ChildPosiDeviceCode); //濡傛灉娌℃湁浠诲姟锛屽垯鍙互杩涜绉诲姩鍑烘潵
+ //鍒ゆ柇姣嶈溅鏄惁鏈変换鍔�
+ Dt_Task _Task1 = _taskService.MothermacTask(Muche.ChildPosiDeviceCode);
+ if (_Task1 == null)
+ {
+ RGVMovetask(Muche.ZicheMotherinlaw, Muche.ChildPosiDeviceCode); //濡傛灉娌℃湁浠诲姟锛屽垯鍙互杩涜绉诲姩鍑烘潵
+ }
+
}
}
}
@@ -480,7 +565,12 @@
Dt_Task task = _taskService.MothermachinemovementTask2(Muche2.ChildPosiDeviceCode); //鑾峰彇鍒版瘝杞︾Щ鍔ㄤ换鍔�
if (task == null)
{
- RGVMovetask(Muche2.ZicheMotherinlaw, Muche2.ChildPosiDeviceCode); //濡傛灉娌℃湁浠诲姟锛屽垯鍙互杩涜绉诲姩鍑烘潵
+ Dt_Task _Task1 = _taskService.MothermacTask(Muche2.ChildPosiDeviceCode);
+ if (_Task1 == null)
+ {
+ RGVMovetask(Muche2.ZicheMotherinlaw, Muche2.ChildPosiDeviceCode); //濡傛灉娌℃湁浠诲姟锛屽垯鍙互杩涜绉诲姩鍑烘潵
+ }
+
}
}
return null;
@@ -511,7 +601,7 @@
AGVStation Muche2 = _agvStationService.GetMothervehicle(aGVStation.MotherCardeputy); //鍐呬晶姣嶈溅
int mucheaddre2 = GetDeviceAddress.GetEquipmentlocation(Muche2.ChildPosiDeviceCode);
- if ((neizichecurraddres == neiziche.WaitmomentOne || neizichecurraddres == neiziche.WaitmomentTwo) && task == null && mucheaddre1 == Muche.Motherinlaw && mucheaddre2 == Muche2.Motherinlaw)
+ if ((neizichecurraddres == neiziche.WaitmomentOne || neizichecurraddres == neiziche.WaitmomentTwo) && task == null && neizichecurraddres != neiziche.HCJStorageaddress && mucheaddre1 == Muche.Motherinlaw && mucheaddre2 == Muche2.Motherinlaw)
{
return _Task;
}
@@ -570,7 +660,7 @@
=> Findshippingtask(RGVTaskdevice, getStackerObject.RGVCurrentlocation), //瀛愯溅鍙栬揣鍚庯紝杩涜鏀捐揣锛堝凡瀹屾垚锛�
((int)RGVEquipment.OutRGVForklift, RgvEquipmentStatus.NoCargo)
- => OutboundGateVehicle(RGVTaskdevice), //鍑哄簱鍙GV鍙栬揣锛堝凡瀹屾垚锛�
+ => OutboundGateVehicle(RGVTaskdevice), //鍑哄簱鍙GV鍙栬揣锛堝凡瀹屾垚锛�
((int)RGVEquipment.OutRGVForklift, RgvEquipmentStatus.HasCargo)
=> _taskService.GetOutkouFinhuoTask(RGVTaskdevice.ChildPosiDeviceCode,
@@ -694,6 +784,16 @@
{
return dtTasks;
}
+ else
+ {
+ //濡傛灉姣嶈溅鏃犺揣锛屽垯涓嬪埌閲岄潰鍘�
+ bool NoCargobool = GetDeviceAddress.Mucheywhaddres(muchestation.ChildPosiDeviceCode);
+ if (NoCargobool)
+ {
+ //涓嬪彂姣嶈溅绉诲姩浠诲姟
+ RGVMovetask(muchestation.Motherinlaw, muchestation.ChildPosiDeviceCode);
+ }
+ }
}
}
}
@@ -730,6 +830,16 @@
{
return dtTasks;
}
+ else
+ {
+ //濡傛灉姣嶈溅鏃犺揣锛屽垯涓嬪埌閲岄潰鍘�
+ bool NoCargobool = GetDeviceAddress.Mucheywhaddres(muchestation.ChildPosiDeviceCode);
+ if (NoCargobool)
+ {
+ //涓嬪彂姣嶈溅绉诲姩浠诲姟
+ RGVMovetask(muchestation.Motherinlaw, muchestation.ChildPosiDeviceCode);
+ }
+ }
}
}
@@ -747,6 +857,25 @@
var mu2rgv = _agvStationService.GetMothervehicle(GdZiche.MotherCardeputy);
int mu2 = GetDeviceAddress.GetEquipmentlocation(mu2rgv.ChildPosiDeviceCode);
+
+ //闇�瑕佸垽鏂瘝杞︽槸鍚︽湁璐э紝鏃犺揣鍒欎笅鏂硅嚦绉诲姩浠诲姟
+ bool NoCargobool = GetDeviceAddress.Mucheywhaddres(mu1rgv.ChildPosiDeviceCode);
+ if (NoCargobool)
+ {
+ //涓嬪彂姣嶈溅绉诲姩浠诲姟
+ RGVMovetask(mu1rgv.Motherinlaw, mu1rgv.ChildPosiDeviceCode);
+ }
+
+
+ bool NoCargobool2 = GetDeviceAddress.Mucheywhaddres(mu2rgv.ChildPosiDeviceCode);
+ if (NoCargobool2)
+ {
+ //涓嬪彂姣嶈溅绉诲姩浠诲姟
+ RGVMovetask(mu2rgv.Motherinlaw, mu2rgv.ChildPosiDeviceCode);
+ }
+
+
+
if (mu1 == mu1rgv.Motherinlaw && mu2 == mu2rgv.Motherinlaw)
{
@@ -812,7 +941,12 @@
int mucboject4 = GetDeviceAddress.GetEquipmentlocation(muchestation2.ChildPosiDeviceCode);
if (mucboject4 == muchestation2.Motherinlaw)
{
- return task;
+ //鍒ゆ柇鍙夎溅鏄惁鏈夊彇璐т换鍔�
+ Dt_Task chachetask = _taskService.ChacheGetFinhuoTask("RGV118");
+ if(chachetask == null)
+ {
+ return task;
+ }
}
}
@@ -869,7 +1003,7 @@
GetStackerObject getStackerObject = GetDeviceAddress.GetChildDeviceCode(zichestation.ChildPosiDeviceCode);
if (getStackerObject.StaclerkJobJobStatusValue != RGV_Rgvtaskstutas.Executing && getStackerObject.RgvCraneAutoStatusValue == RgvCraneAutoStatus.Automatic
- && (getStackerObject.RGVCurrentlocation == zichestation.WaitmomentOne || getStackerObject.RGVCurrentlocation == zichestation.WaitmomentTwo) && getStackerObject.RGVCurrentlocation != zichestation.ZicheMotherinlaw)
+ && (getStackerObject.RGVCurrentlocation == zichestation.WaitmomentOne || getStackerObject.RGVCurrentlocation == zichestation.WaitmomentTwo || getStackerObject.RGVCurrentlocation==1171) && getStackerObject.RGVCurrentlocation != zichestation.ZicheMotherinlaw)
{
RGVMovetask(GdZiche.Motherinlaw, GdZiche.ChildPosiDeviceCode);
}
@@ -950,6 +1084,13 @@
}
}
+ }else if(task != null && RgvCraneStatusValue == (int)RgvEquipmentStatus.NoCargo)
+ {
+ if (GdZiche.HCJStorageaddress == RGVCurrentlocation)
+ {
+ //濡傛灉鍦�2宸烽亾鐨勬瘝杞︼紝鍒欏彲浠ユ斁瀛愯溅鏉�1鍙风瓑寰呯偣锛屽鏋滃湪HCJ鍒欏彲浠ヨ瀛愯溅鍘�2鍙�
+ RGVMovetask(GdZiche.WaitmomentTwo, GdZiche.ChildPosiDeviceCode);
+ }
}
}
}
--
Gitblit v1.9.3