1
dengjunjie
2026-01-21 0c407bdcf2a26d78d2b0740f74af209977f0e7ce
1
已添加13个文件
已重命名1个文件
已删除1个文件
已修改8个文件
34089 ■■■■■ 文件已修改
代码管理/WCS/WIDESEAWCS_Client/package-lock.json 33431 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/DeviceTypeEnum.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/LocationEnum/EnableStatusEnum.cs 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/LocationEnum/LocationChangeType.cs 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/LocationEnum/LocationStatusEnum.cs 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/LocationEnum/LocationTypeEnum.cs 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/SequenceEnum.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/GALAXIS/CancelGALAXISTask.cs 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/GALAXIS/GALAXISReturn.cs 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/GALAXIS/GALAXISTaskInfo.cs 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/GALAXIS/GALAXISUpdateTaskStatus.cs 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/GALAXIS/ReturnGALAXIS.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/GALAXIS/UpdateGALAXISTaskGrade.cs 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WIDESEAWCS_DTO.csproj 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/WMSTasksDTO.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/TaskInfo/Dt_Task.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/KLSAGVController.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/WMS/WMSController.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskHelpMethods.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Client/package-lock.json
ÎļþÒÑɾ³ý
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/DeviceTypeEnum.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_Common
{
    public enum DeviceTypeEnum
    {
        /// <summary>
        /// å‡¯ä¹å£«
        /// </summary>
        GALAXIS,
        /// <summary>
        /// æµ·åº·
        /// </summary>
        HIKROBOT,
        /// <summary>
        /// åŽŸåŠ›èšåˆå››å‘è½¦
        /// </summary>
        YuanLiJuHe,
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/LocationEnum/EnableStatusEnum.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_Common.LocationEnum
{
    /// <summary>
    /// è´§ä½ç¦ç”¨çŠ¶æ€
    /// </summary>
    public enum EnableStatusEnum
    {
        /// <summary>
        /// æ­£å¸¸
        /// </summary>
        [Description("正常")]
        Normal = 0,
        /// <summary>
        /// åªå…¥
        /// </summary>
        [Description("只入")]
        OnlyIn = 1,
        /// <summary>
        /// åªå‡º
        /// </summary>
        [Description("只出")]
        OnlyOut = 2,
        /// <summary>
        /// ç¦ç”¨
        /// </summary>
        [Description("禁用")]
        Disable = 3
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/LocationEnum/LocationChangeType.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_Common.LocationEnum
{
    /// <summary>
    /// è´§ä½çŠ¶æ€å˜æ›´ç±»åž‹
    /// </summary>
    public enum LocationChangeType
    {
        /// <summary>
        /// å…¥åº“分配
        /// </summary>
        [Description("入库分配")]
        InboundAssignLocation,
        /// <summary>
        /// å‡ºåº“分配
        /// </summary>
        [Description("出库分配")]
        OutboundAssignLocation,
        /// <summary>
        /// ç§»åº“分配
        /// </summary>
        [Description("移库分配")]
        RelocationAssignLocation,
        /// <summary>
        /// å…¥åº“任务完成
        /// </summary>
        [Description("入库任务完成")]
        InboundCompleted,
        /// <summary>
        /// å‡ºåº“任务完成
        /// </summary>
        [Description("出库任务完成")]
        OutboundCompleted,
        /// <summary>
        /// ç§»åº“任务完成
        /// </summary>
        [Description("移库任务完成")]
        RelocationCompleted,
        /// <summary>
        /// æ‰‹åŠ¨ä¿®æ”¹
        /// </summary>
        [Description("手动修改")]
        HandUpdate
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/LocationEnum/LocationStatusEnum.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,50 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_Common.LocationEnum
{
    /// <summary>
    /// è´§ä½çŠ¶æ€
    /// </summary>
    public enum LocationStatusEnum
    {
        /// <summary>
        /// ç©ºé—²
        /// </summary>
        [Description("空闲")]
        Free = 0,
        /// <summary>
        /// é”å®š
        /// </summary>
        [Description("锁定")]
        Lock = 1,
        /// <summary>
        /// å…¥åº“锁定
        /// </summary>
        [Description("入库锁定")]
        InLock = 10,
        /// <summary>
        /// å‡ºåº“锁定
        /// </summary>
        [Description("出库锁定")]
        OutLock = 20,
        /// <summary>
        /// æœ‰è´§
        /// </summary>
        [Description("有货")]
        InStock = 100,
        /// <summary>
        /// å¤§æ‰˜ç›˜é”å®š
        /// </summary>
        [Description("大托盘锁定")]
        PalletLock = 99
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/LocationEnum/LocationTypeEnum.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_Common.LocationEnum
{
    /// <summary>
    /// è´§ä½ç±»åž‹
    /// </summary>
    public enum LocationTypeEnum
    {
        /// <summary>
        /// æœªå®šä¹‰
        /// </summary>
        [Description("未定义")]
        Undefined = 0,
        /// <summary>
        /// å°æ‰˜ç›˜
        /// </summary>
        [Description("小托盘")]
        SmallPallet = 1,
        /// <summary>
        /// ä¸­æ‰˜ç›˜
        /// </summary>
        [Description("中托盘")]
        MediumPallet = 2,
        /// <summary>
        /// å¤§æ‰˜ç›˜
        /// </summary>
        [Description("大托盘")]
        LargePallet = 3,
        /// <summary>
        /// ç‰¹å¤§æ‰˜ç›˜
        /// </summary>
        [Description("特大托盘")]
        ExtraPallet = 4,
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/SequenceEnum.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_Common
{
    public enum SequenceEnum
    {
        SeqTaskNum
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/GALAXIS/CancelGALAXISTask.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_DTO
{
    /// <summary>
    /// å–消凯乐士任务
    /// </summary>
    public class CancelGALAXISTask
    {
        /// ä»»åŠ¡ç¼–å·
        /// </summary>
        public string taskId { get; set; }
        /// <summary>
        /// è¯·æ±‚时间戳
        /// </summary>
        public string reportTime { get; set; }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/GALAXIS/GALAXISReturn.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_DTO
{
    /// <summary>
    /// å‡¯ä¹å£«è¿”回结果
    /// </summary>
    public class GALAXISReturn
    {
        /// <summary>
        /// è¿”回码
        /// </summary>
        public int code {  get; set; }
        /// <summary>
        /// è¿”回时间戳
        /// </summary>
        public string reportTime {  get; set; }
        public bool success {  get; set; }
        public GALAXISReturnData data {  get; set; }
    }
    public class GALAXISReturnData
    {
        /// <summary>
        /// å¤šä»»åŠ¡ç»„
        /// </summary>
        public string groupId { get; set; }
        /// <summary>
        /// ä»»åŠ¡ç¼–å·
        /// </summary>
        public string taskId { get; set; }
        /// <summary>
        /// è¯·æ±‚结果,0成功,1失败
        /// </summary>
        public int returnStatus { get; set; }
        /// <summary>
        /// è¯·æ±‚异常结果描述
        /// </summary>
        public string returnInfo { get; set; }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/GALAXIS/GALAXISTaskInfo.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_DTO
{
    /// <summary>
    /// å‡¯ä¹å£«ä»»åŠ¡ä¿¡æ¯
    /// </summary>
    public class GALAXISTaskInfo
    {
        public string groupId { get; set; }
        public string msgTime { get; set; }
        public GALAXISTask tasks { get; set; }
    }
    public class GALAXISTask
    {
        /// <summary>
        /// ä»»åŠ¡ç¼–å·
        /// </summary>
        public string taskId { get; set; }
        /// <summary>
        /// 0入库,1出库,2移库
        /// </summary>
        public int taskType { get; set; }
        /// <summary>
        /// ä¼˜å…ˆçº§
        /// </summary>
        public int priorityCode { get; set; }
        /// <summary>
        /// ä»»åŠ¡åº“åŒºï¼ŒRCS定义
        /// </summary>
        public string district { get; set; }
        /// <summary>
        /// å®¹å™¨ç±»åž‹ï¼Œå¾…定
        /// </summary>
        public int containerType { get; set; }
        /// <summary>
        /// å®¹å™¨ç¼–号
        /// </summary>
        public string barCode { get; set; }
        /// <summary>
        /// èµ·ç‚¹ç‚¹ä½
        /// </summary>
        public string startNode { get; set; }
        /// <summary>
        /// èµ·ç‚¹åŒºåŸŸ,使用点位默认-1
        /// </summary>
        public int fromArea { get; set; } = -1;
        /// <summary>
        /// ç»ˆç‚¹ç‚¹ä½
        /// </summary>
        public string endNode { get; set; }
        /// <summary>
        /// ç»ˆç‚¹åŒºåŸŸ,使用点位默认-1
        /// </summary>
        public int toArea { get; set; } = -1;
        /// <summary>
        /// ä¾§å‰æ‹†å ç›˜æŒ‡å®šå±‚数,任务类型入库
        /// </summary>
        public int layer { get; set; }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/GALAXIS/GALAXISUpdateTaskStatus.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_DTO
{
    /// <summary>
    /// å‡¯ä¹å£«æ›´æ–°ä»»åŠ¡çŠ¶æ€
    /// </summary>
    public class GALAXISUpdateTaskStatus
    {
        /// <summary>
        /// ä»»åŠ¡ç¼–å·
        /// </summary>
        public string taskId { get; set; }
        /// <summary>
        /// æ‰§è¡Œä»»åŠ¡åº“ä½
        /// </summary>
        public string siteCode { get; set; }
        /// <summary>
        /// å®¹å™¨ç¼–号
        /// </summary>
        public string rackNo { get; set; }
        /// <summary>
        /// è®¾å¤‡ç¼–号
        /// </summary>
        public int vid { get; set; }
        /// <summary>
        /// æµ‹é‡é«˜åº¦ï¼Œ
        /// 0:货物高度小于最矮传感器
        ///1:货物高度大于最矮传感器小于最高传感器
        ///2:货物高度大于最高传感器
        /// </summary>
        public int height { get; set; }
        /// <summary>
        /// è¯·æ±‚时间戳
        /// </summary>
        public string reportTime { get; set; }
        /// <summary>
        /// ä»»åŠ¡çŠ¶æ€<br></br>
        /// 0任务完成,<br></br>
        /// 1起点无货,<br></br>
        /// 2终点有货,<br></br>
        /// 3任务编号重复,<br></br>
        /// 4取货完成,<br></br>
        /// 5RCS接收任务操作数据库异常,<br></br>
        /// 6任务类型有误,<br></br>
        /// 7参数有误,<br></br>
        /// 8RCS未知异常,<br></br>
        /// 9正在执行或已执行完毕的任务不能取消,<br></br>
        /// 10开始执行任务,<br></br>
        /// 13任务废止,不再执行<br></br>
        /// </summary>
        public int taskStatus { get; set; }
        /// <summary>
        /// è¯·æ±‚结果描述
        /// </summary>
        public string returnInfo { get; set; }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/GALAXIS/ReturnGALAXIS.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_DTO
{
    /// <summary>
    /// è¿”回凯乐士结果信息
    /// </summary>
    public class ReturnGALAXIS
    {
        /// <summary>
        /// è¯·æ±‚结果,0成功,1失败
        /// </summary>
        public int returnStatus { get; set; }
        /// <summary>
        /// è¯·æ±‚异常结果描述
        /// </summary>
        public string returnInfo { get; set; }
        /// <summary>
        /// è¯·æ±‚时间戳
        /// </summary>
        public string msgTime { get; set; }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/GALAXIS/UpdateGALAXISTaskGrade.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_DTO
{
    /// <summary>
    /// æ›´æ–°å‡¯ä¹å£«ä»»åŠ¡ä¼˜å…ˆçº§
    /// </summary>
    public class UpdateGALAXISTaskGrade
    {
        /// <summary>
        /// ä»»åŠ¡ç¼–å·
        /// </summary>
        public string taskId { get; set; }
        /// <summary>
        /// è¯·æ±‚时间戳
        /// </summary>
        public string reportTime { get; set; }
        /// <summary>
        /// ä»»åŠ¡åº“åŒº
        /// </summary>
        public string district { get; set; }
        /// <summary>
        /// æ–°çš„优先级
        /// </summary>
        public int priorityCode { get; set; }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WIDESEAWCS_DTO.csproj
@@ -11,10 +11,9 @@
    </ItemGroup>
    <ItemGroup>
      <Folder Include="AGV\HIKROBOT\" />
      <Folder Include="BasicInfo\" />
      <Folder Include="WMS\" />
      <Folder Include="RGV\" />
      <Folder Include="AGV\" />
    </ItemGroup>
</Project>
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/WMSTasksDTO.cs
ÎļþÃû´Ó ´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTasksDTO.cs ÐÞ¸Ä
@@ -4,7 +4,7 @@
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_DTO.TaskInfo
namespace WIDESEAWCS_DTO.WMS
{
    public class WMSTasksDTO
    {
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs
@@ -30,6 +30,8 @@
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core.BaseRepository;
using Microsoft.AspNetCore.Mvc;
using WIDESEAWCS_DTO.WMS;
using WIDESEAWCS_Common;
namespace WIDESEAWCS_ITaskInfoService
{
@@ -190,5 +192,12 @@
        /// <param name="taskNum">任务号</param>
        /// <returns>返回处理结果</returns>
        WebResponseContent RollbackTaskStatusToLast(int taskNum);
        /// <summary>
        /// èŽ·å–ä»»åŠ¡å·
        /// </summary>
        /// <param name="sequenceName"></param>
        /// <returns></returns>
        int GetTaskNum(string sequenceName);
        WebResponseContent UpdateTaskStatus(object TaskDTO, DeviceTypeEnum deviceTypeEnum);
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/TaskInfo/Dt_Task.cs
@@ -66,7 +66,7 @@
        /// </summary>
        [ImporterHeader(Name = "巷道号")]
        [ExporterHeader(DisplayName = "巷道号")]
        [SugarColumn(IsNullable = false, Length = 10, ColumnDescription = "巷道号")]
        [SugarColumn(IsNullable = true, Length = 10, ColumnDescription = "巷道号")]
        public string Roadway { get; set; }
        /// <summary>
@@ -138,7 +138,7 @@
        /// </summary>
        [ImporterHeader(Name = "WMS任务主键")]
        [ExporterHeader(DisplayName = "WMS任务主键")]
        [SugarColumn(IsNullable = false, ColumnDescription = "WMS任务主键")]
        [SugarColumn(IsNullable = true, ColumnDescription = "WMS任务主键")]
        public int WMSId { get; set; }
        /// <summary>
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/KLSAGVController.cs
@@ -1,5 +1,10 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WIDESEAWCS_Common;
using WIDESEAWCS_Core;
using WIDESEAWCS_DTO.WMS;
using WIDESEAWCS_ITaskInfoService;
namespace WIDESEAWCS_Server.Controllers.AGV
{
@@ -7,5 +12,21 @@
    [ApiController]
    public class KLSAGVController : ControllerBase
    {
        private readonly ITaskService _taskService;
        public KLSAGVController(ITaskService taskService)
        {
            _taskService = taskService;
        }
        /// <summary>
        /// ä»»åŠ¡çŠ¶æ€æ›´æ–°
        /// </summary>
        /// <param name="taskDTOs"></param>
        /// <returns></returns>
        [HttpPost, Route("UpdateTaskStatus"), AllowAnonymous]
        public WebResponseContent UpdateTaskStatus(object TaskDTO)
        {
            return _taskService.UpdateTaskStatus(TaskDTO, DeviceTypeEnum.GALAXIS);
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/WMS/WMSController.cs
@@ -3,7 +3,7 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WIDESEAWCS_Core;
using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_DTO.WMS;
using WIDESEAWCS_ITaskInfoService;
namespace WIDESEAWCS_Server.Controllers.WMS
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs
@@ -5,7 +5,11 @@
using System.Threading.Tasks;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_Core;
using WIDESEAWCS_DTO.TaskInfo;
using SqlSugar.Extensions;
using WIDESEAWCS_DTO.WMS;
using WIDESEAWCS_Common.LocationEnum;
using WIDESEAWCS_Common;
using WIDESEAWCS_Common.TaskEnum;
namespace WIDESEAWCS_TaskInfoService
{
@@ -16,17 +20,71 @@
        /// </summary>
        /// <param name="taskDTO"></param>
        /// <returns></returns>
        public WebResponseContent CreateNewInTask(TaskDTO taskDTO)
        public WebResponseContent CreateKLSNewInTask(TaskDTO taskDTO, int taskType)
        {
            try
            {
                int containerType = taskDTO.containerCode.Contains("") ? LocationTypeEnum.LargePallet.ObjToInt() : LocationTypeEnum.SmallPallet.ObjToInt();
                //获取货位信息
                Dt_KLSLocationInfo? kLSLocationInfos = _kLSLocationInfoService.Repository.QueryFirst(x => x.WarehouseId.ToString() == taskDTO.toAreaCode);
                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()
                {
                    TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    WMSTaskNum = taskDTO.taskCode,
                    Grade = taskDTO.taskPriority,
                    PalletCode = taskDTO.containerCode,
                    TaskState = TaskInStatusEnum.InNew.ObjToInt(),
                    TaskType = taskType,
                    SourceAddress = taskDTO.fromLocationCode,
                    CurrentAddress = taskDTO.fromLocationCode,
                    NextAddress = kLSLocationInfo.LocationCode,
                    TargetAddress = kLSLocationInfo.LocationCode,
                };
                kLSLocationInfo.LocationStatus = LocationStatusEnum.InLock.ObjToInt();
                Db.Ado.BeginTran();
                BaseDal.AddData(dt_Task);
                _kLSLocationInfoService.Repository.UpdateData(kLSLocationInfo);
                Db.Ado.CommitTran();
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                Db.Ado.RollbackTran();
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        public WebResponseContent CreateKLSNewOutTask(TaskDTO taskDTO, int taskType)
        {
            try
            {
                Dt_KLSLocationInfo? kLSLocationInfo = _kLSLocationInfoService.Repository.QueryFirst(x => x.LocationCode == taskDTO.fromLocationCode);
                if (kLSLocationInfo == null) throw new Exception($"未找到起点库位【{taskDTO.fromLocationCode}】!");
                if (kLSLocationInfo.LocationStatus != LocationStatusEnum.InStock.ObjToInt()) throw new Exception($"起点库位【{taskDTO.fromLocationCode}】当前库位状态不可出库!");
                Dt_Task dt_Task = new Dt_Task()
                {
                    TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    WMSTaskNum = taskDTO.taskCode,
                    Grade = taskDTO.taskPriority,
                    PalletCode = taskDTO.containerCode,
                    TaskState = TaskOutStatusEnum.OutNew.ObjToInt(),
                    TaskType = taskType,
                    SourceAddress = taskDTO.fromLocationCode,
                    CurrentAddress = taskDTO.fromLocationCode,
                    NextAddress = taskDTO.toLocationCode,
                    TargetAddress = taskDTO.toLocationCode,
                };
                kLSLocationInfo.LocationStatus = LocationStatusEnum.OutLock.ObjToInt();
                Db.Ado.BeginTran();
                BaseDal.AddData(dt_Task);
                _kLSLocationInfoService.Repository.UpdateData(kLSLocationInfo);
                Db.Ado.CommitTran();
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                Db.Ado.RollbackTran();
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskHelpMethods.cs
@@ -5,7 +5,7 @@
using System.Threading.Tasks;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_DTO.WMS;
namespace WIDESEAWCS_TaskInfoService
{
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common;
using WIDESEAWCS_Core;
namespace WIDESEAWCS_TaskInfoService
{
    public partial class TaskService
    {
        /// <summary>
        /// æ›´æ–°ä»»åŠ¡çŠ¶æ€
        /// </summary>
        /// <param name="TaskDTO"></param>
        /// <param name="deviceTypeEnum"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public WebResponseContent UpdateTaskStatus(object TaskDTO, DeviceTypeEnum deviceTypeEnum)
        {
            try
            {
                if (deviceTypeEnum == DeviceTypeEnum.GALAXIS)
                {
                }
                else if (deviceTypeEnum == DeviceTypeEnum.HIKROBOT)
                {
                }
                else
                {
                }
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -18,12 +18,14 @@
using AutoMapper;
using SqlSugar;
using System.Diagnostics.CodeAnalysis;
using WIDESEAWCS_Common;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_DTO.WMS;
using WIDESEAWCS_IBasicInfoService;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
@@ -76,8 +78,6 @@
            {
                foreach (var item in taskDTOs)
                {
                    if (item.taskType == TaskTypeEnum.MLInbound.ObjToInt())
                    {
                        foreach (var task in item.tasks)
                        {
                            content = TaskHelpMethods.isOkTaskInfo(task, true, true);
@@ -86,8 +86,10 @@
                            {
                                continue;
                            }
                            CreateNewInTask(task);
                        }
                        if (item.taskType == TaskTypeEnum.MLInbound.ObjToInt())
                            CreateKLSNewInTask(task, item.taskType);
                        else if (item.taskType == TaskTypeEnum.MLOutbound.ObjToInt())
                            CreateKLSNewOutTask(task, item.taskType);
                    }
                }
            }
@@ -625,5 +627,14 @@
            }
            return content;
        }
        static object lock_taskNum = new object();
        public int GetTaskNum(string sequenceName)
        {
            lock (lock_taskNum)
            {
                return Db.Ado.GetScalar($"SELECT NEXT VALUE FOR {sequenceName}").ObjToInt();
            }
        }
    }
}