dengjunjie
2025-01-07 ceb8c334e8ca10d569b4c7f72b74126ce1877e48
添加辅料仓功能,优化测试架仓代码
已修改9个文件
已复制1个文件
已重命名3个文件
已添加3个文件
1082 ■■■■■ 文件已修改
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/APIEnum/APIEnum.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/Agv/AgvTaskDTO.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/CTU_AGVController .cs 272 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/InvokeAGVService.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGV/AGV_CSJExtend.cs 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGV/AGV_CSJob.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/辅料仓/AGV_FLExtend.cs 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/辅料仓/AGV_FLJob.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/淮安PDA/common/config.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/淮安PDA/pages/stash/InPinku.vue 522 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/淮安PDA/pages/stash/boxing.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/APIEnum/APIEnum.cs
@@ -10,16 +10,22 @@
    public enum APIEnum
    {
        /// <summary>
        /// AGV发送任务接口
        /// æµ‹è¯•æž¶AGV发送任务接口
        /// </summary>
        [Description("AGV发送任务接口")]
        AgvSendTask,
        [Description("测试架AGV发送任务接口")]
        Agv_CSJSendTask,
        /// <summary>
        /// AGV安全信号回复
        /// æµ‹è¯•æž¶AGV安全信号回复
        /// </summary>
        [Description("AGV安全信号回复")]
        AgvSecureReply,
        [Description("测试架AGV安全信号回复")]
        Agv_CSJSecureReply,
        /// <summary>
        /// è¾…æ–™AGV任务发送
        /// </summary>
        [Description("辅料AGV任务发送")]
        Agv_FLSendTask,
        /// <summary>
        /// å›žè°ƒWMS任务完成
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/Agv/AgvTaskDTO.cs
@@ -28,6 +28,10 @@
        /// </summary>
        public List<CodePath> PositionCodePath { get; set; }
        /// <summary>
        /// æ‰˜ç›˜å·
        /// </summary>
        public string ctnrCode {  get; set; }
        /// <summary>
        /// è½½å…·ç¼–号
        /// </summary>
        public string PodCode { get; set; }
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs
@@ -23,6 +23,7 @@
using System.Text;
using System.Threading.Tasks;
using WIDESEA_DTO.Agv;
using WIDESEAWCS_Common.APIEnum;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseServices;
@@ -138,7 +139,7 @@
        /// </summary>
        /// <param name="taskModel"></param>
        /// <returns></returns>
        WebResponseContent AgvSendTask(AgvTaskDTO taskModel);
        WebResponseContent AgvSendTask(AgvTaskDTO taskModel, APIEnum SendTask = APIEnum.Agv_CSJSendTask);
        /// <summary>
        /// å®‰å…¨ä¿¡å·ç”³è¯·
        /// </summary>
@@ -150,7 +151,7 @@
        /// </summary>
        /// <param name="secureModel"></param>
        /// <returns></returns>
        WebResponseContent AgvSecureReply(AgvSecureReplyDTO secureReplyModel);
        WebResponseContent AgvSecureReply(AgvSecureReplyDTO secureReplyModel, APIEnum SecureReply = APIEnum.Agv_CSJSecureReply);
        /// <summary>
        /// AGV任务状态刷新
        /// </summary>
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/CTU_AGVController .cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,272 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WIDESEA_DTO.Agv;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Enums;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_Tasks;
namespace WIDESEAWCS_Server.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class CTU_AGVController : ControllerBase
    {
        private readonly IStationMangerRepository _stationMangerRepository;
        private readonly ITaskService _taskService;
        private readonly ITaskRepository _taskRepository;
        public CTU_AGVController(IStationMangerRepository stationMangerRepository, ITaskService taskService, ITaskRepository taskRepository)
        {
            _stationMangerRepository = stationMangerRepository;
            _taskService = taskService;
            _taskRepository = taskRepository;
        }
        #region å®‰å…¨ä¿¡å·ç”³è¯·
        /// <summary>
        /// å®‰å…¨ä¿¡å·ç”³è¯· AGV-WCS
        /// </summary>
        /// <param name="secureApplyModel"></param>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("AgvSecureApply"), AllowAnonymous]
        public AgvResponseContent AgvSecureApply([FromBody] AgvSecureApplyDTO secureApplyModel)
        {
            AgvResponseContent agvResponseContent = new AgvResponseContent();
            agvResponseContent.ReqCode = secureApplyModel.ReqCode;
            try
            {
                var task = _taskRepository.QueryFirst(x => secureApplyModel.TaskCode == x.AgvTaskNum);
                if (task == null) throw new Exception("未找到任务");
                if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt())
                {
                    var content = PutRequest(task.NextAddress, task.PalletType);
                }
                else
                {
                    var content = TakeRequest(task.CurrentAddress);
                }
                task.TaskState = TaskStatusEnum.AGV_WaitToExecute.ObjToInt();
                var up = _taskRepository.UpdateData(task);
                agvResponseContent.Code = up ? "0" : "1";
                agvResponseContent.Message = up ? "成功" : "失败";
            }
            catch (Exception ex)
            {
                agvResponseContent.Code = "1";
                agvResponseContent.Message = ex.Message;
            }
            return agvResponseContent;
            //return _taskService.AgvSecureApply(secureApplyModel);
        }
        #endregion
        /// <summary>
        /// CtuAGV任务更新/完成
        /// </summary>
        /// <param name="agvUpdateModel"></param>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("CtuCallback"), AllowAnonymous]
        public AgvResponseContent CtuCallback([FromBody] AgvUpdateDTO agvUpdateModel)
        {
            AgvResponseContent agvResponseContent = new AgvResponseContent();
            try
            {
                if (agvUpdateModel == null) throw new Exception("未获取到请求参数");
                agvResponseContent.ReqCode = agvUpdateModel.ReqCode;
                var task = _taskRepository.QueryFirst(x => agvUpdateModel.TaskCode == x.AgvTaskNum);
                if (task == null) throw new Exception($"未找到任务,任务号【{agvUpdateModel.TaskCode}】");
                if (agvUpdateModel.Method == "end")
                {
                    if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt()) PutFinish(task.NextAddress);
                    _taskService.TaskCompleted(task.TaskNum);
                }
                agvResponseContent.Code = "0";
                agvResponseContent.Message = "成功";
            }
            catch (Exception ex)
            {
                agvResponseContent.Code = "1";
                agvResponseContent.Message = ex.Message;
            }
            return agvResponseContent;
        }
        /// <summary>
        /// æ”¾è´§è¯·æ±‚
        /// </summary>
        /// <param name="code"></param>
        /// <param name="palletType"></param>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("PutRequest"), AllowAnonymous]
        public WebResponseContent PutRequest(string code, int palletType)
        {
            try
            {
                Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == code);
                if (stationManger == null)
                {
                    return WebResponseContent.Instance.Error($"未找到站台配置");
                }
                IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode);
                if (device == null)
                {
                    return WebResponseContent.Instance.Error($"未找到对应设备");
                }
                OtherDevice otherDevice = (OtherDevice)device;
                bool canPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode);
                if (canPut)
                {
                    otherDevice.SetValue(GroundStationDBName.W_PutRequest, true, stationManger.StationCode);
                    return WebResponseContent.Instance.OK();
                }
                else
                {
                    otherDevice.SetValue(GroundStationDBName.W_PutRequest, true, stationManger.StationCode);
                    Thread.Sleep(1000);
                    canPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode);
                    if (canPut)
                    {
                        return WebResponseContent.Instance.OK();
                    }
                    else
                    {
                        return WebResponseContent.Instance.Error($"放货申请中");
                    }
                }
            }
            catch (Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        //[HttpPost, HttpGet, Route("PutFinish"), AllowAnonymous]
        /// <summary>
        /// æ”¾è´§å®Œæˆ
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("PutFinish"), AllowAnonymous]
        public WebResponseContent PutFinish(string code)
        {
            try
            {
                Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == code);
                if (stationManger == null)
                {
                    return WebResponseContent.Instance.Error($"未找到站台配置");
                }
                IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode);
                if (device == null)
                {
                    return WebResponseContent.Instance.Error($"未找到对应设备");
                }
                OtherDevice otherDevice = (OtherDevice)device;
                otherDevice.SetValue(GroundStationDBName.W_PutFinish, true, stationManger.StationCode);
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        //[HttpPost, HttpGet, Route("TakeRequest"), AllowAnonymous]
        /// <summary>
        /// å–货请求
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("TakeRequest"), AllowAnonymous]
        public WebResponseContent TakeRequest(string code)
        {
            try
            {
                Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == code);
                if (stationManger == null)
                {
                    return WebResponseContent.Instance.Error($"未找到站台配置");
                }
                IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode);
                if (device == null)
                {
                    return WebResponseContent.Instance.Error($"未找到对应设备");
                }
                OtherDevice otherDevice = (OtherDevice)device;
                bool canPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, stationManger.StationCode);
                if (canPut)
                {
                    otherDevice.SetValue(GroundStationDBName.W_TakeRequest, true, stationManger.StationCode);
                    return WebResponseContent.Instance.OK();
                }
                else
                {
                    otherDevice.SetValue(GroundStationDBName.W_TakeRequest, true, stationManger.StationCode);
                    Thread.Sleep(1000);
                    canPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, stationManger.StationCode);
                    if (canPut)
                    {
                        return WebResponseContent.Instance.OK();
                    }
                    else
                    {
                        return WebResponseContent.Instance.Error($"取货申请中");
                    }
                }
            }
            catch (Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        //[HttpPost, HttpGet, Route("TakeFinish"), AllowAnonymous]
        /// <summary>
        /// å–货完成
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("TakeFinish"), AllowAnonymous]
        public WebResponseContent TakeFinish(string code)
        {
            try
            {
                Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == code);
                if (stationManger == null)
                {
                    return WebResponseContent.Instance.Error($"未找到站台配置");
                }
                IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode);
                if (device == null)
                {
                    return WebResponseContent.Instance.Error($"未找到对应设备");
                }
                OtherDevice otherDevice = (OtherDevice)device;
                otherDevice.SetValue(GroundStationDBName.W_TakeFinish, true, stationManger.StationCode);
                Thread.Sleep(1000);
                otherDevice.SetValue(GroundStationDBName.W_TakeFinish, false, stationManger.StationCode);
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/InvokeAGVService.cs
@@ -19,14 +19,14 @@
        /// </summary>
        /// <param name="taskModel"></param>
        /// <returns></returns>
        public WebResponseContent AgvSendTask(AgvTaskDTO taskModel)
        public WebResponseContent AgvSendTask(AgvTaskDTO taskModel, APIEnum SendTask = APIEnum.Agv_CSJSendTask)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                string? apiAddress = apiInfos.FirstOrDefault(x => x.ApiCode == APIEnum.AgvSendTask.ToString())?.ApiAddress;
                if (string.IsNullOrEmpty(apiAddress))
                    return WebResponseContent.Instance.Error($"未找到发送AGV任务接口,请检查接口配置"); // AppSettings.Get(APIEnum.AgvSendTask.ToString());
                string? apiAddress = apiInfos.FirstOrDefault(x => x.ApiCode == SendTask.ToString())?.ApiAddress;
                if (string.IsNullOrEmpty(apiAddress))
                    return WebResponseContent.Instance.Error($"未找到发送AGV任务接口,请检查接口配置");
                string response = HttpHelper.Post(apiAddress, taskModel.Serialize());
                AgvResponseContent agvContent = response.DeserializeObject<AgvResponseContent>();
                if (agvContent.Code == "0")
@@ -56,14 +56,14 @@
        /// </summary>
        /// <param name="secureModel"></param>
        /// <returns></returns>
        public WebResponseContent AgvSecureReply(AgvSecureReplyDTO secureReplyModel)
        public WebResponseContent AgvSecureReply(AgvSecureReplyDTO secureReplyModel, APIEnum SecureReply = APIEnum.Agv_CSJSecureReply)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                string? apiAddress = apiInfos.FirstOrDefault(x => x.ApiCode == APIEnum.AgvSecureReply.ToString())?.ApiAddress;
                string? apiAddress = apiInfos.FirstOrDefault(x => x.ApiCode == SecureReply.ToString())?.ApiAddress;
                if (string.IsNullOrEmpty(apiAddress))
                    return WebResponseContent.Instance.Error($"未找到发送AGV任务接口,请检查接口配置"); // AppSettings.Get(APIEnum.AgvSendTask.ToString());// AppSettings.Get(APIEnum.AgvSecureReply.ToString());
                    return WebResponseContent.Instance.Error($"未找到发送AGV任务接口,请检查接口配置");
                string response = HttpHelper.Post(apiAddress, secureReplyModel.Serialize());
                AgvResponseContent agvContent = response.DeserializeObject<AgvResponseContent>();
                if (agvContent.Code == "0")
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -116,7 +116,8 @@
                Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum);
                if (task != null)
                {
                    BaseDal.DeleteAndMoveIntoHty(task, App.User == null ? OperateTypeEnum.自动完成 : OperateTypeEnum.人工完成);
                    task.TaskState = TaskStatusEnum.Finish.ObjToInt();
                    BaseDal.DeleteAndMoveIntoHty(task, App.User?.UserId == 0 ? OperateTypeEnum.自动完成 : OperateTypeEnum.人工完成);
                }
                string? url = apiInfos.FirstOrDefault(x => x.ApiCode == APIEnum.FeedBackWMSTaskCompleted.ToString())?.ApiAddress;
                if (string.IsNullOrEmpty(url))
@@ -189,7 +190,7 @@
                        if (routers.Count == 1)
                        {
                            if(taskTypeGroup == TaskTypeGroup.InboundGroup && item.TargetAddress == stationManger.StackerCraneCode)
                            if (taskTypeGroup == TaskTypeGroup.InboundGroup && item.TargetAddress == stationManger.StackerCraneCode)
                            {
                                task.NextAddress = router.NextPosi;
                                task.DeviceCode = stationManger.StationDeviceCode;
@@ -197,7 +198,15 @@
                            else
                            {
                                task.NextAddress = item.TargetAddress;
                                task.DeviceCode = stationManger.StationDeviceCode;
                                if (item.RoadWay.Contains("AGV"))
                                {
                                    task.DeviceCode = item.RoadWay;
                                    task.AgvTaskNum = task.DeviceCode + DateTime.Now.ToString("yyyyMMdd") + item.TaskNum;
                                }
                                else
                                {
                                    task.DeviceCode = stationManger.StationDeviceCode;
                                }
                            }
                        }
                        else
@@ -210,7 +219,7 @@
                    {
                        if (taskTypeGroup == TaskTypeGroup.OutbondGroup)
                        {
                            task.AgvTaskNum = "AGV-" + DateTime.Now.ToString("yyyyMMdd") + item.TaskNum;
                            task.AgvTaskNum = item.AGVArea + DateTime.Now.ToString("yyyyMMdd") + item.TaskNum;
                            List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && item.AGVArea == x.NextPosi);
                            if (routers.FirstOrDefault() == null)
                            {
@@ -224,7 +233,7 @@
                        }
                        else
                        {
                            task.AgvTaskNum = "AGV-" + DateTime.Now.ToString("yyyyMMdd") + item.TaskNum;
                            task.AgvTaskNum = item.AGVArea + DateTime.Now.ToString("yyyyMMdd") + item.TaskNum;
                            List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && item.AGVArea == x.StartPosi);
                            if (routers.FirstOrDefault() == null)
                            {
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGV/AGV_CSJExtend.cs
ÎļþÃû´Ó ´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGV/AGVExtend.cs ÐÞ¸Ä
@@ -14,7 +14,7 @@
namespace WIDESEAWCS_Tasks
{
    public partial class AGVJob
    public partial class AGV_CSJJob
    {
        /// <summary>
        /// ä¸‹å‘AGV任务
@@ -23,7 +23,7 @@
        {
            try
            {
                var newTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskStatusEnum.AGV_Execute.ObjToInt()).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList();
                var newTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskStatusEnum.AGV_Execute.ObjToInt() && nameof(AGV_CSJJob).Contains(x.DeviceCode)).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList();
                foreach (var agvTask in newTasks)
                {
                    try
@@ -66,14 +66,14 @@
                        agvTask.TaskState = TaskStatusEnum.Exception.ObjToInt();
                        //agvTask.Remark = content.Data.ObjToString();
                        agvTask.ExceptionMessage = ex.Message;
                        WriteError(nameof(AGVJob), ex.Message, ex);
                        WriteError(nameof(AGV_CSJJob), ex.Message, ex);
                    }
                }
                _taskService.UpdateData(newTasks);
            }
            catch (Exception ex)
            {
                WriteError(nameof(AGVJob), ex.Message, ex);
                WriteError(nameof(AGV_CSJJob), ex.Message, ex);
            }
        }
        /// <summary>
@@ -83,10 +83,10 @@
        {
            try
            {
                var WaitToTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskStatusEnum.AGV_WaitToExecute.ObjToInt()).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList();
                var WaitToTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskStatusEnum.AGV_WaitToExecute.ObjToInt() && nameof(AGV_CSJJob).Contains(x.DeviceCode)).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList();
                foreach (var WaitToTask in WaitToTasks)
                {
                    if(WaitToTask.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)
                    if (WaitToTask.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)
                    {
                        Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == WaitToTask.NextAddress);
                        if (stationManger == null)
@@ -101,7 +101,7 @@
                        OtherDevice otherDevice = (OtherDevice)device;
                        bool canPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode);
                        bool requestPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutRequest, stationManger.StationCode);
                        if(!requestPut)
                        if (!requestPut)
                        {
                            otherDevice.SetValue(GroundStationDBName.W_PutRequest, true, stationManger.StationCode);
                            continue;
@@ -157,7 +157,7 @@
            }
            catch (Exception ex)
            {
                Console.Out.WriteLine(nameof(AGVJob) + ":" + ex.Message);
                Console.Out.WriteLine(nameof(AGV_CSJJob) + ":" + ex.Message);
            }
        }
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGV/AGV_CSJob.cs
ÎļþÃû´Ó ´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGV/AGVJob.cs ÐÞ¸Ä
@@ -21,7 +21,7 @@
namespace WIDESEAWCS_Tasks
{
    [DisallowConcurrentExecution]
    public partial class AGVJob : JobBase, IJob
    public partial class AGV_CSJJob : JobBase, IJob
    {
        public readonly ITaskService _taskService;
        private readonly ITaskExecuteDetailService _taskExecuteDetailService;
@@ -29,7 +29,7 @@
        private readonly IStationMangerRepository _stationMangerRepository;
        private readonly IMapper _mapper;
        public AGVJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IStationMangerRepository stationMangerRepository, IMapper mapper)
        public AGV_CSJJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IStationMangerRepository stationMangerRepository, IMapper mapper)
        {
            _taskService = taskService;
            _taskExecuteDetailService = taskExecuteDetailService;
@@ -47,7 +47,7 @@
            }
            catch (Exception ex)
            {
                Console.Out.WriteLine(nameof(AGVJob) + ":" + ex.Message);
                Console.Out.WriteLine(nameof(AGV_CSJJob) + ":" + ex.Message);
            }
            return Task.CompletedTask;
        }
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/¸¨ÁϲÖ/AGV_FLExtend.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,106 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_DTO.Agv;
using WIDESEAWCS_Common.APIEnum;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_Tasks.StackerCraneJob;
namespace WIDESEAWCS_Tasks
{
    public partial class AGV_FLJob
    {
        /// <summary>
        /// ä¸‹å‘AGV任务
        /// </summary>
        public void SendAGVTask()
        {
            try
            {
                var newTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskStatusEnum.New.ObjToInt() && nameof(AGV_FLJob).Contains(x.DeviceCode)).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList();
                foreach (var task in newTasks)
                {
                    try
                    {
                        if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt())
                            task.CurrentAddress = GetAGVAddress(task.CurrentAddress);
                        else
                            task.NextAddress = GetAGVAddress(task.NextAddress);
                        AgvTaskDTO taskDTO = new AgvTaskDTO()
                        {
                            TaskCode = task.AgvTaskNum,
                            ReqCode = DateTime.Now.ToString("yyyyMMddHHmmss"),
                            TaskTyp = task.TaskType == TaskTypeEnum.Outbound.ObjToInt() ? "FLC" : "FLR",
                            ctnrCode = task.PalletCode,
                            PositionCodePath = new List<CodePath>()
                        {
                            new CodePath()
                            {
                                type="05",
                                positionCode=task.CurrentAddress
                            },
                            new CodePath()
                            {
                                type="05",
                                positionCode=task.NextAddress
                            }
                        },
                        };
                        //WebResponseContent content = _taskService.AgvSendTask(taskDTO, APIEnum.Agv_FLSendTask);
                        //if (!content.Status) throw new Exception(content.Message);
                        task.TaskState = TaskStatusEnum.AGV_Executing.ObjToInt();
                    }
                    catch (Exception ex)
                    {
                        task.TaskState = TaskStatusEnum.Exception.ObjToInt();
                        task.ExceptionMessage = ex.Message;
                    }
                }
                _taskService.UpdateData(newTasks);
            }
            catch (Exception ex)
            {
                WriteError(nameof(AGV_FLJob), ex.Message, ex);
            }
        }
        /// <summary>
        /// èŽ·å–AGV地址
        /// </summary>
        /// <param name="Address"></param>
        /// <returns></returns>
        public static string GetAGVAddress(string Address)
        {
            string[] targetCodes = Address.Split("-");
            if (targetCodes.Length == 5)
            {
                var Row = Convert.ToInt16(targetCodes[1]);
                var Column = Convert.ToInt16(targetCodes[2]);
                var Layer = Convert.ToInt16(targetCodes[3]);
                var a = Row switch
                {
                    1 => "A1",
                    2 => "B1",
                    3 => "C1",
                    4 => "D1",
                    5 => "E1",
                    _ => throw new Exception($"未定义的排,地址:【{Address}】"),
                };
                var b = Layer > 9 ? "" + Layer : "0" + Layer;
                var c = Column > 9 ? "" + Column : "0" + Column;
                Address = a + b + c;
            }
            else
            {
                throw new Exception($"地址有误,地址:【{Address}】");
            }
            return Address;
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/¸¨ÁϲÖ/AGV_FLJob.cs
copy from "\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGV/AGVJob.cs" copy to "\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\350\276\205\346\226\231\344\273\223/AGV_FLJob.cs"
Îļþ´Ó ´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGV/AGVJob.cs ¸´ÖÆ
@@ -21,7 +21,7 @@
namespace WIDESEAWCS_Tasks
{
    [DisallowConcurrentExecution]
    public partial class AGVJob : JobBase, IJob
    public partial class AGV_FLJob : JobBase, IJob
    {
        public readonly ITaskService _taskService;
        private readonly ITaskExecuteDetailService _taskExecuteDetailService;
@@ -29,7 +29,7 @@
        private readonly IStationMangerRepository _stationMangerRepository;
        private readonly IMapper _mapper;
        public AGVJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IStationMangerRepository stationMangerRepository, IMapper mapper)
        public AGV_FLJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IStationMangerRepository stationMangerRepository, IMapper mapper)
        {
            _taskService = taskService;
            _taskExecuteDetailService = taskExecuteDetailService;
@@ -42,12 +42,10 @@
            try
            {
                SendAGVTask();
                SendAGVWaitToTask();
            }
            catch (Exception ex)
            {
                Console.Out.WriteLine(nameof(AGVJob) + ":" + ex.Message);
                Console.Out.WriteLine(nameof(AGV_FLJob) + ":" + ex.Message);
            }
            return Task.CompletedTask;
        }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs
@@ -103,7 +103,7 @@
                    _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, locationStatus, LocationStatusEnum.Lock, LocationChangeType.OutboundAssignLocation, stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", taskOut.TaskNum);
                    _unitOfWorkManage.CommitTran();
                    //将任务推送到WCS
                    PushTasksToWCS(new List<Dt_Task>() { taskOut }, "AGV");
                    PushTasksToWCS(new List<Dt_Task>() { taskOut }, "AGV_CSJ");
                    responseContent.OK();
                }
                catch (Exception ex)
@@ -155,7 +155,7 @@
                BaseDal.AddData(taskIn);
                _stockRepository.StockInfoRepository.UpdateData(stockInfo);
                //将任务推送到WCS
                PushTasksToWCS(new List<Dt_Task>() { taskIn }, "AGV"); ;
                PushTasksToWCS(new List<Dt_Task>() { taskIn }, "AGV_CSJ"); ;
                responseContent.OK();
            }
            catch (Exception ex)
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs
@@ -7,6 +7,7 @@
using WIDESEA_Common.LocationEnum;
using WIDESEA_Common.StockEnum;
using WIDESEA_Common.TaskEnum;
using WIDESEA_Common.WareHouseEnum;
using WIDESEA_Core;
using WIDESEA_Core.Helper;
using WIDESEA_DTO.Task;
@@ -29,6 +30,11 @@
                var palletCode = saveModel.MainData["barcode"].ToString();
                var warehouseId = saveModel.MainData["warehouseId"].ObjToInt();
                var stationCode = saveModel.MainData["startPoint"].ToString();
                Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == warehouseId);
                if (warehouse == null)
                {
                    return WebResponseContent.Instance.Error($"未找到库区");
                }
                Dt_Task task = Repository.QueryFirst(x => x.PalletCode == palletCode && x.WarehouseId == warehouseId);
                if (task != null)
                {
@@ -57,37 +63,45 @@
                {
                    return WebResponseContent.Instance.Error($"仓库不正确");
                }
                Dt_Task newTask = new Dt_Task()
                if (warehouse.WarehouseCode == WarehouseEnum.HA60.ToString())
                {
                    CurrentAddress = stationCode,
                    Grade = 0,
                    NextAddress = "",
                    PalletCode = palletCode,
                    Roadway = "",
                    SourceAddress = stationCode,
                    TargetAddress = "",
                    TaskType = TaskTypeEnum.Inbound.ObjToInt(),
                    TaskStatus = TaskStatusEnum.New.ObjToInt(),
                    WarehouseId = stockInfo.WarehouseId,
                    PalletType = stockInfo.PalletType
                };
                if (stockInfo.StockStatus == StockStatusEmun.手动组盘暂存.ObjToInt())
                {
                    stockInfo.StockStatus = StockStatusEmun.手动组盘入库确认.ObjToInt();
                    Dt_LocationInfo locationInfo = _basicRepository.LocationInfoRepository.QueryFirst(x => x.WarehouseId == warehouseId);
                    if (locationInfo == null) return WebResponseContent.Instance.Error($"未找到当前库区货位信息");
                    return DeviceRequestInboundTask(stationCode, locationInfo.RoadwayNo, palletCode);
                }
                else
                {
                    stockInfo.StockStatus = StockStatusEmun.入库确认.ObjToInt();
                    Dt_Task newTask = new Dt_Task()
                    {
                        CurrentAddress = stationCode,
                        Grade = 0,
                        NextAddress = "",
                        PalletCode = palletCode,
                        Roadway = "",
                        SourceAddress = stationCode,
                        TargetAddress = "",
                        TaskType = TaskTypeEnum.Inbound.ObjToInt(),
                        TaskStatus = TaskStatusEnum.New.ObjToInt(),
                        WarehouseId = stockInfo.WarehouseId,
                        PalletType = stockInfo.PalletType
                    };
                    if (stockInfo.StockStatus == StockStatusEmun.手动组盘暂存.ObjToInt())
                    {
                        stockInfo.StockStatus = StockStatusEmun.手动组盘入库确认.ObjToInt();
                    }
                    else
                    {
                        stockInfo.StockStatus = StockStatusEmun.入库确认.ObjToInt();
                    }
                    _unitOfWorkManage.BeginTran();
                    int taskId = BaseDal.AddData(newTask);
                    newTask.TaskId = taskId;
                    _stockRepository.StockInfoRepository.UpdateData(stockInfo);
                    _unitOfWorkManage.CommitTran();
                    PushTasksToWCS(new List<Dt_Task> { newTask });
                    return WebResponseContent.Instance.OK(data: newTask);
                }
                _unitOfWorkManage.BeginTran();
                int taskId = BaseDal.AddData(newTask);
                newTask.TaskId = taskId;
                _stockRepository.StockInfoRepository.UpdateData(stockInfo);
                _unitOfWorkManage.CommitTran();
                PushTasksToWCS(new List<Dt_Task> { newTask });
                return WebResponseContent.Instance.OK(data: newTask);
            }
            catch (Exception ex)
            {
@@ -154,14 +168,17 @@
                {
                    stockInfo.StockStatus = StockStatusEmun.入库确认.ObjToInt();
                }
                LocationStatusEnum lastStatus = (LocationStatusEnum)locationInfo.LocationStatus;
                _unitOfWorkManage.BeginTran();
                _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, lastStatus, LocationStatusEnum.Lock, LocationChangeType.InboundAssignLocation);
                _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, (PalletTypeEnum)newTask.PalletType, LocationStatusEnum.Lock, newTask.WarehouseId);
                int taskId = BaseDal.AddData(newTask);
                newTask.TaskId = taskId;
                _stockRepository.StockInfoRepository.UpdateData(stockInfo);
                _unitOfWorkManage.CommitTran();
                WMSTaskDTO wMSTaskDTO = _mapper.Map<WMSTaskDTO>(newTask);
                //PushTasksToWCS(new List<Dt_Task> { newTask });
                PushTasksToWCS(new List<Dt_Task> { newTask });
                return WebResponseContent.Instance.OK(data: wMSTaskDTO);
            }
            catch (Exception ex)
´úÂë¹ÜÀí/»´°²PDA/common/config.js
@@ -1,8 +1,8 @@
let config = {
    baseUrl: 'http://10.30.4.92:9283',
    baseUrl: 'http://10.30.5.60:9293',
    urls: [
        'http://10.30.4.92:9283',
        'http://10.30.4.92:9283'
        'http://10.30.5.60:9293',
        'http://10.30.5.60:9293'
    ]
}
export {
´úÂë¹ÜÀí/»´°²PDA/pages/stash/InPinku.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,522 @@
<template>
    <view>
        <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem">
        </uni-segmented-control>
        <view class="content">
            <view v-if="current === 0" class="headerstyle">
                <view class="itemstyle">
                    <uni-forms label-width="180">
                        <uni-forms-item label="内箱标签:">
                            <uni-easyinput type="text" placeholder="请扫描内箱标签" ref='midInput' :focus="focus"
                                v-model="materSn" @input="snInput" />
                        </uni-forms-item>
                        <uni-forms-item>
                            <button @click="submit" type="primary" size="default" style="margin-top: 2%;">入平库</button>
                        </uni-forms-item>
                    </uni-forms>
                    <uni-list>
                        <uni-list-item direction="column" v-for="(item,index) in matInfos" :key="index">
                            <template v-slot:body>
                                <view class="uni-list-box">
                                    <uni-icons type="trash" size="22" style="position: absolute;right: 5%;"
                                        @click="deleteList(index)">
                                    </uni-icons>
                                    <view class="uni-content">
                                        <view class="uni-title-sub uni-ellipsis-2">采购单号:{{item.purchaseOrderNo}}</view>
                                        <view class="uni-note">物料编码:{{item.materielCode}}</view>
                                        <view class="uni-note">批次号:{{item.lotNo}}</view>
                                        <view class="uni-note">数量:{{item.quantity}}</view>
                                        <view class="uni-note">生产日期:{{item.productionDate}}</view>
                                        <view class="uni-note">有效期:{{item.effectiveDate}}</view>
                                    </view>
                                </view>
                            </template>
                        </uni-list-item>
                    </uni-list>
                </view>
            </view>
            <view v-if="current === 1" class="headerstyle">
                <view class="itemstyle">
                    <uni-forms label-width="120">
                        <uni-forms-item label="托盘条码">
                            <uni-easyinput type="text" :focus="!addressFocus" v-model="inboundBarcode"
                                placeholder="请扫描托盘条码" ref='midInput' @input="inputChangebarcode" />
                        </uni-forms-item>
                        <uni-forms-item label="地址条码">
                            <uni-easyinput type="text" v-model="address" placeholder="请扫描地址条码" ref='midInput'
                                :focus="addressFocus" />
                        </uni-forms-item>
                        <uni-forms-item>
                            <button @click="inbound" type="primary" size="default" style="margin-top: 2%;">入库确认</button>
                        </uni-forms-item>
                    </uni-forms>
                </view>
            </view>
            <view v-if="current === 2" class="headerstyle">
                <view class="itemstyle">
                    <uni-list :border="true">
                        <uni-list-item direction="column" v-for="(item,index) in orderInfo" :key="index">
                            <template v-slot:body>
                                <view class="uni-list-box">
                                    <view class="uni-content">
                                        <view style="font-size: 18px;">单据号:{{orderNo}}</view>
                                        <view style="font-size: 18px;">物料编码:{{item.materielCode}}</view>
                                        <!-- <view style="font-size: 18px;">物料名称:{{item.matName}}</view> -->
                                        <view style="font-size: 18px;">数量:{{item.orderQuantity}}</view>
                                        <view style="font-size: 18px;">单位:{{item.unit}}</view>
                                        <view style="font-size: 18px;">组盘数量:{{item.receiptQuantity}}</view>
                                    </view>
                                </view>
                            </template>
                        </uni-list-item>
                    </uni-list>
                </view>
            </view>
            <view v-if="current === 3" class="headerstyle">
                <view class="itemstyle">
                    <uni-forms label-width="120">
                        <uni-forms-item>
                            <uni-easyinput type="text" @input="releaseboxInput" v-model="value" placeholder="请扫码"
                                ref='midInput' :focus="true" />
                        </uni-forms-item>
                        <uni-forms-item>
                            <button @click="releasebox" type="primary" size="default">解盘</button>
                        </uni-forms-item>
                    </uni-forms>
                    <uni-list>
                        <uni-list-item direction="column" v-if="value2">
                            <template v-slot:body>
                                <view class="uni-list-box">
                                    <view class="uni-content">
                                        <view class="uni-title-sub uni-ellipsis-2">托盘号:{{value2}}</view>
                                    </view>
                                </view>
                            </template>
                        </uni-list-item>
                        <uni-list-item direction="column" v-for="item in matTotal" :key="item.matCode">
                            <template v-slot:body>
                                <view class="uni-list-box">
                                    <view class="uni-content">
                                        <view class="uni-title-sub uni-ellipsis-2">物料编码:{{item.matCode}}</view>
                                        <view class="uni-title-sub uni-ellipsis-2">数量:{{item.matQuantity}}</view>
                                    </view>
                                </view>
                            </template>
                        </uni-list-item>
                        <uni-list-item direction="column" v-for="(item,index) in matInfo" :key="index">
                            <template v-slot:body>
                                <view class="uni-list-box">
                                    <view class="uni-content">
                                        <view class="uni-title-sub uni-ellipsis-2" style="font-size: 1.1em;">
                                            ç‰©æ–™ç¼–码:{{item.matCode}}
                                        </view>
                                        <view class="uni-title-sub uni-ellipsis-2" style="font-size: 1.1em;">
                                            ç‰©æ–™åç§°ï¼š{{item.matName}}
                                        </view>
                                        <view class="uni-title-sub uni-ellipsis-2" style="font-size: 1.1em;">
                                            æ•°é‡ï¼š{{item.matQty}}
                                        </view>
                                    </view>
                                </view>
                            </template>
                        </uni-list-item>
                    </uni-list>
                </view>
            </view>
        </view>
        <u-toast ref="uToast" />
    </view>
</template>
<script>
    const innerAudioContext = uni.createInnerAudioContext();
    export default {
        data() {
            return {
                items: ['入平库'], //, '入库', '单据信息', '解盘'
                current: 0,
                matTotal: [],
                matInfos: [],
                orderNo: "",
                label: "",
                orderInfo: [],
                focus: false,
                barcode: "",
                materSn: "",
                Initiallife: 1000,
                sns: [],
                sn: "",
                addressFocus: false,
                inboundBarcode: "",
                address: "",
                check: true,
                value: "",
                matInfo: [],
                value2: "",
                matTotals: [],
                warehouseId: "",
                Test: false,
                Testlabel: "",
                Testplaceholder: "",
                Testcheck: false,
            }
        },
        onShow() {},
        onLoad(res) {
            this.focus = false;
            this.addressFocus = false;
            this.orderNo = res.orderNo;
            this.warehouseId = res.warehouseId;
            if (this.warehouseId == 6) { //测试架仓库区ID
                this.Test = true;
                this.Testlabel = "初始寿命:";
                this.Testplaceholder = "请输入初始寿命";
            } else if (this.warehouseId == 2) { //油墨仓库区ID
                this.Test = true;
                this.Testlabel = "数量:";
                this.Testplaceholder = "请输入数量";
                this.Initiallife = 16;
            } else if (this.warehouseId == 5) { //辅料仓库区ID
                this.address = "8005";
            }
            this.label = "单据编号:" + this.orderNo;
            this.getData();
        },
        methods: {
            voiceSpeech(src) {
                innerAudioContext.src = src; // '../../static/success.mp3';
                innerAudioContext.play();
            },
            //解盘
            releasebox() {
                if (this.value.length == 0) {
                    this.$refs.uToast.show({
                        title: "请扫码",
                        type: "error"
                    })
                    return;
                }
                var param;
                var matInfo = this.value.split('|');
                if (matInfo.length == 7) {
                    param = {
                        MainData: {
                            "innerCode": this.value
                        }
                    }
                } else {
                    param = {
                        MainData: {
                            "barcode": this.value
                        }
                    }
                }
                this.$u.post('/api/StockOperate/ReleaseAllBox', param).then(resdt => {
                    if (resdt.status) {
                        uni.$showMsg('解盘成功!')
                        this.value = "";
                        this.matInfo = [];
                        this.matTotals = [];
                        this.value2 = "";
                    } else {
                        this.$refs.uToast.show({
                            title: resdt.message,
                            type: "error"
                        })
                    }
                })
            },
            releaseboxInput() {
                this.$nextTick(() => {
                    if (this.value.length == 0) {
                        return;
                    }
                    var matInfo = this.value.split('|');
                    this.matInfo = [];
                    if (matInfo.length == 7) {
                        this.$u.post('/api/StockOperate/GetStockInfoByInnerCode', {
                            MainData: {
                                "innerCode": this.value
                            }
                        }).then(res => {
                            if (res.status) {
                                this.matInfo = res.data.stockInfo;
                                this.matTotals = res.data.stockTotal;
                                this.value2 = res.data.barcode;
                            } else {
                                this.$refs.uToast.show({
                                    title: res.message,
                                    type: "error"
                                })
                            }
                        })
                    } else {
                        this.$u.post('/api/StockOperate/GetStockInfoByBarcode', {
                            MainData: {
                                "barcode": this.value
                            }
                        }).then(res => {
                            if (res.status) {
                                this.matInfo = res.data.stockInfo;
                                this.matTotals = res.data.stockTotal;
                                this.value2 = res.data.barcode;
                            } else {
                                this.$refs.uToast.show({
                                    title: res.message,
                                    type: "error"
                                })
                            }
                        })
                    }
                })
            },
            updateFocus() {
                debugger
                this.$nextTick(() => {
                    this.materSn = '';
                    if (!this.focus) {
                        this.focus = true;
                    }
                });
            },
            barcodeFocus() {
                debugger
                this.barcode = '';
                if (this.focus) {
                    this.focus = false;
                }
            },
            getData() {
                var postData = {
                    MainData: {
                        orderNo: this.orderNo
                    },
                }
                this.$u.post('/api/InboundOrderDetail/GetInboundOrderDetails', postData).then((res) => {
                    if (res.status) {
                        this.orderInfo = res.data;
                        if (this.orderInfo.length > 3) {
                            this.loadVisible = true;
                        }
                    }
                })
            },
            onClickItem(e) {
                this.focus = false;
                this.addressFocus = false;
                if (this.current !== e.currentIndex) {
                    this.current = e.currentIndex;
                    if (this.current == 2) {
                        this.getData();
                    }
                }
            },
            barcodeInput() {
                this.$nextTick(function(x) {
                    if (this.barcode.length > 0) {
                        // if (this.barcode.substring(0, 1) == 'A' || this.barcode.substring(0, 2) == 'TP') {
                        this.focus = true;
                        // } else {
                        //     this.$refs.uToast.show({
                        //         title: "扫码错误,请扫描托盘码",
                        //         type: "error"
                        //     })
                        // }
                    }
                })
            },
            snInput() {
                this.$nextTick(() => {
                    if (this.warehouseId == 6 || this.warehouseId == 2) {
                        if (this.sns.length > 0) {
                            this.sns = [];
                        }
                    }
                    if (this.materSn != "") {
                        this.focus = false;
                        var matSn = this.materSn;
                        setTimeout(() => {
                            this.materSn = "";
                        }, 10);
                        this.$u.post('/api/MaterielInfo/CodeAnalysis?serNum=' + matSn, {}).then((res) => {
                            this.Testcheck = false;
                            if (res.status) {
                                this.sns.push(res.data.serialNumber);
                                if (this.warehouseId == 6 || this.warehouseId == 2) {
                                    if (this.matInfos.length > 0) {
                                        this.matInfos = [];
                                    }
                                }
                                this.matInfos.push(res.data);
                                if (res.message) {
                                    this.$refs.uToast.show({
                                        title: res.message,
                                        type: "error"
                                    })
                                    setTimeout(() => {
                                        this.voiceSpeech('../../static/fail.mp3');
                                    }, 100);
                                    return;
                                }
                                setTimeout(() => {
                                    this.voiceSpeech('../../static/success.mp3');
                                }, 100);
                            } else {
                                this.$refs.uToast.show({
                                    title: res.message,
                                    type: "error"
                                })
                                setTimeout(() => {
                                    this.voiceSpeech('../../static/fail.mp3');
                                }, 100);
                            }
                        })
                    }
                })
            },
            inbound() {
                if (this.inboundBarcode == "") {
                    this.$refs.uToast.show({
                        title: "请扫描托盘条码",
                        type: "error"
                    })
                    return;
                }
                if (this.address == "") {
                    this.$refs.uToast.show({
                        title: "请扫描地址条码",
                        type: "error"
                    })
                    return;
                }
                var postData = {
                    MainData: {
                        "barcode": this.inboundBarcode,
                        "startPoint": this.address,
                        "warehouseId": this.warehouseId
                    }
                }
                this.$u.post('/api/Task/RequestInboundTask', postData).then(res => {
                    if (res.status) {
                        uni.$showMsg(res.message);
                        this.inboundBarcode = "";
                        this.address = "";
                        setTimeout(() => {
                            this.addressFocus = false;
                        }, 200);
                    } else {
                        this.$refs.uToast.show({
                            title: res.message,
                            type: "error"
                        })
                    }
                }).catch(err => {
                    this.$refs.uToast.show({
                        title: err.message,
                        type: "error"
                    })
                })
            },
            inputChangebarcode() {
                this.addressFocus = false;
                this.$nextTick(function(x) {
                    if (this.inboundBarcode != '') {
                        this.addressFocus = true;
                    }
                })
            },
            deleteList(res) {
                this.matInfos.splice(res, 1);
                this.sns.splice(res, 1);
            },
            submit() {
                if (this.barcode == "") {
                    this.$refs.uToast.show({
                        title: "请扫描托盘条码",
                        type: 'error'
                    })
                    return;
                }
                if (this.matInfos.length == 0) {
                    this.$refs.uToast.show({
                        title: "请扫描内箱标签",
                        type: 'error'
                    })
                    return;
                }
                if (this.Test) {
                    if (!this.Testcheck) {
                        this.Testcheck = true;
                        if (this.warehouseId == 2) {
                            this.$refs.uToast.show({
                                title: "请确认数量",
                                type: 'error'
                            })
                        } else if (this.warehouseId == 6) {
                            this.$refs.uToast.show({
                                title: "请确认初始寿命",
                                type: 'error'
                            })
                        }
                        return;
                    }
                }
                if (this.warehouseId == 2) { //油墨仓库区ID
                    this.sn = this.sns[0];
                    debugger
                    for (var i = 0; i < this.Initiallife - 1; i++) {
                        this.sns.push(this.sn);
                    }
                }
                debugger
                let url = 'palletCode=' + this.barcode + '&initiallife=' + this.Initiallife + '&warehouseId=' + this
                    .warehouseId;
                this.$u.post('/api/InboundOrder/ManualMaterielGroup?' + url, this.sns).then(res => {
                    this.Testcheck = false;
                    if (res.status) {
                        this.$refs.uToast.show({
                            title: "组盘成功",
                            type: "success"
                        })
                        this.focus = false;
                        this.barcode = "";
                        this.matInfos = [];
                        this.sns = [];
                        this.matTotal = [];
                    } else {
                        this.$refs.uToast.show({
                            title: res.message,
                            type: "error"
                        })
                    }
                })
            }
        }
    }
</script>
<style lang="scss">
    @import '@/common/uni-ui.scss';
    .content {
        display: flex;
        height: 150px;
    }
    .content-text {
        font-size: 14px;
        color: #666;
    }
    .itemstyle {
        margin-top: 30px;
        margin-left: 5%;
    }
    .headerstyle {
        width: 90%;
    }
</style>
´úÂë¹ÜÀí/»´°²PDA/pages/stash/boxing.vue
@@ -198,6 +198,8 @@
                this.Testlabel = "数量:";
                this.Testplaceholder = "请输入数量";
                this.Initiallife = 16;
            } else if (this.warehouseId == 5) { //辅料仓库区ID
                this.address = "8005";
            }
            this.label = "单据编号:" + this.orderNo;
            this.getData();
@@ -419,11 +421,14 @@
                }
                this.$u.post('/api/Task/RequestInboundTask', postData).then(res => {
                    if (res.status) {
                        uni.$showMsg(res.message);
                        this.inboundBarcode = "";
                        this.address = "";
                        if (this.warehouseId != 5) this.address = "";
                        setTimeout(() => {
                            this.addressFocus = false;
                            this.$refs.uToast.show({
                                title: "成功",
                                type: "success"
                            })
                        }, 200);
                    } else {
                        this.$refs.uToast.show({
@@ -484,12 +489,10 @@
                }
                if (this.warehouseId == 2) { //油墨仓库区ID
                    this.sn = this.sns[0];
                    debugger
                    for (var i = 0; i < this.Initiallife - 1; i++) {
                        this.sns.push(this.sn);
                    }
                }
                debugger
                let url = 'palletCode=' + this.barcode + '&initiallife=' + this.Initiallife + '&warehouseId=' + this
                    .warehouseId;