e3cfda747bd53f4550904d60cd13aa8f4e525739..b466b3135cd7f3b08f570efda0ffb691daff5270
9 天以前 wangxinhui
一期输送线代码及AGV请求等
b466b3 对比 | 目录
9 天以前 wangxinhui
更新
84ebba 对比 | 目录
已添加12个文件
已修改18个文件
1019 ■■■■■ 文件已修改
项目代码/WCSClient/src/views/basicinfo/locationInfo.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCSClient/src/views/taskinfo/task.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCSServices/WIDESEAWCS_BasicInfoService/LocationInfoService.cs 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCSServices/WIDESEAWCS_Common/APIEnum/APIEnum.cs 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCSServices/WIDESEAWCS_DTO/Agv/AgvTaskFlowDTO.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCSServices/WIDESEAWCS_DTO/Agv/AgvTaskReqContent.cs 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCSServices/WIDESEAWCS_DTO/Agv/AgvTaskRequestDTO.cs 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCSServices/WIDESEAWCS_DTO/EPLightBackDTO.cs 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCSServices/WIDESEAWCS_DTO/EPLightContent.cs 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCSServices/WIDESEAWCS_DTO/EPLightSendDTO.cs 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCSServices/WIDESEAWCS_DTO/TaskInfo/ContainerDTO.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCSServices/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCSServices/WIDESEAWCS_ITaskInfoService/ITaskService.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCSServices/WIDESEAWCS_Model/Models/BasicInfo/Dt_LocationInfo.cs 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCSServices/WIDESEAWCS_Model/Models/TaskInfo/Dt_Task.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCSServices/WIDESEAWCS_Model/Models/TaskInfo/Dt_Task_Hty.cs 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCSServices/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCSServices/WIDESEAWCS_Server/Controllers/Task/TaskController.cs 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCSServices/WIDESEAWCS_Server/Controllers/WebAPIController.cs 129 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCSServices/WIDESEAWCS_Server/Filter/CustomProfile.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs 197 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCSServices/WIDESEAWCS_Tasks/AGV/AGVExtend.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCSServices/WIDESEAWCS_Tasks/一期线体/ConveyorLineJob1.cs 142 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCSServices/WIDESEAWCS_Tasks/二期线体/ConveyorLineJob2.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目资料/AGV通信文档/WCS与RCS安全交互接口文档V1.6_11_13.pdf 补丁 | 查看 | 原始文档 | blame | 历史
项目资料/一期对接相关资料/哈尔滨一期输送线对接协议modbusTcp协议V1.1.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
项目资料/一期对接相关资料/播种墙报文.docx 补丁 | 查看 | 原始文档 | blame | 历史
项目资料/接口汇总文件/EPLight Web API 接口文档1.1.docx 补丁 | 查看 | 原始文档 | blame | 历史
项目资料/接口汇总文件/WMS接口.docx 补丁 | 查看 | 原始文档 | blame | 历史
项目资料/接口汇总文件/WMS接口对接文档20251202_V1.1.3.docx 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WCSClient/src/views/basicinfo/locationInfo.vue
@@ -49,7 +49,7 @@
        { title: "货位编号", field: "locationCode", type: "like"},
        { title: "料箱编号", field: "palletCode", type: "like"},
        { title: "禁用状态", field: "enableStatus" ,type: "select",dataKey: "",data: [{key: "0",value: "启用"},{key: "3",value: "禁用"}]},
        { title: "货位状态", field: "locationStatus" ,type: "selectList",dataKey: "locationStatusEnum",data: []},
        { title: "货位状态", field: "locationStatus" ,type: "selectList",dataKey: "",data: [{key: "0",value: "空闲"},{key: "1",value: "锁定"},{key: "100",value: "有货"}]},
      ],
      [
        { title: "行", field: "row" ,type: "int"},
ÏîÄ¿´úÂë/WCSClient/src/views/taskinfo/task.vue
@@ -24,7 +24,7 @@
      cnName: "任务信息",
      name: "task",
      url: "/Task/",
      sortName: "CreateDate",
      sortName: "taskNum",
    });
    const editFormFields = ref({});
    const editFormOptions = ref([]);
ÏîÄ¿´úÂë/WCSServices/WIDESEAWCS_BasicInfoService/LocationInfoService.cs
@@ -1,4 +1,8 @@
using HslCommunication.WebSocket;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using MathNet.Numerics.Statistics.Mcmc;
using NPOI.Util.Collections;
using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
using SqlSugar;
@@ -188,5 +192,56 @@
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        public override WebResponseContent Export(PageDataOptions options)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                string savePath = AppDomain.CurrentDomain.BaseDirectory + $"ExcelExport";
                IExporter exporter = new ExcelExporter();
                options.Page = 1;
                options.Rows = 30;
                options.Order = "asc";
                options.Sort = "id";
                string where = string.Empty;
                ISugarQueryable<Dt_LocationInfo> sugarQueryable = BaseDal.Db.Queryable<Dt_LocationInfo>();
                if (!string.IsNullOrEmpty(options.Wheres))
                {
                    try
                    {
                        List<SearchParameters> searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>();
                        if (searchParametersList?.Any() == true)
                        {
                            foreach (var param in searchParametersList)
                            {
                                switch (param.Name)
                                {
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                    }
                }
                byte[] data = exporter.ExportAsByteArray(sugarQueryable.ToList()).Result;
                string fileName = "库位信息.xlsx";
                FileHelper.WriteFile(savePath, fileName, data);
                content = WebResponseContent.Instance.OK(data: savePath + "\\" + fileName);
            }
            catch (Exception ex)
            {
                content = WebResponseContent.Instance.Error(ex.Message);
            }
            return content;
        }
    }
}
ÏîÄ¿´úÂë/WCSServices/WIDESEAWCS_Common/APIEnum/APIEnum.cs
@@ -20,14 +20,29 @@
        [Description("AGV任务放行接口")]
        AgvTaskFlow,
        /// <summary>
        /// WMS入库反馈完成
        /// WMS出入库反馈完成
        /// </summary>
        [Description("WMS入库反馈完成")]
        WMSInBoundBack,
        [Description("WMS出入库反馈完成")]
        WMSInOutBoundBack,
        /// <summary>
        /// WMS料箱到达拣选位上报
        /// </summary>
        [Description("WMS料箱到达拣选位上报")]
        WMSPickArrivedUp,
        /// <summary>
        /// äºŒæœŸæ’­ç§å¢™åˆå§‹åŒ–
        /// </summary>
        [Description("二期播种墙初始化")]
        INITIALIZATION,
        /// <summary>
        /// äºŒæœŸæ’­ç§å¢™ç»“束作业
        /// </summary>
        [Description("二期播种墙结束作业")]
        ENDWORK,
        /// <summary>
        /// äºŒæœŸæ’­ç§å¢™ä¸‹å‘
        /// </summary>
        [Description("二期播种墙下发")]
        PickOrderInfoRequest,
    }
}
ÏîÄ¿´úÂë/WCSServices/WIDESEAWCS_DTO/Agv/AgvTaskFlowDTO.cs
@@ -6,6 +6,9 @@
namespace WIDESEAWCS_DTO.Agv
{
    /// <summary>
    /// AGV任务放行
    /// </summary>
    public class AgvTaskFlowDTO
    {
        /// <summary>
ÏîÄ¿´úÂë/WCSServices/WIDESEAWCS_DTO/Agv/AgvTaskReqContent.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core;
namespace WIDESEAWCS_DTO.Agv
{
    public class DataResult
    {
        /// <summary>
        /// è¯·æ±‚结果:0、禁止;1、允许;
        /// </summary>
        public string Result { get; set; }
    }
    /// <summary>
    /// AGV任务请求返回(取放)
    /// </summary>
    public class AgvTaskReqContent
    {
        /// <summary>
        /// è¯·æ±‚编号
        /// </summary>
        public string ReqCode { get; set; }
        /// <summary>
        /// è¿”回码, æˆåŠŸ 0,失败 1
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        /// success æˆ–者异常原因
        /// </summary>
        public string Message { get; set; }
        /// <summary>
        /// ç»“果对象
        /// </summary>
        public DataResult Data { get; set; }
        public AgvTaskReqContent()
        {
        }
        public AgvTaskReqContent OK()
        {
            Code = "0";
            Message = "success";
            Data = new DataResult()
            {
                Result = "1"
            };
            return this;
        }
        public AgvTaskReqContent Error(string message = "")
        {
            Code = "1";
            Message = message;
            Data = new DataResult()
            {
                Result = "0"
            };
            return this;
        }
    }
}
ÏîÄ¿´úÂë/WCSServices/WIDESEAWCS_DTO/Agv/AgvTaskRequestDTO.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_DTO.Agv
{
    /// <summary>
    /// AGV任务请求(取放)
    /// </summary>
    public class AgvTaskRequestDTO
    {
        /// <summary>
        /// è¯·æ±‚编号
        /// </summary>
        public string ReqCode { get; set; }
        /// <summary>
        /// è¯·æ±‚时间截
        /// </summary>
        public string ReqTime { get; set; }
        /// <summary>
        /// ä»»åŠ¡ç¼–å·
        /// </summary>
        public string TaskId { get; set; }
        /// <summary>
        /// æœºå™¨äººç¼–号
        /// </summary>
        public string RobotId { get; set; }
        /// <summary>
        /// ä½ç½®ç¼–号
        /// </summary>
        public string PositionId { get; set; }
        /// <summary>
        /// æ–™ç®±ç¼–号
        /// </summary>
        public string ContainerCode { get; set; }
        /// <summary>
        /// è¯·æ±‚节点
        /// 1:带载请求进入(背着料车进入);<br/>
        /// 2:空载请求进入(不带料车进入);<br/>
        /// 3:请求离开;<br/>
        /// 4:请求放料;<br/>
        /// 5:请求取料;<br/>
        /// 6:通知 PLC æŠ•料;<br/>
        /// 7:通知 PLC æŽ¥æ–™ï¼›<br/>
        /// </summary>
        public string Action { get; set; }
    }
}
ÏîÄ¿´úÂë/WCSServices/WIDESEAWCS_DTO/EPLightBackDTO.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_DTO
{
    public class EPLightBackDTO
    {
        /// <summary>
        /// è®¢å•号
        /// </summary>
        public string DOCNO { get; set; }
        /// <summary>
        /// ä»»åŠ¡å·
        /// </summary>
        public string TASKNO { get; set; }
        /// <summary>
        /// è´§ä½å·
        /// </summary>
        public string LOCATION { get; set; }
        /// <summary>
        /// å®žé™…拍灯数量
        /// </summary>
        public int QUANTITY { get; set; }
        /// <summary>
        /// æ‹ç¯æ—¶é—´
        /// </summary>
        public string RETURNTIME { get; set; }
    }
}
ÏîÄ¿´úÂë/WCSServices/WIDESEAWCS_DTO/EPLightContent.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core;
namespace WIDESEAWCS_DTO
{
    public class EPLightContent
    {
        /// <summary>
        /// è¿”回结果 0:成功;-1:失败
        /// </summary>
        public string Result { get; set; }
        /// <summary>
        /// è¿”回信息
        /// </summary>
        public string Msg { get; set; }
        public EPLightContent()
        {
        }
        public EPLightContent OK(string message = "")
        {
            Result = "0";
            Msg = message;
            return this;
        }
        public EPLightContent Error(string message = "")
        {
            Result = "-1";
            Msg = message;
            return this;
        }
    }
}
ÏîÄ¿´úÂë/WCSServices/WIDESEAWCS_DTO/EPLightSendDTO.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_DTO
{
    public class EPLightSendDTO
    {
        /// <summary>
        /// è®¢å•号
        /// </summary>
        public string DOCNO { get; set; }
        /// <summary>
        /// ä»»åŠ¡å·
        /// </summary>
        public string TASKNO { get; set; }
        /// <summary>
        /// è´§ä½å·
        /// </summary>
        public string LOCATION { get; set; }
        /// <summary>
        /// äº®ç¯æ•°é‡
        /// </summary>
        public int QUANTITY { get; set; }
        /// <summary>
        /// äº®ç¯é¢œè‰²
        /// </summary>
        public string LIGHTCOLOR { get; set; }
        /// <summary>
        /// äº®ç¯çŠ¶æ€ï¼š1:亮:2灭
        /// </summary>
        public string ORDERTYPE { get; set; }
        /// <summary>
        /// ä¸šåŠ¡ç±»åž‹ 1:入库亮灯 2:出库亮灯
        /// </summary>
        public string LIGHTTYPE { get; set; }
    }
}
ÏîÄ¿´úÂë/WCSServices/WIDESEAWCS_DTO/TaskInfo/ContainerDTO.cs
@@ -41,7 +41,7 @@
        public string Direction { get; set; }
    }
    /// <summary>
    /// æ–™ç®±å…¥åº“完成上报
    /// æ–™ç®±å‡ºå…¥åº“完成上报
    /// </summary>
    public class ContainerInFinishDTO
    {
@@ -54,12 +54,16 @@
        /// </summary>
        public string ContainerCode { get; set; }
        /// <summary>
        /// èµ·å§‹ç«™å°
        /// ç«™å°
        /// </summary>
        public string FromStationCode { get; set; }
        public string StationCode { get; set; }
        /// <summary>
        /// ç›®æ ‡è´§ä½
        /// è´§ä½
        /// </summary>
        public string ToLocationCode { get; set; }
        public string LocationCode { get; set; }
        /// <summary>
        /// 1出库完成,2入库完成
        /// </summary>
        public int CompleteType { get; set; }
    }
}
ÏîÄ¿´úÂë/WCSServices/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs
@@ -15,10 +15,23 @@
        /// ä»»åŠ¡å·
        /// </summary>
        public string TaskCode { get; set; }
        /// <summary>
        /// ä»»åŠ¡ä¼˜å…ˆçº§
        /// </summary>
        public int TaskPriority { get; set; }
        /// <summary>
        /// ä»»åŠ¡ä¿¡æ¯
        /// </summary>
        public TaskDescribe TaskDescribe { get; set; }
    }
    /// <summary>
    /// ä»»åŠ¡ä¿¡æ¯
    /// </summary>
    public class TaskDescribe
    {
        /// <summary>
        /// æ–™ç®±å·
        /// </summary>
@@ -44,7 +57,9 @@
        /// </summary>
        public string ToLocationCode { get; set; }
    }
    /// <summary>
    /// æŽ¥æ”¶ä»»åŠ¡
    /// </summary>
    public class WMSTaskDTO
    {
        /// <summary>
@@ -64,4 +79,18 @@
        /// </summary>
        public List<TasksItem> Tasks { get; set; }
    }
    /// <summary>
    /// å–消任务
    /// </summary>
    public class TaskCancel
    {
        /// <summary>
        /// ä»»åŠ¡å·
        /// </summary>
        public string TaskCode { get; set; }
        /// <summary>
        /// æ–™ç®±ç¼–号
        /// </summary>
        public string ContainerCode { get; set; }
    }
}
ÏîÄ¿´úÂë/WCSServices/WIDESEAWCS_ITaskInfoService/ITaskService.cs
@@ -136,5 +136,21 @@
        /// </summary>
        /// <returns></returns>
        WebResponseContent TaskCompleted(int taskNum);
        /// <summary>
        /// äºŒæœŸæ’­ç§å¢™ä¸‹å‘
        /// </summary>
        /// <param name="lightSendDTOs"></param>
        /// <returns></returns>
        EPLightContent PickOrderInfoRequest(List<EPLightSendDTO> lightSendDTOs);
        /// <summary>
        /// äºŒæœŸæ’­ç§å¢™åˆå§‹åŒ–
        /// </summary>
        /// <returns></returns>
        EPLightContent INITIALIZATION();
        /// <summary>
        /// äºŒæœŸæ’­ç§å¢™ç»“束左右
        /// </summary>
        /// <returns></returns>
        EPLightContent ENDWORK();
    }
}
ÏîÄ¿´úÂë/WCSServices/WIDESEAWCS_Model/Models/BasicInfo/Dt_LocationInfo.cs
@@ -1,4 +1,5 @@
using SqlSugar;
using Magicodes.ExporterAndImporter.Core;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -17,78 +18,104 @@
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [ImporterHeader(Name = "主键")]
        [ExporterHeader(DisplayName = "主键")]
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// åº“区编号
        /// </summary>
        [ImporterHeader(IsIgnore = true)]
        [ExporterHeader(IsIgnore = true)]
        [SugarColumn(IsNullable = false, ColumnDescription = "库区编号")]
        public int WarehouseId { get; set; }
        /// <summary>
        /// æ–™ç®±ç¼–号
        /// </summary>
        [ImporterHeader(Name = "料箱编号")]
        [ExporterHeader(DisplayName = "料箱编号")]
        [SugarColumn(IsNullable = false, ColumnDescription = "料箱编号")]
        public string PalletCode { get; set; }
        /// <summary>
        /// è´§ä½ç¼–号
        /// </summary>
        [ImporterHeader(Name = "货位编号")]
        [ExporterHeader(DisplayName = "货位编号")]
        [SugarColumn(IsNullable = true, Length = 30, ColumnDescription = "货位编号")]
        public string LocationCode {  get; set; }
        /// <summary>
        /// è´§ä½åç§°
        /// </summary>
        [ImporterHeader(Name = "货位名称")]
        [ExporterHeader(DisplayName = "货位名称")]
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "货位名称")]
        public string LocationName { get; set; }
        /// <summary>
        /// å··é“编号
        /// </summary>
        [ImporterHeader(Name = "巷道编号")]
        [ExporterHeader(DisplayName = "巷道编号")]
        [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "巷道编号")]
        public string RoadwayNo {  get; set; }
        /// <summary>
        /// è´§ä½è¡Œ
        /// </summary>
        [ImporterHeader(Name = "货位行")]
        [ExporterHeader(DisplayName = "货位行")]
        [SugarColumn(IsNullable = true, ColumnDescription = "货位行")]
        public int Row {  get; set; }
        /// <summary>
        /// è´§ä½åˆ—
        /// </summary>
        [ImporterHeader(Name = "货位列")]
        [ExporterHeader(DisplayName = "货位列")]
        [SugarColumn(IsNullable = true, ColumnDescription = "货位列")]
        public int Columns { get; set; }
        /// <summary>
        /// è´§ä½å±‚
        /// </summary>
        [ImporterHeader(Name = "货位层")]
        [ExporterHeader(DisplayName = "货位层")]
        [SugarColumn(IsNullable = true, ColumnDescription = "货位层")]
        public int Layer {  get; set; }
        /// <summary>
        /// AGV取货点
        /// </summary>
        [ImporterHeader(Name = "AGV取货点")]
        [ExporterHeader(DisplayName = "AGV取货点")]
        [SugarColumn(IsNullable = true, ColumnDescription = "AGV取货点")]
        public string AgvPoint { get; set; }
        /// <summary>
        /// è´§ä½çŠ¶æ€
        /// </summary>
        [ImporterHeader(Name = "货位状态")]
        [ExporterHeader(DisplayName = "货位状态")]
        [SugarColumn(IsNullable = true, DefaultValue = "0", ColumnDescription = "货位状态")]
        public int LocationStatus {  get; set; }
        /// <summary>
        /// ç¦ç”¨çŠ¶æ€
        /// </summary>
        [ImporterHeader(Name = "禁用状态")]
        [ExporterHeader(DisplayName = "禁用状态")]
        [SugarColumn(IsNullable = true, DefaultValue = "0", ColumnDescription = "禁用状态")]
        public int EnableStatus { get; set; }
        /// <summary>
        /// å¤‡æ³¨
        /// </summary>
        [ImporterHeader(Name = "备注")]
        [ExporterHeader(DisplayName = "备注")]
        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "备注")]
        public string Remark {  get; set; }
    }
ÏîÄ¿´úÂë/WCSServices/WIDESEAWCS_Model/Models/TaskInfo/Dt_Task.cs
@@ -66,12 +66,16 @@
        /// <summary>
        /// æ‰˜ç›˜ç±»åž‹
        /// </summary>
        [ImporterHeader(Name = "托盘类型")]
        [ExporterHeader(IsIgnore =true)]
        [SugarColumn(IsNullable = false, ColumnDescription = "托盘类型")]
        public int PalletType { get; set; }
        /// <summary>
        /// è®¾å¤‡ç¼–号
        /// </summary>
        [ImporterHeader(Name = "设备编号")]
        [ExporterHeader(IsIgnore = true)]
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "设备编号")]
        public string DeviceCode { get; set; }
ÏîÄ¿´úÂë/WCSServices/WIDESEAWCS_Model/Models/TaskInfo/Dt_Task_Hty.cs
@@ -1,4 +1,7 @@
using System;
using Magicodes.ExporterAndImporter.Core;
using Org.BouncyCastle.Crypto;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -9,10 +12,14 @@
{
    public class Dt_Task_Hty : Dt_Task, IBaseHistoryEntity
    {
        [ImporterHeader(Name = "来源ID")]
        [ExporterHeader(DisplayName = "来源ID")]
        public int SourceId { get; set; }
        [ImporterHeader(Name = "操作类型")]
        [ExporterHeader(DisplayName = "操作类型")]
        public string OperateType { get; set; }
        [ImporterHeader(Name = "加入时间")]
        [ExporterHeader(DisplayName = "加入时间")]
        public DateTime InsertTime { get; set; }
    }
}
ÏîÄ¿´úÂë/WCSServices/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs
@@ -15,6 +15,7 @@
using WIDESEAWCS_Core.LogHelper;
using WIDESEAWCS_DTO;
using WIDESEAWCS_DTO.Agv;
using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
@@ -86,6 +87,73 @@
            }
            return content;
        }
        /// <summary>
        /// AGV任务请求
        /// </summary>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("WorkRequest"), AllowAnonymous]
        public AgvTaskReqContent WorkRequest([FromBody] AgvTaskRequestDTO agvTaskRequestDTO)
        {
            AgvTaskReqContent content = new AgvTaskReqContent();
            try
            {
                //获取任务
                Dt_Task? taskExist = _taskRepository.QueryFirst(x=>x.PalletCode==agvTaskRequestDTO.ContainerCode) ?? throw new Exception($"未找到料箱{agvTaskRequestDTO.ContainerCode}任务");
                //获取站台
                Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == agvTaskRequestDTO.PositionId) ?? throw new Exception($"未找到{agvTaskRequestDTO.PositionId}站台位置");
                IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode) ?? throw new Exception($"未找到对应设备{stationManger.StationDeviceCode}");
                OtherDevice commonConveyorLine = (OtherDevice)device;
                if (stationManger.StationType==StationTypeEnum.StationType_OnlyOutbound.ObjToInt())
                {
                    short IsPut = commonConveyorLine.Communicator.Read<short>("0");
                    if (IsPut != 256) throw new Exception($"{agvTaskRequestDTO.PositionId}禁止放箱");
                }
                else
                {
                    short IsTake = commonConveyorLine.Communicator.Read<short>("11");
                    if (IsTake != 256) throw new Exception($"{agvTaskRequestDTO.PositionId}禁止取箱");
                }
                content.OK();
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
        /// <summary>
        /// AGV作业完成
        /// </summary>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("WorkFinish"), AllowAnonymous]
        public AgvTaskReqContent WorkFinish([FromBody] AgvTaskRequestDTO agvTaskRequestDTO)
        {
            AgvTaskReqContent content = new AgvTaskReqContent();
            try
            {
                //获取站台
                Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == agvTaskRequestDTO.PositionId) ?? throw new Exception($"未找到{agvTaskRequestDTO.PositionId}站台位置");
                IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode) ?? throw new Exception($"未找到对应设备{stationManger.StationDeviceCode}");
                OtherDevice commonConveyorLine = (OtherDevice)device;
                if (stationManger.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt())
                {
                    commonConveyorLine.Communicator.Write("21", (short)256);
                }
                else
                {
                    commonConveyorLine.Communicator.Write("23", (short)256);
                }
                content.OK();
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
    }
}
ÏîÄ¿´úÂë/WCSServices/WIDESEAWCS_Server/Controllers/Task/TaskController.cs
@@ -2,6 +2,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Text;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseController;
@@ -71,15 +72,31 @@
                {
                    return WebResponseContent.Instance.Error($"未找到对应设备{stationManger.StationDeviceCode}");
                }
                CommonConveyorLine commonConveyorLine = (CommonConveyorLine)device;
                string PickBarCode = commonConveyorLine.GetValue<ConveyorLineDBName, string>(ConveyorLineDBName.R_PickBarCode, stationManger.StationCode).Trim();
                if (containerFlowDTO.ContainerCode!= PickBarCode) throw new Exception($"传入料箱码{containerFlowDTO.ContainerCode},输送料箱码{PickBarCode}数据错误");
                if (containerFlowDTO.Direction=="100")
                if (stationManger.StationDeviceCode== "CL1" || stationManger.StationDeviceCode == "CL2")
                {
                    WebResponseContent responseContent = Service.ContainerFlow(containerFlowDTO, stationManger.StationDeviceCode);
                    if (!responseContent.Status) throw new Exception(responseContent.Message);
                    OtherDevice commonConveyorLine = (OtherDevice)device;
                    byte[] bytesPick = commonConveyorLine.Communicator.Read("12", 5);
                    string PickBarCode = Encoding.UTF8.GetString(bytesPick).Replace("\0", "").Replace("\\0", "");
                    if (containerFlowDTO.ContainerCode != PickBarCode) throw new Exception($"传入料箱码{containerFlowDTO.ContainerCode},输送料箱码{PickBarCode}数据错误");
                    if (containerFlowDTO.Direction == "100")
                    {
                        WebResponseContent responseContent = Service.ContainerFlow(containerFlowDTO, stationManger.StationDeviceCode);
                        if (!responseContent.Status) throw new Exception(responseContent.Message);
                    }
                    commonConveyorLine.Communicator.Write("22", (short)(containerFlowDTO.Direction == "100" ? 256 : 512));
                }
                commonConveyorLine.SetValue(ConveyorLineDBName.W_PickToHode,(short)containerFlowDTO.Direction.ObjToInt(), stationManger.StationCode);
                else
                {
                    CommonConveyorLine commonConveyorLine = (CommonConveyorLine)device;
                    string PickBarCode = commonConveyorLine.GetValue<ConveyorLineDBName, string>(ConveyorLineDBName.R_PickBarCode, stationManger.StationCode).Trim();
                    if (containerFlowDTO.ContainerCode != PickBarCode) throw new Exception($"传入料箱码{containerFlowDTO.ContainerCode},输送料箱码{PickBarCode}数据错误");
                    if (containerFlowDTO.Direction == "100")
                    {
                        WebResponseContent responseContent = Service.ContainerFlow(containerFlowDTO, stationManger.StationDeviceCode);
                        if (!responseContent.Status) throw new Exception(responseContent.Message);
                    }
                    commonConveyorLine.SetValue(ConveyorLineDBName.W_PickToHode, (short)containerFlowDTO.Direction.ObjToInt(), stationManger.StationCode);
                }
                content.OK();
            }
            catch (Exception ex)
@@ -107,10 +124,21 @@
        /// </summary>
        /// <param name="taskNum"></param>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("RecWMSTaskCompleted"), AllowAnonymous]
        public WebResponseContent RecWMSTaskCompleted(int taskNum)
        [HttpPost, HttpGet, Route("RecTaskCompleted"), AllowAnonymous]
        public WebResponseContent RecTaskCompleted(int taskNum)
        {
            return Service.TaskCompleted(taskNum);
        }
        /// <summary>
        /// WMS任务取消同步
        /// </summary>
        /// <param name="taskNum"></param>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("CancelTask"), AllowAnonymous]
        public WebResponseContent CancelTask(List<TaskCancel> taskCancels)
        {
            return WebResponseContent.Instance.Error();
        }
    }
}
ÏîÄ¿´úÂë/WCSServices/WIDESEAWCS_Server/Controllers/WebAPIController.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,129 @@
using Autofac.Core;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Text;
using System.Text.RegularExpressions;
using WIDESEA_DTO.Agv;
using WIDESEA_External.Model;
using WIDESEAWCS_Common;
using WIDESEAWCS_Common.APIEnum;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Enums;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_Core.LogHelper;
using WIDESEAWCS_DTO;
using WIDESEAWCS_DTO.Agv;
using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_QuartzJob.DTO;
using WIDESEAWCS_QuartzJob.Models;
using WIDESEAWCS_QuartzJob.Repository;
using WIDESEAWCS_Tasks;
using WIDESEAWCS_Tasks.DBNames;
using static Dm.net.buffer.ByteArrayBuffer;
namespace WIDESEAWCS_Server.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class WebAPIController : ControllerBase
    {
        private readonly IStationMangerRepository _stationMangerRepository;
        private readonly ITaskService _taskService;
        private readonly ITaskRepository _taskRepository;
        private readonly IRouterRepository _routerRepository;
        public WebAPIController(IStationMangerRepository stationMangerRepository, ITaskService taskService, ITaskRepository taskRepository, IRouterRepository routerRepository)
        {
            _stationMangerRepository = stationMangerRepository;
            _taskService = taskService;
            _taskRepository = taskRepository;
            _routerRepository = routerRepository;
        }
        /// <summary>
        /// å›žè°ƒä¸Šä¼ 
        /// </summary>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("PickOrderCallBack"), AllowAnonymous]
        public EPLightContent? PickOrderCallBack([FromBody] List<EPLightBackDTO> lightBackDTOs)
        {
            EPLightContent content = new EPLightContent();
            try
            {
                if (lightBackDTOs==null)
                {
                    return content.Error("传入不能为空");
                }
                content.OK("接收成功");
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
        /// <summary>
        /// æ’­ç§å¢™ä¸‹å‘(二期)
        /// </summary>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("PickOrderInfoRequest"), AllowAnonymous]
        public EPLightContent PickOrderInfoRequest([FromBody] List<EPLightSendDTO> lightSendDTOs)
        {
            EPLightContent content = new EPLightContent();
            try
            {
                if (lightSendDTOs == null)
                {
                    return content.Error("传入不能为空");
                }
                content = _taskService.PickOrderInfoRequest(lightSendDTOs);
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
        /// <summary>
        /// æ’­ç§å¢™åˆå§‹åŒ–(二期)
        /// </summary>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("INITIALIZATION"), AllowAnonymous]
        public EPLightContent INITIALIZATION()
        {
            EPLightContent content = new EPLightContent();
            try
            {
                content = _taskService.INITIALIZATION();
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
        /// <summary>
        /// æ’­ç§å¢™ç»“束作业(二期)
        /// </summary>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("ENDWORK"), AllowAnonymous]
        public EPLightContent ENDWORK()
        {
            EPLightContent content = new EPLightContent();
            try
            {
                content = _taskService.ENDWORK();
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
    }
}
ÏîÄ¿´úÂë/WCSServices/WIDESEAWCS_Server/Filter/CustomProfile.cs
@@ -21,7 +21,7 @@
        {
            CreateMap<Sys_Menu, MenuDTO>();
            CreateMap<Dt_DeviceInfo,DeviceInfoDTO>();
            CreateMap<TasksItem, Dt_Task>().ForMember(a => a.WMSId, b => b.MapFrom(b => b.TaskCode)).ForMember(a => a.PalletCode, b => b.MapFrom(b => b.ContainerCode)).ForMember(a => a.Grade, b => b.MapFrom(b => b.TaskPriority));
            CreateMap<TasksItem, Dt_Task>().ForMember(a => a.WMSId, b => b.MapFrom(b => b.TaskCode)).ForMember(a => a.PalletCode, b => b.MapFrom(b => b.TaskDescribe.ContainerCode)).ForMember(a => a.Grade, b => b.MapFrom(b => b.TaskPriority));
        }
    }
}
ÏîÄ¿´úÂë/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -21,6 +21,7 @@
using SqlSugar;
using System.Diagnostics.CodeAnalysis;
using System.DirectoryServices.Protocols;
using System.Linq;
using System.Net.Http.Headers;
using System.Security.Policy;
using WIDESEA_DTO.Agv;
@@ -102,27 +103,38 @@
        public WebResponseContent ReceiveWMSTask([NotNull] WMSTaskDTO taskDTO)
        {
            WebResponseContent content = new WebResponseContent();
            string errorMsg = "";
            try
            {
                lock (lock_taskReceive)
                {
                    List<Dt_Task> tasks = new List<Dt_Task>();
                    List<Dt_LocationInfo> locationInfos = _locationInfoRepository.GetCanOut(taskDTO.Tasks.Select(x=>x.ContainerCode).ToList());
                    TasksItem? tasksItem = taskDTO.Tasks.FirstOrDefault(x => !locationInfos.Select(t => t.PalletCode).Contains(x.ContainerCode));
                    if (tasksItem != null) throw new Exception($"任务{tasksItem.TaskCode}料箱号{tasksItem.ContainerCode}不存在");
                    Dt_Task taskOld = BaseDal.QueryFirst(x=> taskDTO.Tasks.Select(x => x.TaskDescribe.ContainerCode).Contains(x.PalletCode));
                    if (taskOld != null) throw new Exception($"料箱{taskOld.PalletCode}"+(taskOld.TaskType == TaskTypeEnum.Inbound.ObjToInt() ? "入库任务已存在" : "出库任务已存在"));
                    List<Dt_LocationInfo> locationInfos = _locationInfoRepository.GetCanOut(taskDTO.Tasks.Select(x=>x.TaskDescribe.ContainerCode).ToList());
                    Dt_LocationInfo? noOutLocation = locationInfos.FirstOrDefault(x=>x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() || x.EnableStatus != EnableStatusEnum.Normal.ObjToInt());
                    if (noOutLocation != null) throw new Exception($"料箱{noOutLocation.PalletCode}货位{noOutLocation.LocationCode}状态不可出库");
                    List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData();
                    //下发任务组
                    string taskGroup= taskDTO.TaskGroupCode.IsNullOrEmpty() ? Guid.NewGuid().ToString().Replace("-","") : taskDTO.TaskGroupCode;
                    foreach (var item in taskDTO.Tasks.OrderBy(x=>x.ToStationCode))
                    foreach (var item in taskDTO.Tasks.OrderBy(x=>x.TaskDescribe.ToStationCode))
                    {
                        if (item.ToStationCode.IsNullOrEmpty()) throw new Exception($"任务{item.TaskCode}出库目标操作台不能为空");
                        if (item.TaskDescribe.ToStationCode.IsNullOrEmpty()) throw new Exception($"任务{item.TaskCode}出库目标操作台不能为空");
                        //获取操作台
                        Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.PickStationCode == item.ToStationCode);
                        if (stationManger == null) throw new Exception($"任务{item.TaskCode}出库目标操作台{item.ToStationCode}不存在");
                        Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.PickStationCode == item.TaskDescribe.ToStationCode);
                        if (stationManger == null) throw new Exception($"任务{item.TaskCode}出库目标操作台{item.TaskDescribe.ToStationCode}不存在");
                        Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.PalletCode == item.TaskDescribe.ContainerCode);
                        if (locationInfo == null)
                        {
                            errorMsg += $"料箱{item.TaskDescribe.ContainerCode}不存在;";
                            continue;
                        };
                        Dt_Task task = _mapper.Map<Dt_Task>(item);
                        Dt_LocationInfo locationInfo = locationInfos.FirstOrDefault(x=>x.PalletCode==item.ContainerCode);
                        task.SourceAddress = locationInfo.LocationCode;
                        task.CurrentAddress = locationInfo.LocationCode;
                        task.NextAddress = stationManger.PickStationCode;
@@ -147,7 +159,7 @@
                    _taskExecuteDetailService.AddTaskExecuteDetail(tasks.Select(x => x.TaskNum).ToList(), "接收WMS任务");
                    content = tasks.Count > 0 ? content.OK("成功") : content.Error("失败");
                    content = tasks.Count > 0 ? content.OK("成功!"+(errorMsg.IsNullOrEmpty()? "": errorMsg)) : content.Error("失败");
                }
            }
            catch (Exception ex)
@@ -170,12 +182,12 @@
                {
                    List<Dt_LocationInfo> locationInfos = _locationInfoRepository.QueryData();
                    Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x=>x.PalletCode== containerFlowDTO.ContainerCode);
                    if (locationInfo != null) throw new Exception($"料箱号{containerFlowDTO.ContainerCode}已存在");
                    if (locationInfo != null) throw new Exception($"库位料箱号{containerFlowDTO.ContainerCode}已存在");
                    if (BaseDal.QueryFirst(x=>x.PalletCode==containerFlowDTO.ContainerCode)!=null) throw new Exception($"料箱号{containerFlowDTO.ContainerCode}任务已存在");
                    Dt_LocationInfo? noInLocation = locationInfos.FirstOrDefault(x => x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt());
                    if (noInLocation == null) throw new Exception($"可用货位不足!");
                    Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt() && x.StationDeviceCode == deviceCode);
                    //下发任务组
                    //创建任务
                    Dt_Task task = new Dt_Task();
                    task.PalletCode = containerFlowDTO.ContainerCode;
                    task.SourceAddress = containerFlowDTO.SlotCode;
@@ -211,7 +223,7 @@
            {
                lock (lock_requestInTask)
                {
                    Dt_Task task = BaseDal.QueryFirst(x => x.PalletCode == barCode && x.NextAddress == stationCode && x.TaskState == TaskStatusEnum.CL_Executing.ObjToInt());
                    Dt_Task task = BaseDal.QueryFirst(x => x.PalletCode == barCode && x.TaskType==TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == stationCode && x.TaskState == TaskStatusEnum.CL_Executing.ObjToInt());
                    if (task == null) throw new Exception($"{barCode}料箱未找到任务!");
                    Dt_LocationInfo? locationInfo = _locationInfoService.AssignLocation();
                    if (locationInfo == null) throw new Exception($"可用货位不足!");
@@ -245,23 +257,11 @@
            DateTime beginDate = DateTime.Now;
            try
            {
                using (HttpContent httpContent = new StringContent(requestJson))
                using (HttpContent httpContent = new StringContent(string.Empty))
                {
                    httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
                    using HttpClient httpClient = new HttpClient();
                    httpClient.Timeout = new TimeSpan(0, 0, 30);
                    string LoginToken = AppSettings.Get("MESLoginToken");
                    headers = new Dictionary<string, string>
                    {
                        //正式
                        { "LoginToken", LoginToken }
                    };
                    if (headers != null)
                    {
                        foreach (var header in headers)
                            httpClient.DefaultRequestHeaders.Add(header.Key, header.Value);
                    }
                    HttpResponseMessage responseMessage = httpClient.PostAsync(serviceAddress, httpContent).Result;
                    result = responseMessage.Content.ReadAsStringAsync().Result;
                }
@@ -478,7 +478,7 @@
            try
            {
                Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum);
                if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)//出库任务逻辑
                if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)//出库任务完成逻辑
                {
                    Dt_LocationInfo locationInfo = _locationInfoRepository.QueryFirst(x=>x.PalletCode==task.PalletCode);
                    if (locationInfo.LocationStatus != LocationStatusEnum.Lock.ObjToInt())
@@ -488,32 +488,54 @@
                    task.TaskState = TaskStatusEnum.Finish.ObjToInt();
                    locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt();
                    locationInfo.PalletCode = "";
                    //料箱出库完成上报给WMS
                    string? url = _apiInfoRepository.QueryFirst(x => x.ApiCode == APIEnum.WMSInOutBoundBack.ToString())?.ApiAddress;
                    if (string.IsNullOrEmpty(url))
                    {
                        _taskExecuteDetailService.AddTaskExecuteDetail(task, $"未找到WMS出库上报接口,请检查接口配置");
                        UpdateTaskExceptionMessage(taskNum, $"未找到WMS出库上报接口,请检查接口配置");
                        return content.Error($"{taskNum},未找到WMS出库上报接口,请检查接口配置");
                    }
                    ContainerInFinishDTO containerInFinishDTO = new ContainerInFinishDTO()
                    {
                        TaskCode = task.TaskNum.ToString(),
                        ContainerCode = task.PalletCode,
                        StationCode = task.TargetAddress,
                        LocationCode = task.SourceAddress,
                        CompleteType = 1
                    };
                    string request = JsonConvert.SerializeObject(containerInFinishDTO, settings);
                    //调用接口
                    string response = HttpHelper.Post(url, request);
                    WMSResponseContent wMSResponse = JsonConvert.DeserializeObject<WMSResponseContent>(response) ?? throw new Exception($"{taskNum},未接收到WMS出库上报返回值");
                    if (wMSResponse.Code != "0") throw new Exception($"出库任务{task.TaskNum}WMS出库上报错误,信息:{wMSResponse.Msg}");
                    _unitOfWorkManage.BeginTran();
                    _locationInfoRepository.UpdateData(locationInfo);
                    BaseDal.DeleteAndMoveIntoHty(task, App.User?.UserId == 0 ? OperateTypeEnum.自动完成 : OperateTypeEnum.人工完成);
                    _unitOfWorkManage.CommitTran();
                }
                else if(task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//入库任务逻辑
                else if(task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//入库任务完成逻辑
                {
                    //string? url = _apiInfoRepository.QueryFirst(x => x.ApiCode == APIEnum.WMSInBoundBack.ToString())?.ApiAddress;
                    //if (string.IsNullOrEmpty(url))
                    //{
                    //    _taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"未找到WMS入库上报接口,请检查接口配置");
                    //    UpdateTaskExceptionMessage(taskNum, $"未找到WMS入库上报接口,请检查接口配置");
                    //    return content.Error($"{taskNum},未找到WMS入库上报接口,请检查接口配置");
                    //}
                    //ContainerInFinishDTO containerInFinishDTO = new ContainerInFinishDTO()
                    //{
                    //    TaskCode= task.TaskNum.ToString(),
                    //    ContainerCode = task.PalletCode,
                    //    FromStationCode = task.SourceAddress,
                    //    ToLocationCode = task.TargetAddress
                    //};
                    //string request = JsonConvert.SerializeObject(containerInFinishDTO, settings);
                    ////调用接口
                    //string response = HttpHelper.Post(url, request);
                    //WMSResponseContent wMSResponse = JsonConvert.DeserializeObject<WMSResponseContent>(response) ??throw new Exception($"{taskNum},未接收到WMS入库上报返回值");
                    //if (wMSResponse.Code!="0") throw new Exception($"入库任务{task.TaskNum}WMS入库上报错误,信息:{wMSResponse.Msg}");
                    string? url = _apiInfoRepository.QueryFirst(x => x.ApiCode == APIEnum.WMSInOutBoundBack.ToString())?.ApiAddress;
                    if (string.IsNullOrEmpty(url))
                    {
                        _taskExecuteDetailService.AddTaskExecuteDetail(task, $"未找到WMS入库上报接口,请检查接口配置");
                        UpdateTaskExceptionMessage(taskNum, $"未找到WMS入库上报接口,请检查接口配置");
                        return content.Error($"{taskNum},未找到WMS入库上报接口,请检查接口配置");
                    }
                    ContainerInFinishDTO containerInFinishDTO = new ContainerInFinishDTO()
                    {
                        TaskCode = task.TaskNum.ToString(),
                        ContainerCode = task.PalletCode,
                        StationCode = task.SourceAddress,
                        LocationCode = task.TargetAddress,
                        CompleteType = 2
                    };
                    string request = JsonConvert.SerializeObject(containerInFinishDTO, settings);
                    //调用接口
                    string response = HttpHelper.Post(url, request);
                    WMSResponseContent wMSResponse = JsonConvert.DeserializeObject<WMSResponseContent>(response) ?? throw new Exception($"{taskNum},未接收到WMS入库上报返回值");
                    if (wMSResponse.Code != "0") throw new Exception($"入库任务{task.TaskNum}WMS入库上报错误,信息:{wMSResponse.Msg}");
                    Dt_LocationInfo locationInfo = _locationInfoRepository.QueryFirst(x => x.LocationCode == task.TargetAddress);
                    if (locationInfo.LocationStatus != LocationStatusEnum.Lock.ObjToInt())
                    {
@@ -536,5 +558,88 @@
            }
            return content;
        }
        /// <summary>
        /// äºŒæœŸæ’­ç§å¢™ä¸‹å‘
        /// </summary>
        /// <param name="taskNum"></param>
        /// <returns></returns>
        public EPLightContent PickOrderInfoRequest(List<EPLightSendDTO> lightSendDTOs)
        {
            EPLightContent content = new EPLightContent();
            try
            {
                string? url = _apiInfoRepository.QueryFirst(x => x.ApiCode == APIEnum.PickOrderInfoRequest.ToString())?.ApiAddress;
                if (string.IsNullOrEmpty(url))
                {
                    return content.Error($"未找到播种墙下发接口,请检查接口配置");
                }
                string request = JsonConvert.SerializeObject(lightSendDTOs, settings);
                //调用接口
                string response = HttpHelper.Post(url, request);
                EPLightContent lightContent = JsonConvert.DeserializeObject<EPLightContent>(response) ?? throw new Exception($"未接收到播种墙下发上报返回值");
                if (lightContent.Result != "0") throw new Exception($"播种墙下发错误,信息:{lightContent.Msg}");
                content.OK("成功");
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
        /// <summary>
        /// äºŒæœŸæ’­ç§å¢™åˆå§‹åŒ–
        /// </summary>
        /// <param name="taskNum"></param>
        /// <returns></returns>
        public EPLightContent INITIALIZATION()
        {
            EPLightContent content = new EPLightContent();
            try
            {
                string? url = _apiInfoRepository.QueryFirst(x => x.ApiCode == APIEnum.INITIALIZATION.ToString())?.ApiAddress;
                if (string.IsNullOrEmpty(url))
                {
                    return content.Error($"未找到播种墙初始化接口,请检查接口配置");
                }
                //调用接口
                string response = Post(url);
                EPLightContent lightContent = JsonConvert.DeserializeObject<EPLightContent>(response) ?? throw new Exception($"未接收到播种墙初始化上报返回值");
                if (lightContent.Result != "0") throw new Exception($"播种墙初始化错误,信息:{lightContent.Msg}");
                content.OK("成功");
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
        /// <summary>
        /// äºŒæœŸæ’­ç§å¢™ç»“束作业
        /// </summary>
        /// <param name="taskNum"></param>
        /// <returns></returns>
        public EPLightContent ENDWORK()
        {
            EPLightContent content = new EPLightContent();
            try
            {
                string? url = _apiInfoRepository.QueryFirst(x => x.ApiCode == APIEnum.ENDWORK.ToString())?.ApiAddress;
                if (string.IsNullOrEmpty(url))
                {
                    return content.Error($"未找到播种墙结束作业接口,请检查接口配置");
                }
                //调用接口
                string response = Post(url);
                EPLightContent lightContent = JsonConvert.DeserializeObject<EPLightContent>(response) ?? throw new Exception($"未接收到播种墙结束作业上报返回值");
                if (lightContent.Result != "0") throw new Exception($"播种墙结束作业错误,信息:{lightContent.Msg}");
                content.OK("成功");
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
    }
}
ÏîÄ¿´úÂë/WCSServices/WIDESEAWCS_Tasks/AGV/AGVExtend.cs
@@ -22,8 +22,8 @@
        {
            try
            {
                var newTasksOut = _taskService.Db.Queryable<Dt_Task>().Where(x => (x.TaskState == TaskStatusEnum.AGV_Execute.ObjToInt()) && x.TaskType==TaskTypeEnum.Outbound.ObjToInt() && x.DeviceCode == "AGV").ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList();
                var newTasksIn = _taskService.Db.Queryable<Dt_Task>().Where(x => (x.TaskState == TaskStatusEnum.AGV_Execute.ObjToInt()) && x.TaskType == TaskTypeEnum.Inbound.ObjToInt() && x.DeviceCode == "AGV").ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList();
                var newTasksOut = _taskService.Db.Queryable<Dt_Task>().Where(x => (x.TaskState == TaskStatusEnum.AGV_Execute.ObjToInt()) && x.TaskType==TaskTypeEnum.Outbound.ObjToInt() && x.DeviceCode == "AGV").ToList().OrderBy(x => x.Grade).ThenBy(x => x.TaskNum).ToList();
                var newTasksIn = _taskService.Db.Queryable<Dt_Task>().Where(x => (x.TaskState == TaskStatusEnum.AGV_Execute.ObjToInt()) && x.TaskType == TaskTypeEnum.Inbound.ObjToInt() && x.DeviceCode == "AGV").ToList().OrderBy(x => x.Grade).ThenBy(x => x.TaskNum).ToList();
                #region å‡ºåº“任务下发
                if (newTasksOut.Count>0)
                {
ÏîÄ¿´úÂë/WCSServices/WIDESEAWCS_Tasks/Ò»ÆÚÏßÌå/ConveyorLineJob1.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,142 @@
using Autofac.Core;
using Microsoft.AspNetCore.Components.Routing;
using Newtonsoft.Json;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Math;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
using Quartz;
using System;
using System.Collections.Generic;
using System.IdentityModel.Tokens.Jwt;
using System.Linq;
using System.Reflection.Metadata;
using System.Text;
using System.Text.Unicode;
using System.Threading.Tasks;
using WIDESEAWCS_Common;
using WIDESEAWCS_Common.Helper;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Communicator;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_QuartzJob.ConveyorLine.Enum;
using WIDESEAWCS_QuartzJob.DTO;
using WIDESEAWCS_QuartzJob.Models;
using WIDESEAWCS_QuartzJob.Repository;
using WIDESEAWCS_QuartzJob.Service;
using WIDESEAWCS_Tasks.DBNames;
using ICacheService = WIDESEAWCS_Core.Caches.ICacheService;
namespace WIDESEAWCS_Tasks
{
    [DisallowConcurrentExecution]
    public class ConveyorLineJob1 : JobBase, IJob
    {
        private readonly ICacheService _cacheService;
        private readonly ITaskService _taskService;
        private readonly ITaskExecuteDetailService _taskExecuteDetailService;
        private readonly ITaskRepository _taskRepository;
        private readonly IStationMangerRepository _stationMangerRepository;
        private readonly IRouterRepository _routerRepository;
        private readonly IRouterService _routerService;
        private readonly IRouterExtension _routerExtension;
        public ConveyorLineJob1(ICacheService cacheService, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IRouterService routerService, IRouterExtension routerExtension)
        {
            _cacheService = cacheService;
            _taskService = taskService;
            _taskExecuteDetailService = taskExecuteDetailService;
            _taskRepository = taskRepository;
            _stationMangerRepository = stationMangerRepository;
            _routerRepository = routerRepository;
            _routerService = routerService;
            _routerExtension = routerExtension;
        }
        /*
        1号位出库口允许放箱        0
        1号位放箱完成信号          21
        6号位拣选位料箱到达        1
        6号位拣选位料箱条码        2
        6号位拣选位料箱流动        22
        8号位入库口允许取箱        11
        8号位入库口料箱条码        12
        8号位机器人取箱完成        23
        */
        public Task Execute(IJobExecutionContext context)
        {
            try
            {
                bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value);
                if (flag && value != null)
                {
                    OtherDevice device = (OtherDevice)value;
                    List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StationDeviceCode == device.DeviceCode);
                    foreach (var station in stationMangers)
                    {
                        if (station.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt())
                        {
                            //拣选申请
                            short pickArrived = device.Communicator.Read<short>("1");
                            if (pickArrived == 256)
                            {
                                byte[] bytesPick = device.Communicator.Read("2", 5);
                                string pickBarCode = Encoding.UTF8.GetString(bytesPick).Replace("\0", "").Replace("\\0", "");
                                //上报WMS料箱到达
                                if (pickBarCode.IsNotEmptyOrNull())
                                {
                                    WebResponseContent content = _taskService.WMSPickUp(station.PickStationCode, pickBarCode);
                                    if (content.Status)
                                    {
                                        WriteInfo(device.DeviceCode, $"{station.PickStationCode}拣选申请上报成功{pickBarCode}");
                                    }
                                    else
                                    {
                                        WriteError(device.DeviceCode, $"{station.PickStationCode}拣选申请上报WMS错误{pickBarCode},信息{content.Message}");
                                    }
                                }
                                else
                                {
                                    WriteError(device.DeviceCode, $"{station.PickStationCode}拣选申请为{pickArrived}条码为空值");
                                }
                            }
                        }
                        else
                        {
                            //入库申请
                            short InTake = device.Communicator.Read<short>("11");
                            byte[] bytesIn = device.Communicator.Read("12", 5);
                            string InBarCode = Encoding.UTF8.GetString(bytesIn).Replace("\0", "").Replace("\\0", "");
                            if (InTake==256 && InBarCode.IsNotEmptyOrNull())
                            {
                                //申请入库任务
                                Dt_Task task = _taskRepository.QueryFirst(x => x.PalletCode == InBarCode && x.TaskType == TaskTypeEnum.Inbound.ObjToInt() && x.TaskState != TaskStatusEnum.CL_Executing.ObjToInt());
                                if (task != null) continue;
                                WebResponseContent content = _taskService.RequestInTask(station.StationCode, InBarCode);
                                if (content.Status)
                                {
                                    WriteInfo(device.DeviceCode, $"站台{station.StationCode}料箱{InBarCode}申请入库成功");
                                }
                                else
                                {
                                    WriteError(device.DeviceCode, $"站台{station.StationCode}料箱{InBarCode}申请入库任务错误,信息{content.Message}");
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                WriteError(nameof(ConveyorLineJob1), ex.Message);
            }
            return Task.CompletedTask;
        }
    }
}
ÏîÄ¿´úÂë/WCSServices/WIDESEAWCS_Tasks/¶þÆÚÏßÌå/ConveyorLineJob2.cs
@@ -60,21 +60,22 @@
                                //上报WMS料箱到达
                                if (PickBarCode.IsNotEmptyOrNull())
                                {
                                    //WebResponseContent content = _taskService.WMSPickUp(station.PickStationCode, PickBarCode);
                                    WebResponseContent content = WebResponseContent.Instance.OK();
                                    WebResponseContent content = _taskService.WMSPickUp(station.PickStationCode, PickBarCode);
                                    //WebResponseContent content = WebResponseContent.Instance.OK();
                                    if (content.Status)
                                    {
                                        //写入拣选确认
                                        conveyorLine.SetValue(ConveyorLineDBName.W_PickToHode, (short)300, station.StationCode);
                                        WriteInfo(conveyorLine.DeviceCode, $"{station.PickStationCode}拣选申请上报成功{PickBarCode}");
                                    }
                                    else
                                    {
                                        WriteError(nameof(conveyorLine.DeviceCode), $"{station.PickStationCode}拣选申请上报WMS错误,信息{content.Message}");
                                        WriteError(conveyorLine.DeviceCode, $"{station.PickStationCode}拣选申请上报WMS错误{PickBarCode},信息{content.Message}");
                                    }
                                }
                                else
                                {
                                    WriteError(nameof(conveyorLine.DeviceCode), $"{station.PickStationCode}拣选申请为{PickRequest}条码为空值");
                                    WriteError(conveyorLine.DeviceCode, $"{station.PickStationCode}拣选申请为{PickRequest}条码为空值");
                                }
                            }
                            
@@ -97,15 +98,16 @@
                                    {
                                        //写入入库确认
                                        conveyorLine.SetValue(ConveyorLineDBName.W_InResponse, true, station.StationCode);
                                        WriteInfo(conveyorLine.DeviceCode, $"站台{station.StationCode}料箱{InBarCode}申请入库成功");
                                    }
                                    else
                                    {
                                        WriteError(nameof(conveyorLine.DeviceCode), $"站台{station.StationCode}料箱{InBarCode}申请入库任务错误,信息{content.Message}");
                                        WriteError(conveyorLine.DeviceCode, $"站台{station.StationCode}料箱{InBarCode}申请入库任务错误,信息{content.Message}");
                                    }
                                }
                                else
                                {
                                    WriteError(nameof(conveyorLine.DeviceCode), $"站台{station.StationCode}入库申请为{InRequest}条码为空值");
                                    WriteError(conveyorLine.DeviceCode, $"站台{station.StationCode}入库申请为{InRequest}条码为空值");
                                }
                            }
                        }
ÏîÄ¿×ÊÁÏ/AGVͨÐÅÎĵµ/WCSÓëRCS°²È«½»»¥½Ó¿ÚÎĵµV1.6_11_13.pdf
Binary files differ
ÏîÄ¿×ÊÁÏ/Ò»ÆÚ¶Ô½ÓÏà¹Ø×ÊÁÏ/¹þ¶û±õÒ»ÆÚÊäËÍÏß¶Ô½ÓЭÒémodbusTcpЭÒéV1.1.xlsx
Binary files differ
ÏîÄ¿×ÊÁÏ/Ò»ÆÚ¶Ô½ÓÏà¹Ø×ÊÁÏ/²¥ÖÖǽ±¨ÎÄ.docx
Binary files differ
ÏîÄ¿×ÊÁÏ/½Ó¿Ú»ã×ÜÎļþ/EPLight Web API ½Ó¿ÚÎĵµ1.1.docx
Binary files differ
ÏîÄ¿×ÊÁÏ/½Ó¿Ú»ã×ÜÎļþ/WMS½Ó¿Ú.docx
Binary files differ
ÏîÄ¿×ÊÁÏ/½Ó¿Ú»ã×ÜÎļþ/WMS½Ó¿Ú¶Ô½ÓÎĵµ20251202_V1.1.3.docx
Binary files differ