From 28f9a99446b7c84d1de4e3ba7a083aced0cc337d Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期四, 17 七月 2025 16:21:18 +0800
Subject: [PATCH] 更新
---
项目代码/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs | 134 +++-----------------------------------------
1 files changed, 10 insertions(+), 124 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs"
index 8b55db4..c3c168d 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs"
@@ -30,6 +30,7 @@
using System.Text;
using System.Threading.Tasks;
using WIDESEA_DTO.Agv;
+using WIDESEAWCS_Common;
using WIDESEAWCS_Common.APIEnum;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
@@ -215,28 +216,21 @@
if (string.IsNullOrEmpty(item.AGVArea))
{
Dt_StationManger stationManger;
+ //鑾峰彇绔欏彴淇℃伅
if (taskTypeGroup == TaskTypeGroup.InboundGroup)
{
stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == item.SourceAddress || x.StationDeviceCode == item.SourceAddress);
- //if (stationManger==null && task.TaskType==TaskTypeEnum.InProduct.ObjToInt())
- //{
- // stationManger = _stationMangerRepository.QueryFirst(x => x.StackerCraneCode==task.SourceAddress);
- // //杞崲鎴愬搧浠撹捣鐐圭珯鍙�
- // item.SourceAddress = stationManger.StationCode;
- // task.CurrentAddress = stationManger.StationCode;
- // task.SourceAddress = stationManger.StationCode;
- //}
}
else
{
- stationManger = _stationMangerRepository.QueryFirst(x => x.StackerCraneCode == item.RoadWay || x.Remark==item.RoadWay);
+ stationManger = _stationMangerRepository.QueryFirst(x => x.StackerCraneCode == item.RoadWay && x.StationType==StationTypeEnum.StationType_OnlyOutbound.ObjToInt());
}
if (stationManger == null)
{
return WebResponseContent.Instance.Error($"鏈壘鍒扮珯鍙伴厤缃俊鎭�");
}
-
- List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && (item.SourceAddress == x.StartPosi || item.RoadWay == x.StartPosi /*|| item.RoadWay == x.ChildPosiDeviceCode || item.RoadWay == x.ChildPosi*/));
+ //鑾峰彇璺敱淇℃伅
+ List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && (item.SourceAddress == x.StartPosi || item.RoadWay == x.StartPosi));
router = routers.FirstOrDefault();
if (router == null)
{
@@ -251,122 +245,13 @@
task.NextAddress = router.NextPosi;
task.DeviceCode = router.ChildPosiDeviceCode;
}
- else if (item.TaskType == TaskTypeEnum.MesMatReturn.ObjToInt() && !router.IsEnd)
- {
- task.NextAddress = router.NextPosi;
- task.DeviceCode = router.ChildPosi;
- }
- else if ((item.TaskType == TaskTypeEnum.MesPalletLargeReturn.ObjToInt() || item.TaskType == TaskTypeEnum.MesPalletSmallReturn.ObjToInt()) && router.IsEnd)
- {
- task.NextAddress = router.NextPosi;
- task.DeviceCode = router.ChildPosi;
- }
- else if (item.TaskType == TaskTypeEnum.MesOutbound.ObjToInt() || item.TaskType == TaskTypeEnum.MesHandOutbound.ObjToInt() || item.TaskType == TaskTypeEnum.MesHandPickOutbound.ObjToInt() || (item.TaskType == TaskTypeEnum.OutAllocate.ObjToInt() && item.RoadWay.Contains("BC")))
- {
- task.NextAddress = router.NextPosi;
- task.DeviceCode = stationManger.StackerCraneCode;
- if (item.TaskType == TaskTypeEnum.MesOutbound.ObjToInt() && task.TargetAddress== "SCUTL-001")
- {
- task.TaskState = TaskStatusEnum.MesPending.ObjToInt();
- }
- else
- {
- task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt();
- }
- }
- else if (item.TaskType == TaskTypeEnum.MesOutbound.ObjToInt() && item.RoadWay.Contains("ZH"))
- {
- task.NextAddress = stationManger.StackerCraneStationCode;
- task.DeviceCode = stationManger.StackerCraneCode;
- task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt();
- }
else
{
- task.NextAddress = taskTypeGroup == TaskTypeGroup.InboundGroup ? task.TargetAddress : router.NextPosi;
- if (item.RoadWay.Contains("AGV_FL")|| (item.RoadWay.Contains("AGV_CP") && taskTypeGroup == TaskTypeGroup.OutbondGroup))
- {
- task.DeviceCode = item.RoadWay;
- task.AgvTaskNum = item.RoadWay + DateTime.Now.ToString("yyyyMMdd") + item.TaskNum;
- }
- else if(item.RoadWay.Contains("AGV_CP") && taskTypeGroup == TaskTypeGroup.InboundGroup)
- {
- task.DeviceCode = stationManger.StationDeviceCode;
- task.AgvTaskNum = task.Roadway + DateTime.Now.ToString("yyyyMMdd") + item.TaskNum;
- }
- else
- {
- task.DeviceCode = stationManger.StationDeviceCode;
- }
- }
- }
- else
- {
- if (item.RoadWay=="AGV_CP")
- {
- Dt_Router routerSelect = _routerRepository.QueryFirst(x => x.InOutType == item.TaskType && item.RoadWay == x.StartPosi && x.NextPosi==item.TargetAddress);
- if (routerSelect != null)
- {
- task.NextAddress = routerSelect.NextPosi;
- task.DeviceCode = routerSelect.ChildPosi;
- task.AgvTaskNum = item.RoadWay + DateTime.Now.ToString("yyyyMMdd") + item.TaskNum;
- }
- else
- {
- return content.Error("鏈壘鍒拌矾鐢变俊鎭�");
- }
- }
- else
- {
- List<Dt_Router> dt_Routers = _routerService.QueryNextRoutes(item.SourceAddress, item.RoadWay, item.TaskType);
- if (dt_Routers != null && dt_Routers.Count > 0)
- {
- task.NextAddress = dt_Routers.FirstOrDefault().NextPosi;
- task.DeviceCode = dt_Routers.FirstOrDefault().ChildPosi;
- }
- else
- {
- task.NextAddress = "";
- task.DeviceCode = "";
- }
+ task.DeviceCode = stationManger.StackerCraneCode;
+ task.NextAddress = router.NextPosi;
}
}
}
- else
- {
- if (taskTypeGroup == TaskTypeGroup.OutbondGroup)
- {
- task.AgvTaskNum = item.AGVArea + DateTime.Now.ToString("yyyyMMdd") + item.TaskNum;
- List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && item.AGVArea == x.NextPosi);
- if (routers.FirstOrDefault() == null)
- {
- return WebResponseContent.Instance.Error($"鏈壘鍒拌矾鐢遍厤缃俊鎭�");
- }
- router = routers.FirstOrDefault();
- task.NextAddress = router?.StartPosi ?? "";
- task.DeviceCode = item.RoadWay;
- task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt();
- }
- else
- {
- task.AgvTaskNum = item.AGVArea + DateTime.Now.ToString("yyyyMMdd") + item.TaskNum;
- List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && item.AGVArea == x.StartPosi);
- if (routers.FirstOrDefault() == null)
- {
- return WebResponseContent.Instance.Error($"鏈壘鍒拌矾鐢遍厤缃俊鎭�");
- }
- router = routers.FirstOrDefault();
- Dt_StationManger? stationManger = _stationMangerRepository.QueryData(x => true).FirstOrDefault(x=>x.StationCode== router?.NextPosi);
- if (stationManger == null)
- {
- return WebResponseContent.Instance.Error($"鏈壘鍒扮珯鍙伴厤缃俊鎭�");
- }
-
- task.NextAddress = stationManger?.AGVStationCode ?? "";
- task.DeviceCode = stationManger?.Remark ?? "";
- task.TaskState = TaskStatusEnum.AGV_Execute.ObjToInt();
- }
- }
-
tasks.Add(task);
}
BaseDal.AddData(tasks);
@@ -436,7 +321,7 @@
/// <param name="palletCode"></param>
/// <param name="sourceAddress"></param>
/// <returns></returns>
- public WebResponseContent RequestWMSTaskSimple(string palletCode, string sourceAddress)
+ public WebResponseContent RequestWMSTaskSimple(string palletCode, string sourceAddress, int taskType=630)
{
WebResponseContent content = new WebResponseContent();
try
@@ -459,7 +344,8 @@
TaskNum = DateTime.Now.ToString("mmss").ObjToInt(),
PalletCode="",
RoadWay="",
- TaskType=TaskTypeEnum.InProduct.ObjToInt(),
+ TaskType= taskType,
+ PalletType=1,
TaskStatus=TaskStatusEnum.New.ObjToInt(),
SourceAddress= sourceAddress,
TargetAddress="",
--
Gitblit v1.9.3