添加仓库的启用禁用状态,优化修改分区接口,优化提升机job,添加海康仓位到仓位接口
已添加1个文件
已修改7个文件
456 ■■■■■ 文件已修改
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/UpLocationStatusDTO.cs 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/WMS/WMSController.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/HKTaskMethods.cs 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs 286 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TSJJob.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs
@@ -102,11 +102,20 @@
        /// </summary>
        [Description("提升机到线边")]
        F03,
        /// <summary>
        /// çº¿è¾¹åˆ°åº“内
        /// </summary>
        [Description("线边到库内")]
        STURR
        STURR,
        /// <summary>
        /// ä»“位到仓位
        /// </summary>
        [Description("仓位到仓位")]
        STUPTBY
    }
    public enum TaskInboundTypeEnum
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/UpLocationStatusDTO.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_DTO.WMS
{
    public class UpLocationStatusDTO
    {
        /// <summary>
        /// ä»“库id
        /// </summary>
        public int WarehouseId { get; set; }
        /// <summary>
        /// ç¦ç”¨çŠ¶æ€ï¼ˆ0 å¯ç”¨ï¼Œ3 ç¦ç”¨ï¼‰
        /// </summary>
        public int EnableStatus { get; set; }
        /// <summary>
        /// è´§ä½ç¼–号列表
        /// </summary>
        public string[] LocationNubList { get; set; }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs
@@ -318,5 +318,13 @@
        /// <param name="wMSUpOrDown"></param>
        /// <returns></returns>
        WebResponseContent UpOrDownContainer(WMSUpOrDownContainerDTO wMSUpOrDown);
        /// <summary>
        /// æ›´æ–°ä»“库库位状态,启用禁用
        /// </summary>
        /// <param name="upLocationStatusDTO"></param>
        /// <returns></returns>
        WebResponseContent UpLocationStatus(UpLocationStatusDTO upLocationStatusDTO);
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/WMS/WMSController.cs
@@ -117,5 +117,18 @@
            WebResponseContent content = _taskService.LocationInquiry(getLocationInfo);
            return WMSReturnMethod.ReturnWMS(content);
        }
        /// <summary>
        /// æ›´æ–°ä¸åŒä»“库的库位状态,禁用启用
        /// </summary>
        /// <param name="upLocationStatusDTO"></param>
        /// <returns></returns>
        [HttpGet, HttpPost, Route("UpLocationStatus"), AllowAnonymous]
        public WMSReturn UpLocationStatus([FromBody]UpLocationStatusDTO upLocationStatusDTO)
        {
            WebResponseContent content = _taskService.UpLocationStatus(upLocationStatusDTO);
            return WMSReturnMethod.ReturnWMS(content);
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/HKTaskMethods.cs
@@ -34,6 +34,10 @@
            try
            {
                Dt_HKLocationInfo? hKLocationInfo = null;
                if (taskType==(int)TaskTypeEnum.STURR)
                {
                    var reslut=_stationInfo.Repository.QueryFirst(x=>x.StationCode==taskDTO.fromLocationCode) ?? throw new Exception($"未找到起点货位【{taskDTO.fromLocationCode}】");
                }
                #region ç‚¹åˆ°ç‚¹
                if (!string.IsNullOrEmpty(taskDTO.toLocationCode))
                {
@@ -126,12 +130,20 @@
            WebResponseContent content = new WebResponseContent();
            try
            {
                //4楼库内到提升机
                Dt_HKLocationInfo? hKLocationInfo = _hKLocationInfoService.Repository.QueryFirst(x => x.LocationCode == taskDTO.fromLocationCode) ?? throw new Exception($"未找到起点库位【{taskDTO.fromLocationCode}】!");
                if (hKLocationInfo.LocationStatus != LocationStatusEnum.InStock.ObjToInt()) throw new Exception($"起点库位【{taskDTO.fromLocationCode}】当前库位状态不可出库!");
                if (hKLocationInfo.PalletCode != taskDTO.containerCode) throw new Exception($"起点库位【{taskDTO.fromLocationCode}】绑定料箱号【{hKLocationInfo.PalletCode}】与任务料箱号【{taskDTO.containerCode}】不匹配!");
                //库内到库外的点到点任务,是否需要判断货位状态?
                Dt_Task dt_Task = new Dt_Task()
                //库内到现边的点到点任务,是否需要判断货位状态?
                if (taskType == (int)TaskTypeEnum.STU0003)
                {
                    var reslut = _stationInfo.Repository.QueryFirst(x => x.StationCode == taskDTO.toLocationCode) ?? throw new Exception($"未找到终点货位【{taskDTO.fromLocationCode}】");
                    if (reslut.StationStatus != (int)LocationStatusEnum.Free)
                    {
                        throw new Exception($"终点站台【{taskDTO.toLocationCode}】状态不为空闲!");
                    }
                }
                    Dt_Task dt_Task = new Dt_Task()
                {
                    TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    WMSTaskNum = taskDTO.taskCode,
@@ -352,6 +364,26 @@
                            hIKROBOTTaskSubmit.targetRoute.Add(targetRoute);
                        }
                        break;
                    case TaskTypeEnum.STUPTBY:
                        {
                            TargetRouteDto target = new TargetRouteDto()
                            {
                                code = task.CurrentAddress,
                                operation = "DELIVERY",//取货
                                seq = 0,
                                type = "STORAGE",
                            };
                            TargetRouteDto targetRoute = new TargetRouteDto()
                            {
                                code = task.NextAddress,
                                operation = "DELIVERY",//送货
                                seq = 1,
                                type = "STORAGE",
                            };
                            hIKROBOTTaskSubmit.targetRoute.Add(target);
                            hIKROBOTTaskSubmit.targetRoute.Add(targetRoute);
                        }
                        break;
                    case TaskTypeEnum.CPMoveInventory:
                        break;
                    default:
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs
@@ -214,12 +214,12 @@
                //入库 åˆ°ä¸€æ¥¼ä¸‰ä¸ªç«™å°çš„位置
                if (taskType == (int)TaskTypeEnum.Q3RK)//6-1楼
                {
                    var  ionInfo = _stationMangerService.Repository.QueryFirst(x => x.StationCode == taskDTO.toLocationCode) ?? throw new Exception($"未找到终点站台【{taskDTO.toLocationCode}】!");
                    var StationInfo = _stationInfo.Repository.QueryFirst(x => x.StationCode == taskDTO.fromLocationCode ) ?? throw new Exception($"未找到{taskDTO.fromLocationCode}起点货位");
                    var ionInfo = _stationMangerService.Repository.QueryFirst(x => x.StationCode == taskDTO.toLocationCode) ?? throw new Exception($"未找到终点站台【{taskDTO.toLocationCode}】!");
                    var StationInfo = _stationInfo.Repository.QueryFirst(x => x.StationCode == taskDTO.fromLocationCode) ?? throw new Exception($"未找到{taskDTO.fromLocationCode}起点货位");
                    if (StationInfo.PalletCode != taskDTO.containerCode) throw new Exception($"起点库位【{taskDTO.fromLocationCode}】绑定料箱号【{StationInfo.PalletCode}】与任务料箱号【{taskDTO.containerCode}】不匹配!");
                    if (StationInfo.StationStatus != (int)LocationStatusEnum.InStock) throw new Exception($"起点库位【{taskDTO.fromLocationCode}】当前状态不可以出库");
                    if (StationInfo.FloorNumber != "FF") throw new Exception($"【{taskDTO.fromLocationCode}】的楼层和任务类型楼层不匹配");
                    dt_Task = new Dt_Task()
                    {
                        TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
@@ -245,7 +245,7 @@
                    var ionInfo = _stationMangerService.Repository.QueryFirst(x => x.StationCode == taskDTO.fromLocationCode) ?? throw new Exception($"未找到起点站台【{taskDTO.fromLocationCode}】!");
                    if (ionInfo.Remark != taskDTO.containerCode) throw new Exception($"起点站台【{taskDTO.fromLocationCode}】绑定料箱号【{ionInfo.Remark}】与任务料箱号【{taskDTO.containerCode}】不匹配!");
                    dt_Task = new Dt_Task()
                    {
                        TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
@@ -297,14 +297,14 @@
            try
            {
                #region æ˜¯å¦éœ€è¦åˆ¤æ–­å¹³åº“库位状态
               var reslut= ValidateLocationForTask(taskType,taskDTO);
                var reslut = ValidateLocationForTask(taskType, taskDTO);
                if (!reslut.Status)
                {
                    throw new Exception(reslut.Message);
                }
                #endregion
                 Dt_Task dt_Task = new Dt_Task()
                Dt_Task dt_Task = new Dt_Task()
                {
                    TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    WMSTaskNum = taskDTO.taskCode,
@@ -378,5 +378,57 @@
            return content;
        }
        #endregion
        #region
        /// <summary>
        /// æµ·åº·ä»“位到仓位的运输任务
        /// </summary>
        /// <param name="taskDTO"></param>
        /// <param name="taskType"></param>
        /// <returns></returns>
        public WebResponseContent HKSTUPTP(TaskDTO taskDTO, int taskType)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                var KLocationInfo = _hKLocationInfoService.Repository.QueryFirst(x => x.LocationCode == taskDTO.fromLocationCode) ?? throw new Exception($"未找到起点库位【{taskDTO.fromLocationCode}】!");
                if (KLocationInfo.LocationStatus != (int)LocationStatusEnum.InStock) throw new Exception($"起点库位【{taskDTO.fromLocationCode}】当前库位状态不是有货!");
                if (KLocationInfo.PalletCode != taskDTO.containerCode) throw new Exception($"当前库位【{taskDTO.fromLocationCode}】绑定料箱号【{KLocationInfo.PalletCode}】与任务的料箱号【{taskDTO.containerCode}】不匹配");
                var KLocationInfo2 = _hKLocationInfoService.Repository.QueryFirst(x => x.LocationCode == taskDTO.toLocationCode) ?? throw new Exception($"未找到终点库位【{taskDTO.toLocationCode}】!");
                if (KLocationInfo2.LocationStatus != (int)LocationStatusEnum.Free) throw new Exception($"终点库位【{taskDTO.toLocationCode}】当前库位状态不是空闲!");
                var dt_Task = new Dt_Task()
                {
                    TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    WMSTaskNum = taskDTO.taskCode,
                    //WMSId = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    Grade = taskDTO.taskPriority,
                    PalletCode = taskDTO.containerCode,
                    Roadway = "1",
                    TaskState = (int)TaskStatusEnum.New,
                    TaskType = taskType,
                    SourceAddress = taskDTO.fromLocationCode,
                    CurrentAddress = taskDTO.fromLocationCode,
                    NextAddress = taskDTO.toLocationCode,
                    TargetAddress = taskDTO.toLocationCode,
                    Creater = "WMS",
                };
                content = SendHIKROBOTTask(dt_Task);
                if (!content.Status) throw new Exception(content.Message);
                dt_Task.Dispatchertime = DateTime.Now;
                BaseDal.AddData(dt_Task);
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
        #endregion
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -198,6 +198,10 @@
                                content = CJCarryTaske(task, item.taskType);
                                objects.Add(content.Data);
                                break;
                            case (int)TaskTypeEnum.STUPTBY:
                                content = HKSTUPTP(task, item.taskType);
                                objects.Add(content.Data);
                                break;
                            #endregion
                            default:
                                objects.Add(new
@@ -388,7 +392,7 @@
                bool isAGV = dt_Task.TaskType == (int)TaskTypeEnum.CPInbound || dt_Task.TaskType == (int)TaskTypeEnum.CPOutbound;
                //海康
                bool isHK = dt_Task.TaskType == (int)TaskTypeEnum.F01 || dt_Task.TaskType == (int)TaskTypeEnum.RK3F || dt_Task.TaskType == (int)TaskTypeEnum.CK3F || dt_Task.TaskType == (int)TaskTypeEnum.Q1TSJ4 || dt_Task.TaskType == (int)TaskTypeEnum.STU0003 || dt_Task.TaskType == (int)TaskTypeEnum.F02 || dt_Task.TaskType == (int)TaskTypeEnum.CHUKU1 || dt_Task.TaskType == (int)TaskTypeEnum.Q3RK || dt_Task.TaskType == (int)TaskTypeEnum.Q3CK;
                bool isHK = dt_Task.TaskType == (int)TaskTypeEnum.F01 || dt_Task.TaskType == (int)TaskTypeEnum.RK3F || dt_Task.TaskType == (int)TaskTypeEnum.CK3F || dt_Task.TaskType == (int)TaskTypeEnum.Q1TSJ4 || dt_Task.TaskType == (int)TaskTypeEnum.STU0003 || dt_Task.TaskType == (int)TaskTypeEnum.F02 || dt_Task.TaskType == (int)TaskTypeEnum.CHUKU1 || dt_Task.TaskType == (int)TaskTypeEnum.Q3RK || dt_Task.TaskType == (int)TaskTypeEnum.Q3CK||dt_Task.TaskType == (int)TaskTypeEnum.STUPTBY;
                //修改原本任务优先级
                dt_Task.Grade = updateTaskPriority.taskPriority;
                #region å‡¯ä¹å£«
@@ -452,11 +456,15 @@
                        initPriority = updateTaskPriority.taskPriority//优先级
                    };
                    Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(HIKROBOTTaskGrade));
                    if (apiInfo == null) throw new Exception("未找到四向车AGV任务下发接口配置信息!请检查接口配置");
                    string response = HttpHelper.Post(apiInfo.ApiAddress, Hkrequest.Serialize());
                    if (apiInfo == null) throw new Exception("未找到海康AGV任务下发接口配置信息!请检查接口配置");
                    var headers = new Dictionary<string, string>
                    {
                        { "X-lr-request-id", DateTimeOffset.Now.ToUnixTimeSeconds().ToString() + dt_Task.WMSTaskNum }
                    };
                    string response = HttpHelper.Post(apiInfo.ApiAddress, Hkrequest.Serialize(), headers: headers);
                    HIKROBOTReturn hIKROBOTReturn = response.DeserializeObject<HIKROBOTReturn>();
                    content.OK(data: hIKROBOTReturn);
                    if (hIKROBOTReturn.code == "SUCCESS0" && hIKROBOTReturn.message == "成功")
                    if (hIKROBOTReturn.code == "SUCCESS" && hIKROBOTReturn.message == "成功")
                    {
                        BaseDal.UpdateData(dt_Task);
                        content.OK("修改{dt_Task.WMSTaskNum}任务优先级成功", dt_Task);
@@ -514,7 +522,16 @@
                var rgv = new List<Dt_RGVLocationInfo>();
                var kls = new List<Dt_KLSLocationInfo>();
                var hk = new List<Dt_HKLocationInfo>();
                var pk = new List<Dt_StationInfo>();
                List<Dt_StationInfo> pk = new List<Dt_StationInfo>();
                if (wMSUpdateLocationArea==null)
                {
                    return content.Error("请求参数不能为空");
                }
                var validWarehouseIds = new[] { 1, 2, 3, 4 };
                if (!validWarehouseIds.Contains(wMSUpdateLocationArea.WarehouseId))
                {
                    return content.Error($"无效的仓库ID:{wMSUpdateLocationArea.WarehouseId},有效值为:1-成品库,2-面料库,3-货库,4-裁剪库");
                }
                if (wMSUpdateLocationArea.WarehouseId == 1)
                {
                    var rgvList = _rGVLocationInfoService.Repository.QueryData(x => wMSUpdateLocationArea.LocationCodes.Contains(x.LocationCode)).ToList();
@@ -523,6 +540,7 @@
                        item.WarehouseId = wMSUpdateLocationArea.UpdateAreaCode.ObjToInt();
                    }
                    rgv.AddRange(rgvList);
                    _rGVLocationInfoService.Repository.UpdateData(rgv);
                }
                if (wMSUpdateLocationArea.WarehouseId == 2)
                {
@@ -533,6 +551,7 @@
                        item.WarehouseId = wMSUpdateLocationArea.UpdateAreaCode.ObjToInt();
                    }
                    kls.AddRange(KLSLocationInfoList);
                    _kLSLocationInfoService.Repository.UpdateData(kls);
                }
                if (wMSUpdateLocationArea.WarehouseId == 3)
                {
@@ -542,21 +561,18 @@
                        item.WarehouseId = wMSUpdateLocationArea.UpdateAreaCode.ObjToInt();
                    }
                    hk.AddRange(hkList);
                    _hKLocationInfoService.Repository.UpdateData(hk);
                }
                if (wMSUpdateLocationArea.WarehouseId == 4)
                {
                    var pkList = _stationInfo.Repository.QueryData(x => wMSUpdateLocationArea.LocationCodes.Contains(x.StationCode)).ToList();
                    foreach (var item in pk)
                    foreach (var item in pkList)
                    {
                        item.StationRegion = wMSUpdateLocationArea.UpdateAreaCode.ObjToInt();
                    }
                    pk.AddRange(pkList);
                    _stationInfo.Repository.UpdateData(pk);
                }
                Db.Ado.BeginTran();
                _rGVLocationInfoService.UpdateData(rgv);
                _kLSLocationInfoService.UpdateData(kls);
                _hKLocationInfoService.UpdateData(hk);
                Db.Ado.CommitTran();
                content.OK();
            }
            catch (Exception ex)
@@ -1596,5 +1612,253 @@
        }
        /// <summary>
        /// æ›´æ–°åº“位启用禁用状态
        /// </summary>
        /// <param name="upLocationStatusDTO"></param>
        /// <returns></returns>
        public WebResponseContent UpLocationStatus(UpLocationStatusDTO upLocationStatusDTO)
        {
            WebResponseContent content = new WebResponseContent();
            List<object> resultList = new List<object>();
            try
            {
                // å‚数验证
                if (upLocationStatusDTO == null)
                {
                    return content.Error("请求参数不能为空");
                }
                if (upLocationStatusDTO.LocationNubList == null || upLocationStatusDTO.LocationNubList.Length == 0)
                {
                    return content.Error("货位编号列表不能为空");
                }
                // æ ¹æ® EnableStatus çš„值判断是启用还是禁用
                // 0=启用,3=禁用
                bool isEnable = (upLocationStatusDTO.EnableStatus == 0);
                int targetStatus = isEnable ? (int)EnableStatusEnum.Normal : (int)EnableStatusEnum.Disable;
                var updatedList = new List<object>();  // ç”¨äºŽæ‰¹é‡æ›´æ–°
                var notFoundLocations = new List<string>();
                // æˆå“åº“ (WarehouseId = 1)
                if (upLocationStatusDTO.WarehouseId == 1)
                {
                    var locationsToUpdate = new List<Dt_RGVLocationInfo>();
                    foreach (var locationCode in upLocationStatusDTO.LocationNubList)
                    {
                        var agv = _rGVLocationInfoService.Repository.QueryFirst(x => x.LocationCode == locationCode);
                        if (agv != null)
                        {
                            agv.EnableStatus = targetStatus;
                            locationsToUpdate.Add(agv);
                            resultList.Add(new
                            {
                                LoctionCode = agv.LocationCode,
                                EnableStatus = agv.EnableStatus,
                            });
                        }
                        else
                        {
                            notFoundLocations.Add(locationCode);
                        }
                    }
                    if (locationsToUpdate.Any())
                    {
                        _rGVLocationInfoService.UpdateData(locationsToUpdate);
                        string message = $"成功更新 {locationsToUpdate.Count} ä¸ªè´§ä½çš„状态";
                        if (notFoundLocations.Any())
                        {
                            message += $",未找到货位:{string.Join(",", notFoundLocations)}";
                        }
                        content.OK(data: resultList, message: message);
                    }
                    else
                    {
                        return content.Error($"未找到任何可更新的货位。未找到的货位:{string.Join(",", notFoundLocations)}");
                    }
                }
                // é¢æ–™åº“ (WarehouseId = 2)
                else if (upLocationStatusDTO.WarehouseId == 2)
                {
                    var locationsToUpdate = new List<Dt_KLSLocationInfo>();
                    foreach (var locationCode in upLocationStatusDTO.LocationNubList)
                    {
                        var kls = _kLSLocationInfoService.Repository.QueryFirst(x => x.LocationCode == locationCode);
                        if (kls != null)
                        {
                            kls.EnableStatus = targetStatus;
                            locationsToUpdate.Add(kls);
                            resultList.Add(new
                            {
                                LoctionCode = kls.LocationCode,
                                EnableStatus = kls.EnableStatus,
                            });
                        }
                        else
                        {
                            notFoundLocations.Add(locationCode);
                        }
                    }
                    if (locationsToUpdate.Any())
                    {
                        _kLSLocationInfoService.UpdateData(locationsToUpdate);
                        string message = $"成功更新 {locationsToUpdate.Count} ä¸ªè´§ä½çš„状态";
                        if (notFoundLocations.Any())
                        {
                            message += $",未找到货位:{string.Join(",", notFoundLocations)}";
                        }
                        content.OK(data: resultList, message: message);
                    }
                    else
                    {
                        return content.Error($"未找到任何可更新的货位。未找到的货位:{string.Join(",", notFoundLocations)}");
                    }
                }
                // è£å‰ªåº“ (WarehouseId = 3)
                else if (upLocationStatusDTO.WarehouseId == 3)
                {
                    var locationsToUpdate = new List<Dt_HKLocationInfo>();
                    foreach (var locationCode in upLocationStatusDTO.LocationNubList)
                    {
                        var hk = _hKLocationInfoService.Repository.QueryFirst(x => x.LocationCode == locationCode);
                        if (hk != null)
                        {
                            hk.EnableStatus = targetStatus;
                            locationsToUpdate.Add(hk);
                            resultList.Add(new
                            {
                                LoctionCode = hk.LocationCode,
                                EnableStatus = hk.EnableStatus,
                            });
                        }
                        else
                        {
                            notFoundLocations.Add(locationCode);
                        }
                    }
                    if (locationsToUpdate.Any())
                    {
                        _hKLocationInfoService.UpdateData(locationsToUpdate);
                        string message = $"成功更新 {locationsToUpdate.Count} ä¸ªè´§ä½çš„状态";
                        if (notFoundLocations.Any())
                        {
                            message += $",未找到货位:{string.Join(",", notFoundLocations)}";
                        }
                        content.OK(data: resultList, message: message);
                    }
                    else
                    {
                        return content.Error($"未找到任何可更新的货位。未找到的货位:{string.Join(",", notFoundLocations)}");
                    }
                }
                // 3-4平库
                else if (upLocationStatusDTO.WarehouseId == 4)
                {
                    var locationsToUpdate = new List<Dt_StationInfo>();
                    foreach (var locationCode in upLocationStatusDTO.LocationNubList)
                    {
                        var station = _stationInfo.Repository.QueryFirst(x => x.StationCode == locationCode);
                        if (station != null)
                        {
                            station.IsOccupied = upLocationStatusDTO.EnableStatus==0?0:1;
                            locationsToUpdate.Add(station);
                            resultList.Add(new
                            {
                                LoctionCode = station.StationCode,
                                EnableStatus = station.IsOccupied,
                            });
                        }
                        else
                        {
                            notFoundLocations.Add(locationCode);
                        }
                    }
                    if (locationsToUpdate.Any())
                    {
                        _stationInfo.UpdateData(locationsToUpdate);
                        string message = $"成功更新 {locationsToUpdate.Count} ä¸ªè´§ä½çš„状态";
                        if (notFoundLocations.Any())
                        {
                            message += $",未找到货位:{string.Join(",", notFoundLocations)}";
                        }
                        content.OK(data: resultList, message: message);
                    }
                    else
                    {
                        return content.Error($"未找到任何可更新的货位。未找到的货位:{string.Join(",", notFoundLocations)}");
                    }
                }
                else if (upLocationStatusDTO.WarehouseId == 5)
                {
                    var locationsToUpdate = new List<Dt_StationManger>();
                    foreach (var locationCode in upLocationStatusDTO.LocationNubList)
                    {
                        var station = _stationMangerService.Repository.QueryFirst(x => x.StationCode == locationCode);
                        if (station != null)
                        {
                            station.IsOccupied = upLocationStatusDTO.EnableStatus == 0 ? 0 : 1;
                            locationsToUpdate.Add(station);
                            resultList.Add(new
                            {
                                LoctionCode = station.StationCode,
                                EnableStatus = station.IsOccupied,
                            });
                        }
                        else
                        {
                            notFoundLocations.Add(locationCode);
                        }
                    }
                    if (locationsToUpdate.Any())
                    {
                        _stationMangerService.UpdateData(locationsToUpdate);
                        string message = $"成功更新 {locationsToUpdate.Count} ä¸ªè´§ä½çš„状态";
                        if (notFoundLocations.Any())
                        {
                            message += $",未找到站台:{string.Join(",", notFoundLocations)}";
                        }
                        content.OK(data: resultList, message: message);
                    }
                    else
                    {
                        return content.Error($"未找到任何可更新的站台。未找到的站台:{string.Join(",", notFoundLocations)}");
                    }
                }
                else
                {
                    return content.Error($"不支持的仓库类型:{upLocationStatusDTO.WarehouseId}");
                }
                return content;
            }
            catch (Exception ex)
            {
                return content.Error($"更新站台状态失败:{ex.Message}");
            }
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TSJJob.cs
@@ -217,9 +217,14 @@
                                    {
                                        //寻找平库货位
                                        var Location = _stationInfoService.Repository.QueryFirst(x=>x.StationRegion==Verification.Message.ObjToInt()&&x.StationStatus==(int)LocationStatusEnum.Free&&x.FloorNumber=="CC"&&x.IsOccupied==(int)LocationStatusEnum.Free);
                                        //这里要判断
                                        if (Location==null)
                                        {
                                            RK3FTask.ExceptionMessage = "$未找到{Verification.Message}区域的货位{Location}";
                                        }
                                        RK3FTask.CurrentAddress = RK3FTask.TargetAddress;
                                        RK3FTask.NextAddress = Location.StationCode;
                                        RK3FTask.TargetAddress = Location.StationCode;
                                        RK3FTask.CurrentAddress = RK3FTask.TargetAddress;
                                        _taskService.UpdateData(RK3FTask);
                                    }
                                        //调用海康进行执行完成接口