1
hutongqing
2024-12-18 70f22c9c06c7dfe2a2a83c0d2fcc79892dba7d8f
1
已删除18个文件
已修改55个文件
已添加23个文件
已重命名2个文件
4599 ■■■■ 文件已修改
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/30faa678-93fd-4e91-b1d8-13e2bcae7dba.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/3ea8b77f-1ded-4afe-bbbb-d42ee2627f62.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/456f23a3-e9db-4baa-b211-0debbf6a9766.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/672f95bc-ead2-44f0-a24c-957a3a267788.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/77d1070c-616d-4033-b739-10b3890a2871.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/8f970bf6-017d-4af8-aaf8-8f1412be4898.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/d42b07cd-42aa-4600-b30d-6127996a8402.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/eea7343e-b2dc-465b-88dc-48639ebcee30.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/read.lock 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/AreaInfo.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Attributes/BoolIndexAttribute.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Helper/ConvertHelper.cs 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskStatusEnum.cs 84 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_StationManger.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineDBName.cs 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineTaskCommand.cs 188 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/R_ConveyorLineDBName.cs 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/W_ConveyorLineDBName.cs 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP仓/StackerCraneJob_PP.cs 303 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/干膜仓/StackerCraneJob_GM.cs 303 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/板材仓/StackerCraneJob_BC.cs 303 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/油墨仓/StackerCraneJob_YM.cs 303 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/测试架仓/StackerCraneJob_CSJ.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/012f25e8-74cc-4271-80f7-3993d746a5bd.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/0f2de342-959b-4075-9776-5b88fd484124.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/2877cb87-c685-49b7-a63b-30bdbb709bbd.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/43c5884a-259b-409f-9f97-bec930af24db.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/4b9d13b5-464a-47d4-8dae-9937d5273cc6.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/5023b4f8-50f2-4301-b3ca-8d83fa478bdc.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/5697cb23-9f2e-4eb6-ba02-077734b9a84e.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/60b56cfe-9fa4-4dcb-a205-bd29744252b2.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/9b53cffc-065b-40ee-a779-a99d0cdd29b8.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/bb9c5c98-5de4-43c8-8a36-34ad166b9c7a.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/d6701bb1-0090-4502-a2ca-a4e0726e92d8.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/ffdc57a2-11a0-4784-96ef-3f73a9839656.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs 174 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_CSJ.cs 199 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_GM.cs 174 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_PP.cs 174 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_ZH.cs 174 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs 174 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/WIDESEA_BasicService.csproj 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/CommonEnum/PalletTypeEnum.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/LocationEnum/LocationStatusEnum.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskEnumHelper.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskInStatusEnum.cs 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskOutStatusEnum.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpResponseContent.cs 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/MesResponseContent.cs 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/ILocationInfoService.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IStockRepository/IStockInfoRepository.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_ApprovalFlow.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_ApprovalNode.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_ApprovalTask.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_NodeTransition.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_CustomerInfo.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_LocationInfo.cs 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_MaterielInfo.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_SupplierInfo.cs 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_Warehouse.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Check/Dt_CheckOrder.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Check/Dt_CheckOrderResult.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Config/Dt_AnalysisRuleConfig.cs 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Config/Dt_CodeRuleConfig.cs 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrder.cs 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrderDetail.cs 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrder_Hty.cs 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_PurchaseOrder.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_PurchaseOrderDetail.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReceiveOrder.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReceiveOrderDetail.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundLockInfo.cs 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrder.cs 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrderDetail.cs 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrderDetail_Hty.cs 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Record/Dt_LocationStatusChangeRecord.cs 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Record/Dt_StockQuantityChangeRecord.cs 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfo.cs 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfoDetail.cs 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/TaskInfo/Dt_Task.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderDetailService.cs 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/StockInfoRepository.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryService.cs 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs 135 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs 238 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Filter/CustomProfile.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/30faa678-93fd-4e91-b1d8-13e2bcae7dba.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/3ea8b77f-1ded-4afe-bbbb-d42ee2627f62.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/456f23a3-e9db-4baa-b211-0debbf6a9766.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/672f95bc-ead2-44f0-a24c-957a3a267788.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/77d1070c-616d-4033-b739-10b3890a2871.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/8f970bf6-017d-4af8-aaf8-8f1412be4898.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/d42b07cd-42aa-4600-b30d-6127996a8402.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/eea7343e-b2dc-465b-88dc-48639ebcee30.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/read.lock
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/AreaInfo.cs
ÎļþÒÑɾ³ý
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Attributes/BoolIndexAttribute.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_Common.Attributes
{
    public class BoolIndexAttribute : Attribute
    {
        public int Index { get; set; }
        public BoolIndexAttribute(int index)
        {
            Index = index;
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Helper/ConvertHelper.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.Attributes;
namespace WIDESEAWCS_Common.Helper
{
    public class ConvertHelper
    {
        public static bool[] ByteToBoolArray(byte data)
        {
            bool[] result = new bool[8];
            for (int i = 0; i < 8; i++)
            {
                result[i] = (data & (1 << i)) != 0;
            }
            return result;
        }
        public static T ByteToBoolObject<T>(byte data)
        {
            bool[] boolArray = ByteToBoolArray(data);
            Type type = typeof(T);
            object? obj = Activator.CreateInstance(type);
            if (obj == null)
            {
                throw new Exception($"类型实例化错误");
            }
            T result = (T)obj;
            PropertyInfo[] propertyInfos = type.GetProperties();
            foreach (PropertyInfo propertyInfo in propertyInfos)
            {
                BoolIndexAttribute? boolIndexAttribute = propertyInfo.GetCustomAttribute<BoolIndexAttribute>();
                if (boolIndexAttribute != null)
                {
                    if (boolIndexAttribute.Index >= 0 && boolIndexAttribute.Index < 8)
                    {
                        propertyInfo.SetValue(result, boolArray[boolIndexAttribute.Index]);
                    }
                }
            }
            return result;
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskStatusEnum.cs
@@ -7,37 +7,22 @@
namespace WIDESEAWCS_Common.TaskEnum
{
    /// <summary>
    /// å…¥åº“任务状态
    /// </summary>
    public enum TaskInStatusEnum
    {
        /// <summary>
        /// æ–°å»ºå…¥åº“任务
        /// </summary>
        [Description("新建入库任务")]
        [Description("新建")]
        InNew = 200,
        ///// <summary>
        ///// AGV入库执行中
        ///// </summary>
        //[Description("AGV入库执行中")]
        //AGV_InExecuting = 210,
        ///// <summary>
        ///// AGV入库完成
        ///// </summary>
        //[Description("AGV搬运完成")]
        //AGV_InFinish = 215,
        /// <summary>
        /// è¾“送线入库执行中
        /// å †åž›æœºå¾…执行
        /// </summary>
        [Description("输送线入库执行中")]
        Line_InExecuting = 220,
        /// <summary>
        /// è¾“送线入库完成
        /// </summary>
        [Description("输送线输送完成")]
        Line_InFinish = 225,
        [Description("堆垛机待执行")]
        SC_InExecute = 225,
        /// <summary>
        /// å †åž›æœºå…¥åº“执行中
@@ -58,12 +43,6 @@
        InFinish = 290,
        /// <summary>
        /// å…¥åº“任务挂起
        /// </summary>
        [Description("入库任务挂起")]
        InPending = 297,
        /// <summary>
        /// å…¥åº“任务取消
        /// </summary>
        [Description("入库任务取消")]
@@ -76,61 +55,40 @@
        InException = 299,
    }
    /// <summary>
    /// å‡ºåº“任务状态
    /// </summary>
    public enum TaskOutStatusEnum
    {
        /// <summary>
        /// æ–°å»ºå‡ºåº“任务
        /// æ–°å»ºä»»åŠ¡
        /// </summary>
        [Description("新建出库任务")]
        [Description("新建")]
        OutNew = 100,
        /// <summary>
        /// å †åž›æœºå‡ºåº“待执行
        /// </summary>
        [Description("堆垛机出库待执行")]
        SC_OutExecute = 125,
        /// <summary>
        /// å †åž›æœºå‡ºåº“执行中
        /// </summary>
        [Description("堆垛机出库执行中")]
        SC_OutExecuting = 110,
        SC_OutExecuting = 130,
        /// <summary>
        /// å †åž›æœºå‡ºåº“完成
        /// </summary>
        [Description("堆垛机出库完成")]
        SC_OutFinish = 115,
        /// <summary>
        /// è¾“送线出库执行中
        /// </summary>
        [Description("输送线出库执行中")]
        Line_OutExecuting = 120,
        /// <summary>
        /// è¾“送线出库完成
        /// </summary>
        [Description("输送线输送完成")]
        Line_OutFinish = 125,
        ///// <summary>
        ///// AGV出库执行中
        ///// </summary>
        //[Description("AGV出库执行中")]
        //AGV_OutExecuting = 130,
        ///// <summary>
        ///// AGV出库完成
        ///// </summary>
        //[Description("AGV搬运完成")]
        //AGV_OutFinish = 135,
        SC_OutFinish = 135,
        /// <summary>
        /// å‡ºåº“任务完成
        /// </summary>
        [Description("出库任务完成")]
        OutFinish = 190,
        /// <summary>
        /// å‡ºåº“任务挂起
        /// </summary>
        [Description("出库任务挂起")]
        OutPending = 197,
        /// <summary>
        /// å‡ºåº“任务取消
@@ -142,6 +100,6 @@
        /// å‡ºåº“任务异常
        /// </summary>
        [Description("出库任务异常")]
        OutException = 199,
        OutException = 199
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs
@@ -36,7 +36,7 @@
        /// <summary>
        /// ä»»åŠ¡çŠ¶æ€
        /// </summary>
        public int TaskState { get; set; }
        public int TaskStatus { get; set; }
        /// <summary>
        /// èµ·ç‚¹
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_StationManger.cs
@@ -30,6 +30,15 @@
        public string StationName { get; set; }
        /// <summary>
        /// ç«™å°ç±»åž‹ <br/>
        /// 1:只入 <br/>
        /// 2:只出 <br/>
        /// 3:可入可出
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "站台类型")]
        public int StationType {  get; set; }
        /// <summary>
        /// å¯¹åº”堆垛机排-列-层
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "对应堆垛机排-列-层")]
@@ -51,7 +60,7 @@
        /// AGV站台编号
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "AGV站台编号")]
        public string AGVStationCode { get; set; }
        public string? AGVStationCode { get; set; }
        /// <summary>
        /// å¤‡æ³¨
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -87,25 +87,15 @@
                    task.Creater = "WMS";
                    if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
                    {
                        List<Dt_Router> routers = _routerService.QueryNextRoutes(item.RoadWay, item.TargetAddress);
                        //暂不考虑多路径
                        if (routers.Count > 0)
                        {
                            task.TaskState = (int)TaskOutStatusEnum.OutNew;
                            task.CurrentAddress = item.SourceAddress;
                            task.NextAddress = routers.FirstOrDefault().ChildPosi;
                        }
                        task.NextAddress = item.TargetAddress;
                    }
                    else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)
                    {
                        List<Dt_Router> routers = _routerService.QueryNextRoutes(item.SourceAddress, item.TargetAddress);
                        //暂不考虑多路径
                        if (routers.Count > 0)
                        {
                            task.TaskState = (int)TaskInStatusEnum.InNew;
                            task.CurrentAddress = item.SourceAddress;
                            task.NextAddress = routers.FirstOrDefault().ChildPosi;
                        }
                        task.TaskState = (int)TaskInStatusEnum.InNew; task.CurrentAddress = item.SourceAddress;
                        task.NextAddress = item.TargetAddress;
                    }
                    tasks.Add(task);
                }
@@ -141,7 +131,7 @@
                    RoadWay = "SC01",
                    SourceAddress = sourceAddress,
                    TargetAddress = "SC01",
                    TaskState = (int)TaskInStatusEnum.InNew,
                    TaskStatus = (int)TaskInStatusEnum.InNew,
                    Id = 0,
                    TaskType = (int)TaskInboundTypeEnum.Inbound
                };
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -36,7 +36,7 @@
namespace WIDESEAWCS_Tasks
{
    [DisallowConcurrentExecution]
    public class CommonConveyorLineJob : IJob
    public class CommonConveyorLineJob : JobBase, IJob
    {
        private readonly ITaskService _taskService;
        private readonly ITaskExecuteDetailService _taskExecuteDetailService;
@@ -59,34 +59,16 @@
                CommonConveyorLine conveyorLine = (CommonConveyorLine)context.JobDetail.JobDataMap.Get("JobParams");
                if (conveyorLine != null)
                {
                    List<string> childDeviceCodes = _routerService.QueryAllPositions(conveyorLine.DeviceCode);
                    List<Task> tasks = new List<Task>();
                    List<string> childDeviceCodes = new List<string>();
                    foreach (string childDeviceCode in childDeviceCodes)
                    {
                        //Task task = Task.Run(() =>
                        //{
                            ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(childDeviceCode);
                        R_ConveyorLineInfo command = conveyorLine.ReadCustomer<R_ConveyorLineInfo>(childDeviceCode);
                            if (command != null)
                            {
                                DeviceProtocolDetailDTO? deviceProtocolDetail = conveyorLine.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.ProtocalDetailValue == command.InteractiveSignal.ToString() && x.DeviceProParamName == nameof(ConveyorLineTaskCommand.InteractiveSignal));
                                if (deviceProtocolDetail != null)
                                {
                                    MethodInfo? method = GetType().GetMethod(deviceProtocolDetail.ProtocolDetailType);
                                    if (method != null)
                                    {
                                        method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode });
                                    }
                                    else
                                    {
                                        //todo æœªæ‰¾åˆ°æ–¹æ³•æ—¶
                                    }
                                }
                            }
                        //});
                        //tasks.Add(task);
                    }
                    Task.WaitAll(tasks.ToArray());
                        }
                    }
                }
            }
@@ -155,7 +137,7 @@
            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
            if (task != null)
            {
                conveyorLine.SetValue(ConveyorLineDBName.WriteInteractiveSignal, 0, childDeviceCode);
                //conveyorLine.SetValue(R_ConveyorLineDBName.WriteInteractiveSignal, 0, childDeviceCode);
                WebResponseContent content = _taskService.UpdateTaskStatusToNext(task);
                Console.Out.WriteLine(content.Serialize());
            }
@@ -212,7 +194,7 @@
            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
            if (task != null)
            {
                conveyorLine.SetValue(ConveyorLineDBName.WriteInteractiveSignal, 0, childDeviceCode);
                //conveyorLine.SetValue(R_ConveyorLineDBName.WriteInteractiveSignal, 0, childDeviceCode);
                WebResponseContent content = _taskService.UpdateTaskStatusToNext(task);
                Console.Out.WriteLine(content.Serialize());
            }
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineDBName.cs
ÎļþÒÑɾ³ý
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineTaskCommand.cs
@@ -20,6 +20,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.Attributes;
using WIDESEAWCS_QuartzJob.DeviceBase;
namespace WIDESEAWCS_Tasks.ConveyorLineJob
@@ -35,4 +36,191 @@
        public int TaskNum { get; set; }
    }
    public class R_ConveyorLineInfo : DeviceCommand
    {
        /// <summary>
        /// ç«™å°ç¼–号
        /// </summary>
        public short ConveyorNo { get; set; }
        /// <summary>
        /// çŠ¶æ€
        /// </summary>
        public byte Status { get; set; }
        /// <summary>
        /// ä»»åŠ¡å·
        /// </summary>
        public int TaskNum { get; set; }
        /// <summary>
        /// èµ·å§‹åœ°å€
        /// </summary>
        public short StartPos { get; set; }
        /// <summary>
        /// ç›®æ ‡åœ°å€
        /// </summary>
        public short EndPos { get; set; }
        /// <summary>
        /// é‡é‡
        /// </summary>
        public short GoodsWeight { get; set; }
        /// <summary>
        /// è´§ç‰©ç±»åž‹
        /// </summary>
        public short GoodsType { get; set; }
        /// <summary>
        /// 0静止1前进2后退3上升/顺时针旋转4下降/逆时针旋转
        /// </summary>
        public short RunStatus { get; set; }
        /// <summary>
        /// æ¡ç 
        /// </summary>
        [DataLength(20)]
        public string Barcode { get; set; }
        /// <summary>
        /// é¢„ç•™
        /// </summary>
        public short Sapre1 { get; set; }
        /// <summary>
        /// é¢„ç•™
        /// </summary>
        public short Sapre2 { get; set; }
        /// <summary>
        /// äº¤äº’信号
        /// </summary>
        public byte Signal { get; set; }
    }
    public class R_ConveyorLineStatus
    {
        /// <summary>
        /// æ¡æ‰‹ä¿¡å·
        /// </summary>
        [BoolIndex(0)]
        public bool HandShake { get; set; }
        /// <summary>
        /// 1联机 0脱机
        /// </summary>
        [BoolIndex(1)]
        public bool Online { get; set; }
        /// <summary>
        /// 1空闲 0繁忙
        /// </summary>
        [BoolIndex(2)]
        public bool Free { get; set; }
        /// <summary>
        /// 1有货 0无货
        /// </summary>
        [BoolIndex(3)]
        public bool Goods { get; set; }
        /// <summary>
        /// 1故障 0正常
        /// </summary>
        [BoolIndex(4)]
        public bool Alarm { get; set; }
        /// <summary>
        /// 1请求补盘 0无
        /// </summary>
        [BoolIndex(5)]
        public bool RequestPakcPallet { get; set; }
        /// <summary>
        /// 1请求拆盘 0无
        /// </summary>
        [BoolIndex(6)]
        public bool RequestUnpackPellet { get; set; }
    }
    public class R_ConveyorLineSignal
    {
        /// <summary>
        /// è¯·æ±‚信号
        /// </summary>
        public bool STB { get; set; }
        /// <summary>
        /// å“åº”信号
        /// </summary>
        public bool ACK { get; set; }
    }
    public class W_ConveyorLineInfo
    {
        /// <summary>
        /// ç«™å°ç¼–号
        /// </summary>
        public short ConveyorNo { get; set; }
        /// <summary>
        /// æ¡æ‰‹ä¿¡å·
        /// </summary>
        public bool HandShake { get; set; }
        /// <summary>
        /// å¤ä½æŠ¥è­¦
        /// </summary>
        public bool ClearAlarm { get; set; }
        /// <summary>
        /// é€€å›ž
        /// </summary>
        public bool Return { get; set; }
        /// <summary>
        /// ä»»åŠ¡å·
        /// </summary>
        public int TaskNum { get; set; }
        /// <summary>
        /// èµ·å§‹åœ°å€
        /// </summary>
        public short StartPos { get; set; }
        /// <summary>
        /// ç›®æ ‡åœ°å€
        /// </summary>
        public short EndPos { get; set; }
        /// <summary>
        /// è´§ç‰©ç±»åž‹
        /// </summary>
        public short GoodsType { get; set; }
        /// <summary>
        /// é¢„ç•™
        /// </summary>
        public short Sapre1 { get; set; }
        /// <summary>
        /// é¢„ç•™
        /// </summary>
        public short Sapre2 { get; set; }
        /// <summary>
        /// è¯·æ±‚信号
        /// </summary>
        public bool STB { get; set; }
        /// <summary>
        /// å“åº”信号
        /// </summary>
        public bool ACK { get; set; }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/R_ConveyorLineDBName.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,124 @@
#region << ç‰ˆ æœ¬ æ³¨ é‡Š >>
/*----------------------------------------------------------------
 * å‘½åç©ºé—´ï¼šWIDESEAWCS_Tasks.ConveyorLineJob
 * åˆ›å»ºè€…:胡童庆
 * åˆ›å»ºæ—¶é—´ï¼š2024/8/2 16:13:36
 * ç‰ˆæœ¬ï¼šV1.0.0
 * æè¿°ï¼š
 *
 * ----------------------------------------------------------------
 * ä¿®æ”¹äººï¼š
 * ä¿®æ”¹æ—¶é—´ï¼š
 * ç‰ˆæœ¬ï¼šV1.0.1
 * ä¿®æ”¹è¯´æ˜Žï¼š
 *
 *----------------------------------------------------------------*/
#endregion << ç‰ˆ æœ¬ æ³¨ é‡Š >>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_Tasks.ConveyorLineJob
{
    public enum R_ConveyorLineDBName
    {
        /// <summary>
        /// ç«™å°ç¼–号
        /// </summary>
        ConveyorNo,
        /// <summary>
        /// æ¡æ‰‹ä¿¡å·
        /// </summary>
        HandShake,
        /// <summary>
        /// 1联机 0脱机
        /// </summary>
        Online,
        /// <summary>
        /// 1空闲 0繁忙
        /// </summary>
        Free,
        /// <summary>
        /// 1有货 0无货
        /// </summary>
        Goods,
        /// <summary>
        /// 1故障 0正常
        /// </summary>
        Alarm,
        /// <summary>
        /// 1请求补盘 0无
        /// </summary>
        RequestPakcPallet,
        /// <summary>
        /// 1请求拆盘 0无
        /// </summary>
        RequestUnpackPellet,
        /// <summary>
        /// ä»»åŠ¡å·
        /// </summary>
        TaskNum,
        /// <summary>
        /// èµ·å§‹åœ°å€
        /// </summary>
        StartPos,
        /// <summary>
        /// ç›®æ ‡åœ°å€
        /// </summary>
        EndPos,
        /// <summary>
        /// é‡é‡
        /// </summary>
        GoodsWeight,
        /// <summary>
        /// è´§ç‰©ç±»åž‹
        /// </summary>
        GoodsType,
        /// <summary>
        /// 0静止1前进2后退3上升/顺时针旋转4下降/逆时针旋转
        /// </summary>
        RunStatus,
        /// <summary>
        /// æ¡ç 
        /// </summary>
        Barcode,
        /// <summary>
        /// é¢„ç•™
        /// </summary>
        Sapre1,
        /// <summary>
        /// é¢„ç•™
        /// </summary>
        Sapre2,
        /// <summary>
        /// è¯·æ±‚信号
        /// </summary>
        STB,
        /// <summary>
        /// å“åº”信号
        /// </summary>
        ACK
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/W_ConveyorLineDBName.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,72 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_Tasks.ConveyorLineJob
{
    public enum W_ConveyorLineDBName
    {
        /// <summary>
        /// ç«™å°ç¼–号
        /// </summary>
        ConveyorNo,
        /// <summary>
        /// æ¡æ‰‹ä¿¡å·
        /// </summary>
        HandShake,
        /// <summary>
        /// å¤ä½æŠ¥è­¦
        /// </summary>
        ClearAlarm,
        /// <summary>
        /// é€€å›ž
        /// </summary>
        Return,
        /// <summary>
        /// ä»»åŠ¡å·
        /// </summary>
        TaskNum,
        /// <summary>
        /// èµ·å§‹åœ°å€
        /// </summary>
        StartPos,
        /// <summary>
        /// ç›®æ ‡åœ°å€
        /// </summary>
        EndPos,
        /// <summary>
        /// è´§ç‰©ç±»åž‹
        /// </summary>
        GoodsType,
        /// <summary>
        /// é¢„ç•™1
        /// </summary>
        Sapre1,
        /// <summary>
        /// é¢„ç•™2
        /// </summary>
        Sapre2,
        /// <summary>
        /// è¯·æ±‚信号
        /// </summary>
        STB,
        /// <summary>
        /// å“åº”信号
        /// </summary>
        ACK
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP²Ö/StackerCraneJob_PP.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,303 @@
using Microsoft.AspNetCore.Components.Routing;
using Quartz;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core.Enums;
using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_QuartzJob.DeviceBase;
using WIDESEAWCS_QuartzJob.Models;
using WIDESEAWCS_QuartzJob.Service;
using WIDESEAWCS_QuartzJob.StackerCrane.Enum;
using WIDESEAWCS_Tasks.HoisterJob;
using WIDESEAWCS_Tasks.StackerCraneJob;
using WIDESEAWCS_Tasks.阻焊仓;
namespace WIDESEAWCS_Tasks
{
    [DisallowConcurrentExecution]
    public class StackerCraneJob_PP : JobBase, IJob
    {
        private readonly ITaskService _taskService;
        private readonly ITaskExecuteDetailService _taskExecuteDetailService;
        private readonly ITaskRepository _taskRepository;
        private readonly IRouterService _routerService;
        private readonly IStationMangerRepository _stationMangerRepository;
        public StackerCraneJob_PP(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository)
        {
            _taskService = taskService;
            _taskExecuteDetailService = taskExecuteDetailService;
            _taskRepository = taskRepository;
            _routerService = routerService;
            _stationMangerRepository = stationMangerRepository;
        }
        public Task Execute(IJobExecutionContext context)
        {
            try
            {
                CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams");
                if (commonStackerCrane != null)
                {
                    if (!commonStackerCrane.IsEventSubscribed)
                    {
                        commonStackerCrane.StackerCraneTaskCompletedEventHandler += CommonStackerCrane_StackerCraneTaskCompletedEventHandler;//订阅任务完成事件
                    }
                    if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal)
                    {
                        commonStackerCrane.CheckStackerCraneTaskCompleted();//防止任务完成事件监测超时,再手动触发一次
                        if (commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby)
                        {
                            Dt_Task? task = GetTask(commonStackerCrane);
                            if (task != null)
                            {
                                StackerCraneTaskCommand? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task);
                                if (stackerCraneTaskCommand != null)
                                {
                                    bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand);
                                    if (sendFlag)
                                    {
                                        commonStackerCrane.LastTaskType = task.TaskType;
                                        _taskService.UpdateTaskStatusToNext(task.TaskNum);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                WriteError(nameof(CommonStackerCraneJob), ex.Message, ex);
            }
            return Task.CompletedTask;
        }
        /// <summary>
        /// ä»»åŠ¡å®Œæˆäº‹ä»¶è®¢é˜…çš„æ–¹æ³•
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CommonStackerCrane_StackerCraneTaskCompletedEventHandler(object? sender, WIDESEAWCS_QuartzJob.StackerCrane.StackerCraneTaskCompletedEventArgs e)
        {
            CommonStackerCrane? commonStackerCrane = sender as CommonStackerCrane;
            if (commonStackerCrane != null)
            {
                if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5)
                {
                    Console.Out.WriteLine("TaskCompleted" + e.TaskNum);
                    _taskService.StackCraneTaskCompleted(e.TaskNum);
                    commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5);
                }
            }
        }
        /// <summary>
        /// èŽ·å–ä»»åŠ¡
        /// </summary>
        /// <param name="commonStackerCrane">堆垛机对象</param>
        /// <returns></returns>
        private Dt_Task? GetTask(CommonStackerCrane commonStackerCrane)
        {
            Dt_Task task;
            if (commonStackerCrane.LastTaskType == null)
            {
                task = _taskService.QueryStackerCraneTask(commonStackerCrane.DeviceCode);
            }
            else
            {
                if (commonStackerCrane.LastTaskType.GetValueOrDefault().GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
                {
                    task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode);
                    if (task == null)
                    {
                        task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode);
                    }
                }
                else
                {
                    task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode);
                    if (task == null)
                    {
                        task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode);
                    }
                }
            }
            if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
            {
                if (OutTaskStationIsOccupied(task) != null || true)
                {
                    return task;
                }
                else
                {
                    List<string> otherOutStaionCodes = _routerService.QueryNextRoutes(commonStackerCrane.DeviceCode, task.NextAddress).Select(x => x.ChildPosi).ToList();
                    List<Dt_Task> tasks = _taskService.QueryStackerCraneOutTasks(commonStackerCrane.DeviceCode, otherOutStaionCodes);
                    foreach (var item in tasks)
                    {
                        if (OutTaskStationIsOccupied(task) != null)
                        {
                            return task;
                        }
                    }
                    task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode);
                }
            }
            return task;
        }
        /// <summary>
        /// å‡ºåº“任务判断出库站台是否被占用
        /// </summary>
        /// <param name="task">任务实体</param>
        /// <returns>如果未被占用,返回传入的任务信息,否则,返回null</returns>
        private Dt_Task? OutTaskStationIsOccupied([NotNull] Dt_Task task)
        {
            Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.TargetAddress && x.StackerCraneCode == task.Roadway);
            if (stationManger != null)
            {
                IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode);
                if (device != null)
                {
                    OtherDevice client = (OtherDevice)device;
                    if (client.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode))//出库站台未被占用
                    {
                        task.TargetAddress = stationManger.StackerCraneStationCode;
                        _taskRepository.UpdateData(task);
                        return task;
                    }
                }
                else
                {
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到出库站台【{stationManger.StationDeviceCode}】对应的通讯对象,无法判断出库站台是否被占用");
                }
            }
            else
            {
                _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到站台【{task.NextAddress}】信息,无法校验站台");
            }
            return null;
        }
        /// <summary>
        /// ä»»åŠ¡å®žä½“è½¬æ¢æˆå‘½ä»¤Model
        /// </summary>
        /// <param name="task">任务实体</param>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        public StackerCraneTaskCommand? ConvertToStackerCraneTaskCommand([NotNull] Dt_Task task)
        {
            StackerCraneTaskCommand stackerCraneTaskCommand = new StackerCraneTaskCommand();
            stackerCraneTaskCommand.Barcode = task.PalletCode;
            stackerCraneTaskCommand.TaskNum = task.TaskNum;
            stackerCraneTaskCommand.WorkType = 1;
            stackerCraneTaskCommand.TrayType = 1;
            if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//判断是否是入库任务
            {
                //List<Dt_Router> routers = _routerService.QueryNextRoutes(task.CurrentAddress, task.Roadway);
                //if (routers.Count > 0)
                //{
                string[] startCodes = task.CurrentAddress.Split("-");
                stackerCraneTaskCommand.StartRow = Convert.ToInt16(startCodes[0]);
                stackerCraneTaskCommand.StartColumn = Convert.ToInt16(startCodes[1]);
                stackerCraneTaskCommand.StartLayer = Convert.ToInt16(startCodes[2]);
                string[] targetCodes = task.NextAddress.Split("-");
                if (targetCodes.Length == 3)
                {
                    stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]);
                    stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]);
                    stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]);
                }
                else
                {
                    //数据配置错误
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"入库任务终点错误,起点:【{task.NextAddress}】");
                    return null;
                }
                //}
                //else
                //{
                //    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到站台【{task.NextAddress}】信息,无法获取对应的堆垛机取货站台信息");
                //    return null;
                //}
            }
            else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
            {
                //List<Dt_Router> routers = _routerService.QueryNextRoutes(task.Roadway, task.TargetAddress);
                //if (routers.Count > 0)
                {
                    string[] targetCodes = task.NextAddress.Split("-");
                    stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]);
                    stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]);
                    stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]);
                    string[] sourceCodes = task.CurrentAddress.Split("-");
                    if (sourceCodes.Length == 3)
                    {
                        stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]);
                        stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]);
                        stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]);
                    }
                    else
                    {
                        //数据配置错误
                        _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"出库任务起点错误,起点:【{task.CurrentAddress}】");
                        return null;
                    }
                }
                //else
                //{
                //    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到站台【{task.NextAddress}】信息,无法获取对应的堆垛机放货站台信息");
                //    return null;
                //}
            }
            else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup)
            {
                string[] targetCodes = task.NextAddress.Split("-");
                if (targetCodes.Length == 3)
                {
                    stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]);
                    stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]);
                    stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]);
                }
                else
                {
                    //数据配置错误
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"移库任务终点错误,起点:【{task.NextAddress}】");
                    return null;
                }
                string[] sourceCodes = task.CurrentAddress.Split("-");
                if (sourceCodes.Length == 3)
                {
                    stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]);
                    stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]);
                    stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]);
                }
                else
                {
                    //数据配置错误
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"移库任务起点错误,起点:【{task.CurrentAddress}】");
                    return null;
                }
            }
            return stackerCraneTaskCommand;
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/¸ÉĤ²Ö/StackerCraneJob_GM.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,303 @@
using Microsoft.AspNetCore.Components.Routing;
using Quartz;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core.Enums;
using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_QuartzJob.DeviceBase;
using WIDESEAWCS_QuartzJob.Models;
using WIDESEAWCS_QuartzJob.Service;
using WIDESEAWCS_QuartzJob.StackerCrane.Enum;
using WIDESEAWCS_Tasks.HoisterJob;
using WIDESEAWCS_Tasks.StackerCraneJob;
using WIDESEAWCS_Tasks.阻焊仓;
namespace WIDESEAWCS_Tasks
{
    [DisallowConcurrentExecution]
    public class StackerCraneJob_GM : JobBase, IJob
    {
        private readonly ITaskService _taskService;
        private readonly ITaskExecuteDetailService _taskExecuteDetailService;
        private readonly ITaskRepository _taskRepository;
        private readonly IRouterService _routerService;
        private readonly IStationMangerRepository _stationMangerRepository;
        public StackerCraneJob_GM(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository)
        {
            _taskService = taskService;
            _taskExecuteDetailService = taskExecuteDetailService;
            _taskRepository = taskRepository;
            _routerService = routerService;
            _stationMangerRepository = stationMangerRepository;
        }
        public Task Execute(IJobExecutionContext context)
        {
            try
            {
                CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams");
                if (commonStackerCrane != null)
                {
                    if (!commonStackerCrane.IsEventSubscribed)
                    {
                        commonStackerCrane.StackerCraneTaskCompletedEventHandler += CommonStackerCrane_StackerCraneTaskCompletedEventHandler;//订阅任务完成事件
                    }
                    if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal)
                    {
                        commonStackerCrane.CheckStackerCraneTaskCompleted();//防止任务完成事件监测超时,再手动触发一次
                        if (commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby)
                        {
                            Dt_Task? task = GetTask(commonStackerCrane);
                            if (task != null)
                            {
                                StackerCraneTaskCommand? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task);
                                if (stackerCraneTaskCommand != null)
                                {
                                    bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand);
                                    if (sendFlag)
                                    {
                                        commonStackerCrane.LastTaskType = task.TaskType;
                                        _taskService.UpdateTaskStatusToNext(task.TaskNum);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                WriteError(nameof(CommonStackerCraneJob), ex.Message, ex);
            }
            return Task.CompletedTask;
        }
        /// <summary>
        /// ä»»åŠ¡å®Œæˆäº‹ä»¶è®¢é˜…çš„æ–¹æ³•
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CommonStackerCrane_StackerCraneTaskCompletedEventHandler(object? sender, WIDESEAWCS_QuartzJob.StackerCrane.StackerCraneTaskCompletedEventArgs e)
        {
            CommonStackerCrane? commonStackerCrane = sender as CommonStackerCrane;
            if (commonStackerCrane != null)
            {
                if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5)
                {
                    Console.Out.WriteLine("TaskCompleted" + e.TaskNum);
                    _taskService.StackCraneTaskCompleted(e.TaskNum);
                    commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5);
                }
            }
        }
        /// <summary>
        /// èŽ·å–ä»»åŠ¡
        /// </summary>
        /// <param name="commonStackerCrane">堆垛机对象</param>
        /// <returns></returns>
        private Dt_Task? GetTask(CommonStackerCrane commonStackerCrane)
        {
            Dt_Task task;
            if (commonStackerCrane.LastTaskType == null)
            {
                task = _taskService.QueryStackerCraneTask(commonStackerCrane.DeviceCode);
            }
            else
            {
                if (commonStackerCrane.LastTaskType.GetValueOrDefault().GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
                {
                    task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode);
                    if (task == null)
                    {
                        task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode);
                    }
                }
                else
                {
                    task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode);
                    if (task == null)
                    {
                        task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode);
                    }
                }
            }
            if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
            {
                if (OutTaskStationIsOccupied(task) != null || true)
                {
                    return task;
                }
                else
                {
                    List<string> otherOutStaionCodes = _routerService.QueryNextRoutes(commonStackerCrane.DeviceCode, task.NextAddress).Select(x => x.ChildPosi).ToList();
                    List<Dt_Task> tasks = _taskService.QueryStackerCraneOutTasks(commonStackerCrane.DeviceCode, otherOutStaionCodes);
                    foreach (var item in tasks)
                    {
                        if (OutTaskStationIsOccupied(task) != null)
                        {
                            return task;
                        }
                    }
                    task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode);
                }
            }
            return task;
        }
        /// <summary>
        /// å‡ºåº“任务判断出库站台是否被占用
        /// </summary>
        /// <param name="task">任务实体</param>
        /// <returns>如果未被占用,返回传入的任务信息,否则,返回null</returns>
        private Dt_Task? OutTaskStationIsOccupied([NotNull] Dt_Task task)
        {
            Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.TargetAddress && x.StackerCraneCode == task.Roadway);
            if (stationManger != null)
            {
                IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode);
                if (device != null)
                {
                    OtherDevice client = (OtherDevice)device;
                    if (client.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode))//出库站台未被占用
                    {
                        task.TargetAddress = stationManger.StackerCraneStationCode;
                        _taskRepository.UpdateData(task);
                        return task;
                    }
                }
                else
                {
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到出库站台【{stationManger.StationDeviceCode}】对应的通讯对象,无法判断出库站台是否被占用");
                }
            }
            else
            {
                _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到站台【{task.NextAddress}】信息,无法校验站台");
            }
            return null;
        }
        /// <summary>
        /// ä»»åŠ¡å®žä½“è½¬æ¢æˆå‘½ä»¤Model
        /// </summary>
        /// <param name="task">任务实体</param>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        public StackerCraneTaskCommand? ConvertToStackerCraneTaskCommand([NotNull] Dt_Task task)
        {
            StackerCraneTaskCommand stackerCraneTaskCommand = new StackerCraneTaskCommand();
            stackerCraneTaskCommand.Barcode = task.PalletCode;
            stackerCraneTaskCommand.TaskNum = task.TaskNum;
            stackerCraneTaskCommand.WorkType = 1;
            stackerCraneTaskCommand.TrayType = 1;
            if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//判断是否是入库任务
            {
                //List<Dt_Router> routers = _routerService.QueryNextRoutes(task.CurrentAddress, task.Roadway);
                //if (routers.Count > 0)
                //{
                string[] startCodes = task.CurrentAddress.Split("-");
                stackerCraneTaskCommand.StartRow = Convert.ToInt16(startCodes[0]);
                stackerCraneTaskCommand.StartColumn = Convert.ToInt16(startCodes[1]);
                stackerCraneTaskCommand.StartLayer = Convert.ToInt16(startCodes[2]);
                string[] targetCodes = task.NextAddress.Split("-");
                if (targetCodes.Length == 3)
                {
                    stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]);
                    stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]);
                    stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]);
                }
                else
                {
                    //数据配置错误
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"入库任务终点错误,起点:【{task.NextAddress}】");
                    return null;
                }
                //}
                //else
                //{
                //    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到站台【{task.NextAddress}】信息,无法获取对应的堆垛机取货站台信息");
                //    return null;
                //}
            }
            else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
            {
                //List<Dt_Router> routers = _routerService.QueryNextRoutes(task.Roadway, task.TargetAddress);
                //if (routers.Count > 0)
                {
                    string[] targetCodes = task.NextAddress.Split("-");
                    stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]);
                    stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]);
                    stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]);
                    string[] sourceCodes = task.CurrentAddress.Split("-");
                    if (sourceCodes.Length == 3)
                    {
                        stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]);
                        stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]);
                        stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]);
                    }
                    else
                    {
                        //数据配置错误
                        _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"出库任务起点错误,起点:【{task.CurrentAddress}】");
                        return null;
                    }
                }
                //else
                //{
                //    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到站台【{task.NextAddress}】信息,无法获取对应的堆垛机放货站台信息");
                //    return null;
                //}
            }
            else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup)
            {
                string[] targetCodes = task.NextAddress.Split("-");
                if (targetCodes.Length == 3)
                {
                    stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]);
                    stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]);
                    stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]);
                }
                else
                {
                    //数据配置错误
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"移库任务终点错误,起点:【{task.NextAddress}】");
                    return null;
                }
                string[] sourceCodes = task.CurrentAddress.Split("-");
                if (sourceCodes.Length == 3)
                {
                    stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]);
                    stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]);
                    stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]);
                }
                else
                {
                    //数据配置错误
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"移库任务起点错误,起点:【{task.CurrentAddress}】");
                    return null;
                }
            }
            return stackerCraneTaskCommand;
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/°å²Ä²Ö/StackerCraneJob_BC.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,303 @@
using Microsoft.AspNetCore.Components.Routing;
using Quartz;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core.Enums;
using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_QuartzJob.DeviceBase;
using WIDESEAWCS_QuartzJob.Models;
using WIDESEAWCS_QuartzJob.Service;
using WIDESEAWCS_QuartzJob.StackerCrane.Enum;
using WIDESEAWCS_Tasks.HoisterJob;
using WIDESEAWCS_Tasks.StackerCraneJob;
using WIDESEAWCS_Tasks.阻焊仓;
namespace WIDESEAWCS_Tasks
{
    [DisallowConcurrentExecution]
    public class StackerCraneJob_BC : JobBase, IJob
    {
        private readonly ITaskService _taskService;
        private readonly ITaskExecuteDetailService _taskExecuteDetailService;
        private readonly ITaskRepository _taskRepository;
        private readonly IRouterService _routerService;
        private readonly IStationMangerRepository _stationMangerRepository;
        public StackerCraneJob_BC(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository)
        {
            _taskService = taskService;
            _taskExecuteDetailService = taskExecuteDetailService;
            _taskRepository = taskRepository;
            _routerService = routerService;
            _stationMangerRepository = stationMangerRepository;
        }
        public Task Execute(IJobExecutionContext context)
        {
            try
            {
                CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams");
                if (commonStackerCrane != null)
                {
                    if (!commonStackerCrane.IsEventSubscribed)
                    {
                        commonStackerCrane.StackerCraneTaskCompletedEventHandler += CommonStackerCrane_StackerCraneTaskCompletedEventHandler;//订阅任务完成事件
                    }
                    if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal)
                    {
                        commonStackerCrane.CheckStackerCraneTaskCompleted();//防止任务完成事件监测超时,再手动触发一次
                        if (commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby)
                        {
                            Dt_Task? task = GetTask(commonStackerCrane);
                            if (task != null)
                            {
                                StackerCraneTaskCommand? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task);
                                if (stackerCraneTaskCommand != null)
                                {
                                    bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand);
                                    if (sendFlag)
                                    {
                                        commonStackerCrane.LastTaskType = task.TaskType;
                                        _taskService.UpdateTaskStatusToNext(task.TaskNum);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                WriteError(nameof(CommonStackerCraneJob), ex.Message, ex);
            }
            return Task.CompletedTask;
        }
        /// <summary>
        /// ä»»åŠ¡å®Œæˆäº‹ä»¶è®¢é˜…çš„æ–¹æ³•
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CommonStackerCrane_StackerCraneTaskCompletedEventHandler(object? sender, WIDESEAWCS_QuartzJob.StackerCrane.StackerCraneTaskCompletedEventArgs e)
        {
            CommonStackerCrane? commonStackerCrane = sender as CommonStackerCrane;
            if (commonStackerCrane != null)
            {
                if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5)
                {
                    Console.Out.WriteLine("TaskCompleted" + e.TaskNum);
                    _taskService.StackCraneTaskCompleted(e.TaskNum);
                    commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5);
                }
            }
        }
        /// <summary>
        /// èŽ·å–ä»»åŠ¡
        /// </summary>
        /// <param name="commonStackerCrane">堆垛机对象</param>
        /// <returns></returns>
        private Dt_Task? GetTask(CommonStackerCrane commonStackerCrane)
        {
            Dt_Task task;
            if (commonStackerCrane.LastTaskType == null)
            {
                task = _taskService.QueryStackerCraneTask(commonStackerCrane.DeviceCode);
            }
            else
            {
                if (commonStackerCrane.LastTaskType.GetValueOrDefault().GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
                {
                    task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode);
                    if (task == null)
                    {
                        task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode);
                    }
                }
                else
                {
                    task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode);
                    if (task == null)
                    {
                        task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode);
                    }
                }
            }
            if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
            {
                if (OutTaskStationIsOccupied(task) != null || true)
                {
                    return task;
                }
                else
                {
                    List<string> otherOutStaionCodes = _routerService.QueryNextRoutes(commonStackerCrane.DeviceCode, task.NextAddress).Select(x => x.ChildPosi).ToList();
                    List<Dt_Task> tasks = _taskService.QueryStackerCraneOutTasks(commonStackerCrane.DeviceCode, otherOutStaionCodes);
                    foreach (var item in tasks)
                    {
                        if (OutTaskStationIsOccupied(task) != null)
                        {
                            return task;
                        }
                    }
                    task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode);
                }
            }
            return task;
        }
        /// <summary>
        /// å‡ºåº“任务判断出库站台是否被占用
        /// </summary>
        /// <param name="task">任务实体</param>
        /// <returns>如果未被占用,返回传入的任务信息,否则,返回null</returns>
        private Dt_Task? OutTaskStationIsOccupied([NotNull] Dt_Task task)
        {
            Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.TargetAddress && x.StackerCraneCode == task.Roadway);
            if (stationManger != null)
            {
                IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode);
                if (device != null)
                {
                    OtherDevice client = (OtherDevice)device;
                    if (client.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode))//出库站台未被占用
                    {
                        task.TargetAddress = stationManger.StackerCraneStationCode;
                        _taskRepository.UpdateData(task);
                        return task;
                    }
                }
                else
                {
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到出库站台【{stationManger.StationDeviceCode}】对应的通讯对象,无法判断出库站台是否被占用");
                }
            }
            else
            {
                _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到站台【{task.NextAddress}】信息,无法校验站台");
            }
            return null;
        }
        /// <summary>
        /// ä»»åŠ¡å®žä½“è½¬æ¢æˆå‘½ä»¤Model
        /// </summary>
        /// <param name="task">任务实体</param>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        public StackerCraneTaskCommand? ConvertToStackerCraneTaskCommand([NotNull] Dt_Task task)
        {
            StackerCraneTaskCommand stackerCraneTaskCommand = new StackerCraneTaskCommand();
            stackerCraneTaskCommand.Barcode = task.PalletCode;
            stackerCraneTaskCommand.TaskNum = task.TaskNum;
            stackerCraneTaskCommand.WorkType = 1;
            stackerCraneTaskCommand.TrayType = 1;
            if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//判断是否是入库任务
            {
                //List<Dt_Router> routers = _routerService.QueryNextRoutes(task.CurrentAddress, task.Roadway);
                //if (routers.Count > 0)
                //{
                string[] startCodes = task.CurrentAddress.Split("-");
                stackerCraneTaskCommand.StartRow = Convert.ToInt16(startCodes[0]);
                stackerCraneTaskCommand.StartColumn = Convert.ToInt16(startCodes[1]);
                stackerCraneTaskCommand.StartLayer = Convert.ToInt16(startCodes[2]);
                string[] targetCodes = task.NextAddress.Split("-");
                if (targetCodes.Length == 3)
                {
                    stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]);
                    stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]);
                    stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]);
                }
                else
                {
                    //数据配置错误
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"入库任务终点错误,起点:【{task.NextAddress}】");
                    return null;
                }
                //}
                //else
                //{
                //    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到站台【{task.NextAddress}】信息,无法获取对应的堆垛机取货站台信息");
                //    return null;
                //}
            }
            else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
            {
                //List<Dt_Router> routers = _routerService.QueryNextRoutes(task.Roadway, task.TargetAddress);
                //if (routers.Count > 0)
                {
                    string[] targetCodes = task.NextAddress.Split("-");
                    stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]);
                    stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]);
                    stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]);
                    string[] sourceCodes = task.CurrentAddress.Split("-");
                    if (sourceCodes.Length == 3)
                    {
                        stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]);
                        stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]);
                        stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]);
                    }
                    else
                    {
                        //数据配置错误
                        _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"出库任务起点错误,起点:【{task.CurrentAddress}】");
                        return null;
                    }
                }
                //else
                //{
                //    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到站台【{task.NextAddress}】信息,无法获取对应的堆垛机放货站台信息");
                //    return null;
                //}
            }
            else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup)
            {
                string[] targetCodes = task.NextAddress.Split("-");
                if (targetCodes.Length == 3)
                {
                    stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]);
                    stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]);
                    stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]);
                }
                else
                {
                    //数据配置错误
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"移库任务终点错误,起点:【{task.NextAddress}】");
                    return null;
                }
                string[] sourceCodes = task.CurrentAddress.Split("-");
                if (sourceCodes.Length == 3)
                {
                    stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]);
                    stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]);
                    stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]);
                }
                else
                {
                    //数据配置错误
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"移库任务起点错误,起点:【{task.CurrentAddress}】");
                    return null;
                }
            }
            return stackerCraneTaskCommand;
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ÓÍÄ«²Ö/StackerCraneJob_YM.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,303 @@
using Microsoft.AspNetCore.Components.Routing;
using Quartz;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core.Enums;
using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_QuartzJob.DeviceBase;
using WIDESEAWCS_QuartzJob.Models;
using WIDESEAWCS_QuartzJob.Service;
using WIDESEAWCS_QuartzJob.StackerCrane.Enum;
using WIDESEAWCS_Tasks.HoisterJob;
using WIDESEAWCS_Tasks.StackerCraneJob;
using WIDESEAWCS_Tasks.阻焊仓;
namespace WIDESEAWCS_Tasks
{
    [DisallowConcurrentExecution]
    public class StackerCraneJob_YM : JobBase, IJob
    {
        private readonly ITaskService _taskService;
        private readonly ITaskExecuteDetailService _taskExecuteDetailService;
        private readonly ITaskRepository _taskRepository;
        private readonly IRouterService _routerService;
        private readonly IStationMangerRepository _stationMangerRepository;
        public StackerCraneJob_YM(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository)
        {
            _taskService = taskService;
            _taskExecuteDetailService = taskExecuteDetailService;
            _taskRepository = taskRepository;
            _routerService = routerService;
            _stationMangerRepository = stationMangerRepository;
        }
        public Task Execute(IJobExecutionContext context)
        {
            try
            {
                CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams");
                if (commonStackerCrane != null)
                {
                    if (!commonStackerCrane.IsEventSubscribed)
                    {
                        commonStackerCrane.StackerCraneTaskCompletedEventHandler += CommonStackerCrane_StackerCraneTaskCompletedEventHandler;//订阅任务完成事件
                    }
                    if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal)
                    {
                        commonStackerCrane.CheckStackerCraneTaskCompleted();//防止任务完成事件监测超时,再手动触发一次
                        if (commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby)
                        {
                            Dt_Task? task = GetTask(commonStackerCrane);
                            if (task != null)
                            {
                                StackerCraneTaskCommand? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task);
                                if (stackerCraneTaskCommand != null)
                                {
                                    bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand);
                                    if (sendFlag)
                                    {
                                        commonStackerCrane.LastTaskType = task.TaskType;
                                        _taskService.UpdateTaskStatusToNext(task.TaskNum);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                WriteError(nameof(CommonStackerCraneJob), ex.Message, ex);
            }
            return Task.CompletedTask;
        }
        /// <summary>
        /// ä»»åŠ¡å®Œæˆäº‹ä»¶è®¢é˜…çš„æ–¹æ³•
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CommonStackerCrane_StackerCraneTaskCompletedEventHandler(object? sender, WIDESEAWCS_QuartzJob.StackerCrane.StackerCraneTaskCompletedEventArgs e)
        {
            CommonStackerCrane? commonStackerCrane = sender as CommonStackerCrane;
            if (commonStackerCrane != null)
            {
                if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5)
                {
                    Console.Out.WriteLine("TaskCompleted" + e.TaskNum);
                    _taskService.StackCraneTaskCompleted(e.TaskNum);
                    commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5);
                }
            }
        }
        /// <summary>
        /// èŽ·å–ä»»åŠ¡
        /// </summary>
        /// <param name="commonStackerCrane">堆垛机对象</param>
        /// <returns></returns>
        private Dt_Task? GetTask(CommonStackerCrane commonStackerCrane)
        {
            Dt_Task task;
            if (commonStackerCrane.LastTaskType == null)
            {
                task = _taskService.QueryStackerCraneTask(commonStackerCrane.DeviceCode);
            }
            else
            {
                if (commonStackerCrane.LastTaskType.GetValueOrDefault().GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
                {
                    task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode);
                    if (task == null)
                    {
                        task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode);
                    }
                }
                else
                {
                    task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode);
                    if (task == null)
                    {
                        task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode);
                    }
                }
            }
            if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
            {
                if (OutTaskStationIsOccupied(task) != null || true)
                {
                    return task;
                }
                else
                {
                    List<string> otherOutStaionCodes = _routerService.QueryNextRoutes(commonStackerCrane.DeviceCode, task.NextAddress).Select(x => x.ChildPosi).ToList();
                    List<Dt_Task> tasks = _taskService.QueryStackerCraneOutTasks(commonStackerCrane.DeviceCode, otherOutStaionCodes);
                    foreach (var item in tasks)
                    {
                        if (OutTaskStationIsOccupied(task) != null)
                        {
                            return task;
                        }
                    }
                    task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode);
                }
            }
            return task;
        }
        /// <summary>
        /// å‡ºåº“任务判断出库站台是否被占用
        /// </summary>
        /// <param name="task">任务实体</param>
        /// <returns>如果未被占用,返回传入的任务信息,否则,返回null</returns>
        private Dt_Task? OutTaskStationIsOccupied([NotNull] Dt_Task task)
        {
            Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.TargetAddress && x.StackerCraneCode == task.Roadway);
            if (stationManger != null)
            {
                IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode);
                if (device != null)
                {
                    OtherDevice client = (OtherDevice)device;
                    if (client.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode))//出库站台未被占用
                    {
                        task.TargetAddress = stationManger.StackerCraneStationCode;
                        _taskRepository.UpdateData(task);
                        return task;
                    }
                }
                else
                {
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到出库站台【{stationManger.StationDeviceCode}】对应的通讯对象,无法判断出库站台是否被占用");
                }
            }
            else
            {
                _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到站台【{task.NextAddress}】信息,无法校验站台");
            }
            return null;
        }
        /// <summary>
        /// ä»»åŠ¡å®žä½“è½¬æ¢æˆå‘½ä»¤Model
        /// </summary>
        /// <param name="task">任务实体</param>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        public StackerCraneTaskCommand? ConvertToStackerCraneTaskCommand([NotNull] Dt_Task task)
        {
            StackerCraneTaskCommand stackerCraneTaskCommand = new StackerCraneTaskCommand();
            stackerCraneTaskCommand.Barcode = task.PalletCode;
            stackerCraneTaskCommand.TaskNum = task.TaskNum;
            stackerCraneTaskCommand.WorkType = 1;
            stackerCraneTaskCommand.TrayType = 1;
            if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//判断是否是入库任务
            {
                //List<Dt_Router> routers = _routerService.QueryNextRoutes(task.CurrentAddress, task.Roadway);
                //if (routers.Count > 0)
                //{
                string[] startCodes = task.CurrentAddress.Split("-");
                stackerCraneTaskCommand.StartRow = Convert.ToInt16(startCodes[0]);
                stackerCraneTaskCommand.StartColumn = Convert.ToInt16(startCodes[1]);
                stackerCraneTaskCommand.StartLayer = Convert.ToInt16(startCodes[2]);
                string[] targetCodes = task.NextAddress.Split("-");
                if (targetCodes.Length == 3)
                {
                    stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]);
                    stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]);
                    stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]);
                }
                else
                {
                    //数据配置错误
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"入库任务终点错误,起点:【{task.NextAddress}】");
                    return null;
                }
                //}
                //else
                //{
                //    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到站台【{task.NextAddress}】信息,无法获取对应的堆垛机取货站台信息");
                //    return null;
                //}
            }
            else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
            {
                //List<Dt_Router> routers = _routerService.QueryNextRoutes(task.Roadway, task.TargetAddress);
                //if (routers.Count > 0)
                {
                    string[] targetCodes = task.NextAddress.Split("-");
                    stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]);
                    stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]);
                    stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]);
                    string[] sourceCodes = task.CurrentAddress.Split("-");
                    if (sourceCodes.Length == 3)
                    {
                        stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]);
                        stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]);
                        stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]);
                    }
                    else
                    {
                        //数据配置错误
                        _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"出库任务起点错误,起点:【{task.CurrentAddress}】");
                        return null;
                    }
                }
                //else
                //{
                //    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到站台【{task.NextAddress}】信息,无法获取对应的堆垛机放货站台信息");
                //    return null;
                //}
            }
            else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup)
            {
                string[] targetCodes = task.NextAddress.Split("-");
                if (targetCodes.Length == 3)
                {
                    stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]);
                    stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]);
                    stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]);
                }
                else
                {
                    //数据配置错误
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"移库任务终点错误,起点:【{task.NextAddress}】");
                    return null;
                }
                string[] sourceCodes = task.CurrentAddress.Split("-");
                if (sourceCodes.Length == 3)
                {
                    stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]);
                    stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]);
                    stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]);
                }
                else
                {
                    //数据配置错误
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"移库任务起点错误,起点:【{task.CurrentAddress}】");
                    return null;
                }
            }
            return stackerCraneTaskCommand;
        }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/²âÊԼܲÖ/StackerCraneJob_CSJ.cs
@@ -208,9 +208,6 @@
            stackerCraneTaskCommand.TrayType = 1;
            if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//判断是否是入库任务
            {
                //List<Dt_Router> routers = _routerService.QueryNextRoutes(task.CurrentAddress, task.Roadway);
                //if (routers.Count > 0)
                //{
                string[] startCodes = task.CurrentAddress.Split("-");
                stackerCraneTaskCommand.StartRow = Convert.ToInt16(startCodes[0]);
@@ -230,17 +227,8 @@
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"入库任务终点错误,起点:【{task.NextAddress}】");
                    return null;
                }
                //}
                //else
                //{
                //    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到站台【{task.NextAddress}】信息,无法获取对应的堆垛机取货站台信息");
                //    return null;
                //}
            }
            else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
            {
                //List<Dt_Router> routers = _routerService.QueryNextRoutes(task.Roadway, task.TargetAddress);
                //if (routers.Count > 0)
                {
                    string[] targetCodes = task.NextAddress.Split("-");
@@ -261,12 +249,6 @@
                        _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"出库任务起点错误,起点:【{task.CurrentAddress}】");
                        return null;
                    }
                }
                //else
                //{
                //    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到站台【{task.NextAddress}】信息,无法获取对应的堆垛机放货站台信息");
                //    return null;
                //}
            }
            else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup)
            {
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/012f25e8-74cc-4271-80f7-3993d746a5bd.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/0f2de342-959b-4075-9776-5b88fd484124.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/2877cb87-c685-49b7-a63b-30bdbb709bbd.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/43c5884a-259b-409f-9f97-bec930af24db.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/4b9d13b5-464a-47d4-8dae-9937d5273cc6.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/5023b4f8-50f2-4301-b3ca-8d83fa478bdc.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/5697cb23-9f2e-4eb6-ba02-077734b9a84e.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/60b56cfe-9fa4-4dcb-a205-bd29744252b2.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/9b53cffc-065b-40ee-a779-a99d0cdd29b8.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/bb9c5c98-5de4-43c8-8a36-34ad166b9c7a.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/d6701bb1-0090-4502-a2ca-a4e0726e92d8.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/ffdc57a2-11a0-4784-96ef-3f73a9839656.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs
@@ -23,12 +23,14 @@
    public partial class LocationInfoService : ServiceBase<Dt_LocationInfo, ILocationInfoRepository>, ILocationInfoService
    {
        private readonly IUnitOfWorkManage _unitOfWorkManage;
        private readonly IBasicRepository _basicRepository;
        public ILocationInfoRepository Repository => BaseDal;
        public LocationInfoService(ILocationInfoRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal)
        public LocationInfoService(ILocationInfoRepository BaseDal, IUnitOfWorkManage unitOfWorkManage, IBasicRepository basicRepository) : base(BaseDal)
        {
            _unitOfWorkManage = unitOfWorkManage;
            _basicRepository = basicRepository;
        }
        /// <summary>
@@ -129,7 +131,7 @@
                                Layer = k + 1,
                                LocationStatus = LocationStatusEnum.Free.ObjToInt(),
                                LocationType = LocationTypeEnum.Undefined.ObjToInt(),
                                RoadwayNo = $"R{initializationLocationDTO.Roadway.ToString()}",
                                RoadwayNo = $"{initializationLocationDTO.Roadway.ToString()}",
                                Row = i + 1,
                                Depth = depth,
                            };
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,174 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.CommonEnum;
using WIDESEA_Common.LocationEnum;
using WIDESEA_Core.BaseServices;
using WIDESEA_Core.Helper;
using WIDESEA_IBasicRepository;
using WIDESEA_IBasicService;
using WIDESEA_Model.Models;
namespace WIDESEA_BasicService
{
    public partial class LocationInfoService
    {
        double weightValue_BC = 0.25;
        private readonly static object _locker_BC = new object();
        static List<LocationCache> locationCaches_BC = new List<LocationCache>();
        /// <summary>
        /// æ¿æä»“货位分配
        /// </summary>
        /// <param name="roadwayNo">巷道号</param>
        /// <param name="palletType">
        /// æ‰˜ç›˜ç±»åž‹
        /// </param>
        /// <returns></returns>
        public Dt_LocationInfo? AssignLocation_BC(string roadwayNo, PalletTypeEnum palletType, string beRelocationCode = "")
        {
            lock (_locker_BC)
            {
                List<LocationCache> removeItems = locationCaches_BC.Where(x => (DateTime.Now - x.DateTime).TotalMinutes > 5).ToList();
                int count = removeItems.Count;
                for (int i = 0; i < count; i++)
                {
                    locationCaches_BC.Remove(removeItems[i]);
                }
                List<string> lockLocationCodes = locationCaches_BC.Select(x => x.LocationCode).ToList();
                List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => x.RoadwayNo == roadwayNo);
                if (locationInfos == null || locationInfos.Count == 0)
                {
                    throw new Exception($"未找到该巷道的货位信息,巷道号:{roadwayNo}");
                }
                if (!string.IsNullOrEmpty(beRelocationCode))
                {
                    Dt_LocationInfo? beRelocation = locationInfos.FirstOrDefault(x => x.LocationCode == beRelocationCode);
                    if (beRelocation == null)
                    {
                        throw new Exception($"未找到货位信息");
                    }
                    int maxDepth = locationInfos.Max(x => x.Depth);
                    int mathCurrentRow = beRelocation.Row - Convert.ToInt32(Math.Ceiling(beRelocation.Row / maxDepth / 2.0)) * maxDepth * 2;
                    if (mathCurrentRow <= maxDepth)
                    {
                        locationInfos = locationInfos.Where(x => x.Row - Convert.ToInt32(Math.Ceiling(x.Row / maxDepth / 2.0)) * maxDepth * 2 <= maxDepth).ToList();
                    }
                    else
                    {
                        locationInfos = locationInfos.Where(x => x.Row - Convert.ToInt32(Math.Ceiling(x.Row / maxDepth / 2.0)) * maxDepth * 2 > maxDepth).ToList();
                    }
                }
                //已定义货位类型的货位
                List<Dt_LocationInfo> definedTypeLocations = locationInfos.Where(x => x.LocationType == palletType.ObjToInt()).ToList();
                //未定义类型的空货位
                List<Dt_LocationInfo> undefinedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == LocationTypeEnum.Undefined.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Column).ToList();
                List<Dt_LocationInfo> definedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == palletType.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Column).ToList();
                if ((locationInfos.Count * weightValue_BC >= definedTypeLocations.Count && undefinedTypeEmptyLocations.Any()) || !definedTypeEmptyLocations.Any())//如果已定义类型货位未超过比例,且有未定义类型的货位
                {
                    if (palletType == PalletTypeEnum.LargePallet || palletType == PalletTypeEnum.LargestPallet)
                    {
                        undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Depth % 2 == 1).ToList();
                    }
                    for (int i = 0; i < undefinedTypeEmptyLocations.Count; i++)
                    {
                        Dt_LocationInfo undefinedTypeEmptyLocation = undefinedTypeEmptyLocations[i];
                        Dt_LocationInfo? locationInfo = GetUsableLocation_BC(locationInfos, undefinedTypeEmptyLocation, palletType);
                        if (locationInfo != null)
                        {
                            UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3);
                            locationCaches_BC.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
                            return locationInfo;
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < definedTypeEmptyLocations.Count; i++)
                    {
                        Dt_LocationInfo definedTypeEmptyLocation = definedTypeEmptyLocations[i];
                        Dt_LocationInfo? locationInfo = GetUsableLocation_BC(locationInfos, definedTypeEmptyLocation, palletType);
                        if (locationInfo != null)
                        {
                            UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3);
                            locationCaches_BC.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
                            return locationInfo;
                        }
                    }
                }
                return null;
            }
        }
        /// <summary>
        /// èŽ·å–å¯ç”¨è´§ä½(测试架仓)
        /// </summary>
        /// <param name="locationInfos"></param>
        /// <param name="emptyLocation"></param>
        /// <param name="palletType"></param>
        /// <returns></returns>
        private Dt_LocationInfo? GetUsableLocation_BC(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, PalletTypeEnum palletType)
        {
            switch (palletType)
            {
                case PalletTypeEnum.LargestPallet:
                case PalletTypeEnum.LargePallet:
                    if (emptyLocation.Depth % 2 == 0)
                    {
                        return null;
                    }
                    break;
            }
            Dt_LocationInfo? locationInfo = DepthLocationIsEmpty_BC(locationInfos, emptyLocation, palletType);
            if (locationInfo != null)
            {
                return locationInfo;
            }
            return null;
        }
        /// <summary>
        /// åˆ¤æ–­ä¸åŒæ·±åº¦çš„同组货位状态是否为空闲空位(测试架仓)
        /// </summary>
        /// <param name="locationInfos"></param>
        /// <param name="emptyLocation"></param>
        /// <returns></returns>
        private Dt_LocationInfo? DepthLocationIsEmpty_BC(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, PalletTypeEnum palletType)
        {
            List<Dt_LocationInfo> locations = GetGroupLocations(locationInfos, emptyLocation);
            bool moreDepthFlag = false;
            bool littleDepthFlag = false;
            switch (palletType)
            {
                case PalletTypeEnum.LargestPallet:
                case PalletTypeEnum.LargePallet:
                    List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList();
                    moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && x.LocationStatus != LocationStatusEnum.PalletLock.ObjToInt()) == null;//查询大于当前货位深度的集合里是否有状态不为有货的货位,如果是true,则表示深货位有未被使用的情况
                    List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList();
                    littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.OnlyIn.ObjToInt() && x.EnableStatus != EnableStatusEnum.Normal.ObjToInt()) == null; //查询小于当前货位深度的集合里是否有状态不为空,且禁用状态不为禁用以及只入的货位,如果是true,则表示浅货位被使用或者被禁用的情况
                    break;
            }
            if (moreDepthFlag && littleDepthFlag)
            {
                return emptyLocation;
            }
            return null;
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_CSJ.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,199 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.CommonEnum;
using WIDESEA_Common.LocationEnum;
using WIDESEA_Core.BaseServices;
using WIDESEA_Core.Helper;
using WIDESEA_IBasicRepository;
using WIDESEA_IBasicService;
using WIDESEA_Model.Models;
namespace WIDESEA_BasicService
{
    public partial class LocationInfoService
    {
        double weightValue_CSJ = 0.25;
        private readonly static object _locker_CSJ = new object();
        static List<LocationCache> locationCaches_CSJ = new List<LocationCache>();
        /// <summary>
        /// æµ‹è¯•架仓货位分配 <br/>
        /// æ‰˜ç›˜ç±»åž‹ï¼š <br/>
        /// 1:最长 <br/>
        /// 2:长 <br/>
        /// 3:中等 <br/>
        /// 4:短 <br/>
        /// 3和4都是3深,且可以混放。 <br/>
        /// 1和2都是2深,且可以混放。 <br/>
        /// ç§»åº“时只能是同侧货位。
        /// </summary>
        /// <param name="roadwayNo">巷道号</param>
        /// <param name="palletType">
        /// æ‰˜ç›˜ç±»åž‹ <br/>
        /// 1:最长 <br/>
        /// 2:长 <br/>
        /// 3:中等 <br/>
        /// 4:短
        /// </param>
        /// <returns></returns>
        public Dt_LocationInfo? AssignLocation_CSJ(string roadwayNo, PalletTypeEnum palletType, string beRelocationCode = "")
        {
            lock (_locker_CSJ)
            {
                List<LocationCache> removeItems = locationCaches_CSJ.Where(x => (DateTime.Now - x.DateTime).TotalMinutes > 5).ToList();
                int count = removeItems.Count;
                for (int i = 0; i < count; i++)
                {
                    locationCaches_CSJ.Remove(removeItems[i]);
                }
                List<string> lockLocationCodes = locationCaches_CSJ.Select(x => x.LocationCode).ToList();
                List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => x.RoadwayNo == roadwayNo);
                if (locationInfos == null || locationInfos.Count == 0)
                {
                    throw new Exception($"未找到该巷道的货位信息,巷道号:{roadwayNo}");
                }
                if (!string.IsNullOrEmpty(beRelocationCode))
                {
                    Dt_LocationInfo? beRelocation = locationInfos.FirstOrDefault(x => x.LocationCode == beRelocationCode);
                    if (beRelocation == null)
                    {
                        throw new Exception($"未找到货位信息");
                    }
                    int maxDepth = locationInfos.Max(x => x.Depth);
                    int mathCurrentRow = beRelocation.Row - Convert.ToInt32(Math.Ceiling(beRelocation.Row / maxDepth / 2.0)) * maxDepth * 2;
                    if (mathCurrentRow <= maxDepth)
                    {
                        locationInfos = locationInfos.Where(x => x.Row - Convert.ToInt32(Math.Ceiling(x.Row / maxDepth / 2.0)) * maxDepth * 2 <= maxDepth).ToList();
                    }
                    else
                    {
                        locationInfos = locationInfos.Where(x => x.Row - Convert.ToInt32(Math.Ceiling(x.Row / maxDepth / 2.0)) * maxDepth * 2 > maxDepth).ToList();
                    }
                }
                //已定义货位类型的货位
                List<Dt_LocationInfo> definedTypeLocations = locationInfos.Where(x => x.LocationType == palletType.ObjToInt()).ToList();
                //未定义类型的空货位
                List<Dt_LocationInfo> undefinedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == LocationTypeEnum.Undefined.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Column).ToList();
                List<Dt_LocationInfo> definedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == palletType.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Column).ToList();
                if ((locationInfos.Count * weightValue_CSJ >= definedTypeLocations.Count && undefinedTypeEmptyLocations.Any()) || !definedTypeEmptyLocations.Any())//如果已定义类型货位未超过比例,且有未定义类型的货位
                {
                    if (palletType == PalletTypeEnum.LargePallet || palletType == PalletTypeEnum.LargestPallet)
                    {
                        undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Depth % 2 == 1).ToList();
                    }
                    for (int i = 0; i < undefinedTypeEmptyLocations.Count; i++)
                    {
                        Dt_LocationInfo undefinedTypeEmptyLocation = undefinedTypeEmptyLocations[i];
                        Dt_LocationInfo? locationInfo = GetUsableLocation_CSJ(locationInfos, undefinedTypeEmptyLocation, palletType);
                        if (locationInfo != null)
                        {
                            UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3);
                            locationCaches_CSJ.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
                            return locationInfo;
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < definedTypeEmptyLocations.Count; i++)
                    {
                        Dt_LocationInfo definedTypeEmptyLocation = definedTypeEmptyLocations[i];
                        Dt_LocationInfo? locationInfo = GetUsableLocation_CSJ(locationInfos, definedTypeEmptyLocation, palletType);
                        if (locationInfo != null)
                        {
                            UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3);
                            locationCaches_CSJ.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
                            return locationInfo;
                        }
                    }
                }
                return null;
            }
        }
        /// <summary>
        /// èŽ·å–å¯ç”¨è´§ä½(测试架仓)
        /// </summary>
        /// <param name="locationInfos"></param>
        /// <param name="emptyLocation"></param>
        /// <param name="palletType"></param>
        /// <returns></returns>
        private Dt_LocationInfo? GetUsableLocation_CSJ(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, PalletTypeEnum palletType)
        {
            switch (palletType)
            {
                case PalletTypeEnum.LargestPallet:
                case PalletTypeEnum.LargePallet:
                    if (emptyLocation.Depth % 2 == 0)
                    {
                        return null;
                    }
                    break;
            }
            Dt_LocationInfo? locationInfo = DepthLocationIsEmpty_CSJ(locationInfos, emptyLocation, palletType);
            if (locationInfo != null)
            {
                return locationInfo;
            }
            return null;
        }
        /// <summary>
        /// åˆ¤æ–­ä¸åŒæ·±åº¦çš„同组货位状态是否为空闲空位(测试架仓)
        /// </summary>
        /// <param name="locationInfos"></param>
        /// <param name="emptyLocation"></param>
        /// <returns></returns>
        private Dt_LocationInfo? DepthLocationIsEmpty_CSJ(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, PalletTypeEnum palletType)
        {
            List<Dt_LocationInfo> locations = GetGroupLocations(locationInfos, emptyLocation);
            bool moreDepthFlag = false;
            bool littleDepthFlag = false;
            switch (palletType)
            {
                case PalletTypeEnum.LargestPallet:
                case PalletTypeEnum.LargePallet:
                    {
                        List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList();
                        moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && x.LocationStatus != LocationStatusEnum.PalletLock.ObjToInt()) == null;//查询大于当前货位深度的集合里是否有状态不为有货的货位,如果是true,则表示深货位有未被使用的情况
                        List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList();
                        littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.OnlyIn.ObjToInt() && x.EnableStatus != EnableStatusEnum.Normal.ObjToInt()) == null; //查询小于当前货位深度的集合里是否有状态不为空,且禁用状态不为禁用以及只入的货位,如果是true,则表示浅货位被使用或者被禁用的情况
                    }
                    break;
                case PalletTypeEnum.MediumPallet:
                case PalletTypeEnum.SmallPallet:
                    {
                        List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList();
                        moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt()) == null;//查询大于当前货位深度的集合里是否有状态不为有货的货位,如果是true,则表示深货位有未被使用的情况
                        List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList();
                        littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.OnlyIn.ObjToInt() && x.EnableStatus != EnableStatusEnum.Normal.ObjToInt()) == null; //查询小于当前货位深度的集合里是否有状态不为空,且禁用状态不为禁用以及只入的货位,如果是true,则表示浅货位被使用或者被禁用的情况
                    }
                    break;
            }
            if (moreDepthFlag && littleDepthFlag)
            {
                return emptyLocation;
            }
            return null;
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_GM.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,174 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.CommonEnum;
using WIDESEA_Common.LocationEnum;
using WIDESEA_Core.BaseServices;
using WIDESEA_Core.Helper;
using WIDESEA_IBasicRepository;
using WIDESEA_IBasicService;
using WIDESEA_Model.Models;
namespace WIDESEA_BasicService
{
    public partial class LocationInfoService
    {
        double weightValue_GM = 0.25;
        private readonly static object _locker_GM = new object();
        static List<LocationCache> locationCaches_GM = new List<LocationCache>();
        /// <summary>
        /// å¹²è†œä»“货位分配
        /// </summary>
        /// <param name="roadwayNo">巷道号</param>
        /// <param name="palletType">
        /// æ‰˜ç›˜ç±»åž‹
        /// </param>
        /// <returns></returns>
        public Dt_LocationInfo? AssignLocation_GM(string roadwayNo, PalletTypeEnum palletType, string beRelocationCode = "")
        {
            lock (_locker_GM)
            {
                List<LocationCache> removeItems = locationCaches_GM.Where(x => (DateTime.Now - x.DateTime).TotalMinutes > 5).ToList();
                int count = removeItems.Count;
                for (int i = 0; i < count; i++)
                {
                    locationCaches_GM.Remove(removeItems[i]);
                }
                List<string> lockLocationCodes = locationCaches_GM.Select(x => x.LocationCode).ToList();
                List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => x.RoadwayNo == roadwayNo);
                if (locationInfos == null || locationInfos.Count == 0)
                {
                    throw new Exception($"未找到该巷道的货位信息,巷道号:{roadwayNo}");
                }
                if (!string.IsNullOrEmpty(beRelocationCode))
                {
                    Dt_LocationInfo? beRelocation = locationInfos.FirstOrDefault(x => x.LocationCode == beRelocationCode);
                    if (beRelocation == null)
                    {
                        throw new Exception($"未找到货位信息");
                    }
                    int maxDepth = locationInfos.Max(x => x.Depth);
                    int mathCurrentRow = beRelocation.Row - Convert.ToInt32(Math.Ceiling(beRelocation.Row / maxDepth / 2.0)) * maxDepth * 2;
                    if (mathCurrentRow <= maxDepth)
                    {
                        locationInfos = locationInfos.Where(x => x.Row - Convert.ToInt32(Math.Ceiling(x.Row / maxDepth / 2.0)) * maxDepth * 2 <= maxDepth).ToList();
                    }
                    else
                    {
                        locationInfos = locationInfos.Where(x => x.Row - Convert.ToInt32(Math.Ceiling(x.Row / maxDepth / 2.0)) * maxDepth * 2 > maxDepth).ToList();
                    }
                }
                //已定义货位类型的货位
                List<Dt_LocationInfo> definedTypeLocations = locationInfos.Where(x => x.LocationType == palletType.ObjToInt()).ToList();
                //未定义类型的空货位
                List<Dt_LocationInfo> undefinedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == LocationTypeEnum.Undefined.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Column).ToList();
                List<Dt_LocationInfo> definedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == palletType.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Column).ToList();
                if ((locationInfos.Count * weightValue_GM >= definedTypeLocations.Count && undefinedTypeEmptyLocations.Any()) || !definedTypeEmptyLocations.Any())//如果已定义类型货位未超过比例,且有未定义类型的货位
                {
                    if (palletType == PalletTypeEnum.LargePallet || palletType == PalletTypeEnum.LargestPallet)
                    {
                        undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Depth % 2 == 1).ToList();
                    }
                    for (int i = 0; i < undefinedTypeEmptyLocations.Count; i++)
                    {
                        Dt_LocationInfo undefinedTypeEmptyLocation = undefinedTypeEmptyLocations[i];
                        Dt_LocationInfo? locationInfo = GetUsableLocation_GM(locationInfos, undefinedTypeEmptyLocation, palletType);
                        if (locationInfo != null)
                        {
                            UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3);
                            locationCaches_GM.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
                            return locationInfo;
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < definedTypeEmptyLocations.Count; i++)
                    {
                        Dt_LocationInfo definedTypeEmptyLocation = definedTypeEmptyLocations[i];
                        Dt_LocationInfo? locationInfo = GetUsableLocation_GM(locationInfos, definedTypeEmptyLocation, palletType);
                        if (locationInfo != null)
                        {
                            UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3);
                            locationCaches_GM.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
                            return locationInfo;
                        }
                    }
                }
                return null;
            }
        }
        /// <summary>
        /// èŽ·å–å¯ç”¨è´§ä½(测试架仓)
        /// </summary>
        /// <param name="locationInfos"></param>
        /// <param name="emptyLocation"></param>
        /// <param name="palletType"></param>
        /// <returns></returns>
        private Dt_LocationInfo? GetUsableLocation_GM(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, PalletTypeEnum palletType)
        {
            switch (palletType)
            {
                case PalletTypeEnum.LargestPallet:
                case PalletTypeEnum.LargePallet:
                    if (emptyLocation.Depth % 2 == 0)
                    {
                        return null;
                    }
                    break;
            }
            Dt_LocationInfo? locationInfo = DepthLocationIsEmpty_GM(locationInfos, emptyLocation, palletType);
            if (locationInfo != null)
            {
                return locationInfo;
            }
            return null;
        }
        /// <summary>
        /// åˆ¤æ–­ä¸åŒæ·±åº¦çš„同组货位状态是否为空闲空位(测试架仓)
        /// </summary>
        /// <param name="locationInfos"></param>
        /// <param name="emptyLocation"></param>
        /// <returns></returns>
        private Dt_LocationInfo? DepthLocationIsEmpty_GM(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, PalletTypeEnum palletType)
        {
            List<Dt_LocationInfo> locations = GetGroupLocations(locationInfos, emptyLocation);
            bool moreDepthFlag = false;
            bool littleDepthFlag = false;
            switch (palletType)
            {
                case PalletTypeEnum.LargestPallet:
                case PalletTypeEnum.LargePallet:
                    List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList();
                    moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && x.LocationStatus != LocationStatusEnum.PalletLock.ObjToInt()) == null;//查询大于当前货位深度的集合里是否有状态不为有货的货位,如果是true,则表示深货位有未被使用的情况
                    List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList();
                    littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.OnlyIn.ObjToInt() && x.EnableStatus != EnableStatusEnum.Normal.ObjToInt()) == null; //查询小于当前货位深度的集合里是否有状态不为空,且禁用状态不为禁用以及只入的货位,如果是true,则表示浅货位被使用或者被禁用的情况
                    break;
            }
            if (moreDepthFlag && littleDepthFlag)
            {
                return emptyLocation;
            }
            return null;
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_PP.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,174 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.CommonEnum;
using WIDESEA_Common.LocationEnum;
using WIDESEA_Core.BaseServices;
using WIDESEA_Core.Helper;
using WIDESEA_IBasicRepository;
using WIDESEA_IBasicService;
using WIDESEA_Model.Models;
namespace WIDESEA_BasicService
{
    public partial class LocationInfoService
    {
        double weightValue_PP = 0.25;
        private readonly static object _locker_PP = new object();
        static List<LocationCache> locationCaches_PP = new List<LocationCache>();
        /// <summary>
        /// PP仓货位分配
        /// </summary>
        /// <param name="roadwayNo">巷道号</param>
        /// <param name="palletType">
        /// æ‰˜ç›˜ç±»åž‹
        /// </param>
        /// <returns></returns>
        public Dt_LocationInfo? AssignLocation_PP(string roadwayNo, PalletTypeEnum palletType, string beRelocationCode = "")
        {
            lock (_locker_PP)
            {
                List<LocationCache> removeItems = locationCaches_PP.Where(x => (DateTime.Now - x.DateTime).TotalMinutes > 5).ToList();
                int count = removeItems.Count;
                for (int i = 0; i < count; i++)
                {
                    locationCaches_PP.Remove(removeItems[i]);
                }
                List<string> lockLocationCodes = locationCaches_PP.Select(x => x.LocationCode).ToList();
                List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => x.RoadwayNo == roadwayNo);
                if (locationInfos == null || locationInfos.Count == 0)
                {
                    throw new Exception($"未找到该巷道的货位信息,巷道号:{roadwayNo}");
                }
                if (!string.IsNullOrEmpty(beRelocationCode))
                {
                    Dt_LocationInfo? beRelocation = locationInfos.FirstOrDefault(x => x.LocationCode == beRelocationCode);
                    if (beRelocation == null)
                    {
                        throw new Exception($"未找到货位信息");
                    }
                    int maxDepth = locationInfos.Max(x => x.Depth);
                    int mathCurrentRow = beRelocation.Row - Convert.ToInt32(Math.Ceiling(beRelocation.Row / maxDepth / 2.0)) * maxDepth * 2;
                    if (mathCurrentRow <= maxDepth)
                    {
                        locationInfos = locationInfos.Where(x => x.Row - Convert.ToInt32(Math.Ceiling(x.Row / maxDepth / 2.0)) * maxDepth * 2 <= maxDepth).ToList();
                    }
                    else
                    {
                        locationInfos = locationInfos.Where(x => x.Row - Convert.ToInt32(Math.Ceiling(x.Row / maxDepth / 2.0)) * maxDepth * 2 > maxDepth).ToList();
                    }
                }
                //已定义货位类型的货位
                List<Dt_LocationInfo> definedTypeLocations = locationInfos.Where(x => x.LocationType == palletType.ObjToInt()).ToList();
                //未定义类型的空货位
                List<Dt_LocationInfo> undefinedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == LocationTypeEnum.Undefined.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Column).ToList();
                List<Dt_LocationInfo> definedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == palletType.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Column).ToList();
                if ((locationInfos.Count * weightValue_PP >= definedTypeLocations.Count && undefinedTypeEmptyLocations.Any()) || !definedTypeEmptyLocations.Any())//如果已定义类型货位未超过比例,且有未定义类型的货位
                {
                    if (palletType == PalletTypeEnum.LargePallet || palletType == PalletTypeEnum.LargestPallet)
                    {
                        undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Depth % 2 == 1).ToList();
                    }
                    for (int i = 0; i < undefinedTypeEmptyLocations.Count; i++)
                    {
                        Dt_LocationInfo undefinedTypeEmptyLocation = undefinedTypeEmptyLocations[i];
                        Dt_LocationInfo? locationInfo = GetUsableLocation_PP(locationInfos, undefinedTypeEmptyLocation, palletType);
                        if (locationInfo != null)
                        {
                            UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3);
                            locationCaches_PP.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
                            return locationInfo;
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < definedTypeEmptyLocations.Count; i++)
                    {
                        Dt_LocationInfo definedTypeEmptyLocation = definedTypeEmptyLocations[i];
                        Dt_LocationInfo? locationInfo = GetUsableLocation_PP(locationInfos, definedTypeEmptyLocation, palletType);
                        if (locationInfo != null)
                        {
                            UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3);
                            locationCaches_PP.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
                            return locationInfo;
                        }
                    }
                }
                return null;
            }
        }
        /// <summary>
        /// èŽ·å–å¯ç”¨è´§ä½(测试架仓)
        /// </summary>
        /// <param name="locationInfos"></param>
        /// <param name="emptyLocation"></param>
        /// <param name="palletType"></param>
        /// <returns></returns>
        private Dt_LocationInfo? GetUsableLocation_PP(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, PalletTypeEnum palletType)
        {
            switch (palletType)
            {
                case PalletTypeEnum.LargestPallet:
                case PalletTypeEnum.LargePallet:
                    if (emptyLocation.Depth % 2 == 0)
                    {
                        return null;
                    }
                    break;
            }
            Dt_LocationInfo? locationInfo = DepthLocationIsEmpty_PP(locationInfos, emptyLocation, palletType);
            if (locationInfo != null)
            {
                return locationInfo;
            }
            return null;
        }
        /// <summary>
        /// åˆ¤æ–­ä¸åŒæ·±åº¦çš„同组货位状态是否为空闲空位(测试架仓)
        /// </summary>
        /// <param name="locationInfos"></param>
        /// <param name="emptyLocation"></param>
        /// <returns></returns>
        private Dt_LocationInfo? DepthLocationIsEmpty_PP(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, PalletTypeEnum palletType)
        {
            List<Dt_LocationInfo> locations = GetGroupLocations(locationInfos, emptyLocation);
            bool moreDepthFlag = false;
            bool littleDepthFlag = false;
            switch (palletType)
            {
                case PalletTypeEnum.LargestPallet:
                case PalletTypeEnum.LargePallet:
                    List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList();
                    moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && x.LocationStatus != LocationStatusEnum.PalletLock.ObjToInt()) == null;//查询大于当前货位深度的集合里是否有状态不为有货的货位,如果是true,则表示深货位有未被使用的情况
                    List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList();
                    littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.OnlyIn.ObjToInt() && x.EnableStatus != EnableStatusEnum.Normal.ObjToInt()) == null; //查询小于当前货位深度的集合里是否有状态不为空,且禁用状态不为禁用以及只入的货位,如果是true,则表示浅货位被使用或者被禁用的情况
                    break;
            }
            if (moreDepthFlag && littleDepthFlag)
            {
                return emptyLocation;
            }
            return null;
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_ZH.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,174 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.CommonEnum;
using WIDESEA_Common.LocationEnum;
using WIDESEA_Core.BaseServices;
using WIDESEA_Core.Helper;
using WIDESEA_IBasicRepository;
using WIDESEA_IBasicService;
using WIDESEA_Model.Models;
namespace WIDESEA_BasicService
{
    public partial class LocationInfoService
    {
        double weightValue_ZH = 0.25;
        private readonly static object _locker_ZH = new object();
        static List<LocationCache> locationCaches_ZH = new List<LocationCache>();
        /// <summary>
        /// é˜»ç„Šä»“货位分配
        /// </summary>
        /// <param name="roadwayNo">巷道号</param>
        /// <param name="palletType">
        /// æ‰˜ç›˜ç±»åž‹
        /// </param>
        /// <returns></returns>
        public Dt_LocationInfo? AssignLocation_ZH(string roadwayNo, PalletTypeEnum palletType, string beRelocationCode = "")
        {
            lock (_locker_ZH)
            {
                List<LocationCache> removeItems = locationCaches_ZH.Where(x => (DateTime.Now - x.DateTime).TotalMinutes > 5).ToList();
                int count = removeItems.Count;
                for (int i = 0; i < count; i++)
                {
                    locationCaches_ZH.Remove(removeItems[i]);
                }
                List<string> lockLocationCodes = locationCaches_ZH.Select(x => x.LocationCode).ToList();
                List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => x.RoadwayNo == roadwayNo);
                if (locationInfos == null || locationInfos.Count == 0)
                {
                    throw new Exception($"未找到该巷道的货位信息,巷道号:{roadwayNo}");
                }
                if (!string.IsNullOrEmpty(beRelocationCode))
                {
                    Dt_LocationInfo? beRelocation = locationInfos.FirstOrDefault(x => x.LocationCode == beRelocationCode);
                    if (beRelocation == null)
                    {
                        throw new Exception($"未找到货位信息");
                    }
                    int maxDepth = locationInfos.Max(x => x.Depth);
                    int mathCurrentRow = beRelocation.Row - Convert.ToInt32(Math.Ceiling(beRelocation.Row / maxDepth / 2.0)) * maxDepth * 2;
                    if (mathCurrentRow <= maxDepth)
                    {
                        locationInfos = locationInfos.Where(x => x.Row - Convert.ToInt32(Math.Ceiling(x.Row / maxDepth / 2.0)) * maxDepth * 2 <= maxDepth).ToList();
                    }
                    else
                    {
                        locationInfos = locationInfos.Where(x => x.Row - Convert.ToInt32(Math.Ceiling(x.Row / maxDepth / 2.0)) * maxDepth * 2 > maxDepth).ToList();
                    }
                }
                //已定义货位类型的货位
                List<Dt_LocationInfo> definedTypeLocations = locationInfos.Where(x => x.LocationType == palletType.ObjToInt()).ToList();
                //未定义类型的空货位
                List<Dt_LocationInfo> undefinedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == LocationTypeEnum.Undefined.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Column).ToList();
                List<Dt_LocationInfo> definedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == palletType.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Column).ToList();
                if ((locationInfos.Count * weightValue_ZH >= definedTypeLocations.Count && undefinedTypeEmptyLocations.Any()) || !definedTypeEmptyLocations.Any())//如果已定义类型货位未超过比例,且有未定义类型的货位
                {
                    if (palletType == PalletTypeEnum.LargePallet || palletType == PalletTypeEnum.LargestPallet)
                    {
                        undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Depth % 2 == 1).ToList();
                    }
                    for (int i = 0; i < undefinedTypeEmptyLocations.Count; i++)
                    {
                        Dt_LocationInfo undefinedTypeEmptyLocation = undefinedTypeEmptyLocations[i];
                        Dt_LocationInfo? locationInfo = GetUsableLocation_ZH(locationInfos, undefinedTypeEmptyLocation, palletType);
                        if (locationInfo != null)
                        {
                            UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3);
                            locationCaches_ZH.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
                            return locationInfo;
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < definedTypeEmptyLocations.Count; i++)
                    {
                        Dt_LocationInfo definedTypeEmptyLocation = definedTypeEmptyLocations[i];
                        Dt_LocationInfo? locationInfo = GetUsableLocation_ZH(locationInfos, definedTypeEmptyLocation, palletType);
                        if (locationInfo != null)
                        {
                            UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3);
                            locationCaches_ZH.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
                            return locationInfo;
                        }
                    }
                }
                return null;
            }
        }
        /// <summary>
        /// èŽ·å–å¯ç”¨è´§ä½(测试架仓)
        /// </summary>
        /// <param name="locationInfos"></param>
        /// <param name="emptyLocation"></param>
        /// <param name="palletType"></param>
        /// <returns></returns>
        private Dt_LocationInfo? GetUsableLocation_ZH(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, PalletTypeEnum palletType)
        {
            switch (palletType)
            {
                case PalletTypeEnum.LargestPallet:
                case PalletTypeEnum.LargePallet:
                    if (emptyLocation.Depth % 2 == 0)
                    {
                        return null;
                    }
                    break;
            }
            Dt_LocationInfo? locationInfo = DepthLocationIsEmpty_ZH(locationInfos, emptyLocation, palletType);
            if (locationInfo != null)
            {
                return locationInfo;
            }
            return null;
        }
        /// <summary>
        /// åˆ¤æ–­ä¸åŒæ·±åº¦çš„同组货位状态是否为空闲空位(测试架仓)
        /// </summary>
        /// <param name="locationInfos"></param>
        /// <param name="emptyLocation"></param>
        /// <returns></returns>
        private Dt_LocationInfo? DepthLocationIsEmpty_ZH(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, PalletTypeEnum palletType)
        {
            List<Dt_LocationInfo> locations = GetGroupLocations(locationInfos, emptyLocation);
            bool moreDepthFlag = false;
            bool littleDepthFlag = false;
            switch (palletType)
            {
                case PalletTypeEnum.LargestPallet:
                case PalletTypeEnum.LargePallet:
                    List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList();
                    moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && x.LocationStatus != LocationStatusEnum.PalletLock.ObjToInt()) == null;//查询大于当前货位深度的集合里是否有状态不为有货的货位,如果是true,则表示深货位有未被使用的情况
                    List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList();
                    littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.OnlyIn.ObjToInt() && x.EnableStatus != EnableStatusEnum.Normal.ObjToInt()) == null; //查询小于当前货位深度的集合里是否有状态不为空,且禁用状态不为禁用以及只入的货位,如果是true,则表示浅货位被使用或者被禁用的情况
                    break;
            }
            if (moreDepthFlag && littleDepthFlag)
            {
                return emptyLocation;
            }
            return null;
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService.cs
@@ -21,8 +21,15 @@
namespace WIDESEA_BasicService
{
    public partial class LocationInfoService : ServiceBase<Dt_LocationInfo, ILocationInfoRepository>, ILocationInfoService
    public class LocationInfoService_Old
    {
        private readonly ILocationInfoRepository Repository;
        public LocationInfoService_Old(ILocationInfoRepository repository)
        {
            Repository = repository;
        }
        double weightValue = 0.5;
        private readonly static object _locker = new object();
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,174 @@
using AutoMapper;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
using WIDESEA_Core.Enums;
using WIDESEA_Core.Helper;
using WIDESEA_Core.Utilities;
using WIDESEA_DTO.Basic;
using WIDESEA_IBasicRepository;
using WIDESEA_IRecordService;
using WIDESEA_IBasicService;
using WIDESEA_Model.Models;
using WIDESEA_Common.CommonEnum;
using WIDESEA_Common.LocationEnum;
namespace WIDESEA_BasicService
{
    public partial class LocationInfoService
    {
        public Dt_LocationInfo? AssignLocation(string roadwayNo, PalletTypeEnum palletType, int warehouseId)
        {
            Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == warehouseId);
            if (warehouse == null)
            {
                throw new Exception($"未找到仓库信息");
            }
            return warehouse.WarehouseName switch
            {
                "板材仓" => AssignLocation_BC(roadwayNo, palletType),
                "PP仓" => AssignLocation_PP(roadwayNo, palletType),
                "干膜仓" => AssignLocation_GM(roadwayNo, palletType),
                "测试架仓" => AssignLocation_CSJ(roadwayNo, palletType),
                "阻焊仓" => AssignLocation_ZH(roadwayNo, palletType),
                "油墨仓" => AssignLocation(roadwayNo),
                "成品仓" => AssignLocation(roadwayNo),
                "辅料仓" => AssignLocation(roadwayNo),
                _ => throw new Exception($"未找到仓库货位分配方法")
            };
        }
        private readonly static object _locker = new object();
        private static List<LocationCache> locationCaches = new List<LocationCache>();
        /// <summary>
        ///
        /// </summary>
        /// <param name="roadwayNo"></param>
        /// <returns></returns>
        public Dt_LocationInfo? AssignLocation(string roadwayNo)
        {
            lock (_locker)
            {
                List<LocationCache> removeItems = locationCaches.Where(x => (DateTime.Now - x.DateTime).TotalMinutes > 5).ToList();//查询添加静态变量超过5分钟的货位
                int count = removeItems.Count;
                for (int i = 0; i < count; i++)
                {
                    locationCaches.Remove(removeItems[i]);//移除查询添加静态变量超过5分钟的货位
                }
                List<string> lockLocations = locationCaches.Select(x => x.LocationCode).ToList();
                List<Dt_LocationInfo> locationInfos = BaseDal.QueryData(x => x.RoadwayNo == roadwayNo);//查询巷道所有货位信息
                Dictionary<string, OrderByType> orderBy = new Dictionary<string, OrderByType>()
                {
                    { nameof(Dt_LocationInfo.Layer),OrderByType.Asc },
                    { nameof(Dt_LocationInfo.Column),OrderByType.Asc },
                    { nameof(Dt_LocationInfo.Depth),OrderByType.Desc },
                    { nameof(Dt_LocationInfo.Row),OrderByType.Asc }
                };
                return BaseDal.QueryFirst(x => x.RoadwayNo == roadwayNo && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && !lockLocations.Contains(x.LocationCode), orderBy);//查询空货位信息并排除5分钟内分配的货位,根据层、列、深度、行排序
            }
        }
        /// <summary>
        /// ä¿®æ”¹è´§ä½çŠ¶æ€åŠç±»åž‹
        /// </summary>
        /// <param name="locationCode">货位编号</param>
        /// <param name="palletType">托盘类型</param>
        /// <param name="locationStatus">货位状态</param>
        public void UpdateLocationStatus(string locationCode, PalletTypeEnum palletType, LocationStatusEnum locationStatus, int warehousId)
        {
            Dt_LocationInfo location = Repository.QueryFirst(x => x.LocationCode == locationCode);
            if (location == null)
            {
                throw new Exception($"未找到货位信息,{locationCode}");
            }
            UpdateLocationStatus(location, palletType, locationStatus, warehousId);
        }
        /// <summary>
        /// ä¿®æ”¹è´§ä½çŠ¶æ€åŠç±»åž‹
        /// </summary>
        /// <param name="location">货位对象</param>
        /// <param name="palletType">托盘类型</param>
        /// <param name="locationStatus">货位状态</param>
        public void UpdateLocationStatus(Dt_LocationInfo location, PalletTypeEnum palletType, LocationStatusEnum locationStatus, int warehousId)
        {
            List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => x.RoadwayNo == location.RoadwayNo);
            List<Dt_LocationInfo> locations = GetGroupLocations(locationInfos, location);
            if (locationInfos.Max(x => x.Depth) < 3)
            {
                for (int i = 0; i < locations.Count; i++)
                {
                    locations[i].LocationStatus = locationStatus.ObjToInt();
                    locations[i].LocationType = palletType.ObjToInt();
                }
                Dt_LocationInfo? nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Column == location.Column + 1);
                if (nearLocation != null)
                {
                    List<Dt_LocationInfo> nearLocations = GetGroupLocations(locationInfos, nearLocation);
                    for (int i = 0; i < nearLocations.Count; i++)
                    {
                        nearLocations[i].LocationType = palletType.ObjToInt();
                        if (palletType == PalletTypeEnum.LargePallet)
                        {
                            nearLocations[i].LocationStatus = locationStatus.ObjToInt();
                        }
                    }
                    locations.AddRange(nearLocations);
                }
            }
            else
            {
                for (int i = 0; i < locations.Count; i++)
                {
                    locations[i].LocationStatus = locationStatus.ObjToInt();
                    locations[i].LocationType = palletType.ObjToInt();
                }
            }
            Repository.UpdateData(locations);
        }
        /// <summary>
        /// èŽ·å–ä¸åŒæ·±åº¦çš„åŒç»„è´§ä½ä¿¡æ¯
        /// </summary>
        /// <param name="locationInfos"></param>
        /// <param name="location"></param>
        /// <returns></returns>
        private List<Dt_LocationInfo> GetGroupLocations(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo location)
        {
            List<Dt_LocationInfo> groupLocations = new List<Dt_LocationInfo>() { location };
            int maxDepth = locationInfos.Max(x => x.Depth);
            for (int j = location.Depth + 1; j <= maxDepth; j++)
            {
                Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer);
                if (locationInfo != null)
                {
                    groupLocations.Add(locationInfo);
                }
            }
            for (int j = location.Depth - 1; j >= 1; j--)
            {
                Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer);
                if (locationInfo != null)
                {
                    groupLocations.Add(locationInfo);
                }
            }
            return groupLocations;
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/WIDESEA_BasicService.csproj
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Common/CommonEnum/PalletTypeEnum.cs
@@ -22,5 +22,10 @@
        /// å¤§æ‰˜ç›˜
        /// </summary>
        LargePallet = 3,
        /// <summary>
        /// æœ€å¤§æ‰˜ç›˜
        /// </summary>
        LargestPallet = 4
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Common/LocationEnum/LocationStatusEnum.cs
@@ -27,18 +27,12 @@
        /// æœ‰è´§
        /// </summary>
        [Description("有货")]
        InStock = 2,
        InStock = 100,
        /// <summary>
        /// ç©ºæ‰˜é”å®š
        /// å¤§æ‰˜ç›˜é”å®š
        /// </summary>
        [Description("空托锁定")]
        PalletLock = 98,
        /// <summary>
        /// ç©ºæ‰˜ç›˜
        /// </summary>
        [Description("空托盘")]
        Pallet = 99
        [Description("大托盘锁定")]
        PalletLock = 99
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskEnumHelper.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEA_Common.TaskEnum
{
    public static class TaskEnumHelper
    {
        public static List<int> GetEnumIndexList(this Type type)
        {
            if (type is null) throw new ArgumentNullException("type");
            if (!type.IsEnum) return new List<int>();
            return Enum.GetValues(type).Cast<int>().ToList();
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskInStatusEnum.cs
ÎļþÃû´Ó ´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/InTaskStatusEnum.cs ÐÞ¸Ä
@@ -10,13 +10,19 @@
    /// <summary>
    /// å…¥åº“任务状态
    /// </summary>
    public enum InTaskStatusEnum
    public enum TaskInStatusEnum
    {
        /// <summary>
        /// æ–°å»ºå…¥åº“任务
        /// </summary>
        [Description("新建")]
        InNew = 200,
        /// <summary>
        /// å †åž›æœºå¾…执行
        /// </summary>
        [Description("堆垛机待执行")]
        SC_InExecute = 225,
        /// <summary>
        /// å †åž›æœºå…¥åº“执行中
@@ -47,35 +53,5 @@
        /// </summary>
        [Description("入库任务异常")]
        InException = 299,
        /// <summary>
        /// æ–°å»ºç§»åº“任务
        /// </summary>
        [Description("新建移库任务")]
        RelocationNew = 300,
        /// <summary>
        /// ç§»åº“任务完成
        /// </summary>
        [Description("移库任务完成")]
        RelocationFinish = 310,
        /// <summary>
        /// ç§»åº“任务执行中
        /// </summary>
        [Description("移库任务执行中")]
        RelocationExecuting = 320,
        /// <summary>
        /// ç§»åº“任务取消
        /// </summary>
        [Description("移库任务取消")]
        RelocationCancel = 330,
        /// <summary>
        /// ç§»åº“任务异常
        /// </summary>
        [Description("移库任务异常")]
        RelocationException = 340,
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskOutStatusEnum.cs
ÎļþÃû´Ó ´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/OutTaskStatusEnum.cs ÐÞ¸Ä
@@ -10,7 +10,7 @@
    /// <summary>
    /// å‡ºåº“任务状态
    /// </summary>
    public enum OutTaskStatusEnum
    public enum TaskOutStatusEnum
    {
        /// <summary>
        /// æ–°å»ºä»»åŠ¡
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs
@@ -7,102 +7,70 @@
namespace WIDESEA_Common.TaskEnum
{
    /// <summary>
    /// ä»»åŠ¡ç±»åž‹
    /// </summary>
    public enum TaskTypeEnum
    public enum TaskInboundTypeEnum
    {
        /// <summary>
        /// å‡ºåº“ =100
        /// </summary>
        [Description("出库")]
        Outbound = 100,
        /// <summary>
        /// ç›˜ç‚¹å‡ºåº“
        /// </summary>
        [Description("盘点出库")]
        OutInventory = 101,
        /// <summary>
        /// åˆ†æ‹£å‡ºåº“
        /// </summary>
        [Description("分拣出库")]
        OutPick = 102,
        /// <summary>
        /// è´¨æ£€å‡ºåº“
        /// </summary>
        [Description("质检出库")]
        OutQuality = 103,
        /// <summary>
        /// å‡ºç©º
        /// </summary>
        [Description("出空")]
        PalletOutbound = 104,
        /// <summary>
        /// è¡¥ç©º
        /// </summary>
        [Description("补空")]
        PalletFillOutbound = 105,
        /// <summary>
        /// å…¥åº“
        /// </summary>
        [Description("入库")]
        Inbound = 200,
        /// <summary>
        /// ç›˜ç‚¹å…¥åº“
        /// </summary>
        [Description("盘点入库")]
        InInventory = 201,
        /// <summary>
        /// åˆ†æ‹£å…¥åº“
        /// </summary>
        [Description("分拣入库")]
        InPick = 202,
        /// <summary>
        /// è´¨æ£€å…¥åº“
        /// </summary>
        [Description("质检入库")]
        InQuality = 203,
        InQuality = 203
    }
    public enum TaskOutboundTypeEnum
    {
        /// <summary>
        /// å…¥ç©º
        /// å‡ºåº“
        /// </summary>
        [Description("入空")]
        PalletInbound = 204,
        [Description("出库")]
        Outbound = 100,
        /// <summary>
        /// å›žç©º
        /// ç›˜ç‚¹å‡ºåº“
        /// </summary>
        [Description("回空")]
        PalletReturnInbound = 205,
        [Description("盘点出库")]
        OutInventory = 101,
        /// <summary>
        /// ç§»åº“
        /// åˆ†æ‹£å‡ºåº“
        /// </summary>
        [Description("移库")]
        Relocation = 300,
        [Description("分拣出库")]
        OutPick = 102,
        /// <summary>
        /// è´¨æ£€å‡ºåº“
        /// </summary>
        [Description("质检出库")]
        OutQuality = 103,
    }
    public enum TaskRelocationTypeEnum
    {
        /// <summary>
        /// åº“内移库
        /// </summary>
        [Description("库内移库")]
        RelocationIn = 301,
        Relocation = 300,
        /// <summary>
        /// åº“外移库
        /// </summary>
        [Description("库外移库")]
        RelocationOut = 302,
        RelocationIn = 301
    }
        [Description("AGV搬运")]
        AGVCarry = 500,
    public enum TaskOtherTypeEnum
    {
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs
@@ -20,9 +20,11 @@
                string result = string.Empty;
                using HttpClient httpClient = new HttpClient();
                httpClient.Timeout = new TimeSpan(0, 0, 60);
                if (headers != null)
                {
                foreach (var header in headers)
                    httpClient.DefaultRequestHeaders.Add(header.Key, header.Value);
                }
                result = await httpClient.GetAsync(serviceAddress).Result.Content.ReadAsStringAsync();
                return result;
@@ -44,9 +46,11 @@
                    httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
                    using HttpClient httpClient = new HttpClient();
                    httpClient.Timeout = new TimeSpan(0, 0, 60);
                    if (headers != null)
                    {
                    foreach (var header in headers)
                        httpClient.DefaultRequestHeaders.Add(header.Key, header.Value);
                    }
                    result = await httpClient.PostAsync(serviceAddress, httpContent).Result.Content.ReadAsStringAsync();
                }
@@ -66,9 +70,11 @@
                string result = string.Empty;
                using HttpClient httpClient = new HttpClient();
                httpClient.Timeout = new TimeSpan(0, 0, 60);
                if (headers != null)
                {
                foreach (var header in headers)
                    httpClient.DefaultRequestHeaders.Add(header.Key, header.Value);
                }
                result = httpClient.GetStringAsync(serviceAddress).Result;
                return result;
@@ -91,8 +97,12 @@
                    using HttpClient httpClient = new HttpClient();
                    httpClient.Timeout = new TimeSpan(0, 0, 60);
                    if (headers != null)
                    {
                    foreach (var header in headers)
                        httpClient.DefaultRequestHeaders.Add(header.Key, header.Value);
                    }
                    result = httpClient.PostAsync(serviceAddress, httpContent).Result.Content.ReadAsStringAsync().Result;
                }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpResponseContent.cs
@@ -8,24 +8,13 @@
namespace WIDESEA_DTO
{
    /// <summary>
    ///
    /// </summary>
    [ModelValidate]
    public class ErpResponseContent
    {
        public class content
        {
            /// <summary>
            ///
            /// </summary>
            public string Code { get; set; }
            /// <summary>
            ///
            /// </summary>
            public string Name { get; set; }
            /// <summary>
            ///
            /// </summary>
            public string ShortName { get; set; }
        }
        //public class Root
        //{
@@ -48,7 +37,7 @@
        /// <summary>
        /// 
        /// </summary>
        public content Content { get; set; }
        public Content Content { get; set; }
        //}
        public static ErpResponseContent Instance
        {
@@ -70,4 +59,23 @@
            return this;
        }
    }
    /// <summary>
    ///
    /// </summary>
    public class Content
    {
        /// <summary>
        ///
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string ShortName { get; set; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/MesResponseContent.cs
@@ -7,6 +7,9 @@
namespace WIDESEA_DTO
{
    /// <summary>
    ///
    /// </summary>
    [ModelValidate]
    public class MesResponseContent
    {
@@ -26,30 +29,6 @@
        /// 
        /// </summary>
        public DateTime DataTime { get; set; }
        /// <summary>
        ///
        /// </summary>
        public content Content { get; set; }
        public class content
        {
            /// <summary>
            ///
            /// </summary>
            public string Code { get; set; }
            /// <summary>
            ///
            /// </summary>
            public string Name { get; set; }
            /// <summary>
            ///
            /// </summary>
            public string ShortName { get; set; }
            /// <summary>
            ///
            /// </summary>
            public string Contacts { get; set; }
        }
        public static MesResponseContent Instance
        {
@@ -71,5 +50,7 @@
            StrMsg = message == null ? "执行失败" : message;
            return this;
        }
        public Content Content { get; set; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEA_DTO.Task
{
    public class WMSTaskDTO
    {
        /// <summary>
        /// WMS任务主键
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// ä»»åŠ¡å·
        /// </summary>
        public int TaskNum { get; set; }
        /// <summary>
        /// æ‰˜ç›˜å·
        /// </summary>
        public string PalletCode { get; set; }
        /// <summary>
        /// å··é“号
        /// </summary>
        public string RoadWay { get; set; }
        /// <summary>
        /// ä»»åŠ¡ç±»åž‹
        /// </summary>
        public int TaskType { get; set; }
        /// <summary>
        /// ä»»åŠ¡çŠ¶æ€
        /// </summary>
        public int TaskStatus { get; set; }
        /// <summary>
        /// èµ·ç‚¹
        /// </summary>
        public string SourceAddress { get; set; }
        /// <summary>
        /// ç»ˆç‚¹
        /// </summary>
        public string TargetAddress { get; set; }
        /// <summary>
        /// ä¼˜å…ˆçº§
        /// </summary>
        public int Grade { get; set; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/ILocationInfoService.cs
@@ -58,7 +58,7 @@
        /// <param name="roadwayNo">巷道号</param>
        /// <param name="palletType">托盘类型</param>
        /// <returns></returns>
        Dt_LocationInfo? AssignLocation(string roadwayNo, PalletTypeEnum palletType);
        Dt_LocationInfo? AssignLocation(string roadwayNo, PalletTypeEnum palletType, int warehouseId);
        /// <summary>
        /// ä¿®æ”¹è´§ä½çŠ¶æ€åŠç±»åž‹
@@ -66,7 +66,7 @@
        /// <param name="locationCode">货位编号</param>
        /// <param name="palletType">托盘类型</param>
        /// <param name="locationStatus">货位状态</param>
        void UpdateLocationStatus(string locationCode, PalletTypeEnum palletType, LocationStatusEnum locationStatus);
        void UpdateLocationStatus(string locationCode, PalletTypeEnum palletType, LocationStatusEnum locationStatus, int warehousId);
        /// <summary>
        /// ä¿®æ”¹è´§ä½çŠ¶æ€åŠç±»åž‹
@@ -74,6 +74,6 @@
        /// <param name="location">货位对象</param>
        /// <param name="palletType">托盘类型</param>
        /// <param name="locationStatus">货位状态</param>
        void UpdateLocationStatus(Dt_LocationInfo location, PalletTypeEnum palletType, LocationStatusEnum locationStatus);
        void UpdateLocationStatus(Dt_LocationInfo location, PalletTypeEnum palletType, LocationStatusEnum locationStatus, int warehousId);
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IStockRepository/IStockInfoRepository.cs
@@ -26,7 +26,5 @@
        List<Dt_StockInfo> GetStockInfosExclude(string materielCode, List<string> palletCodes);
        bool UpdateDataWithDetail(Dt_StockInfo stockInfo);
        Dt_StockInfo GetPalletStockInfo(string roadwayNo);
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs
@@ -22,6 +22,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.CommonEnum;
using WIDESEA_Core;
using WIDESEA_Core.BaseServices;
using WIDESEA_Core.Enums;
@@ -38,8 +39,30 @@
    {
        ITaskRepository Repository { get; }
        WebResponseContent PushTasksToWCS();
        /// <summary>
        /// ç”³è¯·å…¥åº“任务(PDA使用,仅托盘绑定入库站台,不分配货位)
        /// </summary>
        /// <param name="palletCode">托盘号</param>
        /// <param name="stationCode">站台号</param>
        /// <returns></returns>
        WebResponseContent RequestInboundTask(string palletCode, string stationCode);
        /// <summary>
        /// å…¥åº“任务申请分配货位
        /// </summary>
        /// <param name="taskNum">任务号</param>
        /// <param name="roadwayNo">巷道号</param>
        /// <param name="palletType">托盘类型</param>
        /// <returns></returns>
        WebResponseContent AssignInboundTaskLocation(int taskNum, string roadwayNo);
        /// <summary>
        ///
        /// </summary>
        /// <param name="taskNum"></param>
        /// <returns></returns>
        WebResponseContent InboundTaskCompleted(int taskNum);
        /// <summary>
        /// æµ‹è¯•架出仓
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_ApprovalFlow.cs
@@ -8,18 +8,33 @@
namespace WIDESEA_Model.Models
{
    /// <summary>
    /// å®¡æ‰¹æµç¨‹è¡¨
    /// </summary>
    [SugarTable(nameof(Dt_ApprovalFlow), "审批流程表")]
    public class Dt_ApprovalFlow : BaseEntity
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "审批流程编号,主键")]
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// å®¡æ‰¹æµç¨‹ç¼–号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "审批流程编号")]
        public string FlowCode {  get; set; }
        /// <summary>
        /// å®¡æ‰¹æµç¨‹åç§°
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "审批流程名称")]
        public string FlowName { get; set; }
        /// <summary>
        /// å®¡æ‰¹æµç¨‹æè¿°
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "审批流程描述")]
        public string FlowDes { get; set; }
    }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_ApprovalNode.cs
@@ -8,24 +8,45 @@
namespace WIDESEA_Model.Models
{
    /// <summary>
    /// å®¡æ‰¹èŠ‚ç‚¹è¡¨
    /// </summary>
    [SugarTable(nameof(Dt_ApprovalNode), "审批节点表")]
    public class Dt_ApprovalNode : BaseEntity
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "审批节点编号,主键")]
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// å®¡æ‰¹æµç¨‹ç¼–号
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "审批流程编号,外键")]
        public int FlowId { get; set; }
        /// <summary>
        /// å®¡æ‰¹èŠ‚ç‚¹åç§°
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "审批节点名称")]
        public string NodeName { get; set; }
        /// <summary>
        /// èŠ‚ç‚¹ç±»åž‹ï¼ˆå¦‚å•äººå®¡æ‰¹ã€å¤šäººå®¡æ‰¹ã€ä¼šç­¾ç­‰ï¼‰
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "节点类型(如单人审批、多人审批、会签等)")]
        public int NodeType { get; set; }
        /// <summary>
        /// å®¡æ‰¹äººè§’色(如部门经理、总经理等)
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "审批人角色(如部门经理、总经理等)")]
        public int ApproverRole { get; set; }
        /// <summary>
        /// èŠ‚ç‚¹é¡ºåº
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "节点顺序")]
        public int NodeSequence { get; set; }
    }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_ApprovalTask.cs
@@ -8,6 +8,9 @@
namespace WIDESEA_Model.Models
{
    /// <summary>
    /// å®¡æ‰¹ä»»åŠ¡è¡¨
    /// </summary>
    [SugarTable(nameof(Dt_ApprovalTask), "审批任务表")]
    public class Dt_ApprovalTask : BaseEntity
    {
@@ -60,9 +63,9 @@
        public string AuditUser { get; set; }
        /// <summary>
        ///
        /// æ¥æºä¸»é”®
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "")]
        [SugarColumn(IsNullable = false, ColumnDescription = "来源主键")]
        public int SourceKey { get; set; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_NodeTransition.cs
@@ -8,18 +8,33 @@
namespace WIDESEA_Model.Models
{
    /// <summary>
    /// èŠ‚ç‚¹è·³è½¬è¡¨
    /// </summary>
    [SugarTable(nameof(Dt_NodeTransition), "节点跳转表")]
    public class Dt_NodeTransition : BaseEntity
    {
        /// <summary>
        /// è·³è½¬ç¼–号
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "跳转编号,主键")]
        public int Id { get; set; }
        /// <summary>
        /// èµ·å§‹èŠ‚ç‚¹ç¼–å·
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "起始节点编号,外键")]
        public int FromNodeId { get; set; }
        /// <summary>
        /// ç›®æ ‡èŠ‚ç‚¹ç¼–å·
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "目标节点编号,外键")]
        public int ToNodeId { get; set; }
        /// <summary>
        /// è·³è½¬æ¡ä»¶ï¼ˆå¦‚“同意则跳转到下一节点”,“拒绝则结束流程”等)
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 200, ColumnDescription = "跳转条件(如“同意则跳转到下一节点”,“拒绝则结束流程”等)")]
        public string Condition { get; set; }
    }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_CustomerInfo.cs
@@ -8,26 +8,36 @@
namespace WIDESEA_Model.Models
{
    /// <summary>
    /// å®¢æˆ·ä¿¡æ¯
    /// </summary>
    [SugarTable(nameof(Dt_CustomerInfo),"客户信息")]
    public class Dt_CustomerInfo : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// å®¢æˆ·ç¼–码
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "客户编码")]
        public string Code { get; set; }
        /// <summary>
        /// å®¢æˆ·åç§°
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "客户名称")]
        public string Name { get; set; }
        /// <summary>
        /// å®¢æˆ·å…¨ç§°
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 100, ColumnDescription = "客户全称")]
        public string NickName { get; set; }
        /// <summary>
        /// å®¢æˆ·çŠ¶æ€ 0:禁用 1:可用
        /// </summary>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_LocationInfo.cs
@@ -8,49 +8,88 @@
namespace WIDESEA_Model.Models
{
    /// <summary>
    /// è´§ä½ä¿¡æ¯
    /// </summary>
    [SugarTable(nameof(Dt_LocationInfo), "货位信息")]
    public class Dt_LocationInfo : BaseEntity, BaseWarehouseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// ä»“库编号
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "仓库编号")]
        public int WarehouseId { get; set; }
        /// <summary>
        /// è´§ä½ç¼–号
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "货位编号")]
        public string LocationCode {  get; set; }
        /// <summary>
        /// è´§ä½åç§°
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "货位名称")]
        public string LocationName { get; set; }
        /// <summary>
        /// å··é“编号
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "巷道编号")]
        public string RoadwayNo {  get; set; }
        /// <summary>
        /// è´§ä½è¡Œ
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "货位行")]
        public int Row {  get; set; }
        /// <summary>
        /// è´§ä½åˆ—
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "货位列")]
        public int Column { get; set; }
        /// <summary>
        /// è´§ä½å±‚
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "货位层")]
        public int Layer {  get; set; }
        /// <summary>
        /// è´§ä½æ·±åº¦
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "货位深度")]
        public int Depth {  get; set; }
        //[SugarColumn(IsNullable = false, ColumnDescription = "左侧/右侧")]
        //public int LocationSide {  get; set; }
        /// <summary>
        /// è´§ä½ç±»åž‹
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "货位类型")]
        public int LocationType {  get; set; }
        /// <summary>
        /// è´§ä½çŠ¶æ€
        /// </summary>
        [SugarColumn(IsNullable = true, DefaultValue = "0", ColumnDescription = "货位状态")]
        public int LocationStatus {  get; set; }
        /// <summary>
        /// ç¦ç”¨çŠ¶æ€
        /// </summary>
        [SugarColumn(IsNullable = true, DefaultValue = "0", ColumnDescription = "禁用状态")]
        public int EnableStatus { get; set; }
        /// <summary>
        /// å¤‡æ³¨
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "备注")]
        public string Remark {  get; set; }
        public int WarehouseId { get ; set  ; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_MaterielInfo.cs
@@ -10,6 +10,9 @@
namespace WIDESEA_Model.Models
{
    /// <summary>
    /// ç‰©æ–™ä¿¡æ¯
    /// </summary>
    [SugarTable(nameof(Dt_MaterielInfo), "物料信息")]
    [SugarIndex("unique_materielinfo_materielcode", nameof(MaterielCode), OrderByType.Asc, true)]
    public class Dt_MaterielInfo : BaseEntity//, BaseWarehouseEntity
@@ -19,6 +22,12 @@
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// ä»“库编号
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "仓库编号")]
        public int WarehouseId { get; set; }
        /// <summary>
        /// ç‰©æ–™ç¼–号
@@ -115,11 +124,5 @@
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "备注")]
        public string Remark { get; set; }
        /// <summary>
        /// ä»“库编号
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "仓库编号")]
        public int WarehouseId { get; set; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_SupplierInfo.cs
@@ -8,39 +8,75 @@
namespace WIDESEA_Model.Models
{
    /// <summary>
    /// ä¾›åº”商信息
    /// </summary>
    [SugarTable(nameof(Dt_SupplierInfo), "供应商信息")]
    public class Dt_SupplierInfo : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// ä¾›åº”商编码
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "供应商编码")]
        public string SupplierCode { get; set; }
        /// <summary>
        /// ä¾›åº”商名称
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "供应商名称")]
        public string SupplierName { get; set; }
        /// <summary>
        /// ä¾›åº”商简称
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "供应商简称")]
        public string SupplierShortName { get; set; }
        /// <summary>
        /// è”系人
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "联系人")]
        public string Contacts { get; set; }
        /// <summary>
        /// è”系电话
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "联系电话")]
        public string ContactNumber { get; set; }
        /// <summary>
        /// è”系地址
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "联系地址")]
        public string ContactAddress { get; set; }
        /// <summary>
        /// ç”µå­é‚®ç®±
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "电子邮箱")]
        public string Email { get; set; }
        /// <summary>
        /// æè¿°
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "描述")]
        public string Description { get; set; }
        /// <summary>
        /// åº“存组织
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "库存组织")]
        public string InvOrgId { get; set; }
        /// <summary>
        /// çŠ¶æ€
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "状态")]
        public int Status { get; set; }
    }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_Warehouse.cs
@@ -8,27 +8,51 @@
namespace WIDESEA_Model.Models
{
    /// <summary>
    /// ä»“库信息
    /// </summary>
    [SugarTable(nameof(Dt_Warehouse), "仓库信息")]
    public class Dt_Warehouse : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int WarehouseId { get; set; }
        /// <summary>
        /// ä»“库编号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "仓库编号")]
        public string WarehouseCode { get; set; }
        /// <summary>
        /// ä»“库名称
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "仓库名称")]
        public string WarehouseName { get; set; }
        /// <summary>
        /// ä»“库类型
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "仓库类型")]
        public string WarehouseType { get; set; }
        /// <summary>
        /// ä»“库状态
        /// </summary>
        [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "仓库状态")]
        public int WarehouseStatus { get; set; }
        /// <summary>
        /// ä»“库描述
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "仓库描述")]
        public string WarehouseDes { get; set; }
        /// <summary>
        /// å¤‡æ³¨
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "备注")]
        public string Remark { get; set; }
    }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Check/Dt_CheckOrder.cs
@@ -10,7 +10,10 @@
namespace WIDESEA_Model.Models
{
    [SugarTable]
    /// <summary>
    /// è´¨æ£€å•
    /// </summary>
    [SugarTable(nameof(Dt_CheckOrder), "质检单")]
    public class Dt_CheckOrder : BaseEntity
    {
        /// <summary>
@@ -32,9 +35,15 @@
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "收货单号")]
        public string ReceiveOrderNo { get; set; }
        /// <summary>
        /// è´¨æ£€å•状态
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "质检单状态")]
        public int CheckOrderStatus { get; set; }
        /// <summary>
        /// å®¡æ‰¹çŠ¶æ€
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "审批状态")]
        public int AuditStatus { get; set; }
@@ -92,9 +101,15 @@
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "特采说明")]
        public string DefectedNote { get; set; }
        /// <summary>
        /// æ£€éªŒäºº
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "检验人")]
        public string CheckUserName { get; set; }
        /// <summary>
        /// è´¨æ£€ç»“æžœ
        /// </summary>
        [Navigate(NavigateType.OneToMany, nameof(Dt_CheckOrderResult.CheckOrderId), nameof(CheckOrderId))]
        public List<Dt_CheckOrderResult> Details { get; set; }
    }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Check/Dt_CheckOrderResult.cs
@@ -8,6 +8,9 @@
namespace WIDESEA_Model.Models
{
    /// <summary>
    /// æ£€éªŒç»“æžœ
    /// </summary>
    [SugarTable(nameof(Dt_CheckOrderResult), "检验结果")]
    public class Dt_CheckOrderResult : BaseEntity
    {
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Config/Dt_AnalysisRuleConfig.cs
@@ -8,30 +8,57 @@
namespace WIDESEA_Model.Models
{
    [SugarTable(nameof(Dt_AnalysisRuleConfig))]
    /// <summary>
    /// ç¼–码解析规则配置
    /// </summary>
    [SugarTable(nameof(Dt_AnalysisRuleConfig),"编码解析规则配置")]
    public class Dt_AnalysisRuleConfig : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// è§„则编号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "规则编号")]
        public string AnalysisCode { get; set; }
        /// <summary>
        /// è§„则名称
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "规则名称")]
        public string AnalysisName { get; set; }
        /// <summary>
        /// å‰ç¼€å­—符串
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "前缀字符串")]
        public string StartStr { get; set; }
        /// <summary>
        /// ç»“束字符串
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "结束字符串")]
        public string EndStr { get; set; }
        /// <summary>
        /// åˆ†å‰²å­—符串
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "分割字符串")]
        public string SplitStr { get; set; }
        /// <summary>
        /// ç¼–码规则
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 100, ColumnDescription = "编码规则")]
        public string Format { get; set; }
        /// <summary>
        /// å¤‡æ³¨
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "备注")]
        public string Remark { get; set; }
    }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Config/Dt_CodeRuleConfig.cs
@@ -8,33 +8,63 @@
namespace WIDESEA_Model.Models
{
    [SugarTable(nameof(Dt_CodeRuleConfig))]
    /// <summary>
    /// ç¼–码生成规则配置
    /// </summary>
    [SugarTable(nameof(Dt_CodeRuleConfig), "编码生成规则配置")]
    public class Dt_CodeRuleConfig : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// è§„则编号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "规则编号")]
        public string RuleCode { get; set; }
        /// <summary>
        /// è§„则名称
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "规则名称")]
        public string RuleName { get; set; }
        /// <summary>
        /// æµæ°´å·èµ·å§‹å€¼
        /// </summary>
        [SugarColumn(IsNullable = false,ColumnDescription ="流水号起始值")]
        public int StartVal { get; set; }
        /// <summary>
        /// å‰ç¼€å­—符串
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 2, ColumnDescription = "前缀字符串")]
        public string StartStr { get; set; }
        /// <summary>
        /// ç¼–码规则
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "编码规则")]
        public string Format { get; set; }
        /// <summary>
        /// æµæ°´å·é•¿åº¦
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "流水号长度")]
        public int Length { get; set; }
        /// <summary>
        /// æµæ°´å·å½“前值
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "流水号当前值")]
        public int CurrentVal { get; set; }
        /// <summary>
        /// å¤‡æ³¨
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 500, ColumnDescription = "备注")]
        public string Remark { get; set; }
    }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrder.cs
@@ -10,37 +10,70 @@
namespace WIDESEA_Model.Models
{
    /// <summary>
    /// å…¥åº“单
    /// </summary>
    [SugarTable(nameof(Dt_InboundOrder), "入库单")]
    public class Dt_InboundOrder : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// ä»“库主键
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "仓库主键")]
        public int WarehouseId { get; set; }
        /// <summary>
        /// å•据编号
        /// </summary>
        [CodeRule(RuleCodeEnum.InboundOrderRule)]
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "单据编号")]
        public string InboundOrderNo { get; set; }
        /// <summary>
        /// ä¸Šæ¸¸å•据编号
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "上游单据编号")]
        public string UpperOrderNo { get; set; }
        [SugarColumn(IsNullable = false, ColumnDescription = "")]
        public int WarehouseId { get; set; }
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "")]
        /// <summary>
        /// ä¾›åº”商编号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "供应商编号")]
        public string SupplierId { get; set; }
        /// <summary>
        /// å•据类型
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "单据类型")]
        public int OrderType { get; set; }
        /// <summary>
        /// å•据状态
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "单据状态")]
        public int OrderStatus { get; set; }
        /// <summary>
        /// åˆ›å»ºæ–¹å¼
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "创建方式")]
        public int CreateType { get; set; }
        /// <summary>
        /// å¤‡æ³¨
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "备注")]
        public string Remark { get; set; }
        /// <summary>
        /// å…¥åº“单明细
        /// </summary>
        [Navigate(NavigateType.OneToMany, nameof(Dt_InboundOrderDetail.OrderId), nameof(Id))]
        public List<Dt_InboundOrderDetail> Details { get; set; }
    }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrderDetail.cs
@@ -8,42 +8,75 @@
namespace WIDESEA_Model.Models
{
    /// <summary>
    /// å…¥åº“单明细
    /// </summary>
    [SugarTable(nameof(Dt_InboundOrderDetail), "入库单明细")]
    public class Dt_InboundOrderDetail : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// å…¥åº“单主键
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "入库单主键")]
        public int OrderId { get; set; }
        /// <summary>
        /// ç‰©æ–™ç¼–号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "物料编号")]
        public string MaterielCode { get; set; }
        /// <summary>
        /// æ‰¹æ¬¡å·
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "批次号")]
        public string BatchNo { get; set; }
        /// <summary>
        /// å•据数量
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "单据数量")]
        public float OrderQuantity { get; set; }
        /// <summary>
        /// ç»„盘数量
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "组盘数量", DefaultValue = "0")]
        public float ReceiptQuantity { get; set; }
        /// <summary>
        /// ä¸Šæž¶æ•°é‡
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "上架数量", DefaultValue = "0")]
        public float OverInQuantity { get; set; }
        /// <summary>
        /// è®¢å•明细状态
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "订单明细状态")]
        public int OrderDetailStatus { get; set; }
        /// <summary>
        /// å•位
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "单位")]
        public string Unit { get; set; }
        /// <summary>
        /// æ”¶è´§å•明细行号
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "行号")]
        [SugarColumn(IsNullable = false, ColumnDescription = "收货单明细行号")]
        public int RowNo { get; set; }
        /// <summary>
        /// å¤‡æ³¨
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "备注")]
        public string Remark { get; set; }
    }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrder_Hty.cs
@@ -11,34 +11,64 @@
namespace WIDESEA_Model.Models
{
    [SugarTable(nameof(Dt_InboundOrder_Hty), "入库单")]
    /// <summary>
    ///
    /// </summary>
    [SugarTable(nameof(Dt_InboundOrder_Hty), "入库单历史")]
    public class Dt_InboundOrder_Hty 
    {
        /// <summary>
        ///
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        ///
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "单据编号")]
        public string OrderNo { get; set; }
        /// <summary>
        ///
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "上游单据编号")]
        public string UpperOrderNo { get; set; }
        /// <summary>
        ///
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "单据类型")]
        public int OrderType { get; set; }
        /// <summary>
        /// å•据状态
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "单据状态")]
        public int OrderStatus { get; set; }
        /// <summary>
        /// åˆ›å»ºæ–¹å¼
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "创建方式")]
        public int CreateType { get; set; }
        /// <summary>
        /// å¤‡æ³¨
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "备注")]
        public string Remark { get; set; }
        /// <summary>
        /// æºä¸»é”®
        /// </summary>
        [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "源主键")]
        public int SourceId { get; set; }
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "备注")]
        /// <summary>
        /// æ“ä½œç±»åž‹
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "操作类型")]
        public string OperateType { get; set; }
        /// <summary>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_PurchaseOrder.cs
@@ -9,57 +9,63 @@
namespace WIDESEA_Model.Models
{
    [SugarTable(nameof(Dt_PurchaseOrder), "采购订单"), ModelValidate]
    /// <summary>
    ///
    /// </summary>
    [SugarTable(nameof(Dt_PurchaseOrder), "采购单"), ModelValidate]
    public class Dt_PurchaseOrder : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "")]
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// é‡‡è´­å•号
        /// </summary>
        [PropertyValidate("采购单号", NotNullAndEmpty = true)]
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "")]
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "采购单号")]
        public string PurchaseOrderNo { get; set; }
        /// <summary>
        /// å•据类型(S:标准入库、V:寄售补给入库)
        /// </summary>
        [PropertyValidate("单据类型", NotNullAndEmpty = true, Check = new[] { "S", "V" })]
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "")]
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "单据类型")]
        public string PurchaseOrderType { get; set; }
        /// <summary>
        /// ä¾›åº”商编号
        /// </summary>
        [PropertyValidate("供应商编号", NotNullAndEmpty = true)]
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "")]
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "供应商编号")]
        public string SupplierCode { get; set; }
        /// <summary>
        /// é‡‡è´­æ•°é‡
        /// </summary>
        [PropertyValidate("采购数量", MinValue = 0, IsContainMinValue = false)]
        [SugarColumn(IsNullable = false, ColumnDescription = "")]
        [SugarColumn(IsNullable = false, ColumnDescription = "采购数量")]
        public float OrderQuantity { get; set; }
        [SugarColumn(IsNullable = false, ColumnDescription = "")]
        /// <summary>
        /// é‡‡è´­å•状态
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "采购单状态")]
        public int PurchaseOrderStatus { get; set; }
        /// <summary>
        /// ä¸‹å•日期
        /// </summary>
        [PropertyValidate("下单日期", NotNullAndEmpty = true)]
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "")]
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "下单日期")]
        public string OrderDate { get; set; }
        /// <summary>
        /// å¤‡æ³¨
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "")]
        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "备注")]
        public string Remark { get; set; }
        /// <summary>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_PurchaseOrderDetail.cs
@@ -9,6 +9,9 @@
namespace WIDESEA_Model.Models
{
    /// <summary>
    /// é‡‡è´­å•明细
    /// </summary>
    [SugarTable(nameof(Dt_PurchaseOrderDetail), "采购单明细"), ModelValidate]
    public class Dt_PurchaseOrderDetail : BaseEntity
    {
@@ -45,19 +48,19 @@
        /// <summary>
        /// ä»“库编号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnName = "WarehouseId", ColumnDescription = "")]
        [SugarColumn(IsNullable = false, Length = 50, ColumnName = "WarehouseId", ColumnDescription = "仓库编号")]
        public int WarehouseId { get; set; }
        /// <summary>
        /// æ•°é‡
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "")]
        [SugarColumn(IsNullable = false, ColumnDescription = "数量")]
        public float PurchaseDetailQuantity { get; set; }
        /// <summary>
        /// å•位
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "")]
        [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "单位")]
        public string Unit { get; set; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReceiveOrder.cs
@@ -10,6 +10,9 @@
namespace WIDESEA_Model.Models
{
    /// <summary>
    /// æ”¶è´§å•
    /// </summary>
    [SugarTable(nameof(Dt_ReceiveOrder), "收货单")]
    public class Dt_ReceiveOrder : BaseEntity
    {
@@ -80,6 +83,9 @@
        [SugarColumn(IsNullable = true, Length = 500, ColumnDescription = "备注")]
        public string Remark { get; set; }
        /// <summary>
        /// æ”¶è´§å•明细
        /// </summary>
        [Navigate(NavigateType.OneToMany, nameof(Dt_ReceiveOrderDetail.ReceiveOrderId), nameof(ReceiveOrderId))]
        public List<Dt_ReceiveOrderDetail> Details { get; set; }
    }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReceiveOrderDetail.cs
@@ -8,6 +8,9 @@
namespace WIDESEA_Model.Models
{
    /// <summary>
    /// æ”¶è´§å•明细
    /// </summary>
    [SugarTable(nameof(Dt_ReceiveOrderDetail), "收货单明细")]
    public class Dt_ReceiveOrderDetail : BaseEntity
    {
@@ -29,6 +32,9 @@
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "采购单号")]
        public string PurchaseOrderNo { get; set; }
        /// <summary>
        /// é‡‡è´­å•明细行号
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "采购单明细行号")]
        public int PurchaseOrderDetailRowNo { get; set; }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundLockInfo.cs
@@ -9,51 +9,99 @@
namespace WIDESEA_Model.Models
{
    /// <summary>
    /// å‡ºåº“详情
    /// </summary>
    [SugarTable(nameof(Dt_OutStockLockInfo), "出库详情")]
    public class Dt_OutStockLockInfo : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// å•据编号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "单据编号")]
        public string OrderNo { get; set; }
        /// <summary>
        /// å•据明细主键
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "单据明细主键")]
        public int OrderDetailId { get; set; }
        /// <summary>
        /// å•据类型
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "单据类型")]
        public int OrderType { get; set; }
        /// <summary>
        /// æ‰¹æ¬¡å·
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "批次号")]
        public string BatchNo { get; set; }
        /// <summary>
        /// ç‰©æ–™ç¼–号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "物料编号")]
        public string MaterielCode { get; set; }
        /// <summary>
        /// ç‰©æ–™åç§°
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "物料名称")]
        public string MaterielName { get; set; }
        /// <summary>
        /// åº“存主键
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "库存主键")]
        public int StockId { get; set; }
        /// <summary>
        /// å•据数量
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "单据数量")]
        public float OrderQuantity { get; set; }
        /// <summary>
        /// åŽŸå§‹åº“å­˜é‡
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "原始库存量")]
        public float OriginalQuantity {  get; set; }
        /// <summary>
        /// åˆ†é…å‡ºåº“量
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "分配出库量")]
        public float AssignQuantity {  get; set; }
        /// <summary>
        /// è´§ä½ç¼–号
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "货位编号")]
        public string LocationCode { get; set; }
        /// <summary>
        /// æ‰˜ç›˜ç¼–号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "托盘编号")]
        public string PalletCode { get; set; }
        /// <summary>
        /// ä»»åŠ¡å·
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "任务号")]
        public int? TaskNum { get; set; }
        /// <summary>
        /// çŠ¶æ€
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "状态")]
        public int Status { get; set; }
    }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrder.cs
@@ -10,34 +10,64 @@
namespace WIDESEA_Model.Models
{
    /// <summary>
    /// å‡ºåº“单
    /// </summary>
    [SugarTable(nameof(Dt_OutboundOrder), "出库单")]
    public class Dt_OutboundOrder : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// ä»“库主键
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "仓库主键")]
        public int WarehouseId { get; set; }
        /// <summary>
        /// å•据编号
        /// </summary>
        [CodeRule(RuleCodeEnum.OutboundOrderRule)]
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "单据编号", IsOnlyIgnoreUpdate = true)]
        public string OrderNo { get; set; }
        /// <summary>
        /// ä¸Šæ¸¸å•据编号
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "上游单据编号", IsOnlyIgnoreUpdate = true)]
        public string UpperOrderNo { get; set; }
        /// <summary>
        /// å•据类型
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "单据类型", IsOnlyIgnoreUpdate = true)]
        public int OrderType { get; set; }
        /// <summary>
        /// å•据状态
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "单据状态")]
        public int OrderStatus { get; set; }
        /// <summary>
        /// åˆ›å»ºæ–¹å¼
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "创建方式", IsOnlyIgnoreUpdate = true)]
        public int CreateType { get; set; }
        [SugarColumn(IsNullable = false, ColumnDescription = "仓库主键")]
        public int WarehouseId { get; set; }
        /// <summary>
        /// å¤‡æ³¨
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "备注")]
        public string Remark { get; set; }
        /// <summary>
        /// å‡ºåº“单明细
        /// </summary>
        [Navigate(NavigateType.OneToMany, nameof(Dt_OutboundOrderDetail.OrderId), nameof(Id))]
        public List<Dt_OutboundOrderDetail> Details { get; set; }
    }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrderDetail.cs
@@ -8,39 +8,75 @@
namespace WIDESEA_Model.Models
{
    /// <summary>
    /// å‡ºåº“单明细
    /// </summary>
    [SugarTable(nameof(Dt_OutboundOrderDetail), "出库单明细")]
    public class Dt_OutboundOrderDetail : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// å‡ºåº“单主键
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "出库单主键")]
        public int OrderId { get; set; }
        /// <summary>
        /// ç‰©æ–™ç¼–号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "物料编号")]
        public string MaterielCode { get; set; }
        /// <summary>
        /// ç‰©æ–™åç§°
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "物料名称")]
        public string MaterielName { get; set; }
        /// <summary>
        /// æ‰¹æ¬¡å·
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "批次号")]
        public string BatchNo { get; set; }
        /// <summary>
        /// è¡Œå·
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "行号")]
        public int RowNo {  get; set; }
        /// <summary>
        /// å•据数量
        /// </summary>
        [SugarColumn(IsNullable = false,  ColumnDescription = "单据数量")]
        public float OrderQuantity { get; set; }
        /// <summary>
        /// é”å®šæ•°é‡
        /// </summary>
        [SugarColumn(IsNullable = false,  ColumnDescription = "锁定数量", DefaultValue = "0")]
        public float LockQuantity { get; set; }
        /// <summary>
        /// å·²å‡ºæ•°é‡
        /// </summary>
        [SugarColumn(IsNullable = false,  ColumnDescription = "已出数量", DefaultValue = "0")]
        public float OverOutQuantity { get; set; }
        /// <summary>
        /// è®¢å•明细状态
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "订单明细状态")]
        public int OrderDetailStatus { get; set; }
        /// <summary>
        /// å¤‡æ³¨
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "备注")]
        public string Remark { get; set; }
    }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrderDetail_Hty.cs
@@ -9,41 +9,81 @@
namespace WIDESEA_Model.Models
{
    /// <summary>
    ///
    /// </summary>
    [SugarTable(nameof(Dt_OutboundOrderDetail_Hty), "出库单明细")]
    public class Dt_OutboundOrderDetail_Hty 
    {
        /// <summary>
        ///
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        ///
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "出库单主键")]
        public int OrderId { get; set; }
        /// <summary>
        ///
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "物料编号")]
        public string MaterielCode { get; set; }
        /// <summary>
        ///
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "物料名称")]
        public string MaterielName { get; set; }
        /// <summary>
        ///
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "批次号")]
        public string BatchNo { get; set; }
        /// <summary>
        ///
        /// </summary>
        [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "单据数量")]
        public decimal OrderQuantity { get; set; }
        /// <summary>
        ///
        /// </summary>
        [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "锁定数量", DefaultValue = "0")]
        public decimal LockQuantity { get; set; }
        /// <summary>
        ///
        /// </summary>
        [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "已出数量", DefaultValue = "0")]
        public decimal OverOutQuantity { get; set; }
        /// <summary>
        ///
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "订单明细状态")]
        public int OrderDetailStatus { get; set; }
        /// <summary>
        ///
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "备注")]
        public string Remark { get; set; }
        /// <summary>
        ///
        /// </summary>
        [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "源主键")]
        public int SourceId { get; set; }
        /// <summary>
        ///
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "备注")]
        public string OperateType { get; set; }
        /// <summary>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Record/Dt_LocationStatusChangeRecord.cs
@@ -8,36 +8,69 @@
namespace WIDESEA_Model.Models
{
    /// <summary>
    /// è´§ä½çŠ¶æ€å˜åŠ¨è®°å½•
    /// </summary>
    [SugarTable(nameof(Dt_LocationStatusChangeRecord),"货位状态变动记录")]
    public class Dt_LocationStatusChangeRecord : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// è´§ä½ä¸»é”®
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "货位主键")]
        public int LocationId {  get; set; }
        /// <summary>
        /// è´§ä½ç¼–号
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "货位编号")]
        public string LocationCode {  get; set; }
        /// <summary>
        /// å˜åŠ¨å‰è´§ä½çŠ¶æ€
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "变动前货位状态")]
        public int BeforeStatus {  get; set; }
        /// <summary>
        /// å˜åŠ¨åŽè´§ä½çŠ¶æ€
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "变动后货位状态")]
        public int AfterStatus { get; set; }
        /// <summary>
        /// å˜åŠ¨ç±»åž‹ï¼ˆå‡ºåº“ã€å…¥åº“ã€æ‰‹åŠ¨è°ƒæ•´...)
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "变动类型(出库、入库、手动调整...)")]
        public int ChangeType {  get; set; }
        /// <summary>
        /// å•据主键
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "单据主键")]
        public int? OrderId { get; set; }
        /// <summary>
        /// å•据编号
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "单据编号")]
        public string OrderNo {  get; set; }
        /// <summary>
        /// ä»»åŠ¡å·
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "任务号")]
        public int? TaskNum { get; set; }
        /// <summary>
        /// å¤‡æ³¨
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "备注")]
        public string Remark { get; set; }
    }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Record/Dt_StockQuantityChangeRecord.cs
@@ -8,48 +8,93 @@
namespace WIDESEA_Model.Models
{
    /// <summary>
    /// åº“存变动信息记录
    /// </summary>
    [SugarTable(nameof(Dt_StockQuantityChangeRecord), "库存变动信息记录")]
    public class Dt_StockQuantityChangeRecord : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// åº“存明细主键
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "库存明细主键")]
        public int StockDetailId { get; set; }
        /// <summary>
        /// æ‰˜ç›˜ç¼–号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "托盘编号")]
        public string PalleCode { get; set; }
        /// <summary>
        /// ç‰©æ–™ç¼–号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "物料编号")]
        public string MaterielCode { get; set; }
        /// <summary>
        /// ç‰©æ–™åç§°
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 200, ColumnDescription = "物料名称")]
        public string MaterielName { get; set; }
        /// <summary>
        /// æ‰¹æ¬¡å·
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "批次号")]
        public string BatchNo { get; set; }
        /// <summary>
        /// åºåˆ—号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 100, ColumnDescription = "序列号")]
        public string SerilNumber { get; set; }
        /// <summary>
        /// å•据编号
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "单据编号")]
        public string OrderNo { get; set; }
        /// <summary>
        /// ä»»åŠ¡å·
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "任务号")]
        public int? TaskNum { get; set; }
        /// <summary>
        /// å˜åŠ¨ç±»åž‹ï¼ˆå‡ºåº“ã€å…¥åº“ã€æ‰‹åŠ¨è°ƒæ•´...)
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "变动类型(出库、入库、手动调整...)")]
        public int ChangeType { get; set; }
        /// <summary>
        /// å˜åŠ¨æ•°é‡ï¼ˆæ­£æ•°è¡¨ç¤ºå¢žåŠ ï¼Œè´Ÿæ•°è¡¨ç¤ºå‡å°‘ï¼‰
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "变动数量(正数表示增加,负数表示减少)")]
        public float ChangeQuantity { get; set; }
        /// <summary>
        /// å˜åŠ¨å‰åº“å­˜é‡
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "变动前库存量", DefaultValue = "0")]
        public float BeforeQuantity { get; set; }
        /// <summary>
        /// å˜åŠ¨åŽåº“å­˜é‡
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "变动后库存量", DefaultValue = "0")]
        public float AfterQuantity { get; set; }
        /// <summary>
        /// å¤‡æ³¨
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "备注")]
        public string Remark { get; set; }
    }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfo.cs
@@ -8,30 +8,57 @@
namespace WIDESEA_Model.Models
{
    /// <summary>
    /// åº“存信息
    /// </summary>
    [SugarTable(nameof(Dt_StockInfo), "库存信息")]
    public class Dt_StockInfo : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// æ‰˜ç›˜ç¼–号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "托盘编号")]
        public string PalletCode { get; set; }
        /// <summary>
        /// æ‰˜ç›˜ç±»åž‹
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "托盘类型")]
        public int PalletType { get; set; }
        /// <summary>
        /// è´§ä½ç¼–号
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "货位编号")]
        public string LocationCode { get; set; }
        [SugarColumn(IsNullable = false, ColumnDescription = "")]
        /// <summary>
        /// ä»“库主键
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "仓库主键")]
        public int WarehouseId { get; set; }
        /// <summary>
        /// åº“存状态
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "库存状态")]
        public int StockStatus { get; set; }
        /// <summary>
        /// å¤‡æ³¨
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "备注")]
        public string Remark { get; set; }
        [SugarColumn(IsNullable = false, ColumnDescription = "")]
        public int PalletType { get; set; }
        /// <summary>
        /// åº“存明细
        /// </summary>
        [Navigate(NavigateType.OneToMany, nameof(Dt_StockInfoDetail.StockId), nameof(Id))]
        public List<Dt_StockInfoDetail> Details { get; set; }
    }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfoDetail.cs
@@ -8,48 +8,93 @@
namespace WIDESEA_Model.Models
{
    /// <summary>
    ///
    /// </summary>
    [SugarTable(nameof(Dt_StockInfoDetail), "库存信息明细")]
    public class Dt_StockInfoDetail : BaseEntity
    {
        /// <summary>
        ///
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// åº“存信息主键
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "库存信息主键")]
        public int StockId { get; set; }
        /// <summary>
        /// ç‰©æ–™ç¼–号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "物料编号")]
        public string MaterielCode { get; set; }
        /// <summary>
        /// ç‰©æ–™åç§°
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 200, ColumnDescription = "物料名称")]
        public string MaterielName { get; set; }
        /// <summary>
        /// å•据编号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "单据编号")]
        public string OrderNo { get; set; }
        /// <summary>
        /// æ‰¹æ¬¡å·
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "批次号")]
        public string BatchNo { get; set; }
        /// <summary>
        /// ç”Ÿäº§æ—¥æœŸ
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "生产日期")]
        public string ProductionDate { get; set; }
        /// <summary>
        /// æœ‰æ•ˆæœŸ
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "有效期")]
        public string EffectiveDate { get; set; }
        /// <summary>
        /// åºåˆ—号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 100, ColumnDescription = "序列号")]
        public string SerialNumber { get; set; }
        /// <summary>
        /// åº“存数量
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "库存数量")]
        public float StockQuantity { get; set; }
        /// <summary>
        /// å‡ºåº“数量
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "出库数量", DefaultValue = "0")]
        public float OutboundQuantity { get; set; }
        /// <summary>
        /// åº“存明细状态
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "库存明细状态")]
        public int Status { get; set; }
        /// <summary>
        /// å…¥åº“单明细行号
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "入库单明细行号")]
        public int InboundOrderRowNo { get; set; }
        /// <summary>
        /// å¤‡æ³¨
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "备注")]
        public string Remark { get; set; }
    }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/TaskInfo/Dt_Task.cs
@@ -11,6 +11,9 @@
namespace WIDESEA_Model.Models
{
    /// <summary>
    /// ä»»åŠ¡ä¿¡æ¯
    /// </summary>
    [SugarTable(nameof(Dt_Task), "任务信息"), SugarIndex("unique_task_taskNum", nameof(TaskNum), OrderByType.Asc, true)]
    public class Dt_Task : BaseEntity
    {
@@ -39,6 +42,12 @@
        public string PalletCode { get; set; }
        /// <summary>
        /// æ‰˜ç›˜ç±»åž‹
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "托盘类型")]
        public int PalletType { get; set; }
        /// <summary>
        /// å··é“号
        /// </summary>
        [ImporterHeader(Name = "巷道号")]
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderDetailService.cs
@@ -48,11 +48,22 @@
            _recordService = recordService;
        }
        /// <summary>
        /// é”å®šåº“存,由系统分配(仅逻辑运算,不生成任务,不修改数据库数据)
        /// </summary>
        /// <param name="orderDetailId"></param>
        /// <returns></returns>
        public WebResponseContent LockOutboundStock(int orderDetailId)
        {
            Dt_OutboundOrderDetail outboundOrderDetail = BaseDal.QueryFirst(x => x.Id == orderDetailId);
            (bool, string) result = CheckDeital(outboundOrderDetail);
            if (!result.Item1) return WebResponseContent.Instance.Error(result.Item2);
            if (outboundOrderDetail == null)
            {
                return WebResponseContent.Instance.Error("未找到出库单明细信息");
            }
            if (outboundOrderDetail.OrderDetailStatus != OrderDetailStatusEnum.New.ObjToInt())
            {
                return WebResponseContent.Instance.Error("该明细不可操作");
            }
            Dt_OutboundOrder outboundOrder = _outboundRepository.OutboundOrderRepository.QueryFirst(x => x.Id == outboundOrderDetail.OrderId);
            float needQuantity = outboundOrderDetail.OrderQuantity - outboundOrderDetail.LockQuantity;
@@ -137,19 +148,13 @@
            }
        }
        private (bool, string) CheckDeital(Dt_OutboundOrderDetail outboundOrderDetail)
        {
            if (outboundOrderDetail == null)
            {
                return (false, "未找到出库单明细信息");
            }
            if (outboundOrderDetail.OrderDetailStatus != OrderDetailStatusEnum.New.ObjToInt())
            {
                return (false, "该明细不可操作");
            }
            return (true, "成功");
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="outboundOrderDetail"></param>
        /// <param name="stockSelectViews"></param>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        public (List<Dt_StockInfo>, Dt_OutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) AssignStockOutbound(Dt_OutboundOrderDetail outboundOrderDetail, List<StockSelectViewDTO> stockSelectViews)
        {
            (bool, string) checkResult = CheckSelectStockDeital(outboundOrderDetail, stockSelectViews);
@@ -200,6 +205,12 @@
            return (outStocks, outboundOrderDetail, outStockLockInfos, locationInfos);
        }
        /// <summary>
        ///  é”å®šåº“存,由人工指定,或加上系统分配(包含逻辑运算,且修改数据库数据)
        /// </summary>
        /// <param name="orderDetailId"></param>
        /// <param name="stockSelectViews"></param>
        /// <returns></returns>
        public WebResponseContent LockOutboundStock(int orderDetailId, List<StockSelectViewDTO> stockSelectViews)
        {
            try
@@ -229,6 +240,12 @@
            }
        }
        /// <summary>
        ///  é”å®šåº“存,由系统分配(包含逻辑运算,且修改数据库数据)
        /// </summary>
        /// <param name="orderDetailId"></param>
        /// <param name="stockSelectViews"></param>
        /// <returns></returns>
        public WebResponseContent LockOutboundStock(int[] keys)
        {
            try
@@ -273,6 +290,16 @@
            }
        }
        /// <summary>
        /// å‡ºåº“库存分配后,更新数据库数据
        /// </summary>
        /// <param name="stockInfos"></param>
        /// <param name="outboundOrderDetails"></param>
        /// <param name="outStockLockInfos"></param>
        /// <param name="locationInfos"></param>
        /// <param name="locationStatus"></param>
        /// <param name="tasks"></param>
        /// <returns></returns>
        public WebResponseContent LockOutboundStockDataUpdate(List<Dt_StockInfo> stockInfos, List<Dt_OutboundOrderDetail> outboundOrderDetails, List<Dt_OutStockLockInfo> outStockLockInfos, List<Dt_LocationInfo> locationInfos, LocationStatusEnum locationStatus = LocationStatusEnum.Lock, List<Dt_Task>? tasks = null)
        {
            try
@@ -324,6 +351,11 @@
            return (true, "成功");
        }
        /// <summary>
        /// æ’¤é”€é”å®šåº“å­˜
        /// </summary>
        /// <param name="orderDetailId"></param>
        /// <returns></returns>
        public WebResponseContent RevokeLockOutboundStock(int orderDetailId)
        {
            Dt_OutboundOrderDetail outboundOrderDetail = BaseDal.QueryFirst(x => x.Id == orderDetailId);
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/StockInfoRepository.cs
@@ -94,12 +94,5 @@
        {
            return Db.UpdateNav(stockInfo).Include(x => x.Details).ExecuteCommand();
        }
        public Dt_StockInfo GetPalletStockInfo(string roadwayNo)
        {
            //ISugarQueryable<string> locationCodes = Db.Queryable<Dt_LocationInfo>().Where(x => x.RoadwayNo == roadwayNo && x.LocationStatus == LocationStatusEnum.Pallet.ObjToInt() && (x.EnalbeStatus == LocationEnalbeStatusEnum.OnlyOut.ObjToInt() || LocationEnalbeStatusEnum.Normal.ObjToInt() == x.EnalbeStatus)).Select(x => x.LocationCode);
            return Db.Queryable<Dt_StockInfo>().Where(x => x.StockStatus == StockStatusEmun.已入库.ObjToInt() && SqlFunc.Subqueryable<Dt_LocationInfo>().Where(v => v.LocationCode == x.LocationCode && v.RoadwayNo == roadwayNo && v.LocationStatus == LocationStatusEnum.Pallet.ObjToInt() && (v.EnableStatus == EnableStatusEnum.OnlyOut.ObjToInt() || EnableStatusEnum.Normal.ObjToInt() == v.EnableStatus)).Any()).OrderBy(x => x.ModifyDate).First();
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryService.cs
@@ -442,25 +442,25 @@
                        {
                            List<object> data = new List<object>();
                            {
                                Type type = typeof(TaskTypeEnum);
                                List<int> enums = Enum.GetValues(typeof(TaskTypeEnum)).Cast<int>().ToList();
                                int index = 0;
                                foreach (var item in enums)
                                {
                                    FieldInfo? fieldInfo = typeof(TaskTypeEnum).GetField(((TaskTypeEnum)item).ToString());
                                    DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
                                    if (description != null)
                                    {
                                        data.Add(new { key = item.ToString(), value = description.Description });
                                    }
                                    else
                                    {
                                        data.Add(new { key = item.ToString(), value = item.ToString() });
                                    }
                                    index++;
                                }
                            }
                            //{
                            //    Type type = typeof(TaskTypeEnum);
                            //    List<int> enums = Enum.GetValues(typeof(TaskTypeEnum)).Cast<int>().ToList();
                            //    int index = 0;
                            //    foreach (var item in enums)
                            //    {
                            //        FieldInfo? fieldInfo = typeof(TaskTypeEnum).GetField(((TaskTypeEnum)item).ToString());
                            //        DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
                            //        if (description != null)
                            //        {
                            //            data.Add(new { key = item.ToString(), value = description.Description });
                            //        }
                            //        else
                            //        {
                            //            data.Add(new { key = item.ToString(), value = item.ToString() });
                            //        }
                            //        index++;
                            //    }
                            //}
                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                        }
@@ -470,12 +470,12 @@
                            List<object> data = new List<object>();
                            {
                                Type type = typeof(InTaskStatusEnum);
                                List<int> enums = Enum.GetValues(typeof(InTaskStatusEnum)).Cast<int>().ToList();
                                Type type = typeof(TaskInStatusEnum);
                                List<int> enums = Enum.GetValues(typeof(TaskInStatusEnum)).Cast<int>().ToList();
                                int index = 0;
                                foreach (var item in enums)
                                {
                                    FieldInfo? fieldInfo = typeof(InTaskStatusEnum).GetField(((InTaskStatusEnum)item).ToString());
                                    FieldInfo? fieldInfo = typeof(TaskInStatusEnum).GetField(((TaskInStatusEnum)item).ToString());
                                    DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
                                    if (description != null)
                                    {
@@ -490,12 +490,12 @@
                            }
                            {
                                Type type = typeof(OutTaskStatusEnum);
                                List<int> enums = Enum.GetValues(typeof(OutTaskStatusEnum)).Cast<int>().ToList();
                                Type type = typeof(TaskOutStatusEnum);
                                List<int> enums = Enum.GetValues(typeof(TaskOutStatusEnum)).Cast<int>().ToList();
                                int index = 0;
                                foreach (var item in enums)
                                {
                                    FieldInfo? fieldInfo = typeof(OutTaskStatusEnum).GetField(((OutTaskStatusEnum)item).ToString());
                                    FieldInfo? fieldInfo = typeof(TaskOutStatusEnum).GetField(((TaskOutStatusEnum)item).ToString());
                                    DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
                                    if (description != null)
                                    {
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -16,21 +16,8 @@
#endregion << ç‰ˆ æœ¬ æ³¨ é‡Š >>
using AutoMapper;
using HslCommunication.WebSocket;
using MailKit.Search;
using Newtonsoft.Json;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Linq.Expressions;
using System.Net.Http.Headers;
using System.Reflection;
using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.CommonEnum;
using WIDESEA_Common.LocationEnum;
@@ -43,6 +30,7 @@
using WIDESEA_Core.Helper;
using WIDESEA_DTO.Inbound;
using WIDESEA_DTO.Stock;
using WIDESEA_DTO.Task;
using WIDESEA_IBasicRepository;
using WIDESEA_IBasicService;
using WIDESEA_IInboundService;
@@ -65,18 +53,60 @@
        private readonly IStockRepository _stockRepository;
        private readonly IBasicService _basicService;
        private readonly IRecordService _recordService;
        private readonly IOutboundService _outboundService;
        private readonly IStockService _stockService;
        public ITaskRepository Repository => BaseDal;
        public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IStockRepository stockRepository, IBasicService basicService, IRecordService recordService) : base(BaseDal)
        private Dictionary<string, OrderByType> _taskOrderBy = new()
            {
                {nameof(Dt_Task.Grade),OrderByType.Desc },
                {nameof(Dt_Task.CreateDate),OrderByType.Asc},
            };
        public List<int> TaskInboundTypes => typeof(TaskInboundTypeEnum).GetEnumIndexList();
        public List<int> TaskOutboundTypes => typeof(TaskOutboundTypeEnum).GetEnumIndexList();
        public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IStockRepository stockRepository, IBasicService basicService, IRecordService recordService, IOutboundService outboundService, IStockService stockService) : base(BaseDal)
        {
            _mapper = mapper;
            _unitOfWorkManage = unitOfWorkManage;
            _stockRepository = stockRepository;
            _basicService = basicService;
            _recordService = recordService;
            _outboundService = outboundService;
            _stockService = stockService;
        }
        /// <summary>
        /// ä»»åŠ¡ä¿¡æ¯æŽ¨é€è‡³WCS
        /// </summary>
        /// <returns></returns>
        public WebResponseContent PushTasksToWCS()
        {
            try
            {
                List<Dt_Task> tasks = BaseDal.QueryData(x => (TaskInboundTypes.Contains(x.TaskType) && x.TaskStatus == (int)TaskInStatusEnum.InNew || TaskOutboundTypes.Contains(x.TaskType) && x.TaskStatus == (int)TaskOutStatusEnum.OutNew));
                List<WMSTaskDTO> taskDTOs = _mapper.Map<List<WMSTaskDTO>>(tasks);
                string response = HttpHelper.Post("http://127.0.0.1:9291/api/Task/ReceiveTask", taskDTOs.Serialize());
                return JsonConvert.DeserializeObject<WebResponseContent>(response) ?? WebResponseContent.Instance.Error("返回错误");
            }
            catch (Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        /// <summary>
        /// ç”³è¯·å…¥åº“任务(PDA使用,仅托盘绑定入库站台,不分配货位)
        /// </summary>
        /// <param name="palletCode">托盘号</param>
        /// <param name="stationCode">站台号</param>
        /// <returns></returns>
        public WebResponseContent RequestInboundTask(string palletCode, string stationCode)
        {
            try
@@ -85,6 +115,11 @@
                if (task != null)
                {
                    return WebResponseContent.Instance.Error($"该托盘已生成任务");
                }
                if (Repository.QueryFirst(x => x.SourceAddress == stationCode && x.TaskStatus == TaskInStatusEnum.InNew.ObjToInt()) != null)
                {
                    return WebResponseContent.Instance.Error($"该站点已有未执行的任务");
                }
                Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.QueryFirst(x => x.PalletCode == palletCode);
@@ -101,38 +136,24 @@
                    return WebResponseContent.Instance.Error($"该托盘已绑定货位");
                }
                //todo é€šè¿‡ç«™å°å·æ‰¾å··é“号
                string roadwayNo = "RSC01";
                PalletTypeEnum palletType = PalletTypeEnum.SmallPallet;
                Dt_LocationInfo? locationInfo = _basicService.LocationInfoService.AssignLocation(roadwayNo, palletType);
                if (locationInfo == null)
                {
                    return WebResponseContent.Instance.Error($"货位分配失败,未找到可分配货位");
                }
                Dt_Task newTask = new Dt_Task()
                {
                    CurrentAddress = stationCode,
                    Grade = 0,
                    NextAddress = "",
                    PalletCode = palletCode,
                    Roadway = roadwayNo,
                    Roadway = "",
                    SourceAddress = stationCode,
                    TargetAddress = locationInfo.LocationCode,
                    TaskType = TaskTypeEnum.Inbound.ObjToInt(),
                    TaskStatus = InTaskStatusEnum.InNew.ObjToInt(),
                    TargetAddress = "",
                    TaskType = TaskInboundTypeEnum.Inbound.ObjToInt(),
                    TaskStatus = TaskInStatusEnum.SC_InExecute.ObjToInt(),
                };
                LocationStatusEnum lastStatus = (LocationStatusEnum)locationInfo.LocationStatus;
                stockInfo.StockStatus = StockStatusEmun.入库确认.ObjToInt();
                _unitOfWorkManage.BeginTran();
                int taskId = BaseDal.AddData(newTask);
                newTask.TaskId = taskId;
                _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, lastStatus, LocationChangeType.InboundAssignLocation);
                _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock);
                _stockRepository.StockInfoRepository.UpdateData(stockInfo);
                _unitOfWorkManage.CommitTran();
@@ -145,6 +166,54 @@
            }
        }
        /// <summary>
        /// å…¥åº“任务申请分配货位
        /// </summary>
        /// <param name="taskNum">任务号</param>
        /// <param name="roadwayNo">巷道号</param>
        /// <param name="palletType">托盘类型</param>
        /// <returns></returns>
        public WebResponseContent AssignInboundTaskLocation(int taskNum, string roadwayNo)
        {
            try
            {
                Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum);
                if (task == null)
                {
                    return WebResponseContent.Instance.Error($"未找到该入库任务");
                }
                Dt_LocationInfo? locationInfo = _basicService.LocationInfoService.AssignLocation(roadwayNo, (PalletTypeEnum)task.PalletType, task.WarehouseId);
                if (locationInfo == null)
                {
                    return WebResponseContent.Instance.Error($"货位分配失败,未找到可分配货位");
                }
                task.Roadway = roadwayNo;
                task.TargetAddress = locationInfo.LocationCode;
                task.TaskStatus = TaskInStatusEnum.SC_InExecute.ObjToInt();
                LocationStatusEnum lastStatus = (LocationStatusEnum)locationInfo.LocationStatus;
                _unitOfWorkManage.BeginTran();
                _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, lastStatus, LocationChangeType.InboundAssignLocation);
                _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, (PalletTypeEnum)task.PalletType, LocationStatusEnum.Lock, task.WarehouseId);
                BaseDal.UpdateData(task);
                _unitOfWorkManage.CommitTran();
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        /// <summary>
        /// å…¥åº“任务完成
        /// </summary>
        /// <param name="taskNum">任务号</param>
        /// <returns></returns>
        public WebResponseContent InboundTaskCompleted(int taskNum)
        {
            try
@@ -155,7 +224,7 @@
                    return WebResponseContent.Instance.Error($"未找到该任务信息");
                }
                if (task.TaskType != TaskTypeEnum.Inbound.ObjToInt())
                if (task.TaskType != TaskInboundTypeEnum.Inbound.ObjToInt())
                {
                    return WebResponseContent.Instance.Error($"任务类型错误");
                }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,238 @@

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.Enums;
using WIDESEA_Core;
using WIDESEA_DTO.Stock;
using WIDESEA_Model.Models;
using WIDESEA_Core.Helper;
using WIDESEA_Common.OtherEnum;
using WIDESEA_Common.TaskEnum;
using WIDESEA_Common.OrderEnum;
using WIDESEA_Common.StockEnum;
namespace WIDESEA_TaskInfoService
{
    public partial class TaskService
    {
        /// <summary>
        /// åº“存数据转出库任务
        /// </summary>
        /// <param name="stockInfos"></param>
        /// <returns></returns>
        public List<Dt_Task> GetTasks(List<Dt_StockInfo> stockInfos)
        {
            List<Dt_Task> tasks = new List<Dt_Task>();
            for (int i = 0; i < stockInfos.Count; i++)
            {
                Dt_StockInfo stockInfo = stockInfos[i];
                if (stockInfo != null)
                {
                    Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == stockInfo.LocationCode);
                    Dt_Task task = new()
                    {
                        CurrentAddress = stockInfo.LocationCode,
                        Grade = 0,
                        PalletCode = stockInfo.PalletCode,
                        NextAddress = "",
                        Roadway = locationInfo.RoadwayNo,
                        SourceAddress = stockInfo.LocationCode,
                        TargetAddress = "",
                        TaskStatus = TaskOutStatusEnum.OutNew.ObjToInt(),
                        TaskType = TaskOutboundTypeEnum.Outbound.ObjToInt(),
                        TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum))
                    };
                    tasks.Add(task);
                }
            }
            return tasks;
        }
        /// <summary>
        /// å‡ºåº“任务数据处理
        /// </summary>
        /// <param name="orderDetailId"></param>
        /// <param name="stockSelectViews"></param>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        public (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutboundOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) OutboundTaskDataHandle(int orderDetailId, List<StockSelectViewDTO> stockSelectViews)
        {
            List<Dt_Task> tasks = new List<Dt_Task>();
            Dt_OutboundOrderDetail outboundOrderDetail = _outboundService.OutboundOrderDetailService.Repository.QueryFirst(x => x.Id == orderDetailId);
            if (outboundOrderDetail == null)
            {
                throw new Exception("未找到出库单明细信息");
            }
            if (stockSelectViews.Sum(x => x.UseableQuantity) > outboundOrderDetail.OrderQuantity - outboundOrderDetail.LockQuantity)
            {
                throw new Exception("选择数量超出单据数量");
            }
            List<Dt_StockInfo>? stockInfos = null;
            Dt_OutboundOrderDetail? orderDetail = null;
            List<Dt_OutStockLockInfo>? outStockLockInfos = null;
            List<Dt_LocationInfo>? locationInfos = null;
            if (outboundOrderDetail.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt())
            {
                (List<Dt_StockInfo>, Dt_OutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundService.OutboundOrderDetailService.AssignStockOutbound(outboundOrderDetail, stockSelectViews);
                if (result.Item1 != null && result.Item1.Count > 0)
                {
                    tasks = GetTasks(result.Item1);
                    result.Item2.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt();
                    result.Item3.ForEach(x =>
                    {
                        x.Status = OutLockStockStatusEnum.出库中.ObjToInt();
                    });
                    stockInfos = result.Item1;
                    orderDetail = result.Item2;
                    outStockLockInfos = result.Item3;
                    locationInfos = result.Item4;
                }
                else
                {
                    throw new Exception("无库存");
                }
            }
            else
            {
                List<Dt_OutStockLockInfo> stockLockInfos = _outboundService.OutboundStockLockInfoService.GetByOrderDetailId(outboundOrderDetail.OrderId, OutLockStockStatusEnum.已分配);
                if (stockLockInfos != null && stockLockInfos.Count > 0)
                {
                    List<Dt_StockInfo> stocks = _stockService.StockInfoService.Repository.GetStockInfosByPalletCodes(stockLockInfos.Select(x => x.PalletCode).Distinct().ToList());
                    tasks = GetTasks(stocks);
                }
            }
            return (tasks, stockInfos, orderDetail == null ? null : new List<Dt_OutboundOrderDetail> { orderDetail }, outStockLockInfos, locationInfos);
        }
        /// <summary>
        /// ç”Ÿæˆå‡ºåº“任务
        /// </summary>
        /// <param name="orderDetailId"></param>
        /// <param name="stockSelectViews"></param>
        /// <returns></returns>
        public WebResponseContent GenerateOutboundTask(int orderDetailId, List<StockSelectViewDTO> stockSelectViews)
        {
            try
            {
                (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutboundOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) result = OutboundTaskDataHandle(orderDetailId, stockSelectViews);
                WebResponseContent content = GenerateOutboundTaskDataUpdate(result.Item1, result.Item2, result.Item3, result.Item4, result.Item5);
                return content;
            }
            catch (Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        /// <summary>
        /// ç”Ÿæˆå‡ºåº“任务后数据更新到数据库
        /// </summary>
        /// <param name="tasks"></param>
        /// <param name="stockInfos"></param>
        /// <param name="outboundOrderDetails"></param>
        /// <param name="outStockLockInfos"></param>
        /// <param name="locationInfos"></param>
        /// <returns></returns>
        public WebResponseContent GenerateOutboundTaskDataUpdate(List<Dt_Task> tasks, List<Dt_StockInfo>? stockInfos = null, List<Dt_OutboundOrderDetail>? outboundOrderDetails = null, List<Dt_OutStockLockInfo>? outStockLockInfos = null, List<Dt_LocationInfo>? locationInfos = null)
        {
            try
            {
                _unitOfWorkManage.BeginTran();
                BaseDal.AddData(tasks);
                if (stockInfos != null && outboundOrderDetails != null && outStockLockInfos != null && locationInfos != null)
                {
                    WebResponseContent content = _outboundService.OutboundOrderDetailService.LockOutboundStockDataUpdate(stockInfos, outboundOrderDetails, outStockLockInfos, locationInfos, tasks: tasks);
                    if (content.Status)
                    {
                        _unitOfWorkManage.CommitTran();
                    }
                    else
                    {
                        _unitOfWorkManage.RollbackTran();
                    }
                    return content;
                }
                else if (outboundOrderDetails != null && outboundOrderDetails.Count > 0)
                {
                    outboundOrderDetails.ForEach(x =>
                    {
                        x.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt();
                    });
                    _outboundService.OutboundOrderDetailService.Repository.UpdateData(outboundOrderDetails);
                }
                _unitOfWorkManage.CommitTran();
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        /// <summary>
        /// ç”Ÿæˆå‡ºåº“任务
        /// </summary>
        /// <param name="keys"></param>
        /// <returns></returns>
        public WebResponseContent GenerateOutboundTask(int[] keys)
        {
            try
            {
                List<Dt_Task> tasks = new List<Dt_Task>();
                List<StockSelectViewDTO> stockSelectViews = new List<StockSelectViewDTO>();
                List<Dt_StockInfo> stockInfos = new List<Dt_StockInfo>();
                List<Dt_OutboundOrderDetail> outboundOrderDetails = new List<Dt_OutboundOrderDetail>();
                List<Dt_OutStockLockInfo> outStockLockInfos = new List<Dt_OutStockLockInfo>();
                List<Dt_LocationInfo> locationInfos = new List<Dt_LocationInfo>();
                foreach (int key in keys)
                {
                    (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutboundOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) result = OutboundTaskDataHandle(key, stockSelectViews);
                    if (result.Item2 != null && result.Item2.Count > 0)
                    {
                        stockInfos.AddRange(result.Item2);
                    }
                    if (result.Item3 != null && result.Item3.Count > 0)
                    {
                        outboundOrderDetails.AddRange(result.Item3);
                    }
                    if (result.Item4 != null && result.Item4.Count > 0)
                    {
                        outStockLockInfos.AddRange(result.Item4);
                    }
                    if (result.Item5 != null && result.Item5.Count > 0)
                    {
                        locationInfos.AddRange(result.Item5);
                    }
                    if (result.Item1 != null && result.Item1.Count > 0)
                    {
                        tasks.AddRange(result.Item1);
                    }
                }
                WebResponseContent content = GenerateOutboundTaskDataUpdate(tasks, stockInfos, outboundOrderDetails, outStockLockInfos, locationInfos);
                return content;
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs
@@ -42,9 +42,9 @@
        /// <param name="palletType"></param>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("AssignLocation"), AllowAnonymous]
        public Dt_LocationInfo? AssignLocation(string roadwayNo, PalletTypeEnum palletType)
        public Dt_LocationInfo? AssignLocation(string roadwayNo, PalletTypeEnum palletType, int warehouseId)
        {
            return Service.AssignLocation(roadwayNo, palletType);
            return Service.AssignLocation(roadwayNo, palletType, warehouseId);
        }
        /// <summary>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs
@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WIDESEA_Common.CommonEnum;
using WIDESEA_Core;
using WIDESEA_Core.BaseController;
using WIDESEA_DTO.Stock;
@@ -18,15 +19,38 @@
        }
        /// <summary>
        /// å°†WMS任务推送至WCS
        /// </summary>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("PushTasksToWCS"), AllowAnonymous]
        public WebResponseContent PushTasksToWCS()
        {
            return Service.PushTasksToWCS();
        }
        /// <summary>
        /// ç”³è¯·å…¥åº“任务
        /// </summary>
        /// <param name="palletCode"></param>
        /// <param name="stationCode"></param>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("RequestInboundTask")]
        [HttpPost, HttpGet, Route("RequestInboundTask"), AllowAnonymous]
        public WebResponseContent RequestInboundTask(string palletCode, string stationCode)
        {
            return Service.RequestInboundTask(palletCode, stationCode);
        }
        /// <summary>
        /// å…¥åº“任务申请分配货位
        /// </summary>
        /// <param name="taskNum">任务号</param>
        /// <param name="roadwayNo">巷道号</param>
        /// <param name="palletType">托盘类型</param>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("AssignInboundTaskLocation"), AllowAnonymous]
        public WebResponseContent AssignInboundTaskLocation(int taskNum, string roadwayNo)
        {
            return Service.AssignInboundTaskLocation(taskNum, roadwayNo);
        }
        /// <summary>
@@ -34,7 +58,7 @@
        /// </summary>
        /// <param name="taskNum"></param>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("InboundTaskCompleted")]
        [HttpPost, HttpGet, Route("InboundTaskCompleted"), AllowAnonymous]
        public WebResponseContent InboundTaskCompleted(int taskNum)
        {
            return Service.InboundTaskCompleted(taskNum);
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Filter/CustomProfile.cs
@@ -11,6 +11,7 @@
using WIDESEA_DTO.Inbound;
using WIDESEA_DTO.Outbound;
using WIDESEA_DTO.System;
using WIDESEA_DTO.Task;
using WIDESEA_Model.Models;
namespace WIDESEA_WMSServer.Filter
@@ -30,6 +31,8 @@
            CreateMap<OutboundOrderDetailAddDTO, Dt_OutboundOrderDetail>().ForMember(x => x.OrderDetailStatus, b => b.MapFrom(b => 0));
            CreateMap<OutboundOrderAddDTO, Dt_OutboundOrder>();
            CreateMap<Dt_ReceiveOrderDetail, Dt_CheckOrder>().ForMember(a => a.ReceivedQuantity, b => b.MapFrom(x => x.ReceivedQuantity)).ForMember(a => a.MaterielCode, b => b.MapFrom(x => x.MaterielCode)).ForMember(a => a.CheckOrderStatus, b => b.MapFrom(x => CheckOrderStatusEnum.NotCheck.ObjToInt()));
            CreateMap<Dt_Task, WMSTaskDTO>();
        }
    }
}