yanjinhui
2026-03-12 7f8c10c679b319543bc21a3e4f49534475499ce4
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -18,6 +18,7 @@
using AutoMapper;
using SixLabors.ImageSharp.ColorSpaces;
using SqlSugar;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using WIDESEAWCS_BasicInfoService;
using WIDESEAWCS_Common;
@@ -106,7 +107,7 @@
                            continue;
                            //throw new Exception(content.Message);
                        }
                        if (BaseDal.QueryFirst(x => x.WMSTaskNum == task.taskCode) != null)
                        if (BaseDal.QueryFirst(x => x.WMSTaskNum == task.taskCode && x.TaskType == item.taskType) != null)
                        {
                            objects.Add(new
                            {
@@ -116,7 +117,7 @@
                            continue;
                            //throw new Exception($"任务号【{task.taskCode}】已存在任务");
                        }
                        if (BaseDal.QueryFirst(x => x.PalletCode == task.containerCode) != null)
                        if (BaseDal.QueryFirst(x => x.PalletCode == task.containerCode && x.TaskType == item.taskType) != null)
                        {
                            objects.Add(new
                            {
@@ -126,7 +127,7 @@
                            continue;
                            //throw new Exception($"托盘号【{task.containerCode}】已存在任务");
                        }
                        if (BaseDal.QueryFirst(x => x.SourceAddress == task.fromLocationCode) != null)
                        if (BaseDal.QueryFirst(x => x.SourceAddress == task.fromLocationCode && x.TaskType == item.taskType) != null)
                        {
                            objects.Add(new
                            {
@@ -232,6 +233,7 @@
                    if (apiInfo == null) throw new Exception("未找到凯乐士AGV任务下发接口配置信息!请检查接口配置");
                    string response = HttpHelper.Post(apiInfo.ApiAddress, KLS.Serialize());
                    GALAXISReturn agvContent = response.DeserializeObject<GALAXISReturn>();
                    content.OK(data: agvContent);
                    if (agvContent.success == true && agvContent.code == 0)
                    {
                        //直接移入历史
@@ -258,6 +260,7 @@
                    if (apiInfo == null) throw new Exception("未找到四向车AGV任务下发接口配置信息!请检查接口配置");
                    string response = HttpHelper.Post(apiInfo.ApiAddress, cancelSXCTake.Serialize());
                    FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
                    content.OK(data: fOURBOTReturn);
                    if (fOURBOTReturn.returnCode == 0 && fOURBOTReturn.returnUserMsg == "成功")
                    {
                        //直接移入历史
@@ -282,6 +285,7 @@
                    if (apiInfo == null) throw new Exception("未找到四向车AGV任务下发接口配置信息!请检查接口配置");
                    string response = HttpHelper.Post(apiInfo.ApiAddress, cancelHIKROBOTTask.Serialize());
                    HIKROBOTReturn hIKROBOTReturn = response.DeserializeObject<HIKROBOTReturn>();
                    content.OK(data: hIKROBOTReturn);
                    if (hIKROBOTReturn.code == "SUCCESS" && hIKROBOTReturn.message == "成功")
                    {
                        //直接移入历史
@@ -372,6 +376,7 @@
                    if (apiInfo == null) throw new Exception("未找到凯乐士AGV任务下发接口配置信息!请检查接口配置");
                    string response = HttpHelper.Post(apiInfo.ApiAddress, updateGALAXISTaskGrade.Serialize());
                    GALAXISReturn agvContent = response.DeserializeObject<GALAXISReturn>();
                    content.OK(data: agvContent);
                    if (agvContent.success == true && agvContent.code == 0)
                    {
@@ -397,6 +402,7 @@
                    if (apiInfo == null) throw new Exception("未找到更新四向车任务优先级接口配置信息!请检查接口配置");
                    string response = HttpHelper.Post(apiInfo.ApiAddress, request.Serialize());
                    FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
                    content.OK(data: fOURBOTReturn);
                    if (fOURBOTReturn.returnCode == 0 && fOURBOTReturn.returnUserMsg == "成功")
                    {
                        BaseDal.UpdateData(dt_Task);
@@ -421,6 +427,7 @@
                    if (apiInfo == null) throw new Exception("未找到四向车AGV任务下发接口配置信息!请检查接口配置");
                    string response = HttpHelper.Post(apiInfo.ApiAddress, Hkrequest.Serialize());
                    HIKROBOTReturn hIKROBOTReturn = response.DeserializeObject<HIKROBOTReturn>();
                    content.OK(data: hIKROBOTReturn);
                    if (hIKROBOTReturn.code == "SUCCESS0" && hIKROBOTReturn.message == "成功")
                    {
                        BaseDal.UpdateData(dt_Task);
@@ -1078,11 +1085,15 @@
            try
            {
                if (getLocationInfo == null) throw new Exception("请求参数不能为空!");
                if (getLocationInfo.AreaCode == null) throw new Exception("库区编号不能为空!");
                //if (getLocationInfo.AreaCode == null) throw new Exception("库区编号不能为空!");
                if (getLocationInfo.WarehouseId == 0) throw new Exception("仓库ID不能为空!");
                if (getLocationInfo.WarehouseId == 1)
                {
                    List<Dt_RGVLocationInfo> rGVLocationInfos = _rGVLocationInfoService.Repository.QueryData(x => x.WarehouseId == getLocationInfo.AreaCode.ObjToInt());
                    List<Dt_RGVLocationInfo> rGVLocationInfos = new List<Dt_RGVLocationInfo>();
                    if (!string.IsNullOrEmpty(getLocationInfo.AreaCode))
                        rGVLocationInfos = _rGVLocationInfoService.Repository.QueryData(x => x.WarehouseId == getLocationInfo.AreaCode.ObjToInt());
                    else
                        rGVLocationInfos = _rGVLocationInfoService.Repository.QueryData();
                    foreach (var item in rGVLocationInfos)
                    {
                        list.Add(new
@@ -1096,7 +1107,11 @@
                }
                else if (getLocationInfo.WarehouseId == 2)
                {
                    List<Dt_KLSLocationInfo> rGVLocationInfos = _kLSLocationInfoService.Repository.QueryData(x => x.WarehouseId == getLocationInfo.AreaCode.ObjToInt());
                    List<Dt_KLSLocationInfo> rGVLocationInfos = new List<Dt_KLSLocationInfo>();
                    if (!string.IsNullOrEmpty(getLocationInfo.AreaCode))
                        rGVLocationInfos = _kLSLocationInfoService.Repository.QueryData(x => x.WarehouseId == getLocationInfo.AreaCode.ObjToInt());
                    else
                        rGVLocationInfos = _kLSLocationInfoService.Repository.QueryData();
                    foreach (var item in rGVLocationInfos)
                    {
                        list.Add(new
@@ -1221,6 +1236,7 @@
                };
                string response = HttpHelper.Post(apiInfo.ApiAddress, fOURBOToccupyStation.Serialize());
                FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
                content.OK(data: fOURBOTReturn);
                if (fOURBOTReturn.returnCode != 0 /*&& fOURBOTReturn.returnUserMsg != $"站点已被占用,(podID={iQC.ContainerCode})"*/)
                    throw new Exception(fOURBOTReturn.returnUserMsg);
                #endregion