wankeda
2025-02-28 c7082f9c389230a989b1fa63862f6aa6e720990c
PP仓出库MES,AGV对接流程

PP仓出库MES,AGV对接流程
已删除5个文件
已修改23个文件
已添加57个文件
4723 ■■■■■ 文件已修改
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/7ed246f4-c665-4855-94f0-8ea64664545f.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/9db99863-dd5d-4ea4-9436-cf86369c513c.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/c37c0d0d-502a-46ba-b0c6-e65f37fc1a15.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/f9166ebc-70d4-4adb-962f-3dde09ec62a1.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/APIEnum/APIEnum.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskEnumHelper.cs 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP仓/AGV_PPExtend.cs 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP仓/AGV_PPJob.cs 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP仓/TSJConveyorLineJob_PP.cs 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/mesPPCutOutOrderDetail.vue 441 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/mesPPoutOrderDetail.vue 421 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/extension/outbound/mesPPCutOutboundOrder.js 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/extension/outbound/mesPPCutOutboundOrderDetail.js 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/extension/outbound/mesPPOutboundOrder.js 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/extension/outbound/mesPPOutboundOrderDetail.js 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/router/viewGird.js 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/views/outbound/mesPPCutOutboundOrder.vue 356 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/views/outbound/mesPPCutOutboundOrderDetail.vue 256 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/views/outbound/mesPPOutboundOrder.vue 259 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/views/outbound/mesPPOutboundOrderDetail.vue 149 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/00e22ada-36c2-42fa-ba01-39bb171b9b5f.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/01b812bf-9885-4a77-95d8-f05c785d7354.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/1835396e-ee0b-4003-b5af-b6427288d0f6.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/2a6737f2-ed15-4243-99f4-32f56eae41df.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/3c53f8c2-2194-4cf0-8343-aca04ba405cc.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/47dfe2fa-2b55-44f1-9467-56f17ea6232a.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/736d9a07-7f63-4075-b18a-3910cc852c4c.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/7badb44d-00b3-43fa-954b-a0f65ce3bdd5.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/b0f7d90e-1d2b-41fa-bdc4-6751c11f6ed9.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicRepository/LocationInfoRepository.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/MesResponseContent.cs 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/PPSubsectionModel.cs 194 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IBasicRepository/ILocationInfoRepository.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IInboundRepository/IMesPPBackInboundOrderDetailRepository.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IInboundRepository/IMesPPBackInboundOrderRepository.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IMesPPBackInboundOrderDetailService.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IMesPPBackInboundOrderService.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundRepository/IMesPPCutOutboundOrderDetailRepository.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundRepository/IMesPPCutOutboundOrderRepository.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundRepository/IMesPPOutboundOrderDetailRepository.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundRepository/IMesPPOutboundOrderRepository.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IMesPPCutOutboundOrderDetailService.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IMesPPCutOutboundOrderService.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IMesPPOutboundOrderDetailService.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IMesPPOutboundOrderService.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutStockLockInfoService.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundService.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IStockService/IStockInfoService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundRepository/MesPPBackInboundOrderDetailRepository.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundRepository/MesPPBackInboundOrderRepository.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/MesPPBackInboundOrderDetailService.cs 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/MesPPBackInboundOrderService.cs 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_MesPPBackInboundOrder.cs 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_MesPPBackInboundOrderDetail.cs 116 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_MesPPCutOutboundOrder.cs 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_MesPPCutOutboundOrderDetail.cs 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_MesPPOutboundOrder.cs 123 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_MesPPOutboundOrderDetail.cs 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfoDetail.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundRepository/MesPPCutOutboundOrderDetailRepository.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundRepository/MesPPCutOutboundOrderRepository.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundRepository/MesPPOutboundOrderDetailRepository.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundRepository/MesPPOutboundOrderRepository.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/MesPPCutOutboundOrderDetailService.cs 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/MesPPCutOutboundOrderService.cs 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/MesPPOutboundOrderDetailService.cs 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/MesPPOutboundOrderService.cs 143 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundService.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/AssignInboundTaskLocation_BC.cs 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs 429 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/MesPPBackInboundOrderController.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/MES/MesController.cs 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/MesPPCutOutboundOrderController.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/MesPPCutOutboundOrderDetailController.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/MesPPOutboundOrderController.cs 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/MesPPOutboundOrderDetailController.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/淮安PDA/pages.json 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/淮安PDA/pages/stash/AGVTasks.vue 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目资料/接口文档/MES业务流程图V1.0.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/7ed246f4-c665-4855-94f0-8ea64664545f.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/9db99863-dd5d-4ea4-9436-cf86369c513c.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/c37c0d0d-502a-46ba-b0c6-e65f37fc1a15.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/f9166ebc-70d4-4adb-962f-3dde09ec62a1.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/APIEnum/APIEnum.cs
@@ -28,6 +28,12 @@
        Agv_FLSendTask,
        /// <summary>
        /// PPAGV任务发送
        /// </summary>
        [Description("PPAGV任务发送")]
        Agv_PPSendTask,
        /// <summary>
        /// å›žè°ƒWMS任务完成
        /// </summary>
        [Description("回调WMS任务完成")]
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskEnumHelper.cs
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -258,8 +258,7 @@
                                return WebResponseContent.Instance.Error($"未找到路由配置信息");
                            }
                            router = routers.FirstOrDefault();
                            string stationCode = router?.NextPosi ?? "";
                            Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == stationCode);
                            Dt_StationManger? stationManger = _stationMangerRepository.QueryData(x => true).FirstOrDefault(x=>x.StationCode== router?.NextPosi);
                            if (stationManger == null)
                            {
                                return WebResponseContent.Instance.Error($"未找到站台配置信息");
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP²Ö/AGV_PPExtend.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,65 @@
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_PPJob
    {
        public void SendAGVTask()
        {
            try
            {
                var newTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt()||x.TaskState==TaskStatusEnum.AGV_Execute.ObjToInt()) && nameof(AGV_PPJob).Contains(x.DeviceCode) && !string.IsNullOrEmpty(x.DeviceCode)).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList();
                foreach (var task in newTasks)
                {
                    try
                    {
                        AgvTaskDTO TaskDTO = new AgvTaskDTO()
                        {
                            TaskCode = task.AgvTaskNum,
                            ReqCode = DateTime.Now.ToString("yyyyMMddHHmmss") + task.AgvTaskNum,
                            TaskTyp = task.TaskType < TaskTypeEnum.Inbound.ObjToInt() ? "FLC" : "FLR",
                            ctnrCode = task.PalletCode,
                            PositionCodePath = new List<CodePath>()
                        {
                            new CodePath()
                            {
                                type="00",
                                positionCode=task.CurrentAddress
                            },
                            new CodePath()
                            {
                                type="00",
                                positionCode=task.NextAddress
                            }
                        },
                        };
                        WebResponseContent content = _taskService.AgvSendTask(TaskDTO, APIEnum.Agv_PPSendTask);
                        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);
            }
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP²Ö/AGV_PPJob.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,53 @@
using AutoMapper;
using Newtonsoft.Json;
using Quartz;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_DTO.Agv;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_QuartzJob.Service;
namespace WIDESEAWCS_Tasks
{
    [DisallowConcurrentExecution]
    public partial class AGV_PPJob : JobBase, IJob
    {
        public readonly ITaskService _taskService;
        private readonly ITaskExecuteDetailService _taskExecuteDetailService;
        private readonly IRouterService _routerService;
        private readonly IStationMangerRepository _stationMangerRepository;
        private readonly IMapper _mapper;
        public AGV_PPJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IStationMangerRepository stationMangerRepository, IMapper mapper)
        {
            _taskService = taskService;
            _taskExecuteDetailService = taskExecuteDetailService;
            _routerService = routerService;
            _stationMangerRepository = stationMangerRepository;
            _mapper = mapper;
        }
        public Task Execute(IJobExecutionContext context)
        {
            try
            {
                SendAGVTask();
            }
            catch (Exception ex)
            {
                Console.Out.WriteLine(nameof(AGV_PPJob) + ":" + ex.Message);
            }
            return Task.CompletedTask;
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP²Ö/TSJConveyorLineJob_PP.cs
@@ -69,32 +69,34 @@
                        ConveyorLineSignal conveyorLineSignalRead = conveyorLineInfoRead.Signal.ByteToBoolObject<ConveyorLineSignal>();
                        ConveyorLineSignal conveyorLineSignalWrite = conveyorLineInfoWrite.Signal.ByteToBoolObject<ConveyorLineSignal>();
                        if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt())
                        {
                            if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.ACK)
                            {
                                if (!string.IsNullOrEmpty(conveyorLineInfoRead.Barcode))
                                {
                                    WebResponseContent content = _taskService.RequestWMSTask(conveyorLineInfoRead.Barcode, item.StationCode);
                                    if (content.Status)
                                    {
                                        device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode);
                                    }
                                }
                            }
                            else if (!conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && conveyorLineSignalWrite.ACK)
                            {
                                Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && x.PalletCode == conveyorLineInfoRead.Barcode && x.DeviceCode == item.StationDeviceCode && x.TaskState == TaskStatusEnum.New.ObjToInt());
                                if (task != null)
                                {
                                    _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, currentAddress: item.StackerCraneStationCode, deviceCode: task.Roadway, nextAddress: task.TargetAddress);
                                }
                        #region
                        //if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt())
                        //{
                        //    if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.ACK)
                        //    {
                        //        if (!string.IsNullOrEmpty(conveyorLineInfoRead.Barcode))
                        //        {
                        //            WebResponseContent content = _taskService.RequestWMSTask(conveyorLineInfoRead.Barcode, item.StationCode);
                        //            if (content.Status)
                        //            {
                        //                device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode);
                        //            }
                        //        }
                        //    }
                        //    else if (!conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && conveyorLineSignalWrite.ACK)
                        //    {
                        //        Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && x.PalletCode == conveyorLineInfoRead.Barcode && x.DeviceCode == item.StationDeviceCode && x.TaskState == TaskStatusEnum.New.ObjToInt());
                        //        if (task != null)
                        //        {
                        //            _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, currentAddress: item.StackerCraneStationCode, deviceCode: task.Roadway, nextAddress: task.TargetAddress);
                        //        }
                                device.SetValue(W_ConveyorLineDB.ACK, false, item.StationCode);
                            }
                        //        device.SetValue(W_ConveyorLineDB.ACK, false, item.StationCode);
                        //    }
                        }
                        else if (item.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt())
                        //}
                        #endregion
                        if (item.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt())
                        {
                            if (conveyorLineSignalRead.STB)
                            {
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/mesPPCutOutOrderDetail.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,441 @@
a<template>
  <div>
    <vol-box
      v-model="showDetialBox"
      :lazy="true"
      width="75%"
      :padding="15"
      title="单据明细信息"
    >
      <div class="box-head">
        <el-alert :closable="false" style="width: 100%">
          <el-row>
            <el-col :span="16">
              <span>已选中 {{ selection.length }} é¡¹</span>
            </el-col>
            <el-col :span="8">
              <el-link
                type="primary"
                size="small"
                style="float: right; height: 20px"
                @click="lockstocks"
                >锁定库存</el-link
              >
              <el-link
                type="primary"
                size="small"
                style="float: right; height: 20px; margin-right: 10px"
                @click="outbound"
                >直接出库</el-link
              >
              <el-link
                type="primary"
                size="small"
                style="float: right; height: 20px; margin-right: 10px"
                @click="getData"
                >刷新</el-link
              ></el-col
            >
          </el-row>
        </el-alert>
      </div>
      <div class="box-table" style="margin-top: 1%">
        <el-table
          ref="singleTable"
          :data="tableData"
          style="width: 100%; height: 100%"
          highlight-current-row
          @current-change="handleCurrentChange"
          height="500px"
          @row-click="handleRowClick"
          @selection-change="handleSelectionChange"
        >
          <el-table-column type="selection" width="55"> </el-table-column>
          <el-table-column
            label="序号"
            type="index"
            fixed="left"
            width="55"
            align="center"
          ></el-table-column>
          <el-table-column
            v-for="(item, index) in tableColumns.filter((x) => !x.hidden)"
            :key="index"
            :prop="item.prop"
            :label="item.title"
            :width="item.width"
            align="center"
          >
            <template #default="scoped">
              <div v-if="item.type == 'icon'">
                <el-tooltip
                  class="item"
                  effect="dark"
                  :content="item.title"
                  placement="bottom"
                  ><el-link
                    type="primary"
                    :disabled="getButtonEnable(item.prop, scoped.row)"
                    @click="tableButtonClick(scoped.row, item)"
                    ><i :class="item.icon" style="font-size: 22px"></i></el-link
                ></el-tooltip>
              </div>
              <div v-else-if="item.type == 'tag'">
                <el-tag size="small">
                  {{ getDictionary(scoped.row, item) }}
                </el-tag>
              </div>
            </template>
          </el-table-column>
        </el-table>
      </div>
    </vol-box>
    <stock-select ref="child" @parentCall="parentCall"></stock-select>
    <selected-stock
      ref="selectedStock"
      @parentCall="parentCall"
    ></selected-stock>
  </div>
</template>
<script>
import VolBox from "@/components/basic/VolBox.vue";
import VolForm from "@/components/basic/VolForm.vue";
import StockSelect from "./StockSelect.vue";
import SelectedStock from "./SelectedStock.vue";
export default {
  components: { VolBox, VolForm, StockSelect, SelectedStock },
  data() {
    return {
      row: null,
      showDetialBox: false,
      flag: false,
      currentRow: null,
      selection: [],
      tableData: [],
       tableColumns: [
        {
          prop: "id",
          title: "Id",
          type: "int",
          width: 90,
          hidden: true,
        },
        {
          prop: "orderId",
          title: "出库单主键",
          type: "string",
          width: 90,
          hidden: true,
        },
        {
          prop: "materielCode",
          title: "物料编号",
          type: "string",
          width: 150,
        },
        {
          prop: "materielName",
          title: "物料名称",
          type: "string",
          width: 150,
        },
      {
        field: "targetAddressCode",
        title: "线边仓地址码",
        type: "string",
        width: 100,
        align: "left",
      },
      {
        field: "width",
        title: "裁切宽",
        type: "string",
        width: 100,
        align: "left",
      },
        {
          prop: "orderQuantity",
          title: "单据数量",
          type: "string",
          width: 90,
        },
        {
          prop: "lockQuantity",
          title: "锁定数量",
          type: "int",
          width: 90,
        },
        {
          prop: "overOutQuantity",
          title: "已出数量",
          type: "string",
          width: 90,
        },
        {
          prop: "unit",
          title: "单位",
          type: "string",
          width: 90,
        },
        {
          prop: "orderDetailStatus",
          title: "订单明细状态",
          type: "tag",
          width: 180,
          bindKey: "orderDetailStatusEnum",
        },
        {
          prop: "assignStock",
          title: "指定库存",
          type: "icon",
          width: 90,
          icon: "el-icon-s-grid",
        },
        {
          prop: "viewDetail",
          title: "出库详细",
          type: "icon",
          width: 90,
          icon: "el-icon-s-operation",
        },
        {
          prop: "creater",
          title: "创建人",
          type: "string",
          width: 90,
        },
        {
          prop: "createDate",
          title: "创建时间",
          type: "datetime",
          width: 160,
        },
        {
          prop: "modifier",
          title: "修改人",
          type: "string",
          width: 100,
        },
        {
          prop: "modifyDate",
          title: "修改时间",
          type: "datetime",
          width: 160,
        },
        {
          prop: "remark",
          title: "备注",
          type: "string",
        },
      ],
      paginations: {
        sort: "id",
        order: "desc",
        Foots: "",
        total: 0,
        // 2020.08.29增加自定义分页条大小
        sizes: [30, 60, 100, 120],
        size: 30, // é»˜è®¤åˆ†é¡µå¤§å°
        Wheres: [],
        page: 1,
        rows: 30,
      },
      searchFormOptions: [
        [
          {
            title: "单据编号",
            field: "allocation_code",
            type: "like",
          },
          {
            title: "单据类型",
            field: "allocation_type",
            type: "select",
            dataKey: "OrderType",
            data: [],
          },
          {
            title: "单据状态",
            field: "allocation_state",
            type: "select",
            dataKey: "OrderState",
            data: [],
          },
        ],
      ],
      searchFormFields: {
        allocation_code: "",
        allocation_type: "",
        allocation_state: "",
      },
      dictionaryList: null,
    };
  },
  methods: {
    open(row) {
      this.row = row;
      this.showDetialBox = true;
      this.getDictionaryData();
      this.getData();
    },
    getData() {
      var wheres = [{ name: "orderId", value: this.row.id }];
      var param = {
        page: this.paginations.page,
        rows: this.paginations.rows,
        sort: this.paginations.sort,
        order: this.paginations.order,
        wheres: JSON.stringify(wheres), // æŸ¥è¯¢æ¡ä»¶ï¼Œæ ¼å¼ä¸º[{ name: "字段", value: "xx" }]
      };
      this.http
        .post("api/MesPPCutOutboundOrderDetail/GetPageData", param, "查询中")
        .then((x) => {
            // console.log(x.rows);
          this.tableData = x.rows;
        });
    },
    tableButtonClick(row, column) {
      if (column.prop == "assignStock") {
        this.$refs.child.open(row);
      } else {
        //点击打开出库详情
        this.$refs.selectedStock.open(row);
      }
    },
    lockstocks() {
      if (this.selection.length === 0) {
        return this.$message.error("请选择单据明细");
      }
      var keys = this.selection.map((item) => item.id); // èŽ·å–é€‰ä¸­è¡Œçš„id
      this.http
        .post("api/OutboundOrderDetail/LockOutboundStocks", keys, "数据处理中")
        .then((x) => {
          if (!x.status) return this.$message.error(x.message);
          this.$message.success("操作成功");
          this.showDetialBox = false;
          this.$emit("parentCall", ($vue) => {
            $vue.getData();
          });
        });
    },
    outbound() {
      if (this.selection.length === 0) {
        return this.$message.error("请选择单据明细");
      }
      var keys = this.selection.map((item) => item.id); // èŽ·å–é€‰ä¸­è¡Œçš„id
      this.http
        .post("api/Task/GenerateOutboundTasks", keys, "数据处理中")
        .then((x) => {
          if (!x.status) return this.$message.error(x.message);
          this.$message.success("操作成功");
          this.showDetialBox = false;
          this.$emit("parentCall", ($vue) => {
            $vue.getData();
          });
        });
    },
    setCurrent(row) {
      this.$refs.singleTable.setCurrentRow(row);
    },
    handleCurrentChange(val) {
      this.currentRow = val;
    },
    getButtonEnable(propName, row) {
      if (propName == "assignStock") {
        if (
          row.orderDetailStatus !== 0 &&
          row.orderDetailStatus !== 60 &&
          row.orderDetailStatus !== 70 &&
          row.orderDetailStatus !== 80
        ) {
          return true;
        } else {
          return false;
        }
      }
      return false;
    },
    parentCall(fun) {
      if (typeof fun != "function") {
        return console.log("扩展组件需要传入一个回调方法才能获取父级Vue对象");
      }
      fun(this);
    },
    handleRowClick(row) {
      this.$refs.singleTable.toggleRowSelection(row);
    },
    handleSelectionChange(val) {
      this.selection = val;
    },
    getDictionaryData() {
      if (this.dictionaryList) {
        return;
      }
      var param = [];
      this.tableColumns.forEach((x) => {
        if (x.type == "tag" && x.bindKey != "") {
          param.push(x.bindKey);
        }
      });
      this.http
        .post("api/Sys_Dictionary/GetVueDictionary", param, "查询中")
        .then((x) => {
          if (x.length > 0) {
            this.dictionaryList = x;
          }
        });
    },
    getDictionary(row, column) {
      if (this.dictionaryList) {
        var item = this.dictionaryList.find((x) => x.dicNo == column.bindKey);
        if (item) {
          var dicItem = item.data.find((x) => x.key == row[column.prop]);
          console.log(dicItem);
          if (dicItem) {
            return dicItem.value;
          } else {
            return row[column.prop];
          }
        } else {
          return row[column.prop];
        }
      }
    },
  },
};
</script>
<style scoped>
.text-button {
  border: 0px;
}
</style>
<style>
.text-button:hover {
  background-color: #f0f9eb !important;
}
.el-table .warning-row {
  background: oldlace;
}
.box-table .el-table tbody tr:hover > td {
  background-color: #d8e0d4 !important;
  /* color: #ffffff; */
}
.box-table .el-table tbody tr.current-row > td {
  background-color: #f0f9eb !important;
  /* color: #ffffff; */
}
.el-table .success-row {
  background: #f0f9eb;
}
.box-table .el-table {
  border: 1px solid #ebeef5;
}
</style>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/mesPPoutOrderDetail.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,421 @@
<template>
  <div>
    <vol-box
      v-model="showDetialBox"
      :lazy="true"
      width="75%"
      :padding="15"
      title="单据明细信息"
    >
      <div class="box-head">
        <el-alert :closable="false" style="width: 100%">
          <el-row>
            <el-col :span="16">
              <span>已选中 {{ selection.length }} é¡¹</span>
            </el-col>
            <el-col :span="8">
              <el-link
                type="primary"
                size="small"
                style="float: right; height: 20px"
                @click="lockstocks"
                >锁定库存</el-link
              >
              <el-link
                type="primary"
                size="small"
                style="float: right; height: 20px; margin-right: 10px"
                @click="outbound"
                >直接出库</el-link
              >
              <el-link
                type="primary"
                size="small"
                style="float: right; height: 20px; margin-right: 10px"
                @click="getData"
                >刷新</el-link
              ></el-col
            >
          </el-row>
        </el-alert>
      </div>
      <div class="box-table" style="margin-top: 1%">
        <el-table
          ref="singleTable"
          :data="tableData"
          style="width: 100%; height: 100%"
          highlight-current-row
          @current-change="handleCurrentChange"
          height="500px"
          @row-click="handleRowClick"
          @selection-change="handleSelectionChange"
        >
          <el-table-column type="selection" width="55"> </el-table-column>
          <el-table-column
            label="序号"
            type="index"
            fixed="left"
            width="55"
            align="center"
          ></el-table-column>
          <el-table-column
            v-for="(item, index) in tableColumns.filter((x) => !x.hidden)"
            :key="index"
            :prop="item.prop"
            :label="item.title"
            :width="item.width"
            align="center"
          >
            <template #default="scoped">
              <div v-if="item.type == 'icon'">
                <el-tooltip
                  class="item"
                  effect="dark"
                  :content="item.title"
                  placement="bottom"
                  ><el-link
                    type="primary"
                    :disabled="getButtonEnable(item.prop, scoped.row)"
                    @click="tableButtonClick(scoped.row, item)"
                    ><i :class="item.icon" style="font-size: 22px"></i></el-link
                ></el-tooltip>
              </div>
              <div v-else-if="item.type == 'tag'">
                <el-tag size="small">
                  {{ getDictionary(scoped.row, item) }}
                </el-tag>
              </div>
            </template>
          </el-table-column>
        </el-table>
      </div>
    </vol-box>
    <stock-select ref="child" @parentCall="parentCall"></stock-select>
    <selected-stock
      ref="selectedStock"
      @parentCall="parentCall"
    ></selected-stock>
  </div>
</template>
<script>
import VolBox from "@/components/basic/VolBox.vue";
import VolForm from "@/components/basic/VolForm.vue";
import StockSelect from "./StockSelect.vue";
import SelectedStock from "./SelectedStock.vue";
export default {
  components: { VolBox, VolForm, StockSelect, SelectedStock },
  data() {
    return {
      row: null,
      showDetialBox: false,
      flag: false,
      currentRow: null,
      selection: [],
      tableData: [],
      tableColumns: [
        {
          prop: "id",
          title: "Id",
          type: "int",
          width: 90,
          hidden: true,
        },
        {
          prop: "orderId",
          title: "出库单主键",
          type: "string",
          width: 90,
          hidden: true,
        },
        {
          prop: "warehouse",
          title: "库区",
          type: "string",
          width: 150,
        },
        {
          prop: "carrierCode",
          title: "载具号",
          type: "string",
          width: 150,
        },
        // {
        //   prop: "orderQuantity",
        //   title: "单据数量",
        //   type: "string",
        //   width: 90,
        // },
        // {
        //   prop: "lockQuantity",
        //   title: "锁定数量",
        //   type: "int",
        //   width: 90,
        // },
        // {
        //   prop: "overOutQuantity",
        //   title: "已出数量",
        //   type: "string",
        //   width: 90,
        // },
        {
          prop: "orderDetailStatus",
          title: "订单明细状态",
          type: "tag",
          width: 180,
          bindKey: "orderDetailStatusEnum",
        },
        // {
        //   prop: "assignStock",
        //   title: "指定库存",
        //   type: "icon",
        //   width: 90,
        //   icon: "el-icon-s-grid",
        // },
        // {
        //   prop: "viewDetail",
        //   title: "出库详细",
        //   type: "icon",
        //   width: 90,
        //   icon: "el-icon-s-operation",
        // },
        {
          prop: "creater",
          title: "创建人",
          type: "string",
          width: 90,
        },
        {
          prop: "createDate",
          title: "创建时间",
          type: "datetime",
          width: 160,
        },
        {
          prop: "modifier",
          title: "修改人",
          type: "string",
          width: 100,
        },
        {
          prop: "modifyDate",
          title: "修改时间",
          type: "datetime",
          width: 160,
        },
        {
          prop: "remark",
          title: "备注",
          type: "string",
        },
      ],
      paginations: {
        sort: "id",
        order: "desc",
        Foots: "",
        total: 0,
        // 2020.08.29增加自定义分页条大小
        sizes: [30, 60, 100, 120],
        size: 30, // é»˜è®¤åˆ†é¡µå¤§å°
        Wheres: [],
        page: 1,
        rows: 30,
      },
      searchFormOptions: [
        [
          {
            title: "单据编号",
            field: "allocation_code",
            type: "like",
          },
          {
            title: "单据类型",
            field: "allocation_type",
            type: "select",
            dataKey: "OrderType",
            data: [],
          },
          {
            title: "单据状态",
            field: "allocation_state",
            type: "select",
            dataKey: "OrderState",
            data: [],
          },
        ],
      ],
      searchFormFields: {
        allocation_code: "",
        allocation_type: "",
        allocation_state: "",
      },
      dictionaryList: null,
    };
  },
  methods: {
    open(row) {
      this.row = row;
      this.showDetialBox = true;
      this.getDictionaryData();
      this.getData();
    },
    getData() {
      var wheres = [{ name: "orderId", value: this.row.id }];
      var param = {
        page: this.paginations.page,
        rows: this.paginations.rows,
        sort: this.paginations.sort,
        order: this.paginations.order,
        wheres: JSON.stringify(wheres), // æŸ¥è¯¢æ¡ä»¶ï¼Œæ ¼å¼ä¸º[{ name: "字段", value: "xx" }]
      };
      this.http
        .post("api/MesPPOutboundOrderDetail/GetPageData", param, "查询中")
        .then((x) => {
            // console.log(x.rows);
          this.tableData = x.rows;
        });
    },
    tableButtonClick(row, column) {
      if (column.prop == "assignStock") {
        this.$refs.child.open(row);
      } else {
        //点击打开出库详情
        this.$refs.selectedStock.open(row);
      }
    },
    lockstocks() {
      if (this.selection.length === 0) {
        return this.$message.error("请选择单据明细");
      }
      var keys = this.selection.map((item) => item.id); // èŽ·å–é€‰ä¸­è¡Œçš„id
      this.http
        .post("api/OutboundOrderDetail/LockOutboundStocks", keys, "数据处理中")
        .then((x) => {
          if (!x.status) return this.$message.error(x.message);
          this.$message.success("操作成功");
          this.showDetialBox = false;
          this.$emit("parentCall", ($vue) => {
            $vue.getData();
          });
        });
    },
    outbound() {
      if (this.selection.length === 0) {
        return this.$message.error("请选择单据明细");
      }
      var keys = this.selection.map((item) => item.id); // èŽ·å–é€‰ä¸­è¡Œçš„id
      this.http
        .post("api/Task/GenerateOutboundTasks", keys, "数据处理中")
        .then((x) => {
          if (!x.status) return this.$message.error(x.message);
          this.$message.success("操作成功");
          this.showDetialBox = false;
          this.$emit("parentCall", ($vue) => {
            $vue.getData();
          });
        });
    },
    setCurrent(row) {
      this.$refs.singleTable.setCurrentRow(row);
    },
    handleCurrentChange(val) {
      this.currentRow = val;
    },
    getButtonEnable(propName, row) {
      if (propName == "assignStock") {
        if (
          row.orderDetailStatus !== 0 &&
          row.orderDetailStatus !== 60 &&
          row.orderDetailStatus !== 70 &&
          row.orderDetailStatus !== 80
        ) {
          return true;
        } else {
          return false;
        }
      }
      return false;
    },
    parentCall(fun) {
      if (typeof fun != "function") {
        return console.log("扩展组件需要传入一个回调方法才能获取父级Vue对象");
      }
      fun(this);
    },
    handleRowClick(row) {
      this.$refs.singleTable.toggleRowSelection(row);
    },
    handleSelectionChange(val) {
      this.selection = val;
    },
    getDictionaryData() {
      if (this.dictionaryList) {
        return;
      }
      var param = [];
      this.tableColumns.forEach((x) => {
        if (x.type == "tag" && x.bindKey != "") {
          param.push(x.bindKey);
        }
      });
      this.http
        .post("api/Sys_Dictionary/GetVueDictionary", param, "查询中")
        .then((x) => {
          if (x.length > 0) {
            this.dictionaryList = x;
          }
        });
    },
    getDictionary(row, column) {
      if (this.dictionaryList) {
        var item = this.dictionaryList.find((x) => x.dicNo == column.bindKey);
        if (item) {
          var dicItem = item.data.find((x) => x.key == row[column.prop]);
          console.log(dicItem);
          if (dicItem) {
            return dicItem.value;
          } else {
            return row[column.prop];
          }
        } else {
          return row[column.prop];
        }
      }
    },
  },
};
</script>
<style scoped>
.text-button {
  border: 0px;
}
</style>
<style>
.text-button:hover {
  background-color: #f0f9eb !important;
}
.el-table .warning-row {
  background: oldlace;
}
.box-table .el-table tbody tr:hover > td {
  background-color: #d8e0d4 !important;
  /* color: #ffffff; */
}
.box-table .el-table tbody tr.current-row > td {
  background-color: #f0f9eb !important;
  /* color: #ffffff; */
}
.el-table .success-row {
  background: #f0f9eb;
}
.box-table .el-table {
  border: 1px solid #ebeef5;
}
</style>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/extension/outbound/mesPPCutOutboundOrder.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,74 @@
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
import gridBody from './extend/mesPPCutOutOrderDetail.vue'
let extension = {
    components: {
      //查询界面扩展组件
      gridHeader: '',
      gridBody: gridBody,
      gridFooter: '',
      //新建、编辑弹出框扩展组件
      modelHeader: '',
      modelBody: '',
      modelFooter: ''
    },
    tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写)
    buttons: { view: [], box: [], detail: [] }, //扩展的按钮
    methods: {
       //下面这些方法可以保留也可以删除
      onInit() {
        //扩展页面初始化操作
        this.columns.push({
          field: '操作',
          title: '操作',
          width: 90,
          fixed: 'right',
          align: 'center',
          formatter: (row) => {
              return (
                  '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-view">查看明细</i>'
              );
          },
          click: (row) => {
              this.$refs.gridBody.open(row);
          }
      });
      },
      onInited() {
        //框架初始化配置后
        //如果要配置明细表,在此方法操作
        //this.detailOptions.columns.forEach(column=>{ });
      },
      searchBefore(param) {
        //界面查询前,可以给param.wheres添加查询参数
        //返回false,则不会执行查询
        return true;
      },
      searchAfter(result) {
        //查询后,result返回的查询数据,可以在显示到表格前处理表格的值
        return true;
      },
      addBefore(formData) {
        //新建保存前formData为对象,包括明细表,可以给给表单设置值,自己输出看formData的值
        return true;
      },
      updateBefore(formData) {
        //编辑保存前formData为对象,包括明细表、删除行的Id
        return true;
      },
      rowClick({ row, column, event }) {
        //查询界面点击行事件
        this.$refs.table.$refs.table.toggleRowSelection(row); //单击行时选中当前行;
      },
      modelOpenAfter(row) {
        //点击编辑、新建按钮弹出框后,可以在此处写逻辑,如,从后台获取数据
        //(1)判断是编辑还是新建操作: this.currentAction=='Add';
        //(2)给弹出框设置默认值
        //(3)this.editFormFields.字段='xxx';
        //如果需要给下拉框设置默认值,请遍历this.editFormOptions找到字段配置对应data属性的key值
        //看不懂就把输出看:console.log(this.editFormOptions)
      }
    }
  };
  export default extension;
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/extension/outbound/mesPPCutOutboundOrderDetail.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,73 @@
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
let extension = {
    components: {
      //查询界面扩展组件
      gridHeader: '',
      gridBody: gridBody,
      gridFooter: '',
      //新建、编辑弹出框扩展组件
      modelHeader: '',
      modelBody: '',
      modelFooter: ''
    },
    tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写)
    buttons: { view: [], box: [], detail: [] }, //扩展的按钮
    methods: {
       //下面这些方法可以保留也可以删除
      onInit() {
        //扩展页面初始化操作
        this.columns.push({
          field: '操作',
          title: '操作',
          width: 90,
          fixed: 'right',
          align: 'center',
          formatter: (row) => {
              return (
                  '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-view">查看明细</i>'
              );
          },
          click: (row) => {
              this.$refs.gridBody.open(row);
          }
      });
      },
      onInited() {
        //框架初始化配置后
        //如果要配置明细表,在此方法操作
        //this.detailOptions.columns.forEach(column=>{ });
      },
      searchBefore(param) {
        //界面查询前,可以给param.wheres添加查询参数
        //返回false,则不会执行查询
        return true;
      },
      searchAfter(result) {
        //查询后,result返回的查询数据,可以在显示到表格前处理表格的值
        return true;
      },
      addBefore(formData) {
        //新建保存前formData为对象,包括明细表,可以给给表单设置值,自己输出看formData的值
        return true;
      },
      updateBefore(formData) {
        //编辑保存前formData为对象,包括明细表、删除行的Id
        return true;
      },
      rowClick({ row, column, event }) {
        //查询界面点击行事件
        this.$refs.table.$refs.table.toggleRowSelection(row); //单击行时选中当前行;
      },
      modelOpenAfter(row) {
        //点击编辑、新建按钮弹出框后,可以在此处写逻辑,如,从后台获取数据
        //(1)判断是编辑还是新建操作: this.currentAction=='Add';
        //(2)给弹出框设置默认值
        //(3)this.editFormFields.字段='xxx';
        //如果需要给下拉框设置默认值,请遍历this.editFormOptions找到字段配置对应data属性的key值
        //看不懂就把输出看:console.log(this.editFormOptions)
      }
    }
  };
  export default extension;
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/extension/outbound/mesPPOutboundOrder.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,74 @@
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
import gridBody from './extend/mesPPoutOrderDetail.vue'
let extension = {
    components: {
      //查询界面扩展组件
      gridHeader: '',
      gridBody: gridBody,
      gridFooter: '',
      //新建、编辑弹出框扩展组件
      modelHeader: '',
      modelBody: '',
      modelFooter: ''
    },
    tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写)
    buttons: { view: [], box: [], detail: [] }, //扩展的按钮
    methods: {
       //下面这些方法可以保留也可以删除
      onInit() {
        //扩展页面初始化操作
        this.columns.push({
          field: '操作',
          title: '操作',
          width: 90,
          fixed: 'right',
          align: 'center',
          formatter: (row) => {
              return (
                  '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-view">查看明细</i>'
              );
          },
          click: (row) => {
              this.$refs.gridBody.open(row);
          }
      });
      },
      onInited() {
        //框架初始化配置后
        //如果要配置明细表,在此方法操作
        //this.detailOptions.columns.forEach(column=>{ });
      },
      searchBefore(param) {
        //界面查询前,可以给param.wheres添加查询参数
        //返回false,则不会执行查询
        return true;
      },
      searchAfter(result) {
        //查询后,result返回的查询数据,可以在显示到表格前处理表格的值
        return true;
      },
      addBefore(formData) {
        //新建保存前formData为对象,包括明细表,可以给给表单设置值,自己输出看formData的值
        return true;
      },
      updateBefore(formData) {
        //编辑保存前formData为对象,包括明细表、删除行的Id
        return true;
      },
      rowClick({ row, column, event }) {
        //查询界面点击行事件
        this.$refs.table.$refs.table.toggleRowSelection(row); //单击行时选中当前行;
      },
      modelOpenAfter(row) {
        //点击编辑、新建按钮弹出框后,可以在此处写逻辑,如,从后台获取数据
        //(1)判断是编辑还是新建操作: this.currentAction=='Add';
        //(2)给弹出框设置默认值
        //(3)this.editFormFields.字段='xxx';
        //如果需要给下拉框设置默认值,请遍历this.editFormOptions找到字段配置对应data属性的key值
        //看不懂就把输出看:console.log(this.editFormOptions)
      }
    }
  };
  export default extension;
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/extension/outbound/mesPPOutboundOrderDetail.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,57 @@
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
let extension = {
    components: {
      //查询界面扩展组件
      gridHeader: '',
      gridBody: gridBody,
      gridFooter: '',
      //新建、编辑弹出框扩展组件
      modelHeader: '',
      modelBody: '',
      modelFooter: ''
    },
    tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写)
    buttons: { view: [], box: [], detail: [] }, //扩展的按钮
    methods: {
       //下面这些方法可以保留也可以删除
      onInit() {
      },
      onInited() {
        //框架初始化配置后
        //如果要配置明细表,在此方法操作
        //this.detailOptions.columns.forEach(column=>{ });
      },
      searchBefore(param) {
        //界面查询前,可以给param.wheres添加查询参数
        //返回false,则不会执行查询
        return true;
      },
      searchAfter(result) {
        //查询后,result返回的查询数据,可以在显示到表格前处理表格的值
        return true;
      },
      addBefore(formData) {
        //新建保存前formData为对象,包括明细表,可以给给表单设置值,自己输出看formData的值
        return true;
      },
      updateBefore(formData) {
        //编辑保存前formData为对象,包括明细表、删除行的Id
        return true;
      },
      rowClick({ row, column, event }) {
        //查询界面点击行事件
        this.$refs.table.$refs.table.toggleRowSelection(row); //单击行时选中当前行;
      },
      modelOpenAfter(row) {
        //点击编辑、新建按钮弹出框后,可以在此处写逻辑,如,从后台获取数据
        //(1)判断是编辑还是新建操作: this.currentAction=='Add';
        //(2)给弹出框设置默认值
        //(3)this.editFormFields.字段='xxx';
        //如果需要给下拉框设置默认值,请遍历this.editFormOptions找到字段配置对应data属性的key值
        //看不懂就把输出看:console.log(this.editFormOptions)
      }
    }
  };
  export default extension;
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/router/viewGird.js
@@ -181,6 +181,22 @@
    name: 'mesOutboundOrder',
    component: () => import('@/views/outbound/mesOutboundOrder.vue')
  }, {
    path: '/mesPPOutboundOrder',
    name: 'mesPPOutboundOrder',
    component: () => import('@/views/outbound/mesPPOutboundOrder.vue')
  },{
    path: '/mesPPOutboundOrderDetail',
    name: 'mesPPOutboundOrderDetail',
    component: () => import('@/views/outbound/mesPPOutboundOrderDetail.vue')
  },{
    path: '/mesPPCutOutboundOrder',
    name: 'mesPPCutOutboundOrder',
    component: () => import('@/views/outbound/mesPPCutOutboundOrder.vue')
  }, {
    path: '/mesPPCutOutboundOrderDetail',
    name: 'mesPPCutOutboundOrderDetail',
    component: () => import('@/views/outbound/mesPPCutOutboundOrderDetail.vue')
  },{
    path: '/returnOrder',
    name: 'returnOrder',
    component: () => import('@/views/inbound/returnOrder.vue')
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/views/outbound/mesPPCutOutboundOrder.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,356 @@
<template>
  <view-grid
    ref="grid"
    :columns="columns"
    :detail="detail"
    :editFormFields="editFormFields"
    :editFormOptions="editFormOptions"
    :searchFormFields="searchFormFields"
    :searchFormOptions="searchFormOptions"
    :table="table"
    :extend="extend"
  >
  </view-grid>
</template>
    <script>
import extend from "@/extension/outbound/mesPPCutOutboundOrder.js";
import { ref, defineComponent } from "vue";
export default defineComponent({
  setup() {
    const table = ref({
      key: "id",
      footer: "Foots",
      cnName: "PP仓小卷MES出库单",
      name: "mesPPCutOutboundOrder",
      url: "/mesPPCutOutboundOrder/",
      sortName: "id",
    });
    const editFormFields = ref({
      orderType: "",
      orderNo: "",
      upperOrderNo: "",
      orderStatus: "",
      remark: "",
      warehouseId: "",
    });
    const editFormOptions = ref([
      [
        {
          title: "单据类型",
          required: true,
          field: "orderType",
          type: "select",
          dataKey: "outOrderType",
          data: [],
        },
        {
          field: "orderNo",
          title: "单据编号",
          type: "string",
          readonly: true,
        },
        {
          title: "单据状态",
          field: "orderStatus",
          type: "select",
          dataKey: "inboundState",
          data: [],
          readonly: true,
        },
        {
          title: "仓库",
          field: "warehouseId",
          type: "select",
          dataKey: "warehouses",
          data: [],
          required: true,
        },
        {
          title: "备注",
          field: "remark",
          type: "textarea",
        },
      ],
    ]);
    const searchFormFields = ref({
      orderNo: "",
      upperOrderNo: "",
      orderType: "",
      orderStatus: "",
      createType: "",
      creater: "",
      createDate: "",
    });
    const searchFormOptions = ref([
      [
        { title: "单据编号", field: "orderNo", type: "like" },
        {
          title: "单据类型",
          field: "orderType",
          type: "select",
          dataKey: "outOrderType",
          data: [],
        },
        {
          title: "单据状态",
          field: "orderStatus",
          type: "select",
          dataKey: "outboundStatusEnum",
          data: [],
        },
      ],
      [
        {
          title: "创建方式",
          field: "createType",
          type: "select",
          dataKey: "createType",
          data: [],
        },
        { title: "创建者", field: "creater", type: "like" },
        { title: "创建时间", field: "createDate", type: "datetime" },
      ],
    ]);
    const columns = ref([
      {
        field: "id",
        title: "Id",
        type: "int",
        width: 90,
        hidden: true,
        readonly: true,
        require: true,
        align: "left",
      },
      {
        field: "warehouseId",
        title: "仓库",
        type: "string",
        width: 90,
        align: "left",
        bind: { key: "warehouses", data: [] },
      },
      {
        field: "orderNo",
        title: "单据编号",
        type: "string",
        width: 160,
        align: "left",
        // link: true
      },
      {
        field: "orderType",
        title: "单据类型",
        type: "string",
        width: 150,
        align: "left",
        bind: { key: "outOrderType", data: [] },
      },
      {
        field: "orderStatus",
        title: "单据状态",
        type: "decimal",
        width: 90,
        align: "left",
        bind: { key: "outboundStatusEnum", data: [] },
      },
      {
        field: "createType",
        title: "创建方式",
        type: "string",
        width: 120,
        align: "left",
        bind: { key: "createType", data: [] },
      },
      {
        field: "creater",
        title: "创建人",
        type: "string",
        width: 90,
        align: "left",
      },
      {
        field: "createDate",
        title: "创建时间",
        type: "datetime",
        width: 160,
        align: "left",
      },
      {
        field: "modifier",
        title: "修改人",
        type: "string",
        width: 100,
        align: "left",
      },
      {
        field: "modifyDate",
        title: "修改时间",
        type: "datetime",
        width: 160,
        align: "left",
      },
    ]);
    const detail = ref({
      cnName: "出库明细单",
      table: "OnboundOrderDetail",
      columns: [
        {
          field: "id",
          title: "Id",
          type: "int",
          width: 90,
          hidden: true,
          readonly: true,
          require: true,
          align: "left",
        },
        {
          field: "orderId",
          title: "出库单主键",
          type: "string",
          width: 90,
          align: "left",
          hidden: true,
        },
        {
          field: "materielCode",
          title: "物料编号",
          type: "string",
          width: 150,
          align: "left",
          edit: { type: "string" },
          required: true,
        },
        {
          field: "materielName",
          title: "物料名称",
          type: "string",
          width: 150,
          align: "left",
          edit: { type: "string" },
        },
        {
          field: "batchNo",
          title: "批次号",
          type: "decimal",
          width: 90,
          align: "left",
          edit: { type: "string" },
          required: true,
        },
        {
          field: "orderQuantity",
          title: "单据数量",
          type: "string",
          width: 90,
          align: "left",
          edit: { type: "number" },
          required: true,
        },
        {
          field: "rowNo",
          title: "行号",
          type: "string",
          width: 90,
          align: "left",
          edit: { type: "number" },
          required: true,
        },
        {
          field: "lockQuantity",
          title: "锁定数量",
          type: "int",
          width: 120,
          align: "left",
        },
        {
          field: "overOutQuantity",
          title: "已出数量",
          type: "string",
          width: 200,
          align: "left",
        },
        {
          field: "orderDetailStatus",
          title: "订单明细状态",
          type: "string",
          width: 180,
          align: "left",
          bind: { key: "orderDetailStatusEnum", data: [] },
        },
        {
          field: "unit",
          title: "单位",
          type: "string",
          width: 90,
          align: "left",
        },
        {
          field: "LayerCode",
          title: "层别",
          type: "string",
          width: 180,
          align: "left",
        },
        {
          field: "Sequence",
          title: "序列",
          type: "int",
          width: 180,
          align: "left",
        },
        {
          field: "creater",
          title: "创建人",
          type: "string",
          width: 90,
          align: "left",
        },
        {
          field: "createDate",
          title: "创建时间",
          type: "datetime",
          width: 160,
          align: "left",
        },
        {
          field: "modifier",
          title: "修改人",
          type: "string",
          width: 100,
          align: "left",
        },
        {
          field: "modifyDate",
          title: "修改时间",
          type: "datetime",
          width: 160,
          align: "left",
        },
        {
          field: "remark",
          title: "备注",
          type: "string",
          width: 100,
          align: "left",
        },
      ],
      sortName: "id",
      key: "id",
    });
    return {
      table,
      extend,
      editFormFields,
      editFormOptions,
      searchFormFields,
      searchFormOptions,
      columns,
      detail,
    };
  },
});
</script>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/views/outbound/mesPPCutOutboundOrderDetail.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,256 @@
<template>
  <view-grid
    ref="grid"
    :columns="columns"
    :detail="detail"
    :editFormFields="editFormFields"
    :editFormOptions="editFormOptions"
    :searchFormFields="searchFormFields"
    :searchFormOptions="searchFormOptions"
    :table="table"
    :extend="extend"
  >
  </view-grid>
</template>
    <script>
import extend from "@/extension/outbound/mesPPCutOutboundOrderDetail.js";
import { ref, defineComponent } from "vue";
export default defineComponent({
  setup() {
    const table = ref({
      key: "id",
      footer: "Foots",
      cnName: "出库单明细",
      name: "mesPPCutOutboundOrderDetail",
      url: "/mesPPCutOutboundOrderDetail/",
      sortName: "id",
    });
    const editFormFields = ref({
      deviceCode: "",
      deviceName: "",
      deviceType: "",
      deviceStatus: "",
      deviceIp: "",
      devicePort: "",
      devicePlcType: "",
      deviceRemark: "",
    });
    const editFormOptions = ref([
      [
        {
          title: "设备编号",
          required: true,
          field: "deviceCode",
          type: "string",
        },
        {
          title: "设备名称",
          required: true,
          field: "deviceName",
          type: "string",
        },
        {
          title: "设备类型",
          required: true,
          field: "deviceType",
          type: "string",
        },
        {
          title: "设备状态",
          required: true,
          field: "deviceStatus",
          type: "string",
        },
      ],
      [
        { title: "设备IP", required: true, field: "deviceIp", type: "string" },
        {
          title: "设备端口",
          required: true,
          field: "devicePort",
          type: "string",
        },
        {
          title: "PLC类型",
          required: true,
          field: "devicePlcType",
          type: "string",
        },
        {
          title: "备注",
          field: "deviceRemark",
          type: "string",
        },
      ],
    ]);
    const searchFormFields = ref({
      deviceCode: "",
      deviceType: "",
      deviceStatus: "",
    });
    const searchFormOptions = ref([
      [
        { title: "设备编号", field: "deviceCode" },
        { title: "设备类型", field: "deviceType" },
        { title: "设备状态", field: "deviceStatus" },
      ],
    ]);
    const columns = ref([
      {
        field: "id",
        title: "Id",
        type: "int",
        width: 90,
        hidden: true,
        readonly: true,
        align: "left",
      },
      {
        field: "orderId",
        title: "出库单主键",
        type: "string",
        width: 90,
        align: "left",
        hidden: true,
      },
      {
        field: "materielCode",
        title: "物料编号",
        type: "string",
        width: 150,
        align: "left",
      },
      {
        field: "materielName",
        title: "物料名称",
        type: "string",
        width: 150,
        align: "left",
      },
      {
        field: "batchNo",
        title: "批次号",
        type: "decimal",
        width: 90,
        align: "left",
      },
      {
        field: "orderQuantity",
        title: "单据数量",
        type: "string",
        width: 90,
        align: "left",
      },
      {
        field: "lockQuantity",
        title: "锁定数量",
        type: "int",
        width: 120,
        align: "left",
      },
      {
        field: "overOutQuantity",
        title: "已出数量",
        type: "string",
        width: 200,
        align: "left",
      },
      {
        field: "unit",
        title: "单位",
        type: "string",
        width: 90,
        align: "left",
      },
      {
        field: "targetAddressCode",
        title: "线边仓地址码",
        type: "string",
        width: 100,
        align: "left",
      },
      {
        field: "width",
        title: "裁切宽",
        type: "string",
        width: 100,
        align: "left",
      },
      {
        field: "orderDetailStatus",
        title: "订单明细状态",
        type: "string",
        width: 180,
        align: "left",
      },
      {
        field: "LayerCode",
        title: "层别",
        type: "string",
        width: 180,
        align: "left",
      },
      {
        field: "Sequence",
        title: "序列",
        type: "int",
        width: 180,
        align: "left",
      },
      {
        field: "creater",
        title: "创建人",
        type: "string",
        width: 90,
        align: "left",
      },
      {
        field: "createDate",
        title: "创建时间",
        type: "datetime",
        width: 160,
        align: "left",
      },
      {
        field: "modifier",
        title: "修改人",
        type: "string",
        width: 100,
        align: "left",
      },
      {
        field: "modifyDate",
        title: "修改时间",
        type: "datetime",
        width: 160,
        align: "left",
      },
      {
        field: "remark",
        title: "备注",
        type: "string",
        width: 100,
        align: "left",
      },
    ]);
    const detail = ref({
      cnName: "#detailCnName",
      table: "",
      columns: [],
      sortName: "",
    });
    return {
      table,
      extend,
      editFormFields,
      editFormOptions,
      searchFormFields,
      searchFormOptions,
      columns,
      detail,
    };
  },
});
</script>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/views/outbound/mesPPOutboundOrder.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,259 @@
<template>
  <view-grid
    ref="grid"
    :columns="columns"
    :detail="detail"
    :editFormFields="editFormFields"
    :editFormOptions="editFormOptions"
    :searchFormFields="searchFormFields"
    :searchFormOptions="searchFormOptions"
    :table="table"
    :extend="extend"
  >
  </view-grid>
</template>
    <script>
import extend from "@/extension/outbound/mesPPOutboundOrder.js";
import { ref, defineComponent } from "vue";
export default defineComponent({
  setup() {
    const table = ref({
      key: "id",
      footer: "Foots",
      cnName: "PP仓大卷MES出库单",
      name: "mesPPOutboundOrder",
      url: "/mesPPOutboundOrder/",
      sortName: "id",
    });
    const editFormFields = ref({});
    const editFormOptions = ref([[]]);
    const searchFormFields = ref({
      orderNo: "",
      materialCode: "",
      batchNo: "",
    });
    const searchFormOptions = ref([
      [
        { title: "单据编号", field: "orderNo", type: "like" },
        { title: "物料编号", field: "materialCode", type: "like" },
        { title: "批次号", field: "batchNo", type: "like" },
      ],
    ]);
    const columns = ref([
      {
        field: "id",
        title: "Id",
        type: "int",
        width: 90,
        hidden: true,
        readonly: true,
        align: "left",
      },
      {
        field: "warehouseId",
        title: "所属仓库",
        type: "string",
        width: 80,
        align: "left",
        bind: { key: "warehouses", data: [] },
      },
      {
        field: "orderNo",
        title: "单据编号",
        type: "string",
        width: 150,
        align: "left",
      },
      {
        field: "taskNo",
        title: "任务单号",
        type: "string",
        width: 150,
        align: "left",
      },
      // {
      //   field: "batchNo",
      //   title: "批次号",
      //   type: "decimal",
      //   width: 90,
      //   align: "left",
      // },
      {
        field: "OrderStatus",
        title: "订单状态",
        type: "string",
        width: 180,
        align: "left",
        bind: { key: "orderDetailStatusEnum", data: [] },
      },
      {
        field: "materialCode",
        title: "物料编号",
        type: "string",
        width: 200,
        align: "left",
      },
      {
        field: "materialName",
        title: "物料名称",
        type: "string",
        width: 180,
        align: "left",
      },
      {
        field: "createType",
        title: "创建方式",
        type: "string",
        width: 120,
        align: "left",
        bind: { key: "createType", data: [] },
      },
      {
        field: "unit",
        title: "单位",
        type: "string",
        width: 90,
        align: "left",
      },
      {
        field: "orderQuantity",
        title: "单据数量",
        type: "datetime",
        width: 160,
        align: "left",
      },
      {
        field: "lockQuantity",
        title: "锁定数量",
        type: "string",
        width: 100,
        align: "left",
      },
      {
        field: "overOutQuantity",
        title: "已出数量",
        type: "datetime",
        width: 160,
        align: "left",
      },
      {
        field: "line",
        title: "线体",
        type: "string",
        width: 100,
        align: "left",
      },
      {
        field: "targetAddressCode",
        title: "线边仓地址码",
        type: "string",
        width: 100,
        align: "left",
      },
      {
        field: "width",
        title: "裁切宽",
        type: "string",
        width: 100,
        align: "left",
      },
    ]);
    const detail = ref({
      cnName: "出库明细单",
      table: "OnboundOrderDetail",
      columns: [
        {
          field: "id",
          title: "Id",
          type: "int",
          width: 90,
          hidden: true,
          readonly: true,
          require: true,
          align: "left",
        },
        {
          field: "orderId",
          title: "出库单主键",
          type: "string",
          width: 90,
          align: "left",
          hidden: true,
        },
        {
          field: "Warehouse",
          title: "库区",
          type: "string",
          width: 150,
          align: "left",
        },
        {
          field: "CarrierCode",
          title: "载具号",
          type: "string",
          width: 150,
          align: "left",
        },
        {
          field: "orderDetailStatus",
          title: "订单明细状态",
          type: "string",
          width: 180,
          align: "left",
          bind: { key: "orderDetailStatusEnum", data: [] },
        },
        {
          field: "creater",
          title: "创建人",
          type: "string",
          width: 90,
          align: "left",
        },
        {
          field: "createDate",
          title: "创建时间",
          type: "datetime",
          width: 160,
          align: "left",
        },
        {
          field: "modifier",
          title: "修改人",
          type: "string",
          width: 100,
          align: "left",
        },
        {
          field: "modifyDate",
          title: "修改时间",
          type: "datetime",
          width: 160,
          align: "left",
        },
        {
          field: "remark",
          title: "备注",
          type: "string",
          width: 100,
          align: "left",
        },
      ],
      sortName: "id",
      key: "id",
    });
    return {
      table,
      extend,
      editFormFields,
      editFormOptions,
      searchFormFields,
      searchFormOptions,
      columns,
      detail,
    };
  },
});
</script>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/views/outbound/mesPPOutboundOrderDetail.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,149 @@
<template>
    <view-grid
      ref="grid"
      :columns="columns"
      :detail="detail"
      :editFormFields="editFormFields"
      :editFormOptions="editFormOptions"
      :searchFormFields="searchFormFields"
      :searchFormOptions="searchFormOptions"
      :table="table"
      :extend="extend"
    >
    </view-grid>
  </template>
    <script>
  import extend from "@/extension/outbound/mesPPOutboundOrderDetail.js";
  import { ref, defineComponent } from "vue";
  export default defineComponent({
    setup() {
      const table = ref({
        key: "id",
        footer: "Foots",
        cnName: "PP仓大卷MES出库单明细",
        name: "mesPPOutboundOrderDetail",
        url: "/mesPPOutboundOrderDetail/",
        sortName: "id",
      });
      const editFormFields = ref({
      });
      const editFormOptions = ref([
        [
        ],
      ]);
      const searchFormFields = ref({
        orderNo: "",
        materialCode: "",
        batchNo: "",
      });
      const searchFormOptions = ref([
        [
          { title: "单据编号", field: "orderNo", type:"like" },
          { title: "物料编号", field: "materialCode" ,type:"like"},
          { title: "批次号", field: "batchNo" ,type:"like"},
        ],
      ]);
      const columns = ref([
      {
          field: "id",
          title: "Id",
          type: "int",
          width: 90,
          hidden: true,
          readonly: true,
          align: "left",
        },
        {
          field: "OrderId",
          title: "出库单主键",
          type: "string",
          width: 80,
          align: "left",
          bind: { key: "warehouses", data: [] },
        },
        {
          field: "Warehouse",
          title: "库区",
          type: "string",
          width: 150,
          align: "left",
        },
        {
          field: "CarrierCode",
          title: "载具号",
          type: "string",
          width: 150,
          align: "left",
        },
        {
          field: "createType",
          title: "创建方式",
          type: "string",
          width: 120,
          align: "left",
          bind: { key: "createType", data: [] },
        },
            {
          field: "orderDetailStatus",
          title: "订单明细状态",
          type: "string",
          width: 180,
          align: "left",
        },
        {
          field: "creater",
          title: "创建人",
          type: "string",
          width: 90,
          align: "left",
        },
        {
          field: "createDate",
          title: "创建时间",
          type: "datetime",
          width: 160,
          align: "left",
        },
        {
          field: "modifier",
          title: "修改人",
          type: "string",
          width: 100,
          align: "left",
        },
        {
          field: "modifyDate",
          title: "修改时间",
          type: "datetime",
          width: 160,
          align: "left",
        },
        {
          field: "remark",
          title: "备注",
          type: "string",
          width: 100,
          align: "left",
        },
      ]);
      const detail = ref({
        cnName: "#detailCnName",
        table: "",
        columns: [],
        sortName: "",
      });
      return {
        table,
        extend,
        editFormFields,
        editFormOptions,
        searchFormFields,
        searchFormOptions,
        columns,
        detail,
      };
    },
  });
  </script>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/00e22ada-36c2-42fa-ba01-39bb171b9b5f.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/01b812bf-9885-4a77-95d8-f05c785d7354.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/1835396e-ee0b-4003-b5af-b6427288d0f6.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/2a6737f2-ed15-4243-99f4-32f56eae41df.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/3c53f8c2-2194-4cf0-8343-aca04ba405cc.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/47dfe2fa-2b55-44f1-9467-56f17ea6232a.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/736d9a07-7f63-4075-b18a-3910cc852c4c.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/7badb44d-00b3-43fa-954b-a0f65ce3bdd5.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/b0f7d90e-1d2b-41fa-bdc4-6751c11f6ed9.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_BasicRepository/LocationInfoRepository.cs
@@ -84,5 +84,15 @@
        {
            return QueryData(x => x.LocationCode, x => x.WarehouseId == warehouseId && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyOut.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())).Distinct().ToList();
        }
        /// <summary>
        /// èŽ·å–MES指定可出库货位编号
        /// </summary>
        /// <param name="warehouseId"></param>
        /// <returns></returns>
        public List<string> GetCanOutLocationCodes(string locationcode)
        {
            return QueryData(x => x.LocationCode, x => x.LocationCode == locationcode && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyOut.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())).Distinct().ToList();
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/MesResponseContent.cs
@@ -29,6 +29,38 @@
        /// 
        /// </summary>
        public DateTime DataTime { get; set; }
        /// <summary>
        /// ç‰©æ–™ç¼–码
        /// </summary>
        public string MaterialCode { get; set; }
        /// <summary>
        /// æ•°é‡
        /// </summary>
        public float Quantity { get; set; }
        /// <summary>
        /// å•位
        /// </summary>
        public string Unit { get; set; }
        /// <summary>
        /// åº“区
        /// </summary>
        public string Warehouse { get; set; }
        /// <summary>
        /// åº“区名称
        /// </summary>
        public string WarehouseName { get; set; }
        /// <summary>
        /// è£åˆ‡åŽå®½åº¦
        /// </summary>
        public float CutedWidth { get; set; }
        /// <summary>
        /// è½½å…·å·
        /// </summary>
        public string CarrierCode { get; set; }
        /// <summary>
        /// ç‰©æ–™æ‰¹æ¬¡
        /// </summary>
        public string MaterialLot { get; set; }
        public static MesResponseContent Instance
        {
@@ -56,4 +88,11 @@
    {
        public string Contacts { get; set; }
    }
    /// <summary>
    /// PP库存查询,回复MES
    /// </summary>
    public class QueryPpByWidthModelCount
    {
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/PPSubsectionModel.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,194 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.Attributes;
namespace WIDESEA_DTO.MES
{
    /// <summary>
    /// PP大卷出库
    /// </summary>
    public class PPSubsectionOutModel
    {
        /// <summary>
        /// ä»»åŠ¡å•å·
        /// </summary>
        public string TaskNo { get; set; }
        /// <summary>
        /// ç‰©æ–™ç¼–码
        /// </summary>
        public string MaterialCode { get; set; }
        /// <summary>
        /// ç‰©æ–™åç§°
        /// </summary>
        public string MaterialName { get; set; }
        /// <summary>
        /// éœ€æ±‚数量
        /// </summary>
        public float RequiredQuantity { get; set; }
        /// <summary>
        /// å•位
        /// </summary>
        public string Unit { get; set; }
        /// <summary>
        /// çº¿è¾¹ä»“地址码
        /// </summary>
        public string TargetAddressCode { get; set; }
        /// <summary>
        /// è£åˆ‡å®½
        /// </summary>
        public float Width { get; set; }
        /// <summary>
        /// è½½å…·åˆ—表
        /// </summary>
        public List<CarrierInfo> Carriers { get; set; }
    }
    /// <summary>
    /// è½½å…·åˆ—表明细
    /// </summary>
    [ModelValidate]
    public class CarrierInfo
    {
        /// <summary>
        /// åº“区
        /// </summary>
        public string Warehouse { get; set; }
        /// <summary>
        /// è½½å…·å·
        /// </summary>
        public string CarrierCode { get; set; }
    }
    /// <summary>
    /// pp小卷出库
    /// </summary>
    public class PPCutOutModle
    {
        /// <summary>
        /// ä»»åŠ¡å•å·
        /// </summary>
        public string TaskNo { get; set; }
        /// <summary>
        /// ç‰©æ–™è¯¦æƒ…
        /// </summary>
        public List<MaterialDetail> MaterialDetails { get; set; }
    }
    /// <summary>
    /// ç‰©æ–™è¯¦æƒ…明细
    /// </summary>
    [ModelValidate]
    public class MaterialDetail
    {
        /// <summary>
        /// ç‰©æ–™ç¼–码
        /// </summary>
        public string MaterialCode { get; set; }
        /// <summary>
        /// ç‰©æ–™åç§°
        /// </summary>
        public string MaterialName { get; set; }
        /// <summary>
        /// éœ€æ±‚数量
        /// </summary>
        public float RequiredQuantity { get; set; }
        /// <summary>
        /// å•位
        /// </summary>
        public string Unit { get; set; }
        /// <summary>
        /// å±‚别
        /// </summary>
        public string LayerCode { get; set; }
        /// <summary>
        /// åºåˆ—
        /// </summary>
        public int Sequence { get; set; }
        /// <summary>
        /// çº¿è¾¹ä»“地址
        /// </summary>
        public string TargetAddressCode { get; set; }
        /// <summary>
        /// è£åˆ‡å®½
        /// </summary>
        public float Width { get; set; }
    }
    /// <summary>
    /// PP入库
    /// </summary>
    public class PPBackModel
    {
        /// <summary>
        /// æºåœ°å€ç 
        /// </summary>
        public string SourceAddressCode {  get; set; }
        /// <summary>
        ///载具号
        /// </summary>
        public string CarrierCode { get; set; }
        /// <summary>
        /// æ‰¹æ¬¡ä¿¡æ¯
        /// </summary>
        public List<MaterialLotInfo> MaterialLotInfo { get; set; }
    }
    /// <summary>
    /// æ‰¹æ¬¡ä¿¡æ¯æ˜Žç»†
    /// </summary>
    [ModelValidate]
    public class MaterialLotInfo
    {
        /// <summary>
        /// ç‰©æ–™æ‰¹æ¬¡
        /// </summary>
        public string MaterialLot {  get; set; }
        /// <summary>
        /// ç‰©æ–™ç¼–码
        /// </summary>
        public string MaterialCode { get; set; }
        /// <summary>
        /// é€€åº“数量
        /// </summary>
        public float Quantity { get; set; }
        /// <summary>
        /// è£åˆ‡åŽå®½åº¦
        /// </summary>
        public float CutedWidth { get; set; }
        /// <summary>
        /// åŽŸç‰©æ–™æ‰¹æ¬¡å·
        /// </summary>
        public string MaterialLotOld { get; set; }
        /// <summary>
        /// å•位
        /// </summary>
        public string Unit { get; set; }
        /// <summary>
        /// ç”Ÿäº§æ—¥æœŸ
        /// </summary>
        public string ProductionDate { get; set; }
        /// <summary>
        /// æœ‰æ•ˆæœŸ
        /// </summary>
        public string ExpirationDate { get; set; }
    }
    /// <summary>
    /// PP库存查询
    /// </summary>
    public class QueryPpByWidthModel
    {
        /// <summary>
        /// ç‰©æ–™ç¼–码
        /// </summary>
        public string MaterialCode { get; set; }
        /// <summary>
        /// è£åˆ‡åŽå®½åº¦
        /// </summary>
        public float CutedWidth { get; set; }
        /// <summary>
        /// åº“区类型
        /// </summary>
        public int WarehouseType { get; set; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IBasicRepository/ILocationInfoRepository.cs
@@ -52,5 +52,12 @@
        /// <param name="warehouseId"></param>
        /// <returns></returns>
        List<string> GetCanOutLocationCodes(int warehouseId);
        /// <summary>
        /// èŽ·å–MES指定可出库货位编号
        /// </summary>
        /// <param name="warehouseId"></param>
        /// <returns></returns>
        List<string> GetCanOutLocationCodes(string locationcode);
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IInboundRepository/IMesPPBackInboundOrderDetailRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Model.Models.Inbound;
namespace WIDESEA_IInboundRepository
{
    public interface IMesPPBackInboundOrderDetailRepository : IRepository<Dt_MesPPBackInboundOrderDetail>
    {
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IInboundRepository/IMesPPBackInboundOrderRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Model.Models.Inbound;
using WIDESEA_Model.Models.Outbound;
namespace WIDESEA_IInboundRepository
{
    public interface IMesPPBackInboundOrderRepository : IRepository<Dt_MesPPBackInboundOrder>
    {
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IMesPPBackInboundOrderDetailService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseServices;
using WIDESEA_Model.Models.Inbound;
namespace WIDESEA_IInboundService
{
    public interface IMesPPBackInboundOrderDetailService : IService<Dt_MesPPBackInboundOrderDetail>
    {
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IMesPPBackInboundOrderService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseServices;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.Inbound;
namespace WIDESEA_IInboundService
{
    public interface IMesPPBackInboundOrderService : IService<Dt_MesPPBackInboundOrder>
    {
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundRepository/IMesPPCutOutboundOrderDetailRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.Outbound;
namespace WIDESEA_IOutboundRepository
{
    public interface IMesPPCutOutboundOrderDetailRepository : IRepository<Dt_MesPPCutOutboundOrderDetail>
    {
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundRepository/IMesPPCutOutboundOrderRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.Outbound;
namespace WIDESEA_IOutboundRepository
{
    public interface IMesPPCutOutboundOrderRepository : IRepository<Dt_MesPPCutOutboundOrder>
    {
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundRepository/IMesPPOutboundOrderDetailRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.Outbound;
namespace WIDESEA_IOutboundRepository
{
    public interface IMesPPOutboundOrderDetailRepository : IRepository<Dt_MesPPOutboundOrderDetail>
    {
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundRepository/IMesPPOutboundOrderRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Model.Models;
namespace WIDESEA_IOutboundRepository
{
    public interface IMesPPOutboundOrderRepository : IRepository<Dt_MesPPOutboundOrder>
    {
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IMesPPCutOutboundOrderDetailService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseServices;
using WIDESEA_Model.Models;
namespace WIDESEA_IOutboundService
{
    public interface IMesPPCutOutboundOrderDetailService : IService<Dt_MesPPCutOutboundOrderDetail>
    {
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IMesPPCutOutboundOrderService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseServices;
using WIDESEA_IOutboundRepository;
using WIDESEA_Model.Models.Outbound;
namespace WIDESEA_IOutboundService
{
    public interface IMesPPCutOutboundOrderService : IService<Dt_MesPPCutOutboundOrder>
    {
        IMesPPCutOutboundOrderRepository Repository { get; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IMesPPOutboundOrderDetailService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting.Server;
using WIDESEA_Core.BaseServices;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.Outbound;
namespace WIDESEA_IOutboundService
{
    public interface IMesPPOutboundOrderDetailService : IService<Dt_MesPPOutboundOrderDetail>
    {
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IMesPPOutboundOrderService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseServices;
using WIDESEA_IOutboundRepository;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.Outbound;
namespace WIDESEA_IOutboundService
{
    public interface IMesPPOutboundOrderService : IService<Dt_MesPPOutboundOrder>
    {
        IMesPPOutboundOrderRepository Repository { get; }
        (List<Dt_StockInfo>, Dt_MesPPOutboundOrder, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) AssignStockOutbound(Dt_MesPPOutboundOrder mesOutboundOrder);
        (List<Dt_StockInfo>, Dt_MesPPCutOutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) AssignStockOutbound(Dt_MesPPCutOutboundOrder mesPPOutboundOrder, Dt_MesPPCutOutboundOrderDetail  mesPPCutOutboundOrderDetail);
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutStockLockInfoService.cs
@@ -9,6 +9,7 @@
using WIDESEA_Core.Enums;
using WIDESEA_IOutboundRepository;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.Outbound;
namespace WIDESEA_IOutboundService
{
@@ -41,7 +42,7 @@
        Dt_OutStockLockInfo GetOutStockLockInfo(Dt_OutboundOrder outboundOrder, Dt_OutboundOrderDetail outboundOrderDetail, Dt_StockInfo outStock, float assignQuantity, int? taskNum = null);
        /// <summary>
        ///
        /// PP大卷出库
        /// </summary>
        /// <param name="mesOutboundOrder"></param>
        /// <param name="outStock"></param>
@@ -51,6 +52,26 @@
        Dt_OutStockLockInfo GetOutStockLockInfo(Dt_MesOutboundOrder mesOutboundOrder, Dt_StockInfo outStock, float assignQuantity, int? taskNum = null);
        /// <summary>
        /// PP小卷出库
        /// </summary>
        /// <param name="mesOutboundOrder"></param>
        /// <param name="outStock"></param>
        /// <param name="assignQuantity"></param>
        /// <param name="taskNum"></param>
        /// <returns></returns>
        Dt_OutStockLockInfo GetOutStockLockInfo(Dt_MesPPCutOutboundOrder mesPPCutOutboundOrder,Dt_MesPPCutOutboundOrderDetail  mesPPCutOutboundOrderDetail, Dt_StockInfo outStock, float assignQuantity, int? taskNum = null);
        /// <summary>
        ///
        /// </summary>
        /// <param name="mesOutboundOrder"></param>
        /// <param name="outStock"></param>
        /// <param name="assignQuantity"></param>
        /// <param name="taskNum"></param>
        /// <returns></returns>
        Dt_OutStockLockInfo GetOutStockLockInfo(Dt_MesPPOutboundOrder mesPPOutboundOrder, Dt_StockInfo outStock, float assignQuantity, int? taskNum = null);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="orderDetailId"></param>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundService.cs
@@ -16,5 +16,13 @@
        IOutboundOrderService OutboundOrderService { get; }
        IOutStockLockInfoService OutboundStockLockInfoService { get; }
        IMesPPOutboundOrderService MesPPOutboundOrderService { get; }
        IMesPPOutboundOrderDetailService MesPPOutboundOrderDetailService { get; }
        IMesPPCutOutboundOrderService MesPPCutOutboundOrderService { get; }
        IMesPPCutOutboundOrderDetailService MesPPCutOutboundOrderDetailService { get; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IStockService/IStockInfoService.cs
@@ -21,6 +21,8 @@
        List<Dt_StockInfo> GetOutboundStocks(List<Dt_StockInfo> stockInfos, string materielCode, float needQuantity, out float residueQuantity);
        List<Dt_StockInfo> GetUseableStocks(string materielCode, string batchNo, int warehoseId);
        List<Dt_StockInfo> GetUseableStocks(string materielCode, string batchNo, string palletcode,int warehoseId);
        WebResponseContent StockQueryData(SaveModel saveModel);
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs
@@ -225,6 +225,33 @@
        MesResponseContent SubstrateBack(SubstrateBackModel model);
        /// <summary>
        /// PP大卷出库-进行分卷
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        MesResponseContent PPSubsectionOut(PPSubsectionOutModel model);
        /// <summary>
        /// PP小卷出库
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        MesResponseContent PPCutOut(PPCutOutModle model);
        /// <summary>
        /// PP入库(大卷、小卷、张料)
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        MesResponseContent PPBack(PPBackModel model);
        /// <summary>
        /// PP库存查询
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        MesResponseContent QueryPpByWidth(QueryPpByWidthModel model);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="roadwayNos"></param>
@@ -271,6 +298,13 @@
        /// <returns></returns>
        WebResponseContent UpdateTaskInfo(WCSTaskDTO task);
        /// <summary>
        /// PP仓agv搬运任务
        /// </summary>
        /// <param name="task"></param>
        /// <returns></returns>
        WebResponseContent AGVTasks(SaveModel saveModel);
        WebResponseContent GeneratePKOutboundTask(int orderDetailId, List<StockSelectViewDTO> stockSelectViews);
    }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_InboundRepository/MesPPBackInboundOrderDetailRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseRepository;
using WIDESEA_IInboundRepository;
using WIDESEA_Model.Models.Inbound;
namespace WIDESEA_InboundRepository
{
    public class MesPPBackInboundOrderDetailRepository : RepositoryBase<Dt_MesPPBackInboundOrderDetail>, IMesPPBackInboundOrderDetailRepository
    {
        public MesPPBackInboundOrderDetailRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
        {
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_InboundRepository/MesPPBackInboundOrderRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseRepository;
using WIDESEA_IInboundRepository;
using WIDESEA_Model.Models.Inbound;
using WIDESEA_Model.Models.Outbound;
namespace WIDESEA_InboundRepository
{
    public class MesPPBackInboundOrderRepository : RepositoryBase<Dt_MesPPBackInboundOrder>, IMesPPBackInboundOrderRepository
    {
        public MesPPBackInboundOrderRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
        {
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/MesPPBackInboundOrderDetailService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseServices;
using WIDESEA_IBasicRepository;
using WIDESEA_IBasicService;
using WIDESEA_IInboundRepository;
using WIDESEA_IInboundService;
using WIDESEA_IOutboundService;
using WIDESEA_IRecordService;
using WIDESEA_IStockService;
using WIDESEA_Model.Models.Inbound;
namespace WIDESEA_InboundService
{
    public class MesPPBackInboundOrderDetailService : ServiceBase<Dt_MesPPBackInboundOrderDetail, IMesPPBackInboundOrderDetailRepository>, IMesPPBackInboundOrderDetailService
    {
        private readonly IBasicRepository _basicRepository;
        private readonly IStockService _stockService;
        private readonly IOutStockLockInfoService _outStockLockInfoService;
        private readonly IBasicService _basicService;
        private readonly IRecordService _recordService;
        public IMesPPBackInboundOrderDetailRepository Repository => BaseDal;
        public MesPPBackInboundOrderDetailService(IMesPPBackInboundOrderDetailRepository BaseDal, IBasicRepository basicRepository, IStockService stockService, IOutStockLockInfoService outStockLockInfoService, IBasicService basicService, IRecordService recordService) : base(BaseDal)
        {
            _basicRepository = basicRepository;
            _stockService = stockService;
            _outStockLockInfoService = outStockLockInfoService;
            _basicService = basicService;
            _recordService = recordService;
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/MesPPBackInboundOrderService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseServices;
using WIDESEA_IBasicRepository;
using WIDESEA_IBasicService;
using WIDESEA_IInboundRepository;
using WIDESEA_IInboundService;
using WIDESEA_IOutboundRepository;
using WIDESEA_IOutboundService;
using WIDESEA_IRecordService;
using WIDESEA_IStockService;
using WIDESEA_Model.Models.Inbound;
using WIDESEA_Model.Models.Outbound;
namespace WIDESEA_InboundService
{
    public class MesPPBackInboundOrderService : ServiceBase<Dt_MesPPBackInboundOrder, IMesPPBackInboundOrderRepository>, IMesPPBackInboundOrderService
    {
        private readonly IBasicRepository _basicRepository;
        private readonly IStockService _stockService;
        private readonly IOutStockLockInfoService _outStockLockInfoService;
        private readonly IBasicService _basicService;
        private readonly IRecordService _recordService;
        public IMesPPBackInboundOrderRepository Repository => BaseDal;
        public MesPPBackInboundOrderService(IMesPPBackInboundOrderRepository BaseDal, IBasicRepository basicRepository, IStockService stockService, IOutStockLockInfoService outStockLockInfoService, IBasicService basicService, IRecordService recordService) : base(BaseDal)
        {
            _basicRepository = basicRepository;
            _stockService = stockService;
            _outStockLockInfoService = outStockLockInfoService;
            _basicService = basicService;
            _recordService = recordService;
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_MesPPBackInboundOrder.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,79 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;
using WIDESEA_Core.Attributes;
using WIDESEA_Core.CodeConfigEnum;
using WIDESEA_Core.DB.Models;
namespace WIDESEA_Model.Models.Inbound
{
    /// <summary>
    /// PP入库单
    /// </summary>
    [SugarTable(nameof(Dt_MesPPBackInboundOrder), "PP入库单")]
    public class Dt_MesPPBackInboundOrder : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// ä»“库主键
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "仓库主键")]
        public int WarehouseId { get; set; }
        /// <summary>
        /// å•据编号
        /// </summary>
        [CodeRule(RuleCodeEnum.InboundOrderRule)]
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "单据编号")]
        public string InboundOrderNo { get; set; }
        /// <summary>
        /// åŽŸåœ°å€ç 
        /// </summary>
        //[CodeRule(RuleCodeEnum.InboundOrderRule)]
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "原地址码")]
        public string SourceAddressCode { get; set; }
        /// <summary>
        /// è½½å…·å·
        /// </summary>
        //[CodeRule(RuleCodeEnum.InboundOrderRule)]
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "载具号")]
        public string CarrierCode { get; set; }
        /// <summary>
        /// å•据类型
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "单据类型")]
        public int OrderType { get; set; }
        /// <summary>
        /// å•据状态
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "单据状态")]
        public int OrderStatus { get; set; }
        /// <summary>
        /// åˆ›å»ºæ–¹å¼
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "创建方式")]
        public int CreateType { get; set; }
        /// <summary>
        /// å¤‡æ³¨
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "备注")]
        public string Remark { get; set; }
        /// <summary>
        /// å…¥åº“单明细
        /// </summary>
        [Navigate(NavigateType.OneToMany, nameof(Dt_MesPPBackInboundOrderDetail.OrderId), nameof(Id))]
        public List<Dt_MesPPBackInboundOrderDetail> Details { get; set; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_MesPPBackInboundOrderDetail.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,116 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;
using WIDESEA_Core.DB.Models;
namespace WIDESEA_Model.Models.Inbound
{
    /// <summary>
    /// PP入库单明细
    /// </summary>
    [SugarTable(nameof(Dt_MesPPBackInboundOrderDetail), "PP入库单明细")]
    public class Dt_MesPPBackInboundOrderDetail : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// å…¥åº“单主键
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "入库单主键")]
        public int OrderId { get; set; }
        /// <summary>
        /// ç‰©æ–™ç¼–号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "物料编号")]
        public string MaterielCode { get; set; }
        /// <summary>
        /// ç‰©æ–™åç§°
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 200, ColumnDescription = "物料名称")]
        public string MaterielName { get; set; }
        /// <summary>
        /// æ‰¹æ¬¡å·
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "批次号")]
        public string MaterialLot { get; set; }
        /// <summary>
        /// ç‰©æ–™è§„æ ¼
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "物料规格")]
        public string MaterielSpec { get; set; }
        /// <summary>
        /// å•据数量
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "单据数量")]
        public float OrderQuantity { get; set; }
        /// <summary>
        /// ç»„盘数量
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "组盘数量", DefaultValue = "0")]
        public float ReceiptQuantity { get; set; }
        /// <summary>
        /// ä¸Šæž¶æ•°é‡
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "上架数量", DefaultValue = "0")]
        public float OverInQuantity { get; set; }
        /// <summary>
        /// è®¢å•明细状态
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "订单明细状态")]
        public int OrderDetailStatus { get; set; }
        /// <summary>
        /// å•位
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "单位")]
        public string Unit { get; set; }
        /// <summary>
        /// æ”¶è´§å•明细行号
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "收货单明细行号")]
        public int RowNo { get; set; }
        /// <summary>
        /// å¤‡æ³¨
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "备注")]
        public string Remark { get; set; }
        /// <summary>
        /// è£åˆ‡å®½
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "裁切宽")]
        public float CutedWidth { get; set; }
        /// <summary>
        /// åŽŸç‰©æ–™æ‰¹æ¬¡å·
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "原物料批次号")]
        public string MaterialLotOld { get; set; }
        /// <summary>
        /// ç”Ÿäº§æ—¥æœŸ
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "生产日期")]
        public string ProductionDate { get; set; }
        /// <summary>
        /// æœ‰æ•ˆæ—¥æœŸ
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "有效日期")]
        public string EffectiveDate { get; set; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_MesPPCutOutboundOrder.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;
using WIDESEA_Core.Attributes;
using WIDESEA_Core.CodeConfigEnum;
using WIDESEA_Core.DB.Models;
namespace WIDESEA_Model.Models.Outbound
{
    /// <summary>
    /// PP仓小卷MES出库单
    /// </summary>
    [SugarTable(nameof(Dt_MesPPCutOutboundOrder))]
    public class Dt_MesPPCutOutboundOrder : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// ä»“库主键
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "仓库主键")]
        public int WarehouseId { get; set; }
        /// <summary>
        /// å•据编号
        /// </summary>
        [CodeRule(RuleCodeEnum.OutboundOrderRule)]
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "单据编号", IsOnlyIgnoreUpdate = true)]
        public string OrderNo { get; set; }
        /// <summary>
        /// ä»»åŠ¡å•å·
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "任务单号")]
        public string TaskNo { get; set; }
        /// <summary>
        /// å•据类型
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "单据类型", IsOnlyIgnoreUpdate = true)]
        public int OrderType { get; set; }
        /// <summary>
        /// å•据状态
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "单据状态")]
        public int OrderStatus { get; set; }
        /// <summary>
        /// åˆ›å»ºæ–¹å¼
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "创建方式", IsOnlyIgnoreUpdate = true)]
        public int CreateType { get; set; }
        /// <summary>
        /// å‡ºåº“单明细
        /// </summary>
        [Navigate(NavigateType.OneToMany, nameof(Dt_MesPPCutOutboundOrderDetail.OrderId), nameof(Id))]
        public List<Dt_MesPPCutOutboundOrderDetail> Details { get; set; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_MesPPCutOutboundOrderDetail.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,106 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.DB.Models;
namespace WIDESEA_Model.Models
{
    /// <summary>
    /// PP仓小卷MES出库单明细
    /// </summary>
    [SugarTable(nameof(Dt_MesPPCutOutboundOrderDetail), "PP仓小卷MES出库单明细")]
    public class Dt_MesPPCutOutboundOrderDetail : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// å‡ºåº“单主键
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "出库单主键")]
        public int OrderId { get; set; }
        /// <summary>
        /// ç‰©æ–™ç¼–号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "物料编号")]
        public string MaterielCode { get; set; }
        /// <summary>
        /// ç‰©æ–™åç§°
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "物料名称")]
        public string MaterielName { get; set; }
        /// <summary>
        /// æ‰¹æ¬¡å·
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "批次号")]
        public string BatchNo { get; set; }
        /// <summary>
        /// å•据数量
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "单据数量")]
        public float OrderQuantity { get; set; }
        /// <summary>
        /// é”å®šæ•°é‡
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "锁定数量", DefaultValue = "0")]
        public float LockQuantity { get; set; }
        /// <summary>
        /// å·²å‡ºæ•°é‡
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "已出数量", DefaultValue = "0")]
        public float OverOutQuantity { get; set; }
        /// <summary>
        /// è®¢å•明细状态
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "订单明细状态")]
        public int OrderDetailStatus { get; set; }
        /// <summary>
        /// å•位
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "单位")]
        public string Unit { get; set; }
        /// <summary>
        /// å±‚别
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "层别")]
        public string LayerCode { get; set; }
        /// <summary>
        /// åºåˆ—
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "序列")]
        public int Sequence { get; set; }
        /// <summary>
        /// è£åˆ‡å®½
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "裁切宽")]
        public float Width { get; set; }
        /// <summary>
        /// çº¿è¾¹ä»“地址码
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "线边仓地址码")]
        public string TargetAddressCode { get; set; }
        /// <summary>
        /// å¤‡æ³¨
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "备注")]
        public string Remark { get; set; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_MesPPOutboundOrder.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,123 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.Attributes;
using WIDESEA_Core.CodeConfigEnum;
using WIDESEA_Core.DB.Models;
using WIDESEA_Model.Models.Outbound;
namespace WIDESEA_Model.Models
{
    /// <summary>
    /// PP仓大卷MES出库单
    /// </summary>
    [SugarTable(nameof(Dt_MesPPOutboundOrder))]
    public class Dt_MesPPOutboundOrder : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// ä»“库主键
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "仓库主键")]
        public int WarehouseId { get; set; }
        /// <summary>
        /// å•据编号
        /// </summary>
        [CodeRule(RuleCodeEnum.OutboundOrderRule)]
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "单据编号", IsOnlyIgnoreUpdate = true)]
        public string OrderNo { get; set; }
        /// <summary>
        /// ä»»åŠ¡å•å·
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "任务单号")]
        public string TaskNo { get; set; }
        /// <summary>
        /// å•据类型
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "单据类型", IsOnlyIgnoreUpdate = true)]
        public int OrderType { get; set; }
        /// <summary>
        /// å•据状态
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "单据状态")]
        public int OrderStatus { get; set; }
        /// <summary>
        /// åˆ›å»ºæ–¹å¼
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "创建方式", IsOnlyIgnoreUpdate = true)]
        public int CreateType { get; set; }
        /// <summary>
        /// ç‰©æ–™ç¼–号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "物料编号")]
        public string MaterialCode { get; set; }
        /// <summary>
        /// ç‰©æ–™åç§°
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "物料名称")]
        public string MaterialName { get; set; }
        /// <summary>
        /// å•位
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "单位")]
        public string Unit { get; set; }
        /// <summary>
        /// å•据数量
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "单据数量")]
        public float OrderQuantity { get; set; }
        /// <summary>
        /// é”å®šæ•°é‡
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "锁定数量", DefaultValue = "0")]
        public float LockQuantity { get; set; }
        /// <summary>
        /// å·²å‡ºæ•°é‡
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "已出数量", DefaultValue = "0")]
        public float OverOutQuantity { get; set; }
        /// <summary>
        /// çº¿ä½“
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "线体")]
        public string Line { get; set; }
        /// <summary>
        /// çº¿è¾¹ä»“地址码
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "线边仓地址码")]
        public string TargetAddressCode { get; set; }
        /// <summary>
        /// è£åˆ‡å®½
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "裁切宽")]
        public float Width { get; set; }
        /// <summary>
        /// å‡ºåº“单明细
        /// </summary>
        [Navigate(NavigateType.OneToMany, nameof(Dt_MesPPOutboundOrderDetail.OrderId), nameof(Id))]
        public List<Dt_MesPPOutboundOrderDetail> Details { get; set; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_MesPPOutboundOrderDetail.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;
using WIDESEA_Core.DB.Models;
namespace WIDESEA_Model.Models.Outbound
{
    /// <summary>
    /// PP仓大卷MES出库单明细
    /// </summary>
    [SugarTable(nameof(Dt_MesPPOutboundOrderDetail))]
    public class Dt_MesPPOutboundOrderDetail : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// ä»“库主键
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "仓库主键")]
        public int OrderId { get; set; }
        /// <summary>
        /// åº“区
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "库区")]
        public string Warehouse { get; set; }
        /// <summary>
        /// è½½å…·å·
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "载具号")]
        public string CarrierCode { get; set; }
        /// <summary>
        /// è®¢å•明细状态
        /// </summary>
        [SugarColumn(IsNullable = false,ColumnDescription = "订单明细状态")]
        public int OrderDetailStatus { get; set; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfoDetail.cs
@@ -82,6 +82,12 @@
        public float StockQuantity { get; set; }
        /// <summary>
        /// è£åˆ‡åŽå®½åº¦
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "裁切后宽度")]
        public float CutedWidth { get; set; }
        /// <summary>
        /// å‡ºåº“数量
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "出库数量", DefaultValue = "0")]
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundRepository/MesPPCutOutboundOrderDetailRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseRepository;
using WIDESEA_IOutboundRepository;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.Outbound;
namespace WIDESEA_OutboundRepository
{
    public class MesPPCutOutboundOrderDetailRepository : RepositoryBase<Dt_MesPPCutOutboundOrderDetail>, IMesPPCutOutboundOrderDetailRepository
    {
        public MesPPCutOutboundOrderDetailRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
        {
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundRepository/MesPPCutOutboundOrderRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseRepository;
using WIDESEA_IOutboundRepository;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.Outbound;
namespace WIDESEA_OutboundRepository
{
    public class MesPPCutOutboundOrderRepository : RepositoryBase<Dt_MesPPCutOutboundOrder>, IMesPPCutOutboundOrderRepository
    {
        public MesPPCutOutboundOrderRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
        {
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundRepository/MesPPOutboundOrderDetailRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseRepository;
using WIDESEA_IOutboundRepository;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.Outbound;
namespace WIDESEA_OutboundRepository
{
    public class MesPPOutboundOrderDetailRepository : RepositoryBase<Dt_MesPPOutboundOrderDetail>, IMesPPOutboundOrderDetailRepository
    {
        public MesPPOutboundOrderDetailRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
        {
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundRepository/MesPPOutboundOrderRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseRepository;
using WIDESEA_IOutboundRepository;
using WIDESEA_Model.Models;
namespace WIDESEA_OutboundRepository
{
    public class MesPPOutboundOrderRepository : RepositoryBase<Dt_MesPPOutboundOrder>, IMesPPOutboundOrderRepository
    {
        public MesPPOutboundOrderRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
        {
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/MesPPCutOutboundOrderDetailService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseServices;
using WIDESEA_IBasicRepository;
using WIDESEA_IBasicService;
using WIDESEA_IOutboundRepository;
using WIDESEA_IOutboundService;
using WIDESEA_IRecordService;
using WIDESEA_IStockService;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.Outbound;
using WIDESEA_OutboundRepository;
namespace WIDESEA_OutboundService
{
    public class MesPPCutOutboundOrderDetailService : ServiceBase<Dt_MesPPCutOutboundOrderDetail, IMesPPCutOutboundOrderDetailRepository>, IMesPPCutOutboundOrderDetailService
    {
        private readonly IBasicRepository _basicRepository;
        private readonly IStockService _stockService;
        private readonly IOutStockLockInfoService _outStockLockInfoService;
        private readonly IBasicService _basicService;
        private readonly IRecordService _recordService;
        public IMesPPCutOutboundOrderDetailRepository Repository => BaseDal;
        public MesPPCutOutboundOrderDetailService(IMesPPCutOutboundOrderDetailRepository BaseDal, IBasicRepository basicRepository, IStockService stockService, IOutStockLockInfoService outStockLockInfoService, IBasicService basicService, IRecordService recordService) : base(BaseDal)
        {
            _basicRepository = basicRepository;
            _stockService = stockService;
            _outStockLockInfoService = outStockLockInfoService;
            _basicService = basicService;
            _recordService = recordService;
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/MesPPCutOutboundOrderService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseServices;
using WIDESEA_IBasicRepository;
using WIDESEA_IBasicService;
using WIDESEA_IOutboundRepository;
using WIDESEA_IOutboundService;
using WIDESEA_IRecordService;
using WIDESEA_IStockService;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.Outbound;
using WIDESEA_OutboundRepository;
namespace WIDESEA_OutboundService
{
    public class MesPPCutOutboundOrderService : ServiceBase<Dt_MesPPCutOutboundOrder, IMesPPCutOutboundOrderRepository>, IMesPPCutOutboundOrderService
    {
        private readonly IBasicRepository _basicRepository;
        private readonly IStockService _stockService;
        private readonly IOutStockLockInfoService _outStockLockInfoService;
        private readonly IBasicService _basicService;
        private readonly IRecordService _recordService;
        public IMesPPCutOutboundOrderRepository Repository => BaseDal;
        public MesPPCutOutboundOrderService(IMesPPCutOutboundOrderRepository BaseDal, IBasicRepository basicRepository, IStockService stockService, IOutStockLockInfoService outStockLockInfoService, IBasicService basicService, IRecordService recordService) : base(BaseDal)
        {
            _basicRepository = basicRepository;
            _stockService = stockService;
            _outStockLockInfoService = outStockLockInfoService;
            _basicService = basicService;
            _recordService = recordService;
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/MesPPOutboundOrderDetailService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseServices;
using WIDESEA_IBasicRepository;
using WIDESEA_IBasicService;
using WIDESEA_IOutboundRepository;
using WIDESEA_IOutboundService;
using WIDESEA_IRecordService;
using WIDESEA_IStockService;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.Outbound;
using WIDESEA_OutboundRepository;
namespace WIDESEA_OutboundService
{
    public class MesPPOutboundOrderDetailService : ServiceBase<Dt_MesPPOutboundOrderDetail, IMesPPOutboundOrderDetailRepository>, IMesPPOutboundOrderDetailService
    {
        private readonly IBasicRepository _basicRepository;
        private readonly IStockService _stockService;
        private readonly IOutStockLockInfoService _outStockLockInfoService;
        private readonly IBasicService _basicService;
        private readonly IRecordService _recordService;
        public IMesPPOutboundOrderDetailRepository Repository => BaseDal;
        public MesPPOutboundOrderDetailService(IMesPPOutboundOrderDetailRepository BaseDal, IBasicRepository basicRepository, IStockService stockService, IOutStockLockInfoService outStockLockInfoService, IBasicService basicService, IRecordService recordService) : base(BaseDal)
        {
            _basicRepository = basicRepository;
            _stockService = stockService;
            _outStockLockInfoService = outStockLockInfoService;
            _basicService = basicService;
            _recordService = recordService;
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/MesPPOutboundOrderService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,143 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseServices;
using WIDESEA_IBasicRepository;
using WIDESEA_IBasicService;
using WIDESEA_IOutboundRepository;
using WIDESEA_IOutboundService;
using WIDESEA_IRecordService;
using WIDESEA_IStockService;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.Outbound;
using WIDESEA_OutboundRepository;
namespace WIDESEA_OutboundService
{
    public class MesPPOutboundOrderService : ServiceBase<Dt_MesPPOutboundOrder, IMesPPOutboundOrderRepository>, IMesPPOutboundOrderService
    {
        private readonly IBasicRepository _basicRepository;
        private readonly IStockService _stockService;
        private readonly IOutStockLockInfoService _outStockLockInfoService;
        private readonly IBasicService _basicService;
        private readonly IRecordService _recordService;
        public IMesPPOutboundOrderRepository Repository => BaseDal;
        public MesPPOutboundOrderService(IMesPPOutboundOrderRepository BaseDal, IBasicRepository basicRepository, IStockService stockService, IOutStockLockInfoService outStockLockInfoService, IBasicService basicService, IRecordService recordService) : base(BaseDal)
        {
            _basicRepository = basicRepository;
            _stockService = stockService;
            _outStockLockInfoService = outStockLockInfoService;
            _basicService = basicService;
            _recordService = recordService;
        }
        public (List<Dt_StockInfo>, Dt_MesPPOutboundOrder, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) AssignStockOutbound(Dt_MesPPOutboundOrder mesPPOutboundOrder)
        {
            List<Dt_StockInfo> outStocks = new List<Dt_StockInfo>();
            List<Dt_OutStockLockInfo> outStockLockInfos = new List<Dt_OutStockLockInfo>();
            List<Dt_LocationInfo> locationInfos = new List<Dt_LocationInfo>();
            float originalNeedQuantity = mesPPOutboundOrder.OrderQuantity;
            float needQuantity = originalNeedQuantity;
            List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseableStocks(mesPPOutboundOrder.MaterialCode, "", mesPPOutboundOrder.Details.FirstOrDefault()?.CarrierCode ?? "",mesPPOutboundOrder.WarehouseId);
            if (!stockInfos.Any())
            {
                throw new Exception($"未找到可分配库存");
            }
            List<Dt_StockInfo> autoAssignStocks = _stockService.StockInfoService.GetOutboundStocks(stockInfos, mesPPOutboundOrder.MaterialCode, needQuantity, out float residueQuantity);
            mesPPOutboundOrder.LockQuantity += needQuantity - residueQuantity;
            outStocks.AddRange(autoAssignStocks);
            float assignQuantity = needQuantity - residueQuantity;
            float orderQuantity = mesPPOutboundOrder.OrderQuantity;
            for (int j = 0; j < autoAssignStocks.Count; j++)
            {
                float detailAssignQuantity = outStockLockInfos.Where(x => x.MaterielCode == mesPPOutboundOrder.MaterialCode).Sum(x => x.AssignQuantity);//出库订单明细已分配数量
                float palletAssignQuantity = outStockLockInfos.Where(x => x.MaterielCode == mesPPOutboundOrder.MaterialCode && x.PalletCode == autoAssignStocks[j].PalletCode).Sum(x => x.AssignQuantity);//出库详情已分配数量
                float palletOutboundQuantity = autoAssignStocks[j].Details.Sum(x => x.OutboundQuantity);
                if (palletAssignQuantity < palletOutboundQuantity)//如果出库详情已分配数量小于托盘已分配数量,则可以继续添加该托盘出库信息
                {
                    float orderDetailNeedQuantity = mesPPOutboundOrder.OrderQuantity - detailAssignQuantity;
                    if (orderDetailNeedQuantity > autoAssignStocks[j].Details.Sum(x => x.OutboundQuantity) - palletAssignQuantity)
                    {
                        mesPPOutboundOrder.LockQuantity += autoAssignStocks[j].Details.Sum(x => x.OutboundQuantity) - palletAssignQuantity;
                        Dt_OutStockLockInfo outStockLockInfo = _outStockLockInfoService.GetOutStockLockInfo(mesPPOutboundOrder, autoAssignStocks[j], autoAssignStocks[j].Details.Sum(x => x.OutboundQuantity) - palletAssignQuantity);
                        outStockLockInfos.Add(outStockLockInfo);
                    }
                    else
                    {
                        Dt_OutStockLockInfo outStockLockInfo = _outStockLockInfoService.GetOutStockLockInfo(mesPPOutboundOrder, autoAssignStocks[j], mesPPOutboundOrder.OrderQuantity - mesPPOutboundOrder.LockQuantity);
                        outStockLockInfos.Add(outStockLockInfo);
                        mesPPOutboundOrder.LockQuantity = mesPPOutboundOrder.OrderQuantity;
                        break;
                    }
                }
            }
            locationInfos.AddRange(_basicService.LocationInfoService.Repository.GetLocationInfos(outStocks.Select(x => x.LocationCode).ToList()));
            return (outStocks, mesPPOutboundOrder, outStockLockInfos, locationInfos);
        }
        public (List<Dt_StockInfo>, Dt_MesPPCutOutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) AssignStockOutbound(Dt_MesPPCutOutboundOrder mesPPOutboundOrder, Dt_MesPPCutOutboundOrderDetail mesPPCutOutboundOrderDetail)
        {
            List<Dt_StockInfo> outStocks = new List<Dt_StockInfo>();
            List<Dt_OutStockLockInfo> outStockLockInfos = new List<Dt_OutStockLockInfo>();
            List<Dt_LocationInfo> locationInfos = new List<Dt_LocationInfo>();
            //Dt_MesPPCutOutboundOrder outboundOrder = BaseDal.Db.Queryable<Dt_MesPPCutOutboundOrder>().Where(x=>x.Id==mesPPOutboundOrder.OrderId).First();
            float originalNeedQuantity = mesPPCutOutboundOrderDetail.OrderQuantity;
            float needQuantity = originalNeedQuantity;
            List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseableStocks(mesPPCutOutboundOrderDetail.MaterielCode,  "", mesPPOutboundOrder.WarehouseId);
            if (!stockInfos.Any())
            {
                throw new Exception($"未找到可分配库存");
            }
            List<Dt_StockInfo> autoAssignStocks = _stockService.StockInfoService.GetOutboundStocks(stockInfos, mesPPCutOutboundOrderDetail.MaterielCode, needQuantity, out float residueQuantity);
            mesPPCutOutboundOrderDetail.LockQuantity += needQuantity - residueQuantity;
            outStocks.AddRange(autoAssignStocks);
            float assignQuantity = needQuantity - residueQuantity;
            float orderQuantity = mesPPCutOutboundOrderDetail.OrderQuantity;
            for (int j = 0; j < autoAssignStocks.Count; j++)
            {
                float detailAssignQuantity = outStockLockInfos.Where(x => x.MaterielCode == mesPPCutOutboundOrderDetail.MaterielCode).Sum(x => x.AssignQuantity);//出库订单明细已分配数量
                float palletAssignQuantity = outStockLockInfos.Where(x => x.MaterielCode == mesPPCutOutboundOrderDetail.MaterielCode && x.PalletCode == autoAssignStocks[j].PalletCode).Sum(x => x.AssignQuantity);//出库详情已分配数量
                float palletOutboundQuantity = autoAssignStocks[j].Details.Sum(x => x.OutboundQuantity);
                if (palletAssignQuantity < palletOutboundQuantity)//如果出库详情已分配数量小于托盘已分配数量,则可以继续添加该托盘出库信息
                {
                    float orderDetailNeedQuantity = mesPPCutOutboundOrderDetail.OrderQuantity - detailAssignQuantity;
                    if (orderDetailNeedQuantity > autoAssignStocks[j].Details.Sum(x => x.OutboundQuantity) - palletAssignQuantity)
                    {
                        mesPPCutOutboundOrderDetail.LockQuantity += autoAssignStocks[j].Details.Sum(x => x.OutboundQuantity) - palletAssignQuantity;
                        Dt_OutStockLockInfo outStockLockInfo = _outStockLockInfoService.GetOutStockLockInfo(mesPPOutboundOrder, mesPPCutOutboundOrderDetail, autoAssignStocks[j], autoAssignStocks[j].Details.Sum(x => x.OutboundQuantity) - palletAssignQuantity);
                        outStockLockInfos.Add(outStockLockInfo);
                    }
                    else
                    {
                        Dt_OutStockLockInfo outStockLockInfo = _outStockLockInfoService.GetOutStockLockInfo(mesPPOutboundOrder, mesPPCutOutboundOrderDetail, autoAssignStocks[j], mesPPCutOutboundOrderDetail.OrderQuantity - mesPPCutOutboundOrderDetail.LockQuantity);
                        outStockLockInfos.Add(outStockLockInfo);
                        mesPPCutOutboundOrderDetail.LockQuantity = mesPPCutOutboundOrderDetail.OrderQuantity;
                        break;
                    }
                }
            }
            locationInfos.AddRange(_basicService.LocationInfoService.Repository.GetLocationInfos(outStocks.Select(x => x.LocationCode).ToList()));
            return (outStocks, mesPPCutOutboundOrderDetail, outStockLockInfos, locationInfos);
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs
@@ -13,6 +13,7 @@
using WIDESEA_IRecordService;
using WIDESEA_IStockService;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.Outbound;
namespace WIDESEA_IOutboundService
{
@@ -84,7 +85,14 @@
            return outStockLockInfo;
        }
        /// <summary>
        /// PP大卷出库
        /// </summary>
        /// <param name="mesOutboundOrder"></param>
        /// <param name="outStock"></param>
        /// <param name="assignQuantity"></param>
        /// <param name="taskNum"></param>
        /// <returns></returns>
        public Dt_OutStockLockInfo GetOutStockLockInfo(Dt_MesOutboundOrder mesOutboundOrder, Dt_StockInfo outStock, float assignQuantity, int? taskNum = null)
        {
@@ -109,6 +117,63 @@
            return outStockLockInfo;
        }
        /// <summary>
        /// PP小卷出库
        /// </summary>
        /// <param name="mesPPCutOutboundOrderDetail"></param>
        /// <param name="outStock"></param>
        /// <param name="assignQuantity"></param>
        /// <param name="taskNum"></param>
        /// <returns></returns>
        public Dt_OutStockLockInfo GetOutStockLockInfo(Dt_MesPPCutOutboundOrder mesPPCutOutboundOrder,Dt_MesPPCutOutboundOrderDetail  mesPPCutOutboundOrderDetail, Dt_StockInfo outStock, float assignQuantity, int? taskNum = null)
        {
            Dt_OutStockLockInfo outStockLockInfo = new Dt_OutStockLockInfo()
            {
                PalletCode = outStock.PalletCode,
                AssignQuantity = assignQuantity,
                MaterielCode = mesPPCutOutboundOrderDetail.MaterielCode,
                BatchNo = outStock.Details.FirstOrDefault()?.BatchNo ?? "",
                LocationCode = outStock.LocationCode,
                MaterielName = mesPPCutOutboundOrderDetail.MaterielName,
                OrderDetailId = mesPPCutOutboundOrderDetail.Id,
                OrderNo = mesPPCutOutboundOrder.OrderNo,
                OrderType = mesPPCutOutboundOrder.OrderType,
                OriginalQuantity = outStock.Details.Where(x => x.MaterielCode == mesPPCutOutboundOrderDetail.MaterielCode).Sum(x => x.StockQuantity),
                Status = taskNum == null ? OutLockStockStatusEnum.已分配.ObjToInt() : OutLockStockStatusEnum.出库中.ObjToInt(),
                StockId = outStock.Id,
                TaskNum = taskNum,
                OrderQuantity = mesPPCutOutboundOrderDetail.OrderQuantity,
                Unit = mesPPCutOutboundOrderDetail.Unit
            };
            return outStockLockInfo;
        }
        public Dt_OutStockLockInfo GetOutStockLockInfo(Dt_MesPPOutboundOrder  mesPPOutboundOrder, Dt_StockInfo outStock, float assignQuantity, int? taskNum = null)
        {
            Dt_OutStockLockInfo outStockLockInfo = new Dt_OutStockLockInfo()
            {
                PalletCode = outStock.PalletCode,
                AssignQuantity = assignQuantity,
                MaterielCode = mesPPOutboundOrder.MaterialCode,
                BatchNo = outStock.Details.FirstOrDefault()?.BatchNo ?? "",
                LocationCode = outStock.LocationCode,
                MaterielName = mesPPOutboundOrder.MaterialName,
                OrderDetailId = mesPPOutboundOrder.Id,
                OrderNo = mesPPOutboundOrder.OrderNo,
                OrderType = mesPPOutboundOrder.OrderType,
                OriginalQuantity = outStock.Details.Where(x => x.MaterielCode == mesPPOutboundOrder.MaterialCode).Sum(x => x.StockQuantity),
                Status = taskNum == null ? OutLockStockStatusEnum.已分配.ObjToInt() : OutLockStockStatusEnum.出库中.ObjToInt(),
                StockId = outStock.Id,
                TaskNum = taskNum,
                OrderQuantity = mesPPOutboundOrder.OrderQuantity,
                Unit = mesPPOutboundOrder.Unit
            };
            return outStockLockInfo;
        }
        public List<Dt_OutStockLockInfo> OutStockLockInfos(string OrderNo)
        {
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundService.cs
@@ -17,12 +17,22 @@
        public IOutStockLockInfoService OutboundStockLockInfoService { get; }
        public OutboundService(IOutboundOrderDetailService outboundOrderDetailService, IOutboundOrderService outboundOrderService, IOutStockLockInfoService outboundStockLockInfoService, IMesOutboundOrderService mesOutboundOrderService)
        public IMesPPOutboundOrderService MesPPOutboundOrderService { get; }
        public IMesPPOutboundOrderDetailService MesPPOutboundOrderDetailService { get; }
        public IMesPPCutOutboundOrderService MesPPCutOutboundOrderService { get; }
        public IMesPPCutOutboundOrderDetailService MesPPCutOutboundOrderDetailService { get; }
        public OutboundService(IOutboundOrderDetailService outboundOrderDetailService,IMesPPOutboundOrderService mesPPOutboundOrderService, IOutboundOrderService outboundOrderService, IOutStockLockInfoService outboundStockLockInfoService, IMesOutboundOrderService mesOutboundOrderService)
        {
            OutboundOrderDetailService = outboundOrderDetailService;
            OutboundOrderService = outboundOrderService;
            OutboundStockLockInfoService = outboundStockLockInfoService;
            MesOutboundOrderService = mesOutboundOrderService;
            MesPPOutboundOrderService = mesPPOutboundOrderService;
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs
@@ -20,6 +20,7 @@
using WIDESEA_IStockRepository;
using WIDESEA_IStockService;
using WIDESEA_Model.Models;
using WIDESEA_StockRepository;
namespace WIDESEA_StockService
{
@@ -221,5 +222,14 @@
            return BaseDal.GetStockInfos(materielCode, batchNo, locationCodes);
        }
        public List<Dt_StockInfo> GetUseableStocks(string materielCode, string batchNo, string palletcode, int warehoseId)
        {
            Dt_StockInfo stockInfo = BaseDal.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == palletcode && x.WarehouseId == warehoseId).Includes(x => x.Details).First();
            List<string> locationCodes = _basicRepository.LocationInfoRepository.GetCanOutLocationCodes(stockInfo.LocationCode);
            return BaseDal.GetStockInfos(materielCode, batchNo, locationCodes);
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/AssignInboundTaskLocation_BC.cs
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs
@@ -24,6 +24,11 @@
using WIDESEA_ITaskInfoService;
using WIDESEA_Model.Models;
using WIDESEA_Common.OrderEnum;
using WIDESEA_Model.Models.Outbound;
using System.Diagnostics.Metrics;
using System.Reflection.Metadata;
using WIDESEA_Model.Models.Inbound;
using WIDESEA_DTO.Task;
namespace WIDESEA_TaskInfoService
{
@@ -500,5 +505,429 @@
                return MesResponseContent.Instance.Error(ex.Message);
            }
        }
        /// <summary>
        /// PP大卷出库-进行分卷
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public MesResponseContent PPSubsectionOut(PPSubsectionOutModel model)
        {
            MesResponseContent modelCount = new MesResponseContent();
            try
            {
                foreach (var item in model.Carriers)
                {
                    Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == item.Warehouse);
                    if (warehouse == null)
                    {
                        return MesResponseContent.Instance.Error("仓库信息未配置");
                    }
                    Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.QueryFirst(x => x.PalletCode == item.CarrierCode);
                    if (stockInfo == null)
                    {
                        return MesResponseContent.Instance.Error("未找到此载具编号库存");
                    }
                    Dt_MesPPOutboundOrder mesPPOutboundOrder = BaseDal.Db.Queryable<Dt_MesPPOutboundOrder>().Where(x => x.TaskNo == model.TaskNo).Includes(x => x.Details).First();
                    if (mesPPOutboundOrder != null)
                    {
                        return MesResponseContent.Instance.Error("已存在此任务单号");
                    }
                    Dt_MesPPOutboundOrderDetail mesPPOutboundOrderDetail = new Dt_MesPPOutboundOrderDetail()
                    {
                        Warehouse = item.Warehouse,
                        CarrierCode = item.CarrierCode,
                    };
                    Dt_MesPPOutboundOrder mesOutboundOrder = new Dt_MesPPOutboundOrder()
                    {
                        CreateType = OrderCreateTypeEnum.UpperSystemPush.ObjToInt(),
                        MaterialCode = model.MaterialCode,
                        MaterialName = model.MaterialName,
                        OrderQuantity = model.RequiredQuantity,
                        TaskNo = model.TaskNo,
                        Unit = model.Unit,//PP需要转换成米(需求平方(PNL数*面积)/宽度)
                        Width = model.Width,
                        TargetAddressCode = model.TargetAddressCode,
                        OrderType = TaskTypeEnum.MesHandPickOutbound.ObjToInt(),
                        OrderStatus = OutOrderStatusEnum.未开始.ObjToInt(),
                        WarehouseId = warehouse.WarehouseId,
                        Details = new List<Dt_MesPPOutboundOrderDetail> { mesPPOutboundOrderDetail }
                    };
                    //Db.InsertNav(mesOutboundOrder).Include(x=>x.Details).ExecuteCommand();
                    List<Dt_Task> tasks = new List<Dt_Task>();
                    List<Dt_StockInfo>? stockInfos = null;
                    List<Dt_OutStockLockInfo>? outStockLockInfos = null;
                    List<Dt_LocationInfo>? locationInfos = null;
                    {
                        (List<Dt_StockInfo>, Dt_MesPPOutboundOrder, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundService.MesPPOutboundOrderService.AssignStockOutbound(mesOutboundOrder);
                        if (result.Item1 != null && result.Item1.Count > 0)
                        {
                            tasks = GetTasks(result.Item1, TaskTypeEnum.MesOutbound);
                            result.Item2.OrderStatus = OrderDetailStatusEnum.Outbound.ObjToInt();
                            result.Item3.ForEach(x =>
                            {
                                x.Status = OutLockStockStatusEnum.出库中.ObjToInt();
                            });
                            stockInfos = result.Item1;
                            mesOutboundOrder = result.Item2;
                            outStockLockInfos = result.Item3;
                            locationInfos = result.Item4;
                            mesPPOutboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt();
                        }
                        else
                        {
                            throw new Exception("无库存");
                        }
                    }
                    tasks.ForEach(x =>
                    {
                        x.TargetAddress = model.TargetAddressCode;
                    });
                    _unitOfWorkManage.BeginTran();
                    int id = BaseDal.AddData(tasks);
                    outStockLockInfos.ForEach(x =>
                    {
                        x.OrderNo = mesOutboundOrder.TaskNo;
                        x.OrderDetailId = id;
                    });
                    //_outboundService.MesPPOutboundOrderService.Repository.AddData(mesOutboundOrder);
                    Db.InsertNav(mesOutboundOrder).Include(x => x.Details).ExecuteCommand();
                    if (stockInfos != null && stockInfos.Count > 0 && outStockLockInfos != null && outStockLockInfos.Count > 0 && locationInfos != null && locationInfos.Count > 0)
                    {
                        WebResponseContent content = _outboundService.MesOutboundOrderService.LockOutboundStockDataUpdate(stockInfos, outStockLockInfos, locationInfos, tasks: tasks);
                        if (!content.Status)
                        {
                            _unitOfWorkManage.RollbackTran();
                            return MesResponseContent.Instance.Error(content.Message);
                        }
                    }
                    _unitOfWorkManage.CommitTran();
                    PushTasksToWCS(tasks);
                }
                return MesResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                return MesResponseContent.Instance.Error(ex.Message);
            }
        }
        /// <summary>
        /// PP小卷出库
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public MesResponseContent PPCutOut(PPCutOutModle model)
        {
            try
            {
                foreach (var item in model.MaterialDetails)
                {
                    Dt_Warehouse warehouse = _basicService.WarehouseService.Repository.QueryFirst(x => x.WarehouseCode == WarehouseEnum.HA58.ToString());
                    if (warehouse == null)
                    {
                        return MesResponseContent.Instance.Error("仓库基础信息未配置");
                    }
                    Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x => x.MaterielCode == item.MaterialCode);
                    if (materielInfo == null)
                    {
                        return MesResponseContent.Instance.Error($"未找到该物料信息");
                    }
                    Dt_MesPPCutOutboundOrder mesPPCutOutboundOrder = BaseDal.Db.Queryable<Dt_MesPPCutOutboundOrder>().Where(x => x.TaskNo == model.TaskNo).Includes(x => x.Details).First();
                    if (mesPPCutOutboundOrder != null)
                    {
                        return MesResponseContent.Instance.Error("已存在此任务单号");
                    }
                    Dt_MesPPCutOutboundOrderDetail mesPPCutOutboundOrderDetail = new Dt_MesPPCutOutboundOrderDetail()
                    {
                        MaterielCode = item.MaterialCode,
                        MaterielName = item.MaterialName,
                        OrderQuantity = item.RequiredQuantity,
                        Unit = item.Unit,
                        LayerCode = item.LayerCode,
                        Sequence = item.Sequence,
                        TargetAddressCode = item.TargetAddressCode,
                        Width = item.Width,
                    };
                    Dt_MesPPCutOutboundOrder mesPPOutboundOrder = new Dt_MesPPCutOutboundOrder()
                    {
                        CreateType = OrderCreateTypeEnum.UpperSystemPush.ObjToInt(),
                        TaskNo = model.TaskNo,
                        OrderType = TaskTypeEnum.MesOutbound.ObjToInt(),
                        OrderStatus = OutOrderStatusEnum.未开始.ObjToInt(),
                        WarehouseId = warehouse.WarehouseId,
                        Details = new List<Dt_MesPPCutOutboundOrderDetail> { mesPPCutOutboundOrderDetail }
                    };
                    List<Dt_Task> tasks = new List<Dt_Task>();
                    List<Dt_StockInfo>? stockInfos = null;
                    List<Dt_OutStockLockInfo>? outStockLockInfos = null;
                    List<Dt_LocationInfo>? locationInfos = null;
                    {
                        (List<Dt_StockInfo>, Dt_MesPPCutOutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundService.MesPPOutboundOrderService.AssignStockOutbound(mesPPOutboundOrder, mesPPCutOutboundOrderDetail);
                        if (result.Item1 != null && result.Item1.Count > 0)
                        {
                            tasks = GetTasks(result.Item1, TaskTypeEnum.MesOutbound);
                            result.Item2.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt();
                            result.Item3.ForEach(x =>
                            {
                                x.Status = OutLockStockStatusEnum.出库中.ObjToInt();
                            });
                            stockInfos = result.Item1;
                            mesPPCutOutboundOrderDetail = result.Item2;
                            outStockLockInfos = result.Item3;
                            locationInfos = result.Item4;
                        }
                        else
                        {
                            throw new Exception("无库存");
                        }
                    }
                    tasks.ForEach(x =>
                    {
                        x.TargetAddress = mesPPCutOutboundOrderDetail.TargetAddressCode;
                    });
                    _unitOfWorkManage.BeginTran();
                    int id = BaseDal.AddData(tasks);
                    outStockLockInfos.ForEach(x =>
                    {
                        x.OrderNo = mesPPOutboundOrder.TaskNo;
                        x.OrderDetailId = id;
                    });
                    //_outboundService.MesPPOutboundOrderService.Repository.AddData(mesOutboundOrder);
                    Db.InsertNav(mesPPOutboundOrder).Include(x => x.Details).ExecuteCommand();
                    if (stockInfos != null && stockInfos.Count > 0 && outStockLockInfos != null && outStockLockInfos.Count > 0 && locationInfos != null && locationInfos.Count > 0)
                    {
                        WebResponseContent content = _outboundService.MesOutboundOrderService.LockOutboundStockDataUpdate(stockInfos, outStockLockInfos, locationInfos, tasks: tasks);
                        if (!content.Status)
                        {
                            _unitOfWorkManage.RollbackTran();
                            return MesResponseContent.Instance.Error(content.Message);
                        }
                    }
                    _unitOfWorkManage.CommitTran();
                    PushTasksToWCS(tasks, "AGV_PP");
                }
                return MesResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                return MesResponseContent.Instance.Error(ex.Message);
            }
        }
        /// <summary>
        ///  PP入库(大卷、小卷、张料)
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public MesResponseContent PPBack(PPBackModel model)
        {
            try
            {
                foreach (var item in model.MaterialLotInfo)
                {
                    //获取物料信息
                    Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x => x.MaterielCode == item.MaterialCode);
                    if (materielInfo == null)
                    {
                        return MesResponseContent.Instance.Error($"物料{item.MaterialCode}不存在!");
                    }
                    Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == WarehouseEnum.HA58.ToString());
                    if (warehouse == null)
                    {
                        return MesResponseContent.Instance.Error($"未找到仓库信息");
                    }
                    Dt_MesPPBackInboundOrderDetail mesPPBackInboundOrderDetail = new Dt_MesPPBackInboundOrderDetail()
                    {
                        MaterialLot = item.MaterialLot,
                        MaterielCode = item.MaterialCode,
                        OrderQuantity = item.Quantity,
                        CutedWidth = item.CutedWidth,
                        MaterialLotOld = item.MaterialLotOld,
                        Unit = item.Unit,
                        ProductionDate = item.ProductionDate,
                        EffectiveDate = item.ExpirationDate,
                        OrderDetailStatus = OrderDetailStatusEnum.New.ObjToInt(),
                    };
                    Dt_MesPPBackInboundOrder mesPPBackInboundOrder = new Dt_MesPPBackInboundOrder()
                    {
                        WarehouseId = warehouse.WarehouseId,
                        SourceAddressCode = model.SourceAddressCode,
                        CarrierCode = model.CarrierCode,
                        OrderStatus = InOrderStatusEnum.未开始.ObjToInt(),
                        CreateType = OrderCreateTypeEnum.UpperSystemPush.ObjToInt(),
                        Details = new List<Dt_MesPPBackInboundOrderDetail> { mesPPBackInboundOrderDetail }
                    };
                    Dt_StockInfoDetail stockInfoDetail = new Dt_StockInfoDetail()
                    {
                        BatchNo = mesPPBackInboundOrderDetail.MaterialLot,
                        MaterielCode = mesPPBackInboundOrderDetail.MaterielCode,
                        MaterielName = materielInfo.MaterielName,
                        OrderNo = "",
                        SerialNumber = "",
                        StockQuantity = mesPPBackInboundOrderDetail.OrderQuantity,
                        OutboundQuantity = 0,
                        Unit = materielInfo.MaterielUnit,
                        Status = StockStatusEmun.组盘暂存.ObjToInt(),
                        ProductionDate = mesPPBackInboundOrderDetail.ProductionDate,
                        EffectiveDate = mesPPBackInboundOrderDetail.EffectiveDate,
                        InboundOrderRowNo = mesPPBackInboundOrderDetail.RowNo,
                    };
                    Dt_StockInfo stockInfo = new Dt_StockInfo()
                    {
                        PalletCode = model.CarrierCode,
                        StockStatus = StockStatusEmun.组盘暂存.ObjToInt(),
                        WarehouseId = mesPPBackInboundOrder.WarehouseId,
                        Details = new List<Dt_StockInfoDetail> { stockInfoDetail }
                    };
                    _unitOfWorkManage.BeginTran();
                    Db.InsertNav(mesPPBackInboundOrder).Include(x => x.Details).ExecuteCommand();
                    Db.InsertNav(stockInfo).Include(x => x.Details).ExecuteCommand();
                    WebResponseContent content = DeviceRequestInboundTask(mesPPBackInboundOrder, stockInfo);
                    if (!content.Status)
                    {
                        _unitOfWorkManage.RollbackTran();
                        return MesResponseContent.Instance.Error(content.Message);
                    }
                    _unitOfWorkManage.CommitTran();
                }
                return MesResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                return MesResponseContent.Instance.Error(ex.Message);
            }
        }
        public WebResponseContent DeviceRequestInboundTask(Dt_MesPPBackInboundOrder mesPPBackInboundOrder, Dt_StockInfo stockInfo)
        {
            try
            {
                Dt_Task task = Repository.QueryFirst(x => x.PalletCode == stockInfo.PalletCode);
                if (task != null)
                {
                    PushTasksToWCS(new List<Dt_Task> { task });
                    return WebResponseContent.Instance.Error($"该托盘已生成任务");
                }
                if (Repository.QueryFirst(x => x.SourceAddress == stockInfo.PalletCode && x.TaskStatus == TaskStatusEnum.New.ObjToInt()) != null)
                {
                    return WebResponseContent.Instance.Error($"该站点已有未执行的任务");
                }
                //Dt_StockInfo stockInfos = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == palletCode).Includes(x => x.Details).First();
                //if (stockInfos == null)
                //{
                //    return WebResponseContent.Instance.Error($"未找到组盘信息");
                //}
                //if (stockInfo.StockStatus != StockStatusEmun.组盘暂存.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.手动组盘暂存.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.出库完成.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.拣选完成.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.退库.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.MES退库.ObjToInt())
                //{
                //    return WebResponseContent.Instance.Error($"该托盘状态不正确,不可申请入库");
                //}
                //if (!string.IsNullOrEmpty(stockInfo.LocationCode))
                //{
                //    return WebResponseContent.Instance.Error($"该托盘已绑定货位");
                //}
                //只入平库,需判断平库定义货位类型。。。。。。。。。。。。
                Dt_LocationInfo? locationInfos = _basicRepository.LocationInfoRepository.QueryFirst(x => x.WarehouseId == stockInfo.WarehouseId && x.LocationType == LocationTypeEnum.MediumPallet.ObjToInt());
                Dt_LocationInfo? locationInfo = _basicService.LocationInfoService.AssignLocation(locationInfos.RoadwayNo, stockInfo.PalletType, stockInfo.WarehouseId);
                if (locationInfo == null)
                {
                    return WebResponseContent.Instance.Error($"货位分配失败,未找到可分配货位");
                }
                Dt_Task newTask = new Dt_Task()
                {
                    CurrentAddress = mesPPBackInboundOrder.SourceAddressCode,
                    Grade = 0,
                    NextAddress = locationInfo.LocationCode,
                    PalletCode = stockInfo.PalletCode,
                    Roadway = locationInfo.RoadwayNo,//巷道号包含AGV
                    SourceAddress = mesPPBackInboundOrder.SourceAddressCode,
                    TargetAddress = locationInfo.LocationCode,
                    TaskType = TaskTypeEnum.Inbound.ObjToInt(),
                    TaskStatus = TaskStatusEnum.New.ObjToInt(),
                    WarehouseId = stockInfo.WarehouseId,
                    PalletType = stockInfo.PalletType
                };
                LocationStatusEnum lastStatus = (LocationStatusEnum)locationInfo.LocationStatus;
                _unitOfWorkManage.BeginTran();
                _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, lastStatus, LocationStatusEnum.Lock, LocationChangeType.InboundAssignLocation);
                _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, newTask.PalletType, LocationStatusEnum.Lock, newTask.WarehouseId);
                BaseDal.AddData(newTask);
                _stockRepository.StockInfoRepository.UpdateData(stockInfo);
                _unitOfWorkManage.CommitTran();
                PushTasksToWCS(new List<Dt_Task> { newTask });
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        /// <summary>
        ///  PP库存查询
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public MesResponseContent QueryPpByWidth(QueryPpByWidthModel model)
        {
            MesResponseContent content = new MesResponseContent();
            try
            {
                Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == WarehouseEnum.HA58.ToString());
                List<Dt_StockInfo> stockInfos = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x =>
                x.WarehouseId == warehouse.WarehouseId &&
                x.StockStatus == (int)StockStatusEmun.入库完成).Includes(x => x.Details).ToList();
                Dt_StockInfo? stockInfo = stockInfos.FirstOrDefault(x => x.Details.Any(x => x.MaterielCode == model.MaterialCode && x.CutedWidth == model.CutedWidth));
                if (stockInfo == null)
                {
                    return content.Error($"PP仓立库/平库:物料编号:{model.MaterialCode},裁切宽:{model.CutedWidth},未找到此物料库存信息");
                }
                var stock = stockInfo.Details.FirstOrDefault();
                if (stock != null)
                {
                    content.BSucc = true;
                    content.StrCode = "0000";
                    content.StrMsg = "执行成功";
                    content.DataTime = DateTime.Now;
                    content.MaterialCode = stock.MaterielCode;
                    content.Quantity = stock.StockQuantity;
                    content.Unit = stock.Unit;
                    content.Warehouse = warehouse.WarehouseCode;
                    content.WarehouseName = warehouse.WarehouseName;
                    content.CutedWidth = stock.CutedWidth;
                    content.CarrierCode = stockInfo.PalletCode;
                    content.MaterialLot = stock.BatchNo;
                }
                return content;
            }
            catch (Exception ex)
            {
                return MesResponseContent.Instance.Error(ex.Message);
            }
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -50,6 +50,7 @@
using WIDESEA_ITaskInfoRepository;
using WIDESEA_ITaskInfoService;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.Outbound;
using WIDESEA_TaskInfoRepository;
namespace WIDESEA_TaskInfoService
@@ -150,6 +151,68 @@
            }
        }
        public WebResponseContent AGVTasks(SaveModel saveModel)
        {
            try
            {
                var palletCode = saveModel.MainData["barcode"].ToString();
                var stationCode = saveModel.MainData["address"].ToString();
                var warehouseId = saveModel.MainData["warehouseId"].ObjToInt();
                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)
                {
                    return WebResponseContent.Instance.Error($"该托盘已生成任务");
                }
                if (Repository.QueryFirst(x => x.SourceAddress == stationCode && x.TaskStatus == TaskStatusEnum.New.ObjToInt()) != null && warehouse.WarehouseCode != WarehouseEnum.HA58.ToString())
                {
                    return WebResponseContent.Instance.Error($"该站点已有未执行的任务");
                }
                Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == palletCode).Includes(x => x.Details).First();
                if (stockInfo == null)
                {
                    return WebResponseContent.Instance.Error($"未找到组盘信息");
                }
                if (stockInfo.StockStatus != StockStatusEmun.组盘暂存.ObjToInt())
                {
                    return WebResponseContent.Instance.Error($"该托盘状态不正确");
                }
                if (warehouseId != stockInfo.WarehouseId)
                {
                    return WebResponseContent.Instance.Error($"仓库不正确");
                }
                Dt_Task newTask = new Dt_Task()
                {
                    CurrentAddress = stationCode,
                    Grade = 0,
                    NextAddress ="",
                    PalletCode = palletCode,
                    Roadway = warehouse.Remark,//查询对应线边仓地址巷道号
                    SourceAddress = stationCode,
                    TargetAddress = "",
                    TaskType = TaskTypeEnum.OutAllocate.ObjToInt(),
                    TaskStatus = TaskStatusEnum.New.ObjToInt(),
                    WarehouseId = stockInfo.WarehouseId,
                    PalletType = stockInfo.PalletType
                };
                _unitOfWorkManage.BeginTran();
                BaseDal.AddData(newTask);
                PushTasksToWCS(new List<Dt_Task> { newTask});
                _unitOfWorkManage.CommitTran();
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        /// <summary>
        /// å…¥åº“任务完成
        /// </summary>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/MesPPBackInboundOrderController.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
using Microsoft.AspNetCore.Mvc;
using WIDESEA_Core.BaseController;
using WIDESEA_IOutboundService;
using WIDESEA_Model.Models.Outbound;
namespace WIDESEA_WMSServer.Controllers.Inbound
{
    /// <summary>
    /// PP仓小卷MES出库单
    /// </summary>
    [Route("api/mesPPBackInboundOrder")]
    [ApiController]
    public class MesPPBackInboundOrderController : ApiBaseController<IMesPPCutOutboundOrderService, Dt_MesPPCutOutboundOrder>
    {
        public MesPPBackInboundOrderController(IMesPPCutOutboundOrderService service) : base(service)
        {
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/MES/MesController.cs
@@ -96,6 +96,48 @@
        {
            return _taskService.SubstrateBack(model.Content);
        }
        /// <summary>
        /// PP大卷出库-进行分卷
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost, Route("PPSubsectionOut"), AllowAnonymous]
        public MesResponseContent PPSubsectionOut([FromBody] Root<PPSubsectionOutModel> model)
        {
            return _taskService.PPSubsectionOut(model.Content);
        }
       /// <summary>
       /// PP小卷出库
       /// </summary>
       /// <param name="model"></param>
       /// <returns></returns>
        [HttpPost, Route("PPCutOut"), AllowAnonymous]
        public MesResponseContent PPCutOut([FromBody] Root<PPCutOutModle> model)
        {
            return _taskService.PPCutOut(model.Content);
        }
        /// <summary>
        /// PP入库(大卷、小卷、张料)
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost, Route("PPBack"), AllowAnonymous]
        public MesResponseContent PPBack([FromBody] Root<PPBackModel> model)
        {
            return _taskService.PPBack(model.Content);
        }
        /// <summary>
        /// PP库存查询
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost, Route("QueryPpByWidth"), AllowAnonymous]
        public MesResponseContent QueryPpByWidth([FromBody] Root<QueryPpByWidthModel> model)
        {
            return _taskService.QueryPpByWidth(model.Content);
        }
        /// <summary>
        /// ç‰©æ–™å‡ºåº“,WMS同步出库物料批次至MES
@@ -107,5 +149,6 @@
        {
            return _taskService.UploadMesMaterialLotaAcept(model);
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/MesPPCutOutboundOrderController.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
using Autofac.Core;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WIDESEA_Core;
using WIDESEA_Core.BaseController;
using WIDESEA_DTO.Inbound;
using WIDESEA_DTO.MES;
using WIDESEA_DTO.Outbound;
using WIDESEA_IOutboundService;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.Outbound;
namespace WIDESEA_WMSServer.Controllers.Outbound
{
    /// <summary>
    /// PP仓小卷MES出库单
    /// </summary>
    [Route("api/mesPPCutOutboundOrder")]
    [ApiController]
    public class MesPPCutOutboundOrderController : ApiBaseController<IMesPPCutOutboundOrderService, Dt_MesPPCutOutboundOrder>
    {
        public MesPPCutOutboundOrderController(IMesPPCutOutboundOrderService service) : base(service)
        {
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/MesPPCutOutboundOrderDetailController.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
using Autofac.Core;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WIDESEA_Core;
using WIDESEA_Core.BaseController;
using WIDESEA_DTO.Inbound;
using WIDESEA_DTO.MES;
using WIDESEA_DTO.Outbound;
using WIDESEA_IOutboundService;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.Outbound;
namespace WIDESEA_WMSServer.Controllers.Outbound
{
    /// <summary>
    /// PP仓小卷MES出库单
    /// </summary>
    [Route("api/mesPPCutOutboundOrderDetail")]
    [ApiController]
    public class MesPPCutOutboundOrderDetailController : ApiBaseController<IMesPPCutOutboundOrderDetailService, Dt_MesPPCutOutboundOrderDetail>
    {
        public MesPPCutOutboundOrderDetailController(IMesPPCutOutboundOrderDetailService service) : base(service)
        {
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/MesPPOutboundOrderController.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
using Autofac.Core;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WIDESEA_Core;
using WIDESEA_Core.BaseController;
using WIDESEA_DTO.Inbound;
using WIDESEA_DTO.MES;
using WIDESEA_DTO.Outbound;
using WIDESEA_IOutboundService;
using WIDESEA_Model.Models;
namespace WIDESEA_WMSServer.Controllers.Outbound
{
    /// <summary>
    /// MES出库单
    /// </summary>
    [Route("api/mesPPOutboundOrder")]
    [ApiController]
    public class MesPPOutboundOrderController : ApiBaseController<IMesPPOutboundOrderService, Dt_MesPPOutboundOrder>
    {
        public MesPPOutboundOrderController(IMesPPOutboundOrderService service) : base(service)
        {
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/MesPPOutboundOrderDetailController.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,21 @@
using Microsoft.AspNetCore.Mvc;
using WIDESEA_Core.BaseController;
using WIDESEA_IOutboundService;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.Outbound;
namespace WIDESEA_WMSServer.Controllers.Outbound
{
    /// <summary>
    /// MES出库单
    /// </summary>
    [Route("api/mesPPOutboundOrderDetail")]
    [ApiController]
    public class MesPPOutboundOrderDetailController : ApiBaseController<IMesPPOutboundOrderDetailService, Dt_MesPPOutboundOrderDetail>
    {
        public MesPPOutboundOrderDetailController(IMesPPOutboundOrderDetailService service) : base(service)
        {
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs
@@ -303,5 +303,16 @@
        {
            return Service.UpdateTaskInfo(task);
        }
        /// <summary>
        /// PP仓AGV搬运任务
        /// </summary>
        /// <param name="task"></param>
        /// <returns></returns>
        [HttpPost, Route("AGVTasks"), AllowAnonymous]
        public WebResponseContent AGVTasks([FromBody] SaveModel saveModel)
        {
            return Service.AGVTasks(saveModel);
        }
    }
}
´úÂë¹ÜÀí/»´°²PDA/pages.json
@@ -72,6 +72,13 @@
            }
        },
        {
            "path": "pages/stash/AGVTasks",
            "style": {
                "navigationBarTitleText": "AGV搬运任务",
                "enablePullDownRefresh": false
            }
        },
        {
            "path": "pages/stash/InEmpty",
            "style": {
                "navigationBarTitleText": "空箱入库",
´úÂë¹ÜÀí/»´°²PDA/pages/stash/AGVTasks.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,113 @@
<template>
    <view>
        <view class="itemstyle">
            <uni-forms label-width="180">
                <uni-forms-item label="托盘条码:">
                    <uni-easyinput type="text" placeholder="请扫描托盘条码" ref='midInput' :focus="!focus" v-model="barcode"
                        @input="barcodeInput" />
                </uni-forms-item>
                <uni-forms-item label="地址码:">
                    <uni-easyinput type="text" placeholder="请扫描地址码" ref='midInput' :focus="!focus" v-model="address"
                        @input="barcodeInput" />
                </uni-forms-item>
                <uni-forms-item>
                    <button @click="AGVTasks" type="primary" size="default" style="margin-top: 2%;">确认完成</button>
                </uni-forms-item>
            </uni-forms>
        </view>
        <u-toast ref="uToast" />
    </view>
</template>
<script>
    const innerAudioContext = uni.createInnerAudioContext();
    export default {
        data() {
            return {
                focus: false,
                barcode: "",
                address: "",
                    warehouseId: "",
            }
        },
        onShow() {},
        onLoad(res) {
            this.focus = false;
            this.warehouseId=res.warehouseId;
        },
        methods: {
            voiceSpeech(src) {
                innerAudioContext.src = src; // '../../static/success.mp3';
                innerAudioContext.play();
            },
            barcodeInput() {
                this.$nextTick(function(x) {
                    if (this.barcode.length > 0) {
                        this.focus = true;
                    }
                })
            },
            AGVTasks() {
                if (this.barcode == "") {
                    this.$refs.uToast.show({
                        title: "请扫描托盘码",
                        type: 'error'
                    })
                    return;
                }
                if (this.address == "") {
                    this.$refs.uToast.show({
                        title: "请扫描地址码",
                        type: 'error'
                    })
                    return;
                }
                var postDate = {
                    MainData: {
                        barcode: this.barcode,
                        address: this.address,
                        warehouseId:this.warehouseId,
                    }
                }
                this.$u.post('http://127.0.0.1:9293/api/Task/AGVTasks', postDate).then(
                    res => {
                        if (res.status) {
                            this.$refs.uToast.show({
                                title: "任务创建成功成功",
                                type: "success"
                            })
                            this.barcode = "";
                        } 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>
ÏîÄ¿×ÊÁÏ/½Ó¿ÚÎĵµ/MESÒµÎñÁ÷³ÌͼV1.0.xlsx
Binary files differ