1
dengjunjie
2026-02-26 11a5fb245177328f1899a9c89ec983354356168c
1
已添加1个文件
已删除2个文件
已修改9个文件
283 ■■■■■ 文件已修改
.gitignore 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Client/package.json 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/KLSLocationInfoService.cs 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/BasicInfo/InitializationLocationDTO.cs 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WIDESEAWCS_DTO.csproj 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/IKLSLocationInfoService.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_StationManger.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/BasicInfo/KLSLocationInfoController.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/WMS/WMSController.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/TaskExtend.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.gitignore
@@ -260,3 +260,5 @@
*.2
/代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/config/applicationhost.config
/代码管理/WCS/WIDESEAWCS_Client/package.json
/代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Client/package.json
ÎļþÒÑɾ³ý
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/KLSLocationInfoService.cs
@@ -1,10 +1,16 @@
using System;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_DTO.Basic;
using WIDESEAWCS_Common.LocationEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_Core.Utilities;
using WIDESEAWCS_IBasicInfoService;
using WIDESEAWCS_Model.Models;
@@ -17,5 +23,56 @@
        }
        public IRepository<Dt_KLSLocationInfo> Repository => BaseDal;
        /// <summary>
        /// èŽ·å–å¯ç”¨ç©ºè´§ä½
        /// </summary>
        /// <param name="AreaCode"></param>
        /// <param name="containerType"></param>
        /// <returns></returns>
        public Dt_KLSLocationInfo GetFreeLocationInfo(string AreaCode, int containerType)
        {
            Dt_KLSLocationInfo? kLSLocationInfo = BaseDal.QueryFirst(x => x.WarehouseId.ToString() == AreaCode && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == containerType);
            return kLSLocationInfo;
        }
        public WebResponseContent InitializationLocation(InitializationLocationDTO initializationLocationDTO)
        {
            try
            {
                (bool, string, object?) result = ModelValidate.ValidateModelData(initializationLocationDTO);
                if (!result.Item1) return WebResponseContent.Instance.Error(result.Item2);
                List<Dt_KLSLocationInfo> locationInfos = new List<Dt_KLSLocationInfo>();
                for (int i = 9; i < initializationLocationDTO.MaxRow; i++)
                {
                    for (int j = 0; j < initializationLocationDTO.MaxColumn; j++)
                    {
                        for (int k = 0; k < initializationLocationDTO.MaxLayer; k++)
                        {
                            Dt_KLSLocationInfo locationInfo = new Dt_KLSLocationInfo()
                            {
                                Column = j + 1,
                                EnableStatus = EnableStatusEnum.Normal.ObjToInt(),
                                Layer = k + 1,
                                LocationStatus = LocationStatusEnum.Free.ObjToInt(),
                                RoadwayNo = $"{initializationLocationDTO.Roadway}",
                                Row = i + 1,
                                LocationType = LocationTypeEnum.SmallPallet.ObjToInt(),
                                Depth = initializationLocationDTO.Depth,
                            };
                            locationInfo.LocationCode = $"{locationInfo.Row.ToString().PadLeft(3, '0')}-{locationInfo.Column.ToString().PadLeft(3, '0')}-{locationInfo.Layer.ToString().PadLeft(3, '0')}";
                            locationInfo.LocationName = $"{locationInfo.Row.ToString().PadLeft(3, '0')}行{locationInfo.Column.ToString().PadLeft(3, '0')}列{locationInfo.Layer.ToString().PadLeft(3, '0')}层";
                            locationInfos.Add(locationInfo);
                        }
                    }
                }
                BaseDal.AddData(locationInfos);
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/BasicInfo/InitializationLocationDTO.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core.Attributes;
namespace WIDESEA_DTO.Basic
{
    [ModelValidate]
    public class InitializationLocationDTO
    {
        /// <summary>
        /// å··é“号
        /// </summary>
        [PropertyValidate("巷道号", NotNullAndEmpty = true)]
        public string Roadway { get; set; }
        /// <summary>
        /// è¡Œ
        /// </summary>
        [PropertyValidate("行", MinValue = 1, IsContainMinValue = false)]
        public int MaxRow { get; set; }
        /// <summary>
        /// åˆ—
        /// </summary>
        [PropertyValidate("列", MinValue = 1, IsContainMinValue = false)]
        public int MaxColumn { get; set; }
        /// <summary>
        /// å±‚
        /// </summary>
        [PropertyValidate("层", MinValue = 1, IsContainMinValue = false)]
        public int MaxLayer { get; set; }
        /// <summary>
        /// æ˜¯å¦å•深货位
        /// </summary>
        [PropertyValidate("深度", MinValue = 1, NotNullAndEmpty = true, IsContainMinValue = true)]
        public int Depth { get; set; }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WIDESEAWCS_DTO.csproj
@@ -10,8 +10,4 @@
        <ProjectReference Include="..\WIDESEAWCS_Model\WIDESEAWCS_Model.csproj" />
    </ItemGroup>
    <ItemGroup>
      <Folder Include="BasicInfo\" />
    </ItemGroup>
</Project>
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/IKLSLocationInfoService.cs
@@ -3,6 +3,8 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_DTO.Basic;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Model.Models;
@@ -12,5 +14,13 @@
    public interface IKLSLocationInfoService : IService<Dt_KLSLocationInfo>
    {
        public IRepository<Dt_KLSLocationInfo> Repository { get; }
        WebResponseContent InitializationLocation(InitializationLocationDTO initializationLocationDTO);
        /// <summary>
        /// èŽ·å–å¯ç”¨ç©ºè´§ä½
        /// </summary>
        /// <param name="AreaCode"></param>
        /// <returns></returns>
        Dt_KLSLocationInfo GetFreeLocationInfo(string AreaCode, int containerType);
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_StationManger.cs
@@ -39,10 +39,10 @@
        public int StationType {  get; set; }
        /// <summary>
        /// å¯¹åº”堆垛机排-列-层
        /// å¯¹åº”四向车点ID
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "对应堆垛机排-列-层")]
        public string StackerCraneStationCode { get; set; }
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "对应四向车点ID")]
        public string RGVStationCode { get; set; }
        /// <summary>
        /// ç«™å°è®¾å¤‡ç¼–号
@@ -51,10 +51,10 @@
        public string StationDeviceCode { get; set; }
        /// <summary>
        /// å †åž›æœºç¼–号
        /// RGV编号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "堆垛机编号")]
        public string StackerCraneCode { get; set; }
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "RGV编号")]
        public string RGVCode { get; set; }
        /// <summary>
        /// AGV站台编号
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/BasicInfo/KLSLocationInfoController.cs
@@ -1,4 +1,7 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using WIDESEA_DTO.Basic;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseController;
using WIDESEAWCS_IBasicInfoService;
using WIDESEAWCS_Model.Models;
@@ -16,5 +19,15 @@
        {
        }
        /// <summary>
        /// åˆå§‹åŒ–货位
        /// </summary>
        /// <param name="initializationLocationDTO"></param>
        /// <returns></returns>
        [HttpPost, Route("InitializationLocation"), AllowAnonymous]
        public WebResponseContent InitializationLocation([FromBody] InitializationLocationDTO initializationLocationDTO)
        {
            return Service.InitializationLocation(initializationLocationDTO);
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/WMS/WMSController.cs
@@ -118,6 +118,7 @@
        /// </summary>
        /// <param name="AreaCode">区域号</param>
        /// <returns></returns>
        [HttpPost, Route("LocationInquiry"), AllowAnonymous]
        public object  LocationInquiry(string AreaCode)
        {
            WebResponseContent content = _taskService.LocationInquiry(AreaCode);
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json
ÎļþÒÑɾ³ý
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs
@@ -27,13 +27,12 @@
            {
                int containerType = taskDTO.containerCode.Contains("LLM") ? LocationTypeEnum.LargePallet.ObjToInt() : LocationTypeEnum.SmallPallet.ObjToInt();
                //获取货位信息
                Dt_KLSLocationInfo? kLSLocationInfo = _kLSLocationInfoService.Repository.QueryFirst(x => x.WarehouseId.ToString() == taskDTO.toAreaCode && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == containerType);
                if (kLSLocationInfo == null) throw new Exception($"未找到终点库区【{taskDTO.toAreaCode}】可用空货位!");
                Dt_Task dt_Task = new Dt_Task()
                Dt_KLSLocationInfo? kLSLocationInfo = _kLSLocationInfoService.GetFreeLocationInfo(taskDTO.toAreaCode, containerType) ?? throw new Exception($"未找到终点库区【{taskDTO.toAreaCode}】可用空货位!");
                Dt_Task dt_Task = new()
                {
                    TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    WMSTaskNum = taskDTO.taskCode,
                    WMSId = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    //WMSId = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    Grade = taskDTO.taskPriority,
                    PalletCode = taskDTO.containerCode,
                    Roadway = kLSLocationInfo.RoadwayNo,
@@ -113,8 +112,29 @@
        {
            try
            {
                List<Dt_RGVLocationInfo>? rGVLocationInfos = _rGVLocationInfoService.Repository.QueryData(x => x.WarehouseId.ToString() == taskDTO.toAreaCode && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt());
                if (rGVLocationInfos.Count < 1) throw new Exception($"未找到终点库区【{taskDTO.toAreaCode}】可用空货位!");
                var rGVLocationInfo = rGVLocationInfos.OrderBy(x => x.Depth).First();
                Dt_Task 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 = rGVLocationInfo.RoadwayNo,
                    TaskState = TaskStatusEnum.New.ObjToInt(),
                    TaskType = taskType,
                    SourceAddress = taskDTO.fromLocationCode,
                    CurrentAddress = taskDTO.fromLocationCode,
                    NextAddress = rGVLocationInfo.LocationCode,//找入库站台对应的外形检测编号
                    TargetAddress = rGVLocationInfo.LocationCode,
                    Creater = "WMS",
                };
                rGVLocationInfo.LocationStatus = LocationStatusEnum.InLock.ObjToInt();
                Db.Ado.BeginTran();
                BaseDal.AddData(dt_Task);
                _rGVLocationInfoService.Repository.UpdateData(rGVLocationInfo);
                Db.Ado.CommitTran();
                return WebResponseContent.Instance.OK();
            }
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/TaskExtend.cs
@@ -63,6 +63,7 @@
            {
                gALAXISTaskInfo.groupId = DateTime.Now.ToString("yyMMddHHmmss");
                gALAXISTaskInfo.msgTime = DateTime.Now.ToString();
                gALAXISTaskInfo.tasks = new List<GALAXISTask>();
                foreach (var task in tasks)
                {
                    GALAXISTask gALAXISTask = new GALAXISTask()