wangxinhui
2025-03-15 efaf0b8aeb26aca6536a4b384c912cc3cac4d070
成品代码,其他仓优化,前端优化界面增加
已删除6个文件
已修改65个文件
已添加11个文件
1733 ■■■■■ 文件已修改
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/APIEnum/APIEnum.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/Agv/AGVBoxApplyPassDTO.cs 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/CTU_AGVController .cs 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/InvokeAGVService.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP仓/StackerCraneJob_PP.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/干膜仓/ConveyorLineJob_GM.cs 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/干膜仓/StackerCraneJob_GM.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/成品仓/AGV_CPExtend.cs 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/成品仓/AGV_CPJob.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/板材仓/ConveyorLineJob_BC.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/板材仓/StackerCraneJob_BC.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/油墨仓/CommonHoisterJob.cs 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/油墨仓/StackerCraneJob_YM.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/测试架仓/StackerCraneJob_CSJ.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/阻焊仓/StackerCraneJob_ZH.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/MesOutOrderDetail.vue 247 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/SelectedStock.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/extension/outbound/mesOutboundOrder.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/views/inbound/receiveOrder.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/views/outbound/outboundOrder.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/views/stock/stockView.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/views/taskinfo/task.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/views/taskinfo/task_hty.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/1ceb7491-cd63-4a60-ba30-ad6b8388e302.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/2750f5ae-5ba3-4a71-bf69-75c17db76907.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/4097eb55-e5cd-477d-a304-2ebfbecb7877.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/416fe101-249f-41a5-9c55-755eb49bfad0.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/5172d2fd-775d-4922-be09-1cba741a2211.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/5d7aaa65-610a-4a4f-9e08-ac924f0dace4.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/698304e2-84c8-4568-8d00-fafc24f90fa6.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/c0c07971-a8e8-48ed-85a6-a9d507a9fa79.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/d47d14a8-1bd7-49ce-b62d-ff8267c57e45.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/e5636152-b0c4-43fd-9e1c-ef8dceb4183d.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_CheckService/CheckOrderService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/OutProTypeEnum.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/PurchaseOrderEnum.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/ReceiveOrderEnum.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpMesHelper.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpRequestContent.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_External/ERPService/InvokeERPService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderService.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundRepository/IOutProStockInfoRepository.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutProStockInfoService.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutStockLockInfoService.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IProOutOrderDetailService.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IStockRepository/IProStockInfoRepository.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IStockService/IProStockInfoService.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IStockService/IStockService.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/PurchaseOrderService.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderDetailService.cs 85 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderService.cs 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReturnOrderService.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Config/Dt_CodeRuleConfig.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReceiveOrder.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutProStockInfo.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_ProOutOrderDetail.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_ProStockInfoDetail.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundRepository/OutProStockInfoRepository.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutProStockInfoService.cs 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/ProOutOrderDetailService.cs 151 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/ProStockInfoRepository.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_StockService/ProStockInfoService.cs 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockSerivce.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs 160 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutStockLockInfoController.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Filter/CustomProfile.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/APIEnum/APIEnum.cs
@@ -65,6 +65,11 @@
        /// AGV储位绑定查询
        /// </summary>
        [Description("AGV储位绑定查询")]
        Agv_CSJPodBerthAndMat
        Agv_CSJPodBerthAndMat,
        /// <summary>
        /// æˆå“æ–™ç®±å–放货通知回调
        /// </summary>
        [Description("成品料箱取放货通知回调")]
        AGV_CPBoxApplyPass
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs
@@ -62,6 +62,11 @@
        [Description("成品出库")]
        OutProduct = 230,
        /// <summary>
        /// æˆå“å¯„售转仓
        /// </summary>
        [Description("成品寄售转仓")]
        OutSendProduct = 240,
        /// <summary>
        /// é‡‡è´­å…¥åº“
        /// </summary>
        [Description("采购入库")]
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/Agv/AGVBoxApplyPassDTO.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_DTO.Agv
{
    /// <summary>
    /// æ–™ç®±å›žè°ƒ
    /// </summary>
    public class AGVBoxApplyPassDTO
    {
        /// <summary>
        /// è¯·æ±‚编号
        /// </summary>
        public string ReqCode { get; set; }
        /// <summary>
        /// è¯·æ±‚æ—¶é—´
        /// </summary>
        public string ReqTime { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string? ClientCode { get; set; }
        /// <summary>
        /// ä»¤ç‰Œå·
        /// </summary>
        public string? TokenCode { get; set; }
        /// <summary>
        /// ä»»åŠ¡å•å·
        /// </summary>
        public string TaskCode { get; set; }
        /// <summary>
        ///  1.取申请通过<br/>
        ///  2.放申请通过<br/>
        /// </summary>
        public string Type { get; set; }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs
@@ -264,5 +264,9 @@
        /// //判断移库货位任务是否已存在,如存在先执行
        /// </summary>
        Dt_Task QueryStackerExistTask(string PalletCode,string locationCode);
        /// <summary>
        /// AGV成品取放货通知
        /// </summary>
        WebResponseContent AgvBoxApplyPass(AGVBoxApplyPassDTO applyPassDTO, APIEnum SecureReply = APIEnum.AGV_CPBoxApplyPass);
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/CTU_AGVController .cs
@@ -107,10 +107,35 @@
                var task = _taskRepository.QueryFirst(x => agvUpdateModel.TaskCode == x.AgvTaskNum);
                if (task == null) throw new Exception($"未找到任务,任务号【{agvUpdateModel.TaskCode}】");
                if (agvUpdateModel.Method == "end")
                switch (agvUpdateModel.Method)
                {
                    if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt() || task.TaskType == TaskTypeEnum.OutEmpty.ObjToInt() || task.TaskType == TaskTypeEnum.OutAllocate.ObjToInt()) PutFinish(task.NextAddress);
                    _taskService.TaskCompleted(task.TaskNum);
                    case "end":
                        if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt() || task.TaskType == TaskTypeEnum.OutEmpty.ObjToInt() || task.TaskType == TaskTypeEnum.OutAllocate.ObjToInt() || task.TaskType == TaskTypeEnum.OutProduct.ObjToInt())
                            PutFinish(task.NextAddress);
                        _taskService.TaskCompleted(task.TaskNum);
                        break;
                    case "applyToAgv":
                        //更改成品入库AGV取货任务状态
                        if (task.TaskType == TaskTypeEnum.InProduct.ObjToInt())
                        {
                            _taskService.UpdateTask(task,TaskStatusEnum.AGV_WaitToExecute);
                        }
                        break;
                    case "applyFromAgv":
                        //更改成品出AGV放货任务状态
                        if (task.TaskType == TaskTypeEnum.OutProduct.ObjToInt())
                        {
                            _taskService.UpdateTask(task, TaskStatusEnum.AGV_WaitToExecute);
                        }
                        break;
                    case "outbin":
                        if (task.TaskType == TaskTypeEnum.OutProduct.ObjToInt())
                        {
                            TakeFinish(task.CurrentAddress);
                        }
                        break;
                    default:
                        break;
                }
                agvResponseContent.Code = "0";
                agvResponseContent.Message = "成功";
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json
@@ -14,7 +14,9 @@
  //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=",
  "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWCS_HUAIAN;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  //"ConnectionString": "Data Source=10.30.4.92;Initial Catalog=TestWCS_TC;User ID=sa;Password=duo123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  //"ConnectionString": "Data Source=10.30.4.92;Initial Catalog=TESTWCSCP_WCS;User ID=sa;Password=duo123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  "WMSConnectionStrings": "Data Source=.;Initial Catalog=WIDESEAWMS_HUAIAN;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  //"WMSConnectionStrings": "Data Source=10.30.4.92;Initial Catalog=TESTWMSCP_WMS;User ID=sa;Password=duo123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  //跨域
  "Cors": {
    "PolicyName": "CorsIpAccess", //策略名称
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/InvokeAGVService.cs
@@ -83,6 +83,34 @@
            return content;
        }
        /// <summary>
        /// AGV成品取放货通知
        /// </summary>
        public WebResponseContent AgvBoxApplyPass(AGVBoxApplyPassDTO applyPassDTO, APIEnum SecureReply = APIEnum.AGV_CPBoxApplyPass)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                string? apiAddress = apiInfos.FirstOrDefault(x => x.ApiCode == SecureReply.ToString())?.ApiAddress;
                if (string.IsNullOrEmpty(apiAddress))
                    return WebResponseContent.Instance.Error($"未找到发送AGV任务接口,请检查接口配置");
                string response = HttpHelper.Post(apiAddress, applyPassDTO.Serialize());
                AgvResponseContent agvContent = response.DeserializeObject<AgvResponseContent>();
                if (agvContent.Code == "0")
                {
                    content.OK(agvContent.Message);
                }
                else
                {
                    content.Error(agvContent.Message);
                }
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
        /// <summary>
        /// AGV任务状态刷新/AGV任务完成
        /// </summary>
        /// <param name="agvUpdateModel"></param>
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -182,7 +182,7 @@
                        }
                        else
                        {
                            stationManger = _stationMangerRepository.QueryFirst(x => x.StackerCraneCode == item.RoadWay);
                            stationManger = _stationMangerRepository.QueryFirst(x => x.StackerCraneCode == item.RoadWay || x.Remark==item.RoadWay);
                        }
                        if (stationManger == null)
                        {
@@ -228,12 +228,12 @@
                            else
                            {
                                task.NextAddress = taskTypeGroup == TaskTypeGroup.InboundGroup ? task.TargetAddress : router.NextPosi;
                                if (item.RoadWay.Contains("AGV_FL"))
                                if (item.RoadWay.Contains("AGV_FL")|| (item.RoadWay.Contains("AGV_CP") && taskTypeGroup == TaskTypeGroup.OutbondGroup))
                                {
                                    task.DeviceCode = item.RoadWay;
                                    task.AgvTaskNum = task.DeviceCode + DateTime.Now.ToString("yyyyMMdd") + item.TaskNum;
                                    task.AgvTaskNum = item.RoadWay + DateTime.Now.ToString("yyyyMMdd") + item.TaskNum;
                                }
                                else if(item.RoadWay.Contains("AGV_FL"))
                                else if(item.RoadWay.Contains("AGV_CP") && taskTypeGroup == TaskTypeGroup.InboundGroup)
                                {
                                    task.DeviceCode = stationManger.StationDeviceCode;
                                    task.AgvTaskNum = task.DeviceCode + DateTime.Now.ToString("yyyyMMdd") + item.TaskNum;
@@ -842,7 +842,7 @@
        /// </summary>
        public Dt_Task QueryStackerExistTask(string PalletCode, string locationCode)
        {
            return BaseDal.QueryFirst(x => x.PalletCode == PalletCode && x.SourceAddress == locationCode && x.TaskState == (int)TaskStatusEnum.SC_Execute);
            return BaseDal.QueryFirst(x => x.PalletCode == PalletCode && x.SourceAddress == locationCode && (x.TaskState == (int)TaskStatusEnum.SC_Execute || x.TaskState == (int)TaskStatusEnum.SC_Executing));
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP²Ö/StackerCraneJob_PP.cs
@@ -75,8 +75,9 @@
                                        task.Dispatchertime = DateTime.Now;
                                        task.ExceptionMessage = "";
                                        _taskService.UpdateTask(task, TaskStatusEnum.SC_Executing);
                                        commonStackerCrane.Communicator.Write("DB105.54", (short)1);
                                        //延时1s
                                        Thread.Sleep(1000);
                                    }
                                }
                            }
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/¸ÉĤ²Ö/ConveyorLineJob_GM.cs
@@ -1,4 +1,5 @@
using Quartz;
using Newtonsoft.Json;
using Quartz;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -8,6 +9,7 @@
using WIDESEAWCS_Common.Helper;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Caches;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_ITaskInfoRepository;
@@ -24,20 +26,33 @@
    [DisallowConcurrentExecution]
    public class ConveyorLineJob_GM : JobBase, IJob
    {
        private readonly ICacheService _cacheService;
        private readonly ITaskService _taskService;
        private readonly ITaskExecuteDetailService _taskExecuteDetailService;
        private readonly ITaskRepository _taskRepository;
        private readonly IStationMangerRepository _stationMangerRepository;
        private readonly IRouterRepository _routerRepository;
        private readonly List<Dt_WarehouseDevice> warehouseDevices;
        public ConveyorLineJob_GM(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository)
        public ConveyorLineJob_GM(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, ICacheService
            cacheService)
        {
            _cacheService = cacheService;
            _taskService = taskService;
            _taskExecuteDetailService = taskExecuteDetailService;
            _taskRepository = taskRepository;
            _stationMangerRepository = stationMangerRepository;
            _routerRepository = routerRepository;
            string? warehouseDevicesStr = _cacheService.Get<string>(nameof(Dt_WarehouseDevice));
            if (!string.IsNullOrEmpty(warehouseDevicesStr))
            {
                warehouseDevices = JsonConvert.DeserializeObject<List<Dt_WarehouseDevice>>(warehouseDevicesStr) ?? new List<Dt_WarehouseDevice>();
            }
            else
            {
                warehouseDevices = new List<Dt_WarehouseDevice>();
            }
        }
        public Task Execute(IJobExecutionContext context)
@@ -46,6 +61,12 @@
            if (flag && value != null)
            {
                OtherDevice device = (OtherDevice)value;
                Dt_WarehouseDevice? warehouseDevice = warehouseDevices.FirstOrDefault(x => x.DeviceCode == device.DeviceCode);
                if (warehouseDevice == null)
                {
                    WriteError(device.DeviceName, $"请配置仓库设备信息");
                    return Task.CompletedTask;
                }
                List<string> deviceStations = device.DeviceProDTOs.Select(x => x.DeviceChildCode).ToList();
                List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StationDeviceCode == device.DeviceCode);
                foreach (var item in stationMangers.Where(x => deviceStations.Contains(x.StationCode)))
@@ -75,6 +96,7 @@
                            {
                                if (!string.IsNullOrEmpty(conveyorLineInfoRead.Barcode))
                                {
                                    //入库申请任务
                                    WebResponseContent content = _taskService.RequestWMSTask(conveyorLineInfoRead.Barcode, item.StationCode);
                                    if (content.Status)
                                    {
@@ -98,7 +120,7 @@
                        {
                            if (!conveyorLineSignalRead.STB && !conveyorLineSignalRead.ACK && conveyorLineStatus.Online && !conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.STB && !conveyorLineSignalWrite.ACK)
                            {
                                Dt_Task task = _taskRepository.QueryFirst(x => _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.New.ObjToInt() && string.IsNullOrEmpty(x.TargetAddress) && !string.IsNullOrEmpty(x.NextAddress));
                                Dt_Task task = _taskRepository.QueryFirst(x => x.WarehouseId== warehouseDevice.WarehouseId && _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.New.ObjToInt() && string.IsNullOrEmpty(x.TargetAddress) && !string.IsNullOrEmpty(x.NextAddress));
                                if (task != null)
                                {
                                    _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, nextAddress: item.StationCode, deviceCode: item.StackerCraneCode, targetAddress: item.StationCode);
@@ -116,6 +138,7 @@
                                        WriteError(item.StationName, $"未找到对应站台信息,设备编号:{item.StationCode},任务号:{task.TaskNum}");
                                        continue;
                                    }
                                    //入库申请分配货位
                                    string? locationCode = _taskService.RequestAssignLocation(task.TaskNum, stationManger.StackerCraneCode);
                                    if (string.IsNullOrEmpty(locationCode))
                                    {
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/¸ÉĤ²Ö/StackerCraneJob_GM.cs
@@ -93,8 +93,9 @@
                                    task.Dispatchertime = DateTime.Now;
                                    task.ExceptionMessage = "";
                                    _taskService.UpdateTask(task, TaskStatusEnum.SC_Executing);
                                    commonStackerCrane.Communicator.Write("DB105.54", (short)1);
                                    //延时1s
                                    Thread.Sleep(1000);
                                }
                            }
                        }
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/³ÉÆ·²Ö/AGV_CPExtend.cs
@@ -1,4 +1,5 @@
using System;
using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -8,7 +9,9 @@
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_DTO.Agv;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
namespace WIDESEAWCS_Tasks
{
@@ -18,7 +21,7 @@
        {
            try
            {
                var newTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskStatusEnum.AGV_Execute.ObjToInt() && nameof(AGV_CPJob).Contains(x.DeviceCode) && !string.IsNullOrEmpty(x.DeviceCode)).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList();
                var newTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => (x.TaskState == TaskStatusEnum.AGV_Execute.ObjToInt()|| x.TaskState == TaskStatusEnum.New.ObjToInt()) && nameof(AGV_CPJob).Contains(x.DeviceCode) && !string.IsNullOrEmpty(x.DeviceCode)).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList();
                foreach (var task in newTasks)
                {
                    try
@@ -47,11 +50,11 @@
                            }
                        },
                        };
                        //发送AGV任务
                        WebResponseContent content = _taskService.AgvSendTask(taskDTO, APIEnum.Agv_CPSendTask);
                        if (!content.Status) throw new Exception(content.Message);
                        if (!content.Status)
                            throw new Exception(content.Message);
                        task.TaskState = TaskStatusEnum.AGV_Executing.ObjToInt();
                    }
                    catch (Exception ex)
                    {
@@ -62,6 +65,96 @@
                if (newTasks.Count>0)
                {
                    _taskService.UpdateData(newTasks);
                }
            }
            catch (Exception ex)
            {
                WriteError(nameof(AGV_CPJob), ex.Message, ex);
            }
        }
        /// <summary>
        /// AGV取放货回调
        /// </summary>
        public void ContinueAGVTask()
        {
            try
            {
                //获取是否有安全申请中的任务
                var continueTask = _taskService.Db.Queryable<Dt_Task>().Where(x => (x.TaskState == TaskStatusEnum.AGV_WaitToExecute.ObjToInt()) && nameof(AGV_CPJob).Contains(x.DeviceCode) && !string.IsNullOrEmpty(x.DeviceCode)).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).FirstOrDefault();
                if (continueTask!=null)
                {
                    //取货回调
                    if (continueTask.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)
                    {
                        Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == continueTask.CurrentAddress);
                        if (stationManger == null)
                        {
                            throw new Exception($"未找到站台{continueTask.CurrentAddress}信息");
                        }
                        IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode);
                        if (device == null)
                        {
                            throw new Exception($"未找到设备{stationManger.StationDeviceCode}信息");
                        }
                        OtherDevice otherDevice = (OtherDevice)device;
                        short canTake = otherDevice.GetValue<GroundStationDBName, short>(GroundStationDBName.R_IsCanTake, stationManger.StationCode);
                        if (canTake != 1)
                        {
                            return;
                        }
                    }
                    else//放货回调
                    {
                        Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == continueTask.NextAddress);
                        if (stationManger == null)
                        {
                            throw new Exception($"未找到站台{continueTask.NextAddress}信息");
                        }
                        IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode);
                        if (device == null)
                        {
                            throw new Exception($"未找到设备{stationManger.StationDeviceCode}信息");
                        }
                        OtherDevice otherDevice = (OtherDevice)device;
                        short canPut = otherDevice.GetValue<GroundStationDBName, short>(GroundStationDBName.R_IsCanPut, stationManger.StationCode);
                        if (canPut != 1)
                        {
                            return;
                        }
                    }
                    //获取调入参数
                    AGVBoxApplyPassDTO boxApplyPassDTO = new AGVBoxApplyPassDTO()
                    {
                        ReqCode = Guid.NewGuid().ToString().Replace("-", ""),
                        ReqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                        TaskCode = continueTask.AgvTaskNum
                    };
                    if (continueTask.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)
                    {
                        boxApplyPassDTO.Type = "1";
                    }
                    else
                    {
                        boxApplyPassDTO.Type = "2";
                    }
                    //请求料箱回调接口
                    WebResponseContent content = _taskService.AgvBoxApplyPass(boxApplyPassDTO);
                    if (content.Status && continueTask.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)
                    {
                        continueTask.TaskState = TaskStatusEnum.AGV_Executing.ObjToInt();
                        _taskService.UpdateTask(continueTask, TaskStatusEnum.AGV_Executing);
                    }
                    else if (content.Status && continueTask.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
                    {
                        continueTask.TaskState = TaskStatusEnum.AGV_Puting.ObjToInt();
                        _taskService.UpdateTask(continueTask, TaskStatusEnum.AGV_Puting);
                    }
                    else
                    {
                        continueTask.TaskState = TaskStatusEnum.Exception.ObjToInt();
                        continueTask.ExceptionMessage = content.Message;
                        _taskService.UpdateTask(continueTask, TaskStatusEnum.Exception);
                    }
                }
            }
            catch (Exception ex)
@@ -84,11 +177,11 @@
                var Layer = Convert.ToInt16(targetCodes[3]);
                var a = Row switch
                {
                    1 => "A1",
                    2 => "B1",
                    3 => "C1",
                    4 => "D1",
                    5 => "E1",
                    1 => "A",
                    2 => "B",
                    3 => "C",
                    4 => "D",
                    5 => "E",
                    _ => throw new Exception($"未定义的排,地址:【{Address}】"),
                };
                var b = Layer > 9 ? "" + Layer : "0" + Layer;
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/³ÉÆ·²Ö/AGV_CPJob.cs
@@ -33,7 +33,10 @@
        {
            try
            {
                //任务发送
                SendAGVTask();
                //继续执行
                ContinueAGVTask();
            }
            catch (Exception ex)
            {
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/°å²Ä²Ö/ConveyorLineJob_BC.cs
@@ -256,6 +256,7 @@
                                                    deviceCode = item.StackerCraneCode;
                                                    roadwayNo = responseContent.Data.ToString();
                                                    device.SetValue(W_ConveyorLineDB.EndPos, task.NextAddress, item.StationCode);
                                                    device.SetValue(W_ConveyorLineDB.StartPos, task.CurrentAddress, item.StationCode);
                                                }
                                                else
                                                {
@@ -266,10 +267,14 @@
                                            else
                                            {
                                                //task.NextAddress可能是router.NextPosi
                                                device.SetValue(W_ConveyorLineDB.EndPos, task.NextAddress, item.StationCode);
                                                roadwayNo = responseContent.Data.ToString();
                                                deviceCode = router.ChildPosiDeviceCode;
                                                currentAddress = router.StartPosi;
                                                nextAddress= router.NextPosi;
                                                device.SetValue(W_ConveyorLineDB.EndPos, router.NextPosi, item.StationCode);
                                                device.SetValue(W_ConveyorLineDB.StartPos, router.StartPosi, item.StationCode);
                                            }
                                            device.SetValue(W_ConveyorLineDB.TaskNum, task.TaskNum, item.StationCode);
                                            device.SetValue(W_ConveyorLineDB.StartPos, task.CurrentAddress, item.StationCode);
                                            device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Outbound.ObjToInt(), item.StationCode);
                                            device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode);
                                            _taskService.UpdateTask(task, taskState, currentAddress: currentAddress, nextAddress: nextAddress, targetAddress: targetAddress, deviceCode: deviceCode, roadwayNo: roadwayNo,heightType: conveyorLineInfoRead.Spare2);
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/°å²Ä²Ö/StackerCraneJob_BC.cs
@@ -120,6 +120,8 @@
                                    task.Dispatchertime = DateTime.Now;
                                    task.ExceptionMessage = "";
                                    _taskService.UpdateTask(task, TaskStatusEnum.SC_Executing);
                                    //延时1s
                                    Thread.Sleep(1000);
                                }
                            }
                        }
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ÓÍÄ«²Ö/CommonHoisterJob.cs
@@ -93,8 +93,11 @@
                                task.NextAddress = locationCode;
                                task.DeviceCode = stationManger.StackerCraneCode;
                                task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt();
                                _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, deviceCode: task.DeviceCode, targetAddress: task.TargetAddress, currentAddress: task.CurrentAddress, nextAddress: task.NextAddress);
                                bool isWrite = hoister.SetValue(HoisterDBName.RequestIn, false, deviceChildCode);
                                if (isWrite)
                                {
                                    _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, deviceCode: task.DeviceCode, targetAddress: task.TargetAddress, currentAddress: task.CurrentAddress, nextAddress: task.NextAddress);
                                }
                            }
                            else
                            {
@@ -113,8 +116,11 @@
                            if (task != null)
                            {
                                task.TaskState=TaskStatusEnum.HT_Executing.ObjToInt();
                                _taskService.UpdateTask(task, TaskStatusEnum.HT_Executing);
                                bool isWrite = hoister.SetValue(HoisterDBName.RequestOut, true, deviceChildCode);
                                if (isWrite)
                                {
                                    _taskService.UpdateTask(task, TaskStatusEnum.HT_Executing);
                                }
                                WriteError(hoister.DeviceName, $"请求出库,设备编号:{deviceChildCode},任务号:{task.TaskNum}");
                            }
                        }
@@ -134,8 +140,11 @@
                                task.NextAddress = stationManger.StackerCraneStationCode; ;
                                task.DeviceCode = stationManger.StackerCraneCode;
                                task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt();
                                _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, deviceCode: task.DeviceCode, targetAddress: task.TargetAddress, nextAddress: task.NextAddress);
                                bool isWrite = hoister.SetValue(HoisterDBName.RequestOut, false, deviceChildCode);
                                if (isWrite)
                                {
                                    _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, deviceCode: task.DeviceCode, targetAddress: task.TargetAddress, nextAddress: task.NextAddress);
                                }
                            }
                            else
                            {
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ÓÍÄ«²Ö/StackerCraneJob_YM.cs
@@ -80,6 +80,8 @@
                                        task.Dispatchertime = DateTime.Now;
                                        task.ExceptionMessage = "";
                                        _taskService.UpdateTask(task, TaskStatusEnum.SC_Executing);
                                        //延时1s
                                        Thread.Sleep(1000);
                                    }
                                }
                            }
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/²âÊԼܲÖ/StackerCraneJob_CSJ.cs
@@ -94,6 +94,8 @@
                                    task.Dispatchertime = DateTime.Now;
                                    task.ExceptionMessage = "";
                                    _taskService.UpdateTask(task, TaskStatusEnum.SC_Executing);
                                    //延时1s
                                    Thread.Sleep(1000);
                                }
                            }
                        }
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/×躸²Ö/StackerCraneJob_ZH.cs
@@ -73,6 +73,8 @@
                                        task.Dispatchertime = DateTime.Now;
                                        task.ExceptionMessage = "";
                                        _taskService.UpdateTask(task, TaskStatusEnum.SC_Executing);
                                        //延时1s
                                        Thread.Sleep(1000);
                                    }
                                }
                            }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/MesOutOrderDetail.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,247 @@
<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="24">
              <span class="less-style">物料名称: {{ row.materialName }} </span>
              <el-divider direction="vertical"></el-divider>
              <span class="less-style">物料编号: {{ row.materialCode }} </span>
              <el-divider direction="vertical"></el-divider>
              <span class="less-style"
                >需求数量: {{ row.orderQuantity }}
              </span>
              <el-divider direction="vertical"></el-divider>
              <span class="less-style"
                >已分配数量: {{ row.lockQuantity }}
              </span>
            </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
          height="500px"
        >
          >
          <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" v-if="item.type == 'icon'">
              <el-tooltip
                class="item"
                effect="dark"
                :content="item.title"
                placement="bottom"
                ><el-button
                  type="text"
                  @click="tableButtonClick(scoped.row, item)"
                  ><i :class="item.icon" style="font-size: 22px"></i></el-button
              ></el-tooltip>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <template #footer>
        <!-- <el-button type="primary" size="small" @click="submit">确认</el-button> -->
        <el-button type="danger" size="small" @click="showDetialBox = false"
          >关闭</el-button
        >
      </template>
    </vol-box>
  </div>
</template>
    <script>
import VolBox from "@/components/basic/VolBox.vue";
export default {
  components: { VolBox },
  data() {
    return {
      row: null,
      showDetialBox: false,
      tableData: [],
      tableColumns: [
        {
          prop: "id",
          title: "主键",
          type: "string",
          width: 150,
          hidden: true,
        },
        {
          prop: "orderNo",
          title: "单据编号",
          type: "string",
          width: 150,
        },
        {
          prop: "orderDetailId",
          title: "单据明细主键",
          type: "string",
          width: 150,
          hidden: true,
        },
        {
          prop: "orderType",
          title: "单据类型",
          type: "string",
          width: 90,
        },
        {
          prop: "batchNo",
          title: "批次号",
          type: "string",
          width: 120,
        },
        {
          prop: "materielCode",
          title: "物料编号",
          type: "string",
          width: 150,
        },
        {
          prop: "materielName",
          title: "物料名称",
          type: "string",
          width: 150,
        },
        {
          prop: "stockId",
          title: "库存主键",
          type: "string",
          width: 150,
          hidden: true,
        },
        {
          prop: "originalQuantity",
          title: "原始库存量",
          type: "string",
          width: 100,
        },
        // {
        //   prop: "assignQuantity",
        //   title: "分配出库量",
        //   type: "string",
        //   width: 100,
        // },
        {
          prop: "taskNum",
          title: "出库任务号",
          type: "string",
          width: 100,
        },
        {
          prop: "palletCode",
          title: "托盘编号",
          type: "string",
          width: 150,
        },
        {
          prop: "locationCode",
          title: "货位编号",
          type: "string",
          width: 180,
        },
        {
          prop: "status",
          title: "状态",
          type: "string",
        },
      ],
    };
  },
  methods: {
    open(row) {
      this.row = row;
      this.showDetialBox = true;
      this.getData();
    },
    getData() {
      this.http
        .post(
          "api/OutStockLockInfo/GetByMesOrderDetail?taskNo=" +
            this.row.taskNo,
          null,
          "查询中"
        )
        .then((x) => {
          var label=[
              { label: '已分配', value: 0 },
              { label: '出库中', value: 1 },
              { label: '出库完成', value: 2 },
              { label: '拣选完成', value: 3 },
              { label: '撤销', value: 99 }
          ]
          this.tableData=x.map((i) => ({
            ...i,
            status:label.find((j) => j.value === i.status).label
          }))
        });
    },
  },
};
</script>
  <style scoped>
.less-style {
  color: black;
}
.equle-style {
  color: green;
}
.more-style {
  color: red;
}
</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;
}
.box-head .el-alert__content {
  width: 100%;
}
</style>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/SelectedStock.vue
@@ -148,6 +148,12 @@
          width: 100,
        },
        {
          prop: "taskNum",
          title: "出库任务号",
          type: "string",
          width: 100,
        },
        {
          prop: "palletCode",
          title: "托盘编号",
          type: "string",
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/extension/outbound/mesOutboundOrder.js
@@ -1,10 +1,11 @@
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
import gridBody from './extend/addMesOutOrder.vue'
import gridBody from './extend/MesOutOrderDetail.vue'
import gridHeader from './extend/addMesOutOrder.vue'
let extension = {
  components: {
    //查询界面扩展组件
    gridHeader: '',
    gridHeader: gridHeader,
    gridBody: gridBody,
    gridFooter: '',
    //新建、编辑弹出框扩展组件
@@ -21,7 +22,7 @@
      let addButton = this.buttons.find(item => item.value == 'Add');
      if (addButton) {
        addButton.onClick = () => {
          this.$refs.gridBody.open();
          this.$refs.gridHeader.open();
        }
      }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue
@@ -97,6 +97,7 @@
        },
        { title: "创建者", field: "creater", type: "like" },
        { title: "创建时间", field: "createDate", type: "datetime" },
        { title: "所属仓库", field: "warehouseId",type: "selectList",dataKey: "warehouses",data: [],}
      ],
    ]);
    const columns = ref([
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/views/inbound/receiveOrder.vue
@@ -53,7 +53,8 @@
      ],
      [
        { title: "供应商", field: "suppliersId", type: "select",dataKey:"suppliers",data:[]},
        { title: "创建者", field: "creater", type: "like" }
        { title: "创建者", field: "creater", type: "like" },
        { title: "所属仓库", field: "warehouseId",type: "selectList",dataKey: "warehouses",data: [],}
      ],
    ]);
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/views/outbound/outboundOrder.vue
@@ -116,6 +116,7 @@
        },
        { title: "创建者", field: "creater", type: "like" },
        { title: "创建时间", field: "createDate", type: "datetime" },
        { title: "所属仓库", field: "warehouseId",type: "selectList",dataKey: "warehouses",data: [],}
      ],
    ]);
    const columns = ref([
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/views/stock/stockView.vue
@@ -282,6 +282,13 @@
          align: "left",
        },
        {
          field: "materielSpec",
          title: "规格型号",
          type: "string",
          width: 180,
          align: "left",
        },
        {
          field: "serialNumber",
          title: "序列号",
          type: "int",
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/views/taskinfo/task.vue
@@ -120,6 +120,13 @@
        width: 220,
        align: "left",
      },
      {
        field: "orderNo",
        title: "单据编号",
        type: "string",
        width: 150,
        align: "left",
      },
      // {
      //   field: "currentAddress",
      //   title: "当前位置",
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/views/taskinfo/task_hty.vue
@@ -120,6 +120,13 @@
        width: 220,
        align: "left",
      },
      {
        field: "orderNo",
        title: "单据编号",
        type: "string",
        width: 150,
        align: "left",
      },
      // {
      //   field: "currentAddress",
      //   title: "当前位置",
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/1ceb7491-cd63-4a60-ba30-ad6b8388e302.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/2750f5ae-5ba3-4a71-bf69-75c17db76907.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/4097eb55-e5cd-477d-a304-2ebfbecb7877.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/416fe101-249f-41a5-9c55-755eb49bfad0.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/5172d2fd-775d-4922-be09-1cba741a2211.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/5d7aaa65-610a-4a4f-9e08-ac924f0dace4.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/698304e2-84c8-4568-8d00-fafc24f90fa6.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/c0c07971-a8e8-48ed-85a6-a9d507a9fa79.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/d47d14a8-1bd7-49ce-b62d-ff8267c57e45.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/e5636152-b0c4-43fd-9e1c-ef8dceb4183d.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_CheckService/CheckOrderService.cs
@@ -163,7 +163,7 @@
                    Code = checkOrder.CheckOrderNo,
                    CompanyId = "HATC",
                    Result = checkOrder.Result,
                    CreatorCode = "TC20082",//测试
                    CreatorCode = checkOrder.Creater,//测试
                    DefectedNote = checkOrder.DefectedNote,
                    MaterialsCode = checkOrder.MaterielCode,
                    PlantsId = "HA02",
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/OutProTypeEnum.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEA_Common.OrderEnum
{
    public enum OutProTypeEnum
    {
        /// <summary>
        /// æˆå“å‡ºåº“单
        /// </summary>
        [Description("成品出库单")]
        ProOut=1,
        /// <summary>
        /// å¯„售订单转仓
        /// </summary>
        [Description("寄售订单转仓")]
        SendProOut=2
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/PurchaseOrderEnum.cs
@@ -25,7 +25,12 @@
        /// æ”¶è´§å®Œæˆ
        /// </summary>
        [Description("收货完成")]
        Received = 2
        Received = 2,
        /// <summary>
        /// è®¢å•关闭
        /// </summary>
        [Description("订单关闭")]
        Closed = 3
    }
    public enum PurchaseOrderDetailStatusEnum
@@ -44,7 +49,12 @@
        /// æ”¶è´§å®Œæˆ
        /// </summary>
        [Description("收货完成")]
        Received = 2
        Received = 2,
        /// <summary>
        /// è®¢å•关闭
        /// </summary>
        [Description("订单关闭")]
        Closed = 3
    }
    public enum PurchaseOrderTypeEnum
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/ReceiveOrderEnum.cs
@@ -46,6 +46,17 @@
        /// æ”¶è´§å®Œæˆ
        /// </summary>
        [Description("收货完成")]
        Completed
        Completed,
        /// <summary>
        /// å…³é—­
        /// </summary>
        [Description("关闭")]
        å…³é—­ = 99,
        /// <summary>
        /// å–消
        /// </summary>
        [Description("取消")]
        å–消 = 98
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs
@@ -64,7 +64,11 @@
        /// </summary>
        [Description("成品出库")]
        OutProduct = 230,
        /// <summary>
        /// æˆå“å¯„售转仓
        /// </summary>
        [Description("成品寄售转仓")]
        OutSendProduct = 240,
        /// <summary>
        /// é‡‡è´­å…¥åº“
        /// </summary>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpMesHelper.cs
@@ -23,15 +23,19 @@
                    
                    using HttpClient httpClient = new HttpClient();
                    httpClient.Timeout = new TimeSpan(0, 0, 60);
                    //string authorization = "AppKey 1830415116987195392";
                    string authorization = "AppKey 1773317109539201024";
                    //正式
                    string authorization = "AppKey 1830415116987195392";
                    //测试
                    //string authorization = "AppKey 1773317109539201024";
                    headers = new Dictionary<string, string>
                    {
                        { "Authorization", authorization },
                        //{ "Site_tenant_id", "0dc2d164-8a62-417e-8a00-808007464feb" }
                        { "Site_tenant_id", "ced19269-2b83-4577-be43-8cc2f700251e" }
                        //正式
                        { "Site_tenant_id", "0dc2d164-8a62-417e-8a00-808007464feb" }
                        //测试
                        //{ "Site_tenant_id", "ced19269-2b83-4577-be43-8cc2f700251e" }
                    };
                    if (headers != null)
                    {
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpRequestContent.cs
@@ -6,10 +6,22 @@
namespace WIDESEA_DTO.ERP
{
    /// <summary>
    /// è°ƒç”¨ERP接口返回参数
    /// </summary>
    public class ErpRequestContent
    {
        /// <summary>
        /// è§£é‡Š
        /// </summary>
        public string Data { get ; set; }
        /// <summary>
        ///
        /// </summary>
        public string Rdata { get; set; }
        /// <summary>
        /// å“åº”状态
        /// </summary>
        public int res { get ; set; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_External/ERPService/InvokeERPService.cs
@@ -39,7 +39,7 @@
            ERPBaseModel<ERPReceiveModel> model = new ERPBaseModel<ERPReceiveModel>()
            {
                Data = receiveModel,
                Desc = "收货单",
                Desc = "WMS收货单推送",
                Type = "toTCWMSReceive",
                SecurityCode = "TeChuang"
            };
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderService.cs
@@ -32,11 +32,11 @@
        /// å…¥åº“完成上报
        /// </summary>
        /// <returns></returns>
        WebResponseContent FeedbackInboundOrder(Dt_InboundOrder inboundOrder);
        WebResponseContent FeedbackInboundOrder(int inboundOrderId);
        /// <summary>
        /// é€€æ–™å®Œæˆä¸ŠæŠ¥è‡³ERP
        /// </summary>
        public WebResponseContent FeedbackReturnOrder(Dt_InboundOrder inboundOrder,Dt_ReturnOrder returnOrder);
        WebResponseContent FeedbackReturnOrder(Dt_InboundOrder inboundOrder,Dt_ReturnOrder returnOrder);
        /// <summary>
        /// æ ¹æ®ä»“库和托盘号获取托盘类型
        /// </summary>
@@ -47,5 +47,9 @@
        /// </summary>
        /// <returns></returns>
        WebResponseContent ReceiveWarehousingOrder(ErpInOrderDTO model);
        /// <summary>
        /// æˆå“å…¥åº“上传ERP
        /// </summary>
        WebResponseContent FeedbackProIn(Dt_MesProInOrder mesProInOrder);
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundRepository/IOutProStockInfoRepository.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 IOutProStockInfoRepository : IRepository<Dt_OutProStockInfo>
    {
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutProStockInfoService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
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;
namespace WIDESEA_IOutboundService
{
    public interface IOutProStockInfoService : IService<Dt_OutProStockInfo>
    {
        IOutProStockInfoRepository Repository { get; }
        Dt_OutProStockInfo GetOutStockLockInfo(Dt_ProOutOrder proOutOrder, Dt_ProOutOrderDetail proOutOrderDetail, Dt_ProStockInfo proStockInfo, float assignQty, int? taskNum = null);
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutStockLockInfoService.cs
@@ -97,5 +97,11 @@
        /// <param name="palletCode">托盘号</param>
        /// <returns></returns>
        WebResponseContent MaterialPick(string palletCode);
        /// <summary>
        /// èŽ·å–Mes出库详情
        /// </summary>
        /// <param name="taskNo">Mes任务单号</param>
        /// <returns></returns>
        List<Dt_OutStockLockInfo> GetByMesOrderDetail(string taskNo);
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IProOutOrderDetailService.cs
@@ -3,6 +3,8 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.LocationEnum;
using WIDESEA_Core;
using WIDESEA_Core.BaseServices;
using WIDESEA_IOutboundRepository;
using WIDESEA_Model.Models;
@@ -12,5 +14,13 @@
    public interface IProOutOrderDetailService : IService<Dt_ProOutOrderDetail>
    {
        IProOutOrderDetailRepository Repository { get; }
        /// <summary>
        /// åˆ†é…åº“存处理货位数据
        /// </summary>
        (List<Dt_ProStockInfo>, List<Dt_ProOutOrderDetail>, List<Dt_OutProStockInfo>, List<Dt_LocationInfo>) AssignProStockOut(int warehouseId,Dt_ProOutOrder proOutOrder);
        /// <summary>
        /// å‡ºåº“任务数据处理
        /// </summary>
        WebResponseContent LockOutboundStockDataUpdate(List<Dt_ProStockInfo> proStockInfos, List<Dt_ProOutOrderDetail> proOutOrderDetails, List<Dt_OutProStockInfo> outProStockInfos, List<Dt_LocationInfo> locationInfos, LocationStatusEnum locationStatus = LocationStatusEnum.Lock, List<Dt_Task>? tasks = null);
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IStockRepository/IProStockInfoRepository.cs
@@ -10,5 +10,9 @@
{
    public interface IProStockInfoRepository : IRepository<Dt_ProStockInfo>
    {
        /// <summary>
        /// æŸ¥æ‰¾å¯ç”¨åº“å­˜
        /// </summary>
        List<Dt_ProStockInfo> GetProStocks(Dt_ProOutOrderDetail proOutOrderDetail,List<string> locationInfos);
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IStockService/IProStockInfoService.cs
@@ -12,5 +12,13 @@
    public interface IProStockInfoService : IService<Dt_ProStockInfo>
    {
        IProStockInfoRepository Repository { get; }
        /// <summary>
        /// æŸ¥æ‰¾å¯ç”¨åº“å­˜
        /// </summary>
        List<Dt_ProStockInfo> GetUseableStocks(int warehoseId, Dt_ProOutOrderDetail proOutOrderDetail);
        /// <summary>
        /// èŽ·å–å‡ºåº“åº“å­˜
        /// </summary>
        List<Dt_ProStockInfo> GetOutboundStocks(List<Dt_ProStockInfo> stockInfos, Dt_ProOutOrderDetail outOrderDetail, float needQuantity, out float residueQuantity);
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IStockService/IStockService.cs
@@ -15,5 +15,9 @@
        IStockInfoDetail_HtyService StockInfoDetail_HtyService { get; }
        IStockInfo_HtyService StockInfo_HtyService { get; }
        IProStockInfoService ProStockInfoService { get; }
        IProStockInfoDetailService ProStockInfoDetailService { get; }
        IProStockInfo_HtyService ProStockInfo_HtyService { get; }
        IProStockInfoDetail_HtyService ProStockInfoDetail_HtyService { get; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs
@@ -347,6 +347,12 @@
        WebResponseContent PPCutOutGenerateOutboundTasks(int orderDetailId, List<PPStockSelectViewDTO> stockSelectViews);
        WebResponseContent PPGeneratePKOutboundTask(int orderDetailId, List<PPStockSelectViewDTO> stockSelectViews);
        /// <summary>
        /// ç”Ÿæˆæˆå“å‡ºåº“任务
        /// </summary>
        /// <param name="ProOutNo">出库订单号</param>
        /// <param name="StationCode">站台地址</param>
        /// <returns></returns>
        WebResponseContent OutProductTask(string ProOutNo, string StationCode);
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs
@@ -2,8 +2,10 @@
using HslCommunication.WebSocket;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json;
using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime;
using SqlSugar;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
@@ -41,6 +43,7 @@
using WIDESEA_ITaskInfoService;
using WIDESEA_Model.Models;
using WIDESEA_StockRepository;
using static Org.BouncyCastle.Pqc.Crypto.Utilities.PqcOtherInfoGenerator;
namespace WIDESEA_InboundService
{
@@ -556,7 +559,7 @@
                    }
                    else
                    {
                        FeedbackInboundOrder(inboundOrder);
                        FeedbackInboundOrder(inboundOrder.Id);
                    }
                }
                #endregion
@@ -1131,11 +1134,12 @@
        /// å…¥åº“完成上报ERP
        /// </summary>
        /// <returns></returns>
        public WebResponseContent FeedbackInboundOrder(Dt_InboundOrder inboundOrder)
        public WebResponseContent FeedbackInboundOrder(int inboundOrderId)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                Dt_InboundOrder inboundOrder = BaseDal.Db.Queryable<Dt_InboundOrder>().Where(x => x.Id == inboundOrderId).Includes(x => x.Details).First();
                if (inboundOrder.Details.Count == 0)
                {
                    return WebResponseContent.Instance.Error($"未找到入库单明细信息");
@@ -1232,11 +1236,11 @@
                        .Select(mg => new ReturnPickItem
                        {
                            Material = mg.Key,
                            Qty = mg.Sum(x => x.Qty),
                            Qty = mg.Sum(x => x.ReturnQty),
                            Dataitem = mg.Select(d => new ReturnDataItem
                            {
                                Lotno = d.BatchNo,
                                Qty = d.Qty,
                                Qty = d.ReturnQty,
                                Location = warehouse.WarehouseCode,
                                Msfpart = d.Code
                            }).ToList()
@@ -1263,6 +1267,61 @@
            }
            return content;
        }
        /// <summary>
        /// æˆå“å…¥åº“上传ERP
        /// </summary>
        public WebResponseContent FeedbackProIn(Dt_MesProInOrder mesProInOrder)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                List<ERPProItemsItem> proItemsItems = new List<ERPProItemsItem>();
                foreach (var item in mesProInOrder.Details)
                {
                    ERPProItemsItem proItemsItem = new ERPProItemsItem()
                    {
                        PartNum = item.ProductCode,
                        Rev=item.ProductVersion,
                        DateCode=item.DateCode,
                        BatchNumber= item.BagNo,
                        XLocation=item.XSite,
                        Xqty=item.XQty,
                        QtySet=item.SETQty,
                        QtyPcs=item.OKPCSQTY,
                        WoList=new List<ERPProListItem>()
                        {
                            new ERPProListItem()
                            {
                                moNumber=item.MoNumber,
                                WoNumber=item.ERPOrder,
                                QtyPcs=item.OKPCSQTY,
                                QtySet=item.SETQty
                            }
                        }
                    };
                    proItemsItems.Add(proItemsItem);
                }
                ERPProInboundModel proInboundModel = new ERPProInboundModel()
                {
                    Way = 1,
                    Code = mesProInOrder.ProInOrderNo,
                    CreatorCode = "GSWMS",
                    CompanyCode = "HATC",
                    FactoryCode = "HA02",
                    WarehouseCode = "HA71",
                    LocationCode = "HA71",
                    StockDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                    StockFormType= "Production",
                    StockFormItems= proItemsItems
                };
                _invokeERPService.InvokeProInApi(proInboundModel);
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
        static object lock_code = new object();
        public string CreateCodeByRule(string ruleCode)
        {
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/PurchaseOrderService.cs
@@ -258,12 +258,15 @@
                {
                    return WebResponseContent.Instance.Error($"未找到采购单明细信息");
                }
                purchaseOrder.PurchaseOrderStatus = PurchaseOrderStatusEnum.Closed.ObjToInt();
                _unitOfWorkManage.BeginTran();
                BaseDal.DeleteAndMoveIntoHty(purchaseOrder, OperateTypeEnum.关闭);
                BaseDal.UpdateData(purchaseOrder);
                //BaseDal.DeleteAndMoveIntoHty(purchaseOrder, OperateTypeEnum.关闭);
                foreach (var item in purchaseOrder.Details)
                {
                    _purchaseOrderDetailRepository.DeleteAndMoveIntoHty(item, OperateTypeEnum.关闭);
                    item.PurchaseDetailStatus = PurchaseOrderDetailStatusEnum.Closed.ObjToInt();
                    //_purchaseOrderDetailRepository.DeleteAndMoveIntoHty(item, OperateTypeEnum.关闭);
                    _purchaseOrderDetailRepository.UpdateData(item);
                }
                _unitOfWorkManage.CommitTran();
                return WebResponseContent.Instance.OK();
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderDetailService.cs
@@ -72,6 +72,70 @@
                {
                    return WebResponseContent.Instance.Error($"该物料不属于该仓库");
                }
                //无采购单进行收货
                if (receiveOrder.ReceiveOrderType != ReceiveOrderTypeEnum.PO.ObjToInt())
                {
                    //获取具体批次及物料
                    Dt_ReceiveOrderDetail? detailNoPo = receiveOrder.Details.FirstOrDefault(x => x.LotNo == model.LotNo && x.MaterielCode == model.MaterielCode);
                    lock (_rowNoLocker)
                    {
                        if (detailNoPo != null)
                        {
                            //原有收货明细增加收货数量
                            detailNoPo.ReceivedQuantity += model.Quantity;
                            _unitOfWorkManage.BeginTran();
                            BaseDal.UpdateData(detailNoPo);
                            _unitOfWorkManage.CommitTran();
                        }
                        else
                        {
                            int rowNo = 0;
                            if (receiveOrder.Details.Count > 0)
                            {
                                rowNo = receiveOrder.Details.Max(x => x.RowNo);
                            }
                            Dt_ReceiveOrderDetail receiveOrderDetail = new Dt_ReceiveOrderDetail()
                            {
                                PurchaseOrderNo = model.PurchaseOrderNo,
                                ReceivedQuantity = model.Quantity,
                                MaterielCode = model.MaterielCode,
                                LotNo = model.LotNo,
                                MaterielName = materielInfo.MaterielName,
                                MaterielSpec = materielInfo.MaterielSpec,
                                ReceiveOrderId = receiveOrder.ReceiveOrderId,
                                PurchaseOrderDetailRowNo = rowNo + 1,
                                IfInspection = materielInfo.IsCheck.ObjToInt(),
                                CurrCode = "",
                                PriceInTax = 0,
                                TaxRate = "",
                                RowNo = rowNo + 1,
                                Unit = materielInfo.MaterielUnit
                            };
                            if (receiveOrder.ReceiveOrderStatus == ReceiveOrderStatusEnum.NotStarted.ObjToInt())
                            {
                                receiveOrder.ReceiveOrderStatus = ReceiveOrderStatusEnum.Receiving.ObjToInt();
                            }
                            _unitOfWorkManage.BeginTran();
                            _inboundRepository.ReceiveOrderDetailRepository.AddData(receiveOrderDetail);
                            _inboundRepository.ReceiveOrderRepository.UpdateData(receiveOrder);
                            #region æ³¨é‡Š
                            if (materielInfo.IsCheck == WhetherEnum.True)
                            {
                                Dt_CheckOrder checkOrder = _mapper.Map<Dt_CheckOrder>(receiveOrderDetail);
                                checkOrder.ReceiveOrderNo = receiveOrder.ReceiveOrderNo;
                                checkOrder.QualifiedQuantity = receiveOrderDetail.ReceivedQuantity;
                                checkOrder.ReceiveDetailRowNo = receiveOrderDetail.RowNo;
                                checkOrder.ScrappedQuantity = 0;
                                checkOrder.ReturnQuantity = 0;
                                checkOrder.DefectedQuantity = 0;
                                _checkOrderRepository.AddData(checkOrder);
                            }
                            #endregion
                            _unitOfWorkManage.CommitTran();
                        }
                        return WebResponseContent.Instance.OK();
                    }
                }
                Dt_PurchaseOrder purchaseOrder = _inboundRepository.PurchaseOrderRepository.Db.Queryable<Dt_PurchaseOrder>().Where(x => x.PurchaseOrderNo == model.PurchaseOrderNo).Includes(x => x.Details).First();
                if (purchaseOrder == null)
                {
@@ -200,16 +264,17 @@
                        _inboundRepository.ReceiveOrderRepository.UpdateData(receiveOrder);
                        _inboundRepository.PurchaseOrderDetailRepository.UpdateData(purchaseOrderDetail);
                        #region æ³¨é‡Š
                        //if (materielInfo.IsCheck == WhetherEnum.True)
                        //{
                        //    Dt_CheckOrder checkOrder = _mapper.Map<Dt_CheckOrder>(receiveOrderDetail);
                        //    checkOrder.ReceiveOrderNo = receiveOrder.ReceiveOrderNo;
                        //    checkOrder.QualifiedQuantity = receiveOrderDetail.ReceivedQuantity;
                        //    checkOrder.ScrappedQuantity = 0;
                        //    checkOrder.ReturnQuantity = 0;
                        //    checkOrder.DefectedQuantity = 0;
                        //    _checkOrderRepository.AddData(checkOrder);
                        //}
                        ////if (materielInfo.IsCheck == WhetherEnum.True)
                        ////{
                        ////    Dt_CheckOrder checkOrder = _mapper.Map<Dt_CheckOrder>(receiveOrderDetail);
                        ////    checkOrder.ReceiveOrderNo = receiveOrder.ReceiveOrderNo;
                        ////    checkOrder.QualifiedQuantity = receiveOrderDetail.ReceivedQuantity;
                        ////    checkOrder.ReceiveDetailRowNo = receiveOrderDetail.RowNo;
                        ////    checkOrder.ScrappedQuantity = 0;
                        ////    checkOrder.ReturnQuantity = 0;
                        ////    checkOrder.DefectedQuantity = 0;
                        ////    _checkOrderRepository.AddData(checkOrder);
                        ////}
                        #endregion
                        _unitOfWorkManage.CommitTran();
                    }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderService.cs
@@ -131,12 +131,17 @@
                        PriceInTax = 0,
                        PurchaseOrderCode = item.PurchaseOrderNo,
                        PurchaseOrderSerno = item.PurchaseOrderDetailRowNo,
                        QtyRecieved = item.ReceivedQuantity.ObjToInt(),
                        QtyRecieved = item.ReceivedQuantity,
                        Serno = item.RowNo,
                        Supplotno = "",
                        Supplotno = item.LotNo,
                        Taxrate = "",
                    };
                    if (receiveOrder.ReceiveOrderType!=ReceiveOrderTypeEnum.PO.ObjToInt())
                    {
                        recevieOrderDetail.Taxrate = "ZZ11";
                        recevieOrderDetail.Currcode = "RMB";
                    }
                    recevieOrderDetails.Add(recevieOrderDetail);
                }
@@ -158,12 +163,16 @@
                //更新收货单信息
                receiveOrder.ReceiveOrderStatus = ReceiveOrderStatusEnum.Completed.ObjToInt();
                receiveOrder.UploadStatus = WhetherEnum.True.ObjToInt();
                //收货推送至ER
                string response = _invokeERPService.InvokeMatReceiveApi(receiveModel);
                ErpRequestContent requestContent = response.DeserializeObject<ErpRequestContent>();
                if (requestContent.res == 1)
                {
                    receiveOrder.UploadStatus = WhetherEnum.True.ObjToInt();
                }
                BaseDal.UpdateData(receiveOrder);
                //创建入库单
                CreateInboundOrder(orderId);
                //收货推送至ERP æµ‹è¯•注释
                _invokeERPService.InvokeMatReceiveApi(receiveModel);
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
@@ -209,6 +218,10 @@
            try
            {
                Dt_ReceiveOrder receiveOrder = Db.Queryable<Dt_ReceiveOrder>().Where(x => x.ReceiveOrderId == receiveOrderId).Includes(x => x.Details).First();
                if (receiveOrder.UploadStatus!= WhetherEnum.True.ObjToInt())
                {
                    return WebResponseContent.Instance.Error($"该收货单来料上传ERP失败无法创建入库单据");
                }
                if (receiveOrder == null)
                {
                    return WebResponseContent.Instance.Error($"未找到该收货单信息");
@@ -221,17 +234,22 @@
                {
                    return WebResponseContent.Instance.Error($"该收货单未完成");
                }
                Dt_InboundOrder OldCreateOrder = _inboundRepository.InboundOrderRepository.QueryFirst(x => x.UpperOrderNo == receiveOrder.ReceiveOrderNo);
                if (receiveOrder.CreateInOrderStatus==WhetherEnum.True.ObjToInt() || OldCreateOrder!=null)
                {
                    return WebResponseContent.Instance.Error($"该收货单对应的入库单已存在");
                }
                #region æ³¨é‡Š
                //List<Dt_CheckOrder> checkOrders = _checkOrderRepository.QueryData(x => x.ReceiveOrderNo == receiveOrder.ReceiveOrderNo);
                //if (checkOrders.FirstOrDefault(x => x.CheckOrderStatus == CheckOrderStatusEnum.NotCheck.ObjToInt()) != null)
                //{
                //    return WebResponseContent.Instance.Error($"该收货单未质检完成");
                //}
                ////List<Dt_CheckOrder> checkOrders = _checkOrderRepository.QueryData(x => x.ReceiveOrderNo == receiveOrder.ReceiveOrderNo);
                ////if (checkOrders.FirstOrDefault(x => x.CheckOrderStatus == CheckOrderStatusEnum.NotCheck.ObjToInt()) != null)
                ////{
                ////    return WebResponseContent.Instance.Error($"该收货单未质检完成");
                ////}
                //if (checkOrders.FirstOrDefault(x => x.AuditStatus != AuditStatusEnum.Agree.ObjToInt()) != null)
                //{
                //    return WebResponseContent.Instance.Error($"该收货单质检结果审批未完成");
                //}
                ////if (checkOrders.FirstOrDefault(x => x.AuditStatus != AuditStatusEnum.Agree.ObjToInt()) != null)
                ////{
                ////    return WebResponseContent.Instance.Error($"该收货单质检结果审批未完成");
                ////}
                #endregion
                Dt_InboundOrder inboundOrder = new Dt_InboundOrder()
@@ -249,15 +267,15 @@
                {
                    float quantity = item.ReceivedQuantity;
                    #region æ³¨é‡Š
                    //if (item.IfInspection == WhetherEnum.True.ObjToInt())
                    //{
                    //    Dt_CheckOrder? checkOrder = checkOrders.FirstOrDefault(x => x.ReceiveOrderNo == receiveOrder.ReceiveOrderNo && x.ReceiveDetailRowNo == item.RowNo);
                    //    if (checkOrder == null)
                    //    {
                    //        return WebResponseContent.Instance.Error($"质检单数据错误");
                    //    }
                    //    quantity = checkOrder.QualifiedQuantity.GetValueOrDefault() + checkOrder.DefectedQuantity.GetValueOrDefault();
                    //}
                    ////if (item.IfInspection == WhetherEnum.True.ObjToInt())
                    ////{
                    ////    Dt_CheckOrder? checkOrder = checkOrders.FirstOrDefault(x => x.ReceiveOrderNo == receiveOrder.ReceiveOrderNo && x.ReceiveDetailRowNo == item.RowNo);
                    ////    if (checkOrder == null)
                    ////    {
                    ////        return WebResponseContent.Instance.Error($"质检单数据错误");
                    ////    }
                    ////    quantity = checkOrder.QualifiedQuantity.GetValueOrDefault() + checkOrder.DefectedQuantity.GetValueOrDefault();
                    ////}
                    #endregion
                    Dt_InboundOrderDetail detail = new Dt_InboundOrderDetail()
                    {
@@ -342,19 +360,19 @@
                        rowNo += 1;
                        receiveOrderDetails.Add(receiveOrderDetail);
                        #region æ³¨é‡Š
                        //if (materielInfo.IsCheck == WhetherEnum.True)
                        //{
                        //    Dt_CheckOrder checkOrder = _mapper.Map<Dt_CheckOrder>(receiveOrderDetail);
                        //    checkOrder.CheckOrderNo = "TestCheckNo21";//测试
                        //    checkOrder.ReceiveOrderNo = "";
                        //    checkOrder.QualifiedQuantity = receiveOrderDetail.ReceivedQuantity;
                        //    checkOrder.ScrappedQuantity = 0;
                        //    checkOrder.ReturnQuantity = 0;
                        //    checkOrder.DefectedQuantity = 0;
                        //    checkOrder.ReceiveDetailRowNo = rowNo;
                        //    checkOrder.UploadStatus = CheckUploadEnum.UploadNo.ObjToInt();
                        //    checkOrders.Add(checkOrder);
                        //}
                        if (materielInfo.IsCheck == WhetherEnum.True)
                        {
                            Dt_CheckOrder checkOrder = _mapper.Map<Dt_CheckOrder>(receiveOrderDetail);
                            checkOrder.CheckOrderNo = "TestCheckNo21";//测试
                            checkOrder.ReceiveOrderNo = "";
                            checkOrder.QualifiedQuantity = receiveOrderDetail.ReceivedQuantity;
                            checkOrder.ScrappedQuantity = 0;
                            checkOrder.ReturnQuantity = 0;
                            checkOrder.DefectedQuantity = 0;
                            checkOrder.ReceiveDetailRowNo = rowNo;
                            checkOrder.UploadStatus = CheckUploadEnum.UploadNo.ObjToInt();
                            checkOrders.Add(checkOrder);
                        }
                        #endregion
                    }
                    receiveOrder = new Dt_ReceiveOrder()
@@ -405,19 +423,19 @@
                        rowNo += 1;
                        receiveOrderDetails.Add(receiveOrderDetail);
                        //if (materielInfo.IsCheck == WhetherEnum.True)
                        //{
                        //    Dt_CheckOrder checkOrder = _mapper.Map<Dt_CheckOrder>(receiveOrderDetail);
                        //    checkOrder.CheckOrderNo = "Test-CheckNo1";//测试
                        //    checkOrder.QualifiedQuantity = receiveOrderDetail.ReceivedQuantity;
                        //    checkOrder.ScrappedQuantity = 0;
                        //    checkOrder.ReceiveOrderNo = receiveOrder.ReceiveOrderNo;
                        //    checkOrder.ReturnQuantity = 0;
                        //    checkOrder.DefectedQuantity = 0;
                        //    checkOrder.ReceiveDetailRowNo = rowNo;
                        //    checkOrder.UploadStatus = CheckUploadEnum.UploadNo.ObjToInt();
                        //    checkOrders.Add(checkOrder);
                        //}
                        if (materielInfo.IsCheck == WhetherEnum.True)
                        {
                            Dt_CheckOrder checkOrder = _mapper.Map<Dt_CheckOrder>(receiveOrderDetail);
                            checkOrder.CheckOrderNo = "Test-CheckNo1";//测试
                            checkOrder.QualifiedQuantity = receiveOrderDetail.ReceivedQuantity;
                            checkOrder.ScrappedQuantity = 0;
                            checkOrder.ReceiveOrderNo = receiveOrder.ReceiveOrderNo;
                            checkOrder.ReturnQuantity = 0;
                            checkOrder.DefectedQuantity = 0;
                            checkOrder.ReceiveDetailRowNo = rowNo;
                            checkOrder.UploadStatus = CheckUploadEnum.UploadNo.ObjToInt();
                            checkOrders.Add(checkOrder);
                        }
                    }
                }
@@ -434,10 +452,10 @@
                    Db.InsertNav(receiveOrder).Include(x => x.Details).ExecuteCommand();
                    checkOrders.ForEach(x => x.ReceiveOrderNo = receiveOrder.ReceiveOrderNo);
                }
                //if (checkOrders.Count > 0)
                //{
                //    _checkOrderRepository.AddData(checkOrders);
                //}
                if (checkOrders.Count > 0)
                {
                    _checkOrderRepository.AddData(checkOrders);
                }
                _inboundRepository.PurchaseOrderRepository.UpdateData(purchaseOrder);
                _inboundRepository.PurchaseOrderDetailRepository.UpdateData(purchaseOrder.Details);
                _unitOfWorkManage.CommitTran();
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReturnOrderService.cs
@@ -24,12 +24,14 @@
        private readonly IUnitOfWorkManage _unitOfWorkManage;
        private readonly IBasicRepository _basicRepository;
        private readonly IOutboundService _outboundService;
        private readonly IInboundRepository _inboundRepository;
        public ReturnOrderService(IReturnOrderRepository BaseDal,IUnitOfWorkManage unitOfWorkManage,IBasicRepository basicRepository,
        IOutboundService outboundService) : base(BaseDal)
        IOutboundService outboundService,IInboundRepository inboundRepository) : base(BaseDal)
        {
            _unitOfWorkManage = unitOfWorkManage;
            _basicRepository = basicRepository;
            _outboundService = outboundService;
            _inboundRepository = inboundRepository;
        }
        /// <summary>
        /// èŽ·å–é€€æ–™å•
@@ -189,6 +191,12 @@
                {
                    return content.Error("该退料单已完成或退料中");
                }
                //判断是否创建入库单
                Dt_InboundOrder InboundOld = _inboundRepository.InboundOrderRepository.QueryFirst(x=>x.UpperOrderNo== returnOrder.OrderNo);
                if (InboundOld!=null)
                {
                    return content.Error($"该退料单{returnOrder.OrderNo}已生成入库单号{InboundOld.InboundOrderNo}");
                }
                List<Dt_InboundOrderDetail> inboundOrderDetails = new List<Dt_InboundOrderDetail>();
                foreach (var item in returnOrder.Details)
                {
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Config/Dt_CodeRuleConfig.cs
@@ -41,7 +41,7 @@
        /// <summary>
        /// å‰ç¼€å­—符串
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 2, ColumnDescription = "前缀字符串")]
        [SugarColumn(IsNullable = true, Length = 5, ColumnDescription = "前缀字符串")]
        public string StartStr { get; set; }
        /// <summary>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReceiveOrder.cs
@@ -48,6 +48,12 @@
        public int UploadStatus { get; set; }
        /// <summary>
        /// æ˜¯å¦åˆ›å»ºå…¥åº“单
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "是否创建入库单")]
        public int CreateInOrderStatus { get; set; }
        /// <summary>
        /// å®¢æˆ·ä»£å·
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "客户代号")]
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutProStockInfo.cs
@@ -64,6 +64,11 @@
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "产品版本")]
        public string PVer { get; set; }
        /// <summary>
        /// äº§å“æ‰¹æ¬¡
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "产品批次")]
        public string PLot { get; set; }
        /// <summary>
        /// äº§å“å‘¨æœŸ
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "产品周期")]
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_ProOutOrderDetail.cs
@@ -79,9 +79,9 @@
        public string DateCode { get; set; }
        /// <summary>
        /// åˆæ ¼PCS数
        /// å‡ºåº“合格PCS数
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "合格PCS数")]
        [SugarColumn(IsNullable = false, ColumnDescription = "出库合格PCS数")]
        public float QtyPcs { get; set; }
        /// <summary>
@@ -91,6 +91,12 @@
        public float OverQtyPcs { get; set; }
        /// <summary>
        /// é”å®šæ•°é‡
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "锁定数量")]
        public float LockQtyPcs { get; set; }
        /// <summary>
        /// X板数
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "X板数")]
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_ProStockInfoDetail.cs
@@ -56,10 +56,10 @@
        [SugarColumn(IsNullable = false, ColumnDescription = "包装SET数量")]
        public float SETQty { get; set; }
        /// <summary>
        /// åˆæ ¼PCS数
        /// åº“å­˜PCS数
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "合格PCS数")]
        public float OKPCSQTY { get; set; }
        public float StockPcsQty { get; set; }
        /// <summary>
        /// å‘¨æœŸ
        /// </summary>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundRepository/OutProStockInfoRepository.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 OutProStockInfoRepository : RepositoryBase<Dt_OutProStockInfo>, IOutProStockInfoRepository
    {
        public OutProStockInfoRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
        {
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutProStockInfoService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,53 @@
using SqlSugar.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.StockEnum;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
using WIDESEA_IOutboundRepository;
using WIDESEA_IOutboundService;
using WIDESEA_Model.Models;
namespace WIDESEA_OutboundService
{
    public partial class OutProStockInfoService : ServiceBase<Dt_OutProStockInfo, IOutProStockInfoRepository>, IOutProStockInfoService
    {
        private readonly IUnitOfWorkManage _unitOfWorkManage;
        public IOutProStockInfoRepository Repository => BaseDal;
        public OutProStockInfoService(IOutProStockInfoRepository BaseDal,IUnitOfWorkManage unitOfWorkManage) : base(BaseDal)
        {
            _unitOfWorkManage = unitOfWorkManage;
        }
        public Dt_OutProStockInfo GetOutStockLockInfo(Dt_ProOutOrder proOutOrder, Dt_ProOutOrderDetail proOutOrderDetail, Dt_ProStockInfo proStockInfo, float assignQty, int? taskNum = null)
        {
            Dt_OutProStockInfo outProStockInfo = new Dt_OutProStockInfo()
            {
                OrderNo = proOutOrder.ProOutOrderNo,
                OrderDetailId = proOutOrderDetail.Id,
                OrderType = proOutOrder.ProOrderType,
                BatchNo = proOutOrderDetail.PLot,
                SaleOrder = proOutOrderDetail.SaleOrder,
                Customer = proOutOrderDetail.Customer,
                PCode = proOutOrderDetail.PCode,
                PVer = proOutOrderDetail.PVer,
                PLot = proOutOrderDetail.PLot,
                DateCode = proOutOrderDetail.DateCode,
                StockId = proStockInfo.Id,
                OrderQuantity = proOutOrderDetail.QtyPcs,
                OriginalQuantity = proStockInfo.proStockInfoDetails.Sum(x => x.StockPcsQty),
                AssignQuantity = assignQty,
                LocationCode = proStockInfo.LocationCode,
                PalletCode = proStockInfo.PalletCode,
                Unit = proOutOrderDetail.Unit,
                TaskNum = taskNum,
                Status = taskNum == null ? OutLockStockStatusEnum.已分配.ObjToInt() : OutLockStockStatusEnum.出库中.ObjToInt()
            };
            return outProStockInfo;
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs
@@ -188,6 +188,10 @@
        {
            return BaseDal.QueryData(x => x.OrderDetailId == orderDetailId && outStockStatus == null ? true : x.Status == outStockStatus.ObjToInt());
        }
        public List<Dt_OutStockLockInfo> GetByMesOrderDetail(string taskNo)
        {
            return BaseDal.QueryData(x => x.OrderNo == taskNo);
        }
        public List<Dt_OutStockLockInfo> GetStockOutboundOrder(SaveModel saveModel)
        {
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs
@@ -235,7 +235,7 @@
                    ERPPickItemModel pickItemModel = new ERPPickItemModel()
                    {
                        Lotno = item.BatchNo,
                        Qty = item.AssignQuantity.ObjToInt().ToString(),
                        Qty = item.AssignQuantity.ToString(),
                        Location = WarehouseCode
                    };
                    //获取出库单明细
@@ -474,7 +474,7 @@
                    issueModel = new ERPIssueModel()
                    {
                        UniqueTag = id.ToString(),
                        Code = CreateCodeByRule(nameof(RuleCodeEnum.FLCodeRule)),//测试
                        Code = CreateCodeByRule(nameof(RuleCodeEnum.FLCodeRule)),
                        WarehouseCode = warehouse.WarehouseCode,
                        Docremark = "",
                        Deptno = outboundOrder.DepartmentCode,
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/ProOutOrderDetailService.cs
@@ -3,10 +3,16 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.LocationEnum;
using WIDESEA_Core;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
using WIDESEA_Core.Helper;
using WIDESEA_IBasicService;
using WIDESEA_IOutboundRepository;
using WIDESEA_IOutboundService;
using WIDESEA_IRecordService;
using WIDESEA_IStockService;
using WIDESEA_Model.Models;
namespace WIDESEA_OutboundService
@@ -16,10 +22,151 @@
        private readonly IUnitOfWorkManage _unitOfWorkManage;
        public IProOutOrderDetailRepository Repository => BaseDal;
        public ProOutOrderDetailService(IProOutOrderDetailRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal)
        private readonly IStockService _stockInfoService;
        private readonly IBasicService _basicService;
        private readonly IOutProStockInfoService _outProStockInfoService;
        private readonly IRecordService _recordService;
        public ProOutOrderDetailService(IProOutOrderDetailRepository BaseDal, IUnitOfWorkManage unitOfWorkManage, IStockService stockInfoService, IBasicService basicService,IOutProStockInfoService outProStockInfoService, IRecordService recordService) : base(BaseDal)
        {
            _unitOfWorkManage = unitOfWorkManage;
            _stockInfoService = stockInfoService;
            _basicService = basicService;
            _outProStockInfoService = outProStockInfoService;
            _recordService = recordService;
        }
        /// <summary>
        /// å‡ºåº“库存分配后,更新数据库数据
        /// </summary>
        public WebResponseContent LockOutboundStockDataUpdate(List<Dt_ProStockInfo> proStockInfos, List<Dt_ProOutOrderDetail> proOutOrderDetails, List<Dt_OutProStockInfo> outProStockInfos, List<Dt_LocationInfo> locationInfos, LocationStatusEnum locationStatus = LocationStatusEnum.Lock, List<Dt_Task>? tasks = null)
        {
            try
            {
                _stockInfoService.ProStockInfoService.Repository.UpdateData(proStockInfos);
                List<Dt_ProStockInfoDetail> proStockInfoDetails = new List<Dt_ProStockInfoDetail>();
                foreach (var item in proStockInfos)
                {
                    proStockInfoDetails.AddRange(item.proStockInfoDetails);
                }
                _stockInfoService.ProStockInfoDetailService.Repository.UpdateData(proStockInfoDetails);
                BaseDal.UpdateData(proOutOrderDetails);
                List<Dt_OutProStockInfo> addOutStockLockInfos = outProStockInfos.Where(x => x.Id == 0).ToList();
                if (addOutStockLockInfos != null && addOutStockLockInfos.Any())
                {
                    if (tasks != null)
                    {
                        addOutStockLockInfos.ForEach(x =>
                        {
                            x.TaskNum = tasks.FirstOrDefault(v => v.PalletCode == x.PalletCode)?.TaskNum;
                        });
                    }
                    _outProStockInfoService.Repository.AddData(addOutStockLockInfos);
                }
                List<Dt_OutProStockInfo> updateOutStockLockInfos = outProStockInfos.Where(x => x.Id > 0).ToList();
                if (updateOutStockLockInfos != null && updateOutStockLockInfos.Any())
                {
                    _outProStockInfoService.Repository.UpdateData(updateOutStockLockInfos);
                }
                _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfos, locationStatus, LocationChangeType.OutboundAssignLocation, "", tasks?.Select(x => x.TaskNum).ToList());
                _basicService.LocationInfoService.Repository.UpdateLocationStatus(locationInfos, locationStatus);
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        /// <summary>
        /// åˆ†é…åº“存处理货位数据
        /// </summary>
        public (List<Dt_ProStockInfo>, List<Dt_ProOutOrderDetail>, List<Dt_OutProStockInfo>, List<Dt_LocationInfo>) AssignProStockOut(int warehouseId, Dt_ProOutOrder proOutOrder)
        {
            List<Dt_ProOutOrderDetail> OutOrderDetails = proOutOrder.Details;
            if (!OutOrderDetails.Any())
            {
                throw new Exception($"未找到出库单明细信息");
            }
            List<Dt_ProStockInfo> outStocks = new List<Dt_ProStockInfo>();
            List<Dt_OutProStockInfo> outProStockInfos = new List<Dt_OutProStockInfo>();
            List<Dt_LocationInfo> locationInfos = new List<Dt_LocationInfo>();
            List<Dt_ProOutOrderDetail> groupDetails = OutOrderDetails.GroupBy(x => new { x.SaleOrder, x.PCode, x.PVer, x.PLot, x.DateCode }).Select(x => new Dt_ProOutOrderDetail()
            {
                QtyPcs = x.Sum(x => x.QtyPcs) - x.Sum(x => x.OverQtyPcs),
                SaleOrder = x.Key.SaleOrder,
                PCode = x.Key.PCode,
                PVer = x.Key.PVer,
                PLot = x.Key.PLot,
                DateCode = x.Key.DateCode,
            }).ToList();
            foreach (var item in groupDetails)
            {
                float needQty = item.QtyPcs;
                //查找可用库存
                List<Dt_ProStockInfo> stockInfoss = _stockInfoService.ProStockInfoService.GetUseableStocks(warehouseId, item);
                if (!stockInfoss.Any())
                {
                    throw new Exception("未找到可分配库存");
                }
                //获取出库库存
                List<Dt_ProStockInfo> assignOutStocks = _stockInfoService.ProStockInfoService.GetOutboundStocks(stockInfoss, item, needQty, out float residueQuantity);
                item.LockQtyPcs += needQty - residueQuantity;
                outStocks.AddRange(assignOutStocks);
                float assignQuantity = needQty - residueQuantity;
                bool isCanLot = !string.IsNullOrEmpty(item.PLot);
                bool isCanDate = !string.IsNullOrEmpty(item.DateCode);
                List<Dt_ProOutOrderDetail> details = OutOrderDetails
                    .Where(x => x.SaleOrder == item.SaleOrder && x.PCode == item.PCode && x.PVer == item.PVer
                    && (isCanLot ? x.PLot == item.PLot : true)
                    && (isCanDate ? x.DateCode == item.DateCode : true))
                    .ToList();
                for (int i = 0; i < details.Count; i++)
                {
                    float orderQuantity = details[i].QtyPcs;
                    for (int j = 0; j < assignOutStocks.Count; j++)
                    {
                        float detailAssignQuantity = outProStockInfos.Where(x => x.SaleOrder == item.SaleOrder && x.PCode == item.PCode && x.PVer == item.PVer
                            && (item.PLot.IsNotEmptyOrNull() ? x.PLot == item.PLot : false)
                            && (item.DateCode.IsNotEmptyOrNull() ? x.DateCode == item.PLot : false)
                            && x.OrderDetailId == details[i].Id).Sum(x => x.AssignQuantity);//出库订单明细已分配数量
                        float palletAssignQuantity = outProStockInfos.Where(x => x.SaleOrder == item.SaleOrder && x.PCode == item.PCode && x.PVer == item.PVer
                            && (item.PLot.IsNotEmptyOrNull() ? x.PLot == item.PLot : false)
                            && (item.DateCode.IsNotEmptyOrNull() ? x.DateCode == item.PLot : false
                            && x.PalletCode == assignOutStocks[j].PalletCode)).Sum(x => x.AssignQuantity);
                        //出库详情已分配数量
                        palletAssignQuantity = outProStockInfos.Where(x => x.SaleOrder == item.SaleOrder && x.PCode == item.PCode && x.PVer == item.PVer
                            && (item.PLot.IsNotEmptyOrNull() ? x.PLot == item.PLot : false)
                            && (item.DateCode.IsNotEmptyOrNull() ? x.DateCode == item.PLot : false && x.PalletCode == assignOutStocks[j].PalletCode)).Sum(x => x.AssignQuantity);//出库详情已分配数量
                        float palletOutboundQuantity = assignOutStocks[j].proStockInfoDetails.Sum(x => x.OutboundQuantity);
                        if (palletAssignQuantity < palletOutboundQuantity)//如果出库详情已分配数量小于托盘已分配数量,则可以继续添加该托盘出库信息
                        {
                            float orderDetailNeedQuantity = details[i].QtyPcs - detailAssignQuantity;
                            if (orderDetailNeedQuantity > assignOutStocks[j].proStockInfoDetails.Sum(x => x.OutboundQuantity) - palletAssignQuantity)
                            {
                                details[i].LockQtyPcs += assignOutStocks[j].proStockInfoDetails.Sum(x => x.OutboundQuantity) - palletAssignQuantity;
                                Dt_OutProStockInfo outStockLockInfo = _outProStockInfoService.GetOutStockLockInfo(proOutOrder, details[i], assignOutStocks[j], assignOutStocks[j].proStockInfoDetails.Sum(x => x.OutboundQuantity) - palletAssignQuantity);
                                outProStockInfos.Add(outStockLockInfo);
                            }
                            else
                            {
                                Dt_OutProStockInfo outStockLockInfo = _outProStockInfoService.GetOutStockLockInfo(proOutOrder, details[i], assignOutStocks[j], details[i].QtyPcs - details[i].LockQtyPcs);
                                outProStockInfos.Add(outStockLockInfo);
                                details[i].LockQtyPcs = details[i].QtyPcs;
                                break;
                            }
                        }
                    }
                }
                List<string> locationArr = outStocks.Select(x => x.LocationCode).ToList();
                locationInfos.AddRange(_basicService.LocationInfoService.Repository.GetLocationInfos(locationArr));
            }
            return (outStocks, OutOrderDetails, outProStockInfos, locationInfos);
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/ProStockInfoRepository.cs
@@ -1,9 +1,11 @@
using System;
using Microsoft.IdentityModel.Tokens;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.Helper;
using WIDESEA_IStockRepository;
using WIDESEA_Model.Models;
@@ -14,5 +16,24 @@
        public ProStockInfoRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
        {
        }
        //根据明细数据查找可用库存库存
        public List<Dt_ProStockInfo> GetProStocks(Dt_ProOutOrderDetail proOutOrderDetail,List<string> locationInfos)
        {
            List<Dt_ProStockInfo>? proStockInfos = null;
            bool isCanLot= !string.IsNullOrEmpty(proOutOrderDetail.PLot);
            bool isCanDate = !string.IsNullOrEmpty(proOutOrderDetail.DateCode);
            proStockInfos = Db.Queryable<Dt_ProStockInfo>().Where(x => locationInfos.Contains(x.LocationCode))
                .Includes(x => x.proStockInfoDetails)
                .Where(x => x.proStockInfoDetails
                .Any(x => x.SaleOrder == proOutOrderDetail.SaleOrder
                && x.ProductCode == proOutOrderDetail.PCode
                && x.ProductVersion == proOutOrderDetail.PVer
                && (isCanLot ? x.LotNumber == proOutOrderDetail.PLot : true)
                && (isCanDate ? x.DateCode == proOutOrderDetail.DateCode : true)
                ))
            .ToList();
            proStockInfos = proStockInfos.OrderBy(x => x.proStockInfoDetails.FirstOrDefault().DateCode).ToList();
            return proStockInfos;
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_StockService/ProStockInfoService.cs
@@ -5,6 +5,7 @@
using System.Threading.Tasks;
using WIDESEA_Core;
using WIDESEA_Core.BaseServices;
using WIDESEA_IBasicRepository;
using WIDESEA_IStockRepository;
using WIDESEA_IStockService;
using WIDESEA_Model.Models;
@@ -14,11 +15,16 @@
    public partial class ProStockInfoService : ServiceBase<Dt_ProStockInfo, IProStockInfoRepository>, IProStockInfoService
    {
        public IProStockInfoRepository Repository => BaseDal;
        public IStockRepository _stockRepository;
        public ProStockInfoService(IProStockInfoRepository BaseDal,IStockRepository stockRepository) : base(BaseDal)
        private readonly IStockRepository _stockRepository;
        private readonly IBasicRepository _basicRepository;
        public ProStockInfoService(IProStockInfoRepository BaseDal,IStockRepository stockRepository, IBasicRepository basicRepository) : base(BaseDal)
        {
            _stockRepository = stockRepository;
            _basicRepository = basicRepository;
        }
        /// <summary>
        /// æ ¹æ®å¤–包信息解绑内包信息
        /// </summary>
        public WebResponseContent UnBindStock(List<Dt_ProStockInfoDetail> proStockInfoDetails)
        {
            WebResponseContent content = new WebResponseContent();
@@ -37,5 +43,94 @@
            }
            return content;
        }
        //查找可用库存
        public List<Dt_ProStockInfo> GetUseableStocks(int warehoseId,Dt_ProOutOrderDetail proOutOrderDetail)
        {
            List<string> locationCodes = _basicRepository.LocationInfoRepository.GetCanOutLocationCodes(warehoseId);
            return BaseDal.GetProStocks(proOutOrderDetail,locationCodes);
        }
        /// <summary>
        /// èŽ·å–å‡ºåº“åº“å­˜
        /// </summary>
        public List<Dt_ProStockInfo> GetOutboundStocks(List<Dt_ProStockInfo> stockInfos, Dt_ProOutOrderDetail outOrderDetail, float needQuantity, out float residueQuantity)
        {
            List<Dt_ProStockInfo> assignOutStocks =new List<Dt_ProStockInfo>();
            float stockTotalQuantity = stockInfos.Select(x => x.proStockInfoDetails.Sum(v => v.StockPcsQty - v.OutboundQuantity)).Sum(x => x);
            //stockInfos = stockInfos.OrderBy(x => x.Id).ToList();
            if (stockTotalQuantity >= needQuantity)//库存够
            {
                int index = 0;
                while (needQuantity > 0)
                {
                    Dt_ProStockInfo stockInfo = stockInfos[index];
                    float useableStockQuantity = stockInfo.proStockInfoDetails
                        .Where(x => x.SaleOrder == outOrderDetail.SaleOrder && x.ProductCode==outOrderDetail.PCode && x.ProductVersion==outOrderDetail.PVer)
                        .Sum(x => x.StockPcsQty - x.OutboundQuantity);
                    if (useableStockQuantity < needQuantity)
                    {
                        stockInfo.proStockInfoDetails.ForEach(x => x.OutboundQuantity = x.StockPcsQty);
                        needQuantity -= useableStockQuantity;
                    }
                    else
                    {
                        stockInfo.proStockInfoDetails.ForEach(x =>
                        {
                            if ((x.StockPcsQty > x.OutboundQuantity) && x.SaleOrder == outOrderDetail.SaleOrder && x.ProductCode == outOrderDetail.PCode && x.ProductVersion == outOrderDetail.PVer)
                            {
                                if (x.StockPcsQty - x.OutboundQuantity >= needQuantity)
                                {
                                    x.OutboundQuantity += needQuantity;
                                    needQuantity = 0;
                                }
                                else
                                {
                                    needQuantity -= (x.StockPcsQty - x.OutboundQuantity);
                                    x.OutboundQuantity = x.StockPcsQty;
                                }
                            }
                        });
                    }
                    assignOutStocks.Add(stockInfo);
                    index++;
                }
            }
            else
            {
                for (int i = 0; i < stockInfos.Count; i++)
                {
                    Dt_ProStockInfo stockInfo = stockInfos[i];
                    float useableStockQuantity = stockInfo.proStockInfoDetails
                        .Where(x => x.SaleOrder == outOrderDetail.SaleOrder && x.ProductCode == outOrderDetail.PCode && x.ProductVersion == outOrderDetail.PVer)
                        .Sum(x => x.StockPcsQty - x.OutboundQuantity);
                    if (useableStockQuantity < needQuantity)
                    {
                        stockInfo.proStockInfoDetails.ForEach(x => x.OutboundQuantity = x.StockPcsQty);
                        needQuantity -= useableStockQuantity;
                    }
                    else
                    {
                        stockInfo.proStockInfoDetails.ForEach(x =>
                        {
                            if (x.StockPcsQty > x.OutboundQuantity && x.SaleOrder == outOrderDetail.SaleOrder && x.ProductCode == outOrderDetail.PCode && x.ProductVersion == outOrderDetail.PVer)
                            {
                                if (x.StockPcsQty - x.OutboundQuantity >= needQuantity)
                                {
                                    x.OutboundQuantity += needQuantity;
                                    needQuantity = 0;
                                }
                                else
                                {
                                    needQuantity -= (x.StockPcsQty - x.OutboundQuantity);
                                    x.OutboundQuantity = x.StockPcsQty;
                                }
                            }
                        });
                    }
                    assignOutStocks.Add(stockInfo);
                }
            }
            residueQuantity = needQuantity;
            return assignOutStocks;
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockSerivce.cs
@@ -15,13 +15,21 @@
        public IStockInfoDetail_HtyService StockInfoDetail_HtyService { get; }
        public IStockInfo_HtyService StockInfo_HtyService { get; }
        public IProStockInfoService ProStockInfoService { get; }
        public IProStockInfoDetailService ProStockInfoDetailService { get; }
        public IProStockInfo_HtyService ProStockInfo_HtyService { get; }
        public IProStockInfoDetail_HtyService ProStockInfoDetail_HtyService { get; }
        public StockSerivce(IStockInfoDetailService stockInfoDetailService, IStockInfoService stockInfoService, IStockInfoDetail_HtyService stockInfoDetail_HtyService, IStockInfo_HtyService stockInfo_HtyService)
        public StockSerivce(IStockInfoDetailService stockInfoDetailService, IStockInfoService stockInfoService, IStockInfoDetail_HtyService stockInfoDetail_HtyService, IStockInfo_HtyService stockInfo_HtyService, IProStockInfoService proStockInfoService,IProStockInfoDetailService proStockInfoDetailService,IProStockInfo_HtyService proStockInfo_HtyService,IProStockInfoDetail_HtyService proStockInfoDetail_HtyService)
        {
            StockInfoDetailService = stockInfoDetailService;
            StockInfoService = stockInfoService;
            StockInfoDetail_HtyService = stockInfoDetail_HtyService;
            StockInfo_HtyService = stockInfo_HtyService;
            ProStockInfoService= proStockInfoService;
            ProStockInfoDetailService= proStockInfoDetailService;
            ProStockInfo_HtyService = proStockInfo_HtyService;
            ProStockInfoDetail_HtyService = proStockInfoDetail_HtyService;
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs
@@ -442,6 +442,7 @@
                tasks.ForEach(x =>
                {
                    x.TargetAddress = model.Line;
                    x.OrderNo = mesOutboundOrder.TaskNo;
                });
                _unitOfWorkManage.BeginTran();
@@ -501,7 +502,7 @@
                    EffectiveDate = model.ExpirationDate,
                    MaterielCode = model.MaterialCode,
                    InboundOrderRowNo = stockInfoDetail_Hty?.InboundOrderRowNo ?? 0,
                    MaterielName = model.MaterialCode,
                    MaterielName = stockInfoDetail_Hty.MaterielName,
                    ProductionDate = model.ProductionDate,
                    OrderNo = stockInfoDetail_Hty?.OrderNo ?? "",
                    OutboundQuantity = 0,
@@ -1064,6 +1065,7 @@
            }
            return content;
        }
        //外包信息接收
        public MesResponseContent BoxStockin(MesBoxInfoModel boxInfoModel)
        {
            MesResponseContent content = new MesResponseContent();
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -226,7 +226,11 @@
                {
                    return WebResponseContent.Instance.Error($"未找到该任务信息");
                }
                Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == task.WarehouseId);
                if (warehouse.WarehouseCode==WarehouseEnum.HA71.ToString())
                {
                    return InProductCompleted(task);
                }
                Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == task.PalletCode && x.WarehouseId == task.WarehouseId).Includes(x => x.Details).First();
                if (stockInfo == null)
                {
@@ -266,10 +270,8 @@
                LocationStatusEnum lastStatus = (LocationStatusEnum)locationInfo.LocationStatus;
                locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
                Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == task.WarehouseId);
                stockInfo.LocationCode = locationInfo.LocationCode;
                #region ç©ºç®±å…¥åº“/拣选回库/生产退料
                if (task.TaskType == TaskTypeEnum.InEmpty.ObjToInt() || task.TaskType == TaskTypeEnum.InPick.ObjToInt() || (task.TaskType == TaskTypeEnum.ProductionReturn.ObjToInt() && warehouse.WarehouseCode == WarehouseEnum.HA64.ToString()))
                {
@@ -369,7 +371,7 @@
                _stockRepository.StockInfoDetailRepository.UpdateData(stockInfo.Details);
                _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, lastStatus, LocationStatusEnum.InStock, LocationChangeType.InboundCompleted);
                _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, stockInfo.Details.Sum(x => x.StockQuantity), stockInfo.Details.Sum(x => x.StockQuantity), StockChangeTypeEnum.Inbound, taskNum);
                if (inboundOrder != null)
                if (inboundOrder != null && inboundOrderDetail != null)
                {
                    _inboundRepository.InboundOrderRepository.UpdateData(inboundOrder);
                    _inboundRepository.InboundOrderDetailRepository.UpdateData(inboundOrderDetail);
@@ -389,7 +391,7 @@
                    }
                    else
                    {
                        _inboundOrderService.FeedbackInboundOrder(inboundOrder);
                        _inboundOrderService.FeedbackInboundOrder(inboundOrder.Id);
                    }
                }
                return WebResponseContent.Instance.OK();
@@ -400,7 +402,70 @@
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        /// <summary>
        /// æˆå“ä»“任务完成
        /// </summary>
        public WebResponseContent InProductCompleted(Dt_Task task)
        {
            WebResponseContent content=new WebResponseContent();
            try
            {
                //获取组盘信息
                Dt_ProStockInfo proStockInfo = _stockRepository.ProStockInfoRepository.Db.Queryable<Dt_ProStockInfo>().Where(x => x.PalletCode == task.PalletCode).Includes(x => x.proStockInfoDetails).First();
                if (proStockInfo == null)
                {
                    return content.Error($"未找到胶框为{task.PalletCode}组盘信息");
                }
                Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress);
                if (locationInfo == null)
                {
                    return WebResponseContent.Instance.Error($"未找到目标货位信息");
                }
                if (locationInfo.LocationStatus == LocationStatusEnum.InStock.ObjToInt())
                {
                    return WebResponseContent.Instance.Error($"货位状态不正确");
                }
                LocationStatusEnum lastStatus = (LocationStatusEnum)locationInfo.LocationStatus;
                locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
                proStockInfo.LocationCode = locationInfo.LocationCode;
                //获取MES入库单据
                Dt_MesProInOrder mesProInOrder = _inboundRepository.MesProInOrderRepository.Db.Queryable<Dt_MesProInOrder>().Where(x => x.BatchNo == task.PalletCode).Includes(x => x.Details).First();
                if (mesProInOrder == null || mesProInOrder.Details == null || mesProInOrder.Details.Count <= 0)
                {
                    return content.Error("未找到MES内包单据信息");
                }
                //进行单据处理
                mesProInOrder.MesProStatus = InOrderStatusEnum.入库完成.ObjToInt();
                mesProInOrder.Details.ForEach(x =>
                {
                    x.OverInQuantity = x.OKPCSQTY;
                });
                proStockInfo.StockStatus = StockStatusEmun.入库完成.ObjToInt();
                proStockInfo.proStockInfoDetails.ForEach(x =>
                {
                    x.ProOutDetailStatus = StockStatusEmun.入库完成.ObjToInt();
                });
                //更新入库状态
                task.TaskStatus = TaskStatusEnum.Finish.ObjToInt();
                _unitOfWorkManage.BeginTran();
                BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.人工完成 : OperateTypeEnum.自动完成);
                _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, proStockInfo.PalletType, LocationStatusEnum.InStock, proStockInfo.WarehouseId);
                _stockRepository.ProStockInfoRepository.UpdateData(proStockInfo);
                _stockRepository.ProStockInfoDetailRepository.UpdateData(proStockInfo.proStockInfoDetails);
                _inboundRepository.MesProInOrderRepository.UpdateData(mesProInOrder);
                _inboundRepository.MesProInOrderDetailRepository.UpdateData(mesProInOrder.Details);
                _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, lastStatus, LocationStatusEnum.InStock, LocationChangeType.InboundCompleted);
                _unitOfWorkManage.CommitTran();
                //上传ERP
                _inboundOrderService.FeedbackProIn(mesProInOrder);
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                content.Error(ex.Message);
            }
            return content.OK();
        }
        /// <summary>
        /// å‡ºåº“任务完成
        /// </summary>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs
@@ -94,6 +94,10 @@
                    {
                        string? orderNo = stockInfo.Details.FirstOrDefault()?.OrderNo ?? "";
                        inboundOrder =_inboundOrderService.Repository.QueryFirst(x => x.InboundOrderNo == orderNo && x.OrderStatus < InOrderStatusEnum.入库完成.ObjToInt());
                        if (inboundOrder!=null)
                        {
                            newTask.OrderNo = inboundOrder.InboundOrderNo;
                        }
                    }
                    
                    if (inboundOrder != null)
@@ -101,10 +105,12 @@
                        if (inboundOrder.OrderType == InOrderTypeEnum.Allocat.ObjToInt())
                        {
                            newTask.TaskType = TaskTypeEnum.InAllocate.ObjToInt();
                            newTask.OrderNo = inboundOrder.InboundOrderNo;
                        }
                        else if (inboundOrder.OrderType == InOrderTypeEnum.Return.ObjToInt())
                        {
                            newTask.TaskType = TaskTypeEnum.ProductionReturn.ObjToInt();
                            newTask.OrderNo = inboundOrder.InboundOrderNo;
                        }
                    }
                    if (stockInfo.StockStatus == StockStatusEmun.手动组盘暂存.ObjToInt())
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs
@@ -78,36 +78,184 @@
        /// <summary>
        /// ç”Ÿæˆæˆå“å‡ºåº“任务
        /// </summary>
        /// <param name="Id">出库订单ID</param>
        /// <param name="ProOutNo">出库订单号</param>
        /// <param name="StationCode">站台地址</param>
        /// <returns></returns>
        public WebResponseContent OutProductTask(int Id,string StationCode)
        public WebResponseContent OutProductTask(string ProOutNo, string StationCode)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                //获取成品出库订单
                Dt_ProOutOrder proOutOrder = _outboundService.ProOutOrderService.Repository.Db.Queryable<Dt_ProOutOrder>().Where(x => x.ProOutOrderNo == ProOutNo).Includes(x => x.Details).First();
                if (proOutOrder==null)
                {
                    return content.Error("出库订单不存在");
                }
                List<Dt_Task> tasks = new List<Dt_Task>();
                List<StockSelectViewDTO> stockSelectViews = new List<StockSelectViewDTO>();
                List<Dt_ProStockInfo> proStockInfos = new List<Dt_ProStockInfo>();
                List<Dt_ProOutOrderDetail> proOutOrderDetails = new List<Dt_ProOutOrderDetail>();
                List<Dt_OutProStockInfo> outProStockInfos = new List<Dt_OutProStockInfo>();
                List<Dt_LocationInfo> locationInfos = new List<Dt_LocationInfo>();
                (List<Dt_Task>, List<Dt_ProStockInfo>?, List<Dt_ProOutOrderDetail>?, List<Dt_OutProStockInfo>?, List<Dt_LocationInfo>?) result =
                OutProductTaskDataHandle(Id, StationCode);
                OutProductTaskDataHandle(proOutOrder);
                if (result.Item2 != null && result.Item2.Count > 0)
                {
                    proStockInfos.AddRange(result.Item2);
                }
                if (result.Item3 != null && result.Item3.Count > 0)
                {
                    proOutOrderDetails.AddRange(result.Item3);
                }
                if (result.Item4 != null && result.Item4.Count > 0)
                {
                    outProStockInfos.AddRange(result.Item4);
                }
                if (result.Item5 != null && result.Item5.Count > 0)
                {
                    locationInfos.AddRange(result.Item5);
                }
                if (result.Item1 != null && result.Item1.Count > 0)
                {
                    //更新出库目的位置
                    result.Item1.ForEach(x =>
                    {
                        x.TargetAddress = StationCode;
                    });
                    tasks.AddRange(result.Item1);
                }
                //处理出库数据
                content = GenerateOutboundTaskDataUpdate(tasks, proStockInfos, proOutOrderDetails, outProStockInfos, locationInfos);
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                content.Error(ex.Message);
            }
            return content;
        }
        public WebResponseContent GenerateOutboundTaskDataUpdate(List<Dt_Task> tasks, List<Dt_ProStockInfo>? proStockInfos = null, List<Dt_ProOutOrderDetail>? proOutOrderDetails = null, List<Dt_OutProStockInfo>? outProStockInfos = null, List<Dt_LocationInfo>? locationInfos = null)
        {
            try
            {
                _unitOfWorkManage.BeginTran();
                BaseDal.AddData(tasks);
                if (proStockInfos != null && proStockInfos.Count > 0 && proOutOrderDetails != null && proOutOrderDetails.Count > 0 && outProStockInfos != null && outProStockInfos.Count > 0 && locationInfos != null && locationInfos.Count > 0)
                {
                    proStockInfos.ForEach(x =>
                    {
                        x.StockStatus = StockStatusEmun.出库锁定.ObjToInt();
                    });
                    WebResponseContent content = _outboundService.ProOutOrderDetailService.LockOutboundStockDataUpdate(proStockInfos, proOutOrderDetails, outProStockInfos, locationInfos, tasks: tasks);
                    if (!content.Status)
                    {
                        _unitOfWorkManage.RollbackTran();
                        return content;
                    }
                }
                else if (proOutOrderDetails != null && proOutOrderDetails.Count > 0)
                {
                    proOutOrderDetails.ForEach(x =>
                    {
                        x.ProOrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt();
                    });
                    _outboundService.ProOutOrderDetailService.Repository.UpdateData(proOutOrderDetails);
                }
                _unitOfWorkManage.CommitTran();
                PushTasksToWCS(tasks);
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        /// <summary>
        /// å¤„理成品出库数据
        /// </summary>
        /// <returns></returns>
        public (List<Dt_Task>, List<Dt_ProStockInfo>?, List<Dt_ProOutOrderDetail>?, List<Dt_OutProStockInfo>?, List<Dt_LocationInfo>?) OutProductTaskDataHandle(int Id, string StationCode)
        public (List<Dt_Task>, List<Dt_ProStockInfo>?, List<Dt_ProOutOrderDetail>?, List<Dt_OutProStockInfo>?, List<Dt_LocationInfo>?) OutProductTaskDataHandle(Dt_ProOutOrder proOutOrder)
        {
            List<Dt_Task> tasks = new List<Dt_Task>();
            List<Dt_ProStockInfo> proStockInfos = new List<Dt_ProStockInfo>();
            List<Dt_ProOutOrderDetail> proOutOrderDetails = new List<Dt_ProOutOrderDetail>();
            List<Dt_OutProStockInfo> outProStockInfos=new List<Dt_OutProStockInfo>();
            List<Dt_LocationInfo> locationInfos = new List<Dt_LocationInfo>();
            //分配库存
            (List<Dt_ProStockInfo>, List<Dt_ProOutOrderDetail>, List<Dt_OutProStockInfo>, List<Dt_LocationInfo>) result = _outboundService.ProOutOrderDetailService.AssignProStockOut(proOutOrder.WarehouseId, proOutOrder);
            if (result.Item1!=null&&result.Item1.Count>0)
            {
                TaskTypeEnum typeEnum = proOutOrder.ProOrderType switch
                {
                    (int)OutProTypeEnum.ProOut => TaskTypeEnum.OutProduct,
                    (int)OutProTypeEnum.SendProOut => TaskTypeEnum.OutSendProduct,
                    _ => new TaskTypeEnum()
                };
                tasks = GetTasks(result.Item1, typeEnum);
                result.Item2.ForEach(x =>
                {
                    x.ProOrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt();
                });
                result.Item3.ForEach(x =>
                {
                    x.Status = OutLockStockStatusEnum.出库中.ObjToInt();
                });
                proStockInfos = result.Item1;
                proOutOrderDetails = result.Item2;
                outProStockInfos = result.Item3;
                locationInfos = result.Item4;
            }
            else
            {
                throw new Exception("无可分配库存");
            }
            return (tasks, proStockInfos, proOutOrderDetails, outProStockInfos, locationInfos);
        }
        /// <summary>
        /// ç”Ÿæˆä»»åŠ¡
        /// </summary>
        /// <param name="stockInfos"></param>
        /// <param name="taskType"></param>
        /// <returns></returns>
        public List<Dt_Task> GetTasks(List<Dt_ProStockInfo> stockInfos, TaskTypeEnum taskType)
        {
            List<Dt_Task> tasks = new List<Dt_Task>();
            for (int i = 0; i < stockInfos.Count; i++)
            {
                Dt_ProStockInfo stockInfo = stockInfos[i];
                if (stockInfo != null)
                {
                    Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == stockInfo.LocationCode);
                    if (!tasks.Exists(x => x.PalletCode == stockInfo.PalletCode))
                    {
                        Dt_Task task = new()
                        {
                            CurrentAddress = stockInfo.LocationCode,
                            Grade = 0,
                            PalletCode = stockInfo.PalletCode,
                            NextAddress = "",
                            Roadway = locationInfo.RoadwayNo,
                            SourceAddress = stockInfo.LocationCode,
                            TargetAddress = "",
                            TaskStatus = TaskStatusEnum.New.ObjToInt(),
                            TaskType = taskType.ObjToInt(),
                            TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                            PalletType = stockInfo.PalletType,
                            WarehouseId = stockInfo.WarehouseId,
                        };
                        tasks.Add(task);
                    }
                }
            }
            return tasks;
        }
        /// <summary>
        /// åº“存数据转出库任务
@@ -254,6 +402,10 @@
                        _ =>new TaskTypeEnum()
                    };
                    tasks = GetTasks(result.Item1, typeEnum);
                    tasks.ForEach(x =>
                    {
                        x.OrderNo = outboundOrder.UpperOrderNo;
                    });
                    result.Item2.ForEach(x =>
                    {
                        x.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt();
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs
@@ -84,7 +84,16 @@
        {
            return Service.MaterielGroup(saveModel);
        }
        /// <summary>
        /// æ›´æ®å…¥åº“单号ID上传ERP
        /// </summary>
        /// <param name="inboundOrderId">入库单号Id</param>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("FeedbackInboundOrder")]
        public WebResponseContent FeedbackInboundOrder(int inboundOrderId)
        {
            return Service.FeedbackInboundOrder(inboundOrderId);
        }
        ///// <summary>
        ///// å…¥åº“完成后回传ERP
        ///// </summary>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutStockLockInfoController.cs
@@ -42,7 +42,17 @@
        [HttpPost, HttpGet, Route("GetByOrderDetailId"), AllowAnonymous]
        public List<Dt_OutStockLockInfo> GetByOrderDetailId(int orderDetailId)
        {
            return Service.GetByOrderDetailId(orderDetailId,null);
            return Service.GetByOrderDetailId(orderDetailId, null);
        }
        /// <summary>
        /// èŽ·å–Mes出库详情
        /// </summary>
        /// <param name="taskNo">Mes任务单号</param>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("GetByMesOrderDetail"), AllowAnonymous]
        public List<Dt_OutStockLockInfo> GetByMesOrderDetail(string taskNo)
        {
            return Service.GetByMesOrderDetail(taskNo);
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs
@@ -176,6 +176,17 @@
        {
            return Service.GenerateOutboundTasks(keys);
        }
        /// <summary>
        /// ç”Ÿæˆæˆå“å‡ºåº“任务
        /// </summary>
        /// <param name="ProOutNo">出库订单号</param>
        /// <param name="StationCode">站台地址</param>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("OutProductTask"), AllowAnonymous]
        public WebResponseContent OutProductTask(string ProOutNo, string StationCode)
        {
            return Service.OutProductTask(ProOutNo, StationCode);
        }
        ///// <summary>
        ///// ç”ŸæˆMESPP仓大卷出库任务
        ///// </summary>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Filter/CustomProfile.cs
@@ -38,7 +38,7 @@
            CreateMap<Dt_Task, WMSTaskDTO>();
            CreateMap<MESBagDetail, Dt_MesProInOrderDetail>().ForMember(x => x.OverInQuantity, b => b.MapFrom(b => 0));
            CreateMap<ErpProOutOrderDetailds, Dt_ProOutOrderDetail>().ForMember(x => x.ProOrderDetailStatus, b => b.MapFrom(b => 0)).ForMember(x => x.OverQtyPcs, b => b.MapFrom(b => 0));
            CreateMap<Dt_MesProInOrderDetail, Dt_ProStockInfoDetail>().ForMember(x => x.ProOutDetailStatus, b => b.MapFrom(b => StockStatusEmun.组盘暂存.ObjToInt())).ForMember(x => x.OutboundQuantity, b => b.MapFrom(b => 0));
            CreateMap<Dt_MesProInOrderDetail, Dt_ProStockInfoDetail>().ForMember(x => x.ProOutDetailStatus, b => b.MapFrom(b => StockStatusEmun.组盘暂存.ObjToInt())).ForMember(x => x.OutboundQuantity, b => b.MapFrom(b => 0)).ForMember(x => x.StockPcsQty, b => b.MapFrom(b => b.OKPCSQTY));
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json
@@ -14,6 +14,7 @@
  //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=",
  //"ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWMS_HUAIAN;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWMS_HUAIAN;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  //  "ConnectionString": "Data Source=10.30.4.92;Initial Catalog=TESTWMSCP_WMS;User ID=sa;Password=duo123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  //旧WMS数据库连接
  //"TeConnectionString": "Data Source=10.30.4.92;Initial Catalog=TeChuang;User ID=sa;Password=duo123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  //跨域