|  |  | 
 |  |  |   "WorkspaceRootPath": "F:\\Git\u9879\u76EE\\YangJiPingKu\\\u9879\u76EE\u4EE3\u7801\\WCS\\WIDESEAWCS_Server\\", | 
 |  |  |   "Documents": [ | 
 |  |  |     { | 
 |  |  |       "AbsoluteMoniker": "D:0:0:{7F200FE8-CAF6-4131-BD25-8D438FE0ABAC}|WIDESEAWCS_Model\\WIDESEAWCS_Model.csproj|f:\\git\u9879\u76EE\\yangjipingku\\\u9879\u76EE\u4EE3\u7801\\wcs\\wideseawcs_server\\wideseawcs_model\\models\\wmspart\\dt_locationinfo.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", | 
 |  |  |       "RelativeMoniker": "D:0:0:{7F200FE8-CAF6-4131-BD25-8D438FE0ABAC}|WIDESEAWCS_Model\\WIDESEAWCS_Model.csproj|solutionrelative:wideseawcs_model\\models\\wmspart\\dt_locationinfo.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" | 
 |  |  |     }, | 
 |  |  |     { | 
 |  |  |       "AbsoluteMoniker": "D:0:0:{487FA45B-EA1A-4ACA-BB5B-0F6708F462C0}|WIDESEAWCS_Server\\WIDESEAWCS_Server.csproj|f:\\git\u9879\u76EE\\yangjipingku\\\u9879\u76EE\u4EE3\u7801\\wcs\\wideseawcs_server\\wideseawcs_server\\controllers\\wmspart\\locationinfocontroller.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", | 
 |  |  |       "RelativeMoniker": "D:0:0:{487FA45B-EA1A-4ACA-BB5B-0F6708F462C0}|WIDESEAWCS_Server\\WIDESEAWCS_Server.csproj|solutionrelative:wideseawcs_server\\controllers\\wmspart\\locationinfocontroller.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" | 
 |  |  |     }, | 
 |  |  |     { | 
 |  |  |       "AbsoluteMoniker": "D:0:0:{7F200FE8-CAF6-4131-BD25-8D438FE0ABAC}|WIDESEAWCS_Model\\WIDESEAWCS_Model.csproj|f:\\git\u9879\u76EE\\yangjipingku\\\u9879\u76EE\u4EE3\u7801\\wcs\\wideseawcs_server\\wideseawcs_model\\models\\system\\dt_errorinfo.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", | 
 |  |  |       "RelativeMoniker": "D:0:0:{7F200FE8-CAF6-4131-BD25-8D438FE0ABAC}|WIDESEAWCS_Model\\WIDESEAWCS_Model.csproj|solutionrelative:wideseawcs_model\\models\\system\\dt_errorinfo.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" | 
 |  |  |     }, | 
 |  |  |     { | 
 |  |  |       "AbsoluteMoniker": "D:0:0:{7F200FE8-CAF6-4131-BD25-8D438FE0ABAC}|WIDESEAWCS_Model\\WIDESEAWCS_Model.csproj|f:\\git\u9879\u76EE\\yangjipingku\\\u9879\u76EE\u4EE3\u7801\\wcs\\wideseawcs_server\\wideseawcs_model\\models\\system\\dt_batchinfo.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", | 
 |  |  |       "RelativeMoniker": "D:0:0:{7F200FE8-CAF6-4131-BD25-8D438FE0ABAC}|WIDESEAWCS_Model\\WIDESEAWCS_Model.csproj|solutionrelative:wideseawcs_model\\models\\system\\dt_batchinfo.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" | 
 |  |  |     }, | 
 |  |  |     { | 
 |  |  |       "AbsoluteMoniker": "D:0:0:{83F18A31-5983-4587-A0B2-414BF70E50B5}|WIDESEAWCS_TaskInfoService\\WIDESEAWCS_TaskInfoService.csproj|f:\\git\u9879\u76EE\\yangjipingku\\\u9879\u76EE\u4EE3\u7801\\wcs\\wideseawcs_server\\wideseawcs_taskinfoservice\\taskservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", | 
 |  |  |       "RelativeMoniker": "D:0:0:{83F18A31-5983-4587-A0B2-414BF70E50B5}|WIDESEAWCS_TaskInfoService\\WIDESEAWCS_TaskInfoService.csproj|solutionrelative:wideseawcs_taskinfoservice\\taskservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" | 
 |  |  |     }, | 
 |  |  |     { | 
 |  |  |       "AbsoluteMoniker": "D:0:0:{7F200FE8-CAF6-4131-BD25-8D438FE0ABAC}|WIDESEAWCS_Model\\WIDESEAWCS_Model.csproj|F:\\Git\u9879\u76EE\\YangJiPingKu\\\u9879\u76EE\u4EE3\u7801\\WCS\\WIDESEAWCS_Server\\wideseawcs_model\\models\\wmspart\\dt_stockinfo.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", | 
 |  |  |       "RelativeMoniker": "D:0:0:{7F200FE8-CAF6-4131-BD25-8D438FE0ABAC}|WIDESEAWCS_Model\\WIDESEAWCS_Model.csproj|solutionrelative:wideseawcs_model\\models\\wmspart\\dt_stockinfo.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" | 
 |  |  |     }, | 
 |  |  |     { | 
 |  |  |       "AbsoluteMoniker": "D:0:0:{294E4915-0241-4C8C-BA99-7588B945863A}|WIDESEAWCS_Tasks\\WIDESEAWCS_Tasks.csproj|F:\\Git\u9879\u76EE\\YangJiPingKu\\\u9879\u76EE\u4EE3\u7801\\WCS\\WIDESEAWCS_Server\\wideseawcs_tasks\\oht\\ohtjob.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", | 
 |  |  |       "RelativeMoniker": "D:0:0:{294E4915-0241-4C8C-BA99-7588B945863A}|WIDESEAWCS_Tasks\\WIDESEAWCS_Tasks.csproj|solutionrelative:wideseawcs_tasks\\oht\\ohtjob.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" | 
 |  |  |     }, | 
 |  |  |     { | 
 |  |  |       "AbsoluteMoniker": "D:0:0:{9FBC654C-51DE-422D-9E1E-6A38268DE1E2}|WIDESEAWCS_Common\\WIDESEAWCS_Common.csproj|f:\\git\u9879\u76EE\\yangjipingku\\\u9879\u76EE\u4EE3\u7801\\wcs\\wideseawcs_server\\wideseawcs_common\\taskenum\\taskstatusenum.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", | 
 |  |  |       "RelativeMoniker": "D:0:0:{9FBC654C-51DE-422D-9E1E-6A38268DE1E2}|WIDESEAWCS_Common\\WIDESEAWCS_Common.csproj|solutionrelative:wideseawcs_common\\taskenum\\taskstatusenum.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" | 
 |  |  |     }, | 
 |  |  |     { | 
 |  |  |       "AbsoluteMoniker": "D:0:0:{9FBC654C-51DE-422D-9E1E-6A38268DE1E2}|WIDESEAWCS_Common\\WIDESEAWCS_Common.csproj|f:\\git\u9879\u76EE\\yangjipingku\\\u9879\u76EE\u4EE3\u7801\\wcs\\wideseawcs_server\\wideseawcs_common\\taskenum\\tasktypeenum.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", | 
 |  |  |       "RelativeMoniker": "D:0:0:{9FBC654C-51DE-422D-9E1E-6A38268DE1E2}|WIDESEAWCS_Common\\WIDESEAWCS_Common.csproj|solutionrelative:wideseawcs_common\\taskenum\\tasktypeenum.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" | 
 |  |  |     }, | 
 |  |  |     { | 
 |  |  |       "AbsoluteMoniker": "D:0:0:{7279A2AE-8D1F-4E66-A73A-01AF7927A336}|WIDESEAWCS_ITaskInfoService\\WIDESEAWCS_ITaskInfoService.csproj|f:\\git\u9879\u76EE\\yangjipingku\\\u9879\u76EE\u4EE3\u7801\\wcs\\wideseawcs_server\\wideseawcs_itaskinfoservice\\itaskservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", | 
 |  |  |       "RelativeMoniker": "D:0:0:{7279A2AE-8D1F-4E66-A73A-01AF7927A336}|WIDESEAWCS_ITaskInfoService\\WIDESEAWCS_ITaskInfoService.csproj|solutionrelative:wideseawcs_itaskinfoservice\\itaskservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" | 
 |  |  |     } | 
 |  |  |   ], | 
 |  |  |   "DocumentGroupContainers": [ | 
 |  |  | 
 |  |  |       "DocumentGroups": [ | 
 |  |  |         { | 
 |  |  |           "DockedWidth": 200, | 
 |  |  |           "SelectedChildIndex": 1, | 
 |  |  |           "SelectedChildIndex": 0, | 
 |  |  |           "Children": [ | 
 |  |  |             { | 
 |  |  |               "$type": "Document", | 
 |  |  |               "DocumentIndex": 1, | 
 |  |  |               "Title": "Dt_StockInfo.cs", | 
 |  |  |               "DocumentMoniker": "F:\\Git\u9879\u76EE\\YangJiPingKu\\\u9879\u76EE\u4EE3\u7801\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Model\\Models\\WMSPart\\Dt_StockInfo.cs", | 
 |  |  |               "RelativeDocumentMoniker": "WIDESEAWCS_Model\\Models\\WMSPart\\Dt_StockInfo.cs", | 
 |  |  |               "ToolTip": "F:\\Git\u9879\u76EE\\YangJiPingKu\\\u9879\u76EE\u4EE3\u7801\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Model\\Models\\WMSPart\\Dt_StockInfo.cs", | 
 |  |  |               "RelativeToolTip": "WIDESEAWCS_Model\\Models\\WMSPart\\Dt_StockInfo.cs", | 
 |  |  |               "ViewState": "AQIAAAAAAAAAAAAAAADwvw4AAAAdAAAA", | 
 |  |  |               "DocumentIndex": 0, | 
 |  |  |               "Title": "Dt_LocationInfo.cs", | 
 |  |  |               "DocumentMoniker": "F:\\Git\u9879\u76EE\\YangJiPingKu\\\u9879\u76EE\u4EE3\u7801\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Model\\Models\\WMSPart\\Dt_LocationInfo.cs", | 
 |  |  |               "RelativeDocumentMoniker": "WIDESEAWCS_Model\\Models\\WMSPart\\Dt_LocationInfo.cs", | 
 |  |  |               "ToolTip": "F:\\Git\u9879\u76EE\\YangJiPingKu\\\u9879\u76EE\u4EE3\u7801\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Model\\Models\\WMSPart\\Dt_LocationInfo.cs", | 
 |  |  |               "RelativeToolTip": "WIDESEAWCS_Model\\Models\\WMSPart\\Dt_LocationInfo.cs", | 
 |  |  |               "ViewState": "AQIAABEAAAAAAAAAAAAIwBoAAAAeAAAA", | 
 |  |  |               "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", | 
 |  |  |               "WhenOpened": "2025-02-28T16:09:28.316Z", | 
 |  |  |               "WhenOpened": "2025-03-01T13:24:50.229Z", | 
 |  |  |               "EditorCaption": "" | 
 |  |  |             }, | 
 |  |  |             { | 
 |  |  |               "$type": "Document", | 
 |  |  |               "DocumentIndex": 0, | 
 |  |  |               "DocumentIndex": 1, | 
 |  |  |               "Title": "LocationInfoController.cs", | 
 |  |  |               "DocumentMoniker": "F:\\Git\u9879\u76EE\\YangJiPingKu\\\u9879\u76EE\u4EE3\u7801\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Server\\Controllers\\WMSPart\\LocationInfoController.cs", | 
 |  |  |               "RelativeDocumentMoniker": "WIDESEAWCS_Server\\Controllers\\WMSPart\\LocationInfoController.cs", | 
 |  |  |               "ToolTip": "F:\\Git\u9879\u76EE\\YangJiPingKu\\\u9879\u76EE\u4EE3\u7801\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Server\\Controllers\\WMSPart\\LocationInfoController.cs", | 
 |  |  |               "RelativeToolTip": "WIDESEAWCS_Server\\Controllers\\WMSPart\\LocationInfoController.cs", | 
 |  |  |               "ViewState": "AQIAABQAAAAAAAAAAAAIwBMAAAAxAAAA", | 
 |  |  |               "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", | 
 |  |  |               "WhenOpened": "2025-03-01T13:10:30.756Z", | 
 |  |  |               "EditorCaption": "" | 
 |  |  |             }, | 
 |  |  |             { | 
 |  |  |               "$type": "Document", | 
 |  |  |               "DocumentIndex": 3, | 
 |  |  |               "Title": "dt_batchInfo.cs", | 
 |  |  |               "DocumentMoniker": "F:\\Git\u9879\u76EE\\YangJiPingKu\\\u9879\u76EE\u4EE3\u7801\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Model\\Models\\System\\dt_batchInfo.cs", | 
 |  |  |               "RelativeDocumentMoniker": "WIDESEAWCS_Model\\Models\\System\\dt_batchInfo.cs", | 
 |  |  |               "ToolTip": "F:\\Git\u9879\u76EE\\YangJiPingKu\\\u9879\u76EE\u4EE3\u7801\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Model\\Models\\System\\dt_batchInfo.cs", | 
 |  |  |               "RelativeToolTip": "WIDESEAWCS_Model\\Models\\System\\dt_batchInfo.cs", | 
 |  |  |               "ViewState": "AQIAAAMAAAAAAAAAAADwvxoAAAApAAAA", | 
 |  |  |               "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", | 
 |  |  |               "WhenOpened": "2025-03-01T12:57:42.442Z", | 
 |  |  |               "EditorCaption": "" | 
 |  |  |             }, | 
 |  |  |             { | 
 |  |  |               "$type": "Document", | 
 |  |  |               "DocumentIndex": 2, | 
 |  |  |               "Title": "dt_errorInfo.cs", | 
 |  |  |               "DocumentMoniker": "F:\\Git\u9879\u76EE\\YangJiPingKu\\\u9879\u76EE\u4EE3\u7801\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Model\\Models\\System\\dt_errorInfo.cs", | 
 |  |  |               "RelativeDocumentMoniker": "WIDESEAWCS_Model\\Models\\System\\dt_errorInfo.cs", | 
 |  |  |               "ToolTip": "F:\\Git\u9879\u76EE\\YangJiPingKu\\\u9879\u76EE\u4EE3\u7801\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Model\\Models\\System\\dt_errorInfo.cs", | 
 |  |  |               "RelativeToolTip": "WIDESEAWCS_Model\\Models\\System\\dt_errorInfo.cs", | 
 |  |  |               "ViewState": "AQIAAAAAAAAAAAAAAADwvxAAAAAVAAAA", | 
 |  |  |               "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", | 
 |  |  |               "WhenOpened": "2025-03-01T12:57:28.109Z", | 
 |  |  |               "EditorCaption": "" | 
 |  |  |             }, | 
 |  |  |             { | 
 |  |  |               "$type": "Document", | 
 |  |  |               "DocumentIndex": 7, | 
 |  |  |               "Title": "TaskTypeEnum.cs", | 
 |  |  |               "DocumentMoniker": "F:\\Git\u9879\u76EE\\YangJiPingKu\\\u9879\u76EE\u4EE3\u7801\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Common\\TaskEnum\\TaskTypeEnum.cs", | 
 |  |  |               "RelativeDocumentMoniker": "WIDESEAWCS_Common\\TaskEnum\\TaskTypeEnum.cs", | 
 |  |  |               "ToolTip": "F:\\Git\u9879\u76EE\\YangJiPingKu\\\u9879\u76EE\u4EE3\u7801\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Common\\TaskEnum\\TaskTypeEnum.cs", | 
 |  |  |               "RelativeToolTip": "WIDESEAWCS_Common\\TaskEnum\\TaskTypeEnum.cs", | 
 |  |  |               "ViewState": "AQIAAAkAAAAAAAAAAAAAACcAAAAQAAAA", | 
 |  |  |               "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", | 
 |  |  |               "WhenOpened": "2025-03-01T10:49:19.145Z", | 
 |  |  |               "EditorCaption": "" | 
 |  |  |             }, | 
 |  |  |             { | 
 |  |  |               "$type": "Document", | 
 |  |  |               "DocumentIndex": 6, | 
 |  |  |               "Title": "TaskStatusEnum.cs", | 
 |  |  |               "DocumentMoniker": "F:\\Git\u9879\u76EE\\YangJiPingKu\\\u9879\u76EE\u4EE3\u7801\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Common\\TaskEnum\\TaskStatusEnum.cs", | 
 |  |  |               "RelativeDocumentMoniker": "WIDESEAWCS_Common\\TaskEnum\\TaskStatusEnum.cs", | 
 |  |  |               "ToolTip": "F:\\Git\u9879\u76EE\\YangJiPingKu\\\u9879\u76EE\u4EE3\u7801\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Common\\TaskEnum\\TaskStatusEnum.cs", | 
 |  |  |               "RelativeToolTip": "WIDESEAWCS_Common\\TaskEnum\\TaskStatusEnum.cs", | 
 |  |  |               "ViewState": "AQIAAEMAAAAAAAAAAAAQwGAAAAAdAAAA", | 
 |  |  |               "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", | 
 |  |  |               "WhenOpened": "2025-03-01T10:44:46.357Z", | 
 |  |  |               "EditorCaption": "" | 
 |  |  |             }, | 
 |  |  |             { | 
 |  |  |               "$type": "Document", | 
 |  |  |               "DocumentIndex": 8, | 
 |  |  |               "Title": "ITaskService.cs", | 
 |  |  |               "DocumentMoniker": "F:\\Git\u9879\u76EE\\YangJiPingKu\\\u9879\u76EE\u4EE3\u7801\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_ITaskInfoService\\ITaskService.cs", | 
 |  |  |               "RelativeDocumentMoniker": "WIDESEAWCS_ITaskInfoService\\ITaskService.cs", | 
 |  |  |               "ToolTip": "F:\\Git\u9879\u76EE\\YangJiPingKu\\\u9879\u76EE\u4EE3\u7801\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_ITaskInfoService\\ITaskService.cs", | 
 |  |  |               "RelativeToolTip": "WIDESEAWCS_ITaskInfoService\\ITaskService.cs", | 
 |  |  |               "ViewState": "AQIAAFgAAAAAAAAAAAAjwGoAAAANAAAA", | 
 |  |  |               "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", | 
 |  |  |               "WhenOpened": "2025-03-01T08:22:29.442Z", | 
 |  |  |               "EditorCaption": "" | 
 |  |  |             }, | 
 |  |  |             { | 
 |  |  |               "$type": "Document", | 
 |  |  |               "DocumentIndex": 4, | 
 |  |  |               "Title": "TaskService.cs", | 
 |  |  |               "DocumentMoniker": "F:\\Git\u9879\u76EE\\YangJiPingKu\\\u9879\u76EE\u4EE3\u7801\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_TaskInfoService\\TaskService.cs", | 
 |  |  |               "RelativeDocumentMoniker": "WIDESEAWCS_TaskInfoService\\TaskService.cs", | 
 |  |  |               "ToolTip": "F:\\Git\u9879\u76EE\\YangJiPingKu\\\u9879\u76EE\u4EE3\u7801\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_TaskInfoService\\TaskService.cs", | 
 |  |  |               "RelativeToolTip": "WIDESEAWCS_TaskInfoService\\TaskService.cs", | 
 |  |  |               "ViewState": "AQIAADQAAAAAAAAAAAAIwEMAAAANAAAA", | 
 |  |  |               "ViewState": "AQIAAKABAAAAAAAAAAAAAKkBAAAAAAAA", | 
 |  |  |               "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", | 
 |  |  |               "WhenOpened": "2025-02-28T15:19:29.662Z", | 
 |  |  |               "EditorCaption": "" | 
 |  |  |             }, | 
 |  |  |             { | 
 |  |  |               "$type": "Document", | 
 |  |  |               "DocumentIndex": 2, | 
 |  |  |               "DocumentIndex": 5, | 
 |  |  |               "Title": "OHTJob.cs", | 
 |  |  |               "DocumentMoniker": "F:\\Git\u9879\u76EE\\YangJiPingKu\\\u9879\u76EE\u4EE3\u7801\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Tasks\\OHT\\OHTJob.cs", | 
 |  |  |               "RelativeDocumentMoniker": "WIDESEAWCS_Tasks\\OHT\\OHTJob.cs", | 
 |  |  |               "ToolTip": "F:\\Git\u9879\u76EE\\YangJiPingKu\\\u9879\u76EE\u4EE3\u7801\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Tasks\\OHT\\OHTJob.cs", | 
 |  |  |               "RelativeToolTip": "WIDESEAWCS_Tasks\\OHT\\OHTJob.cs", | 
 |  |  |               "ViewState": "AQIAAHwAAAAAAAAAAAAYwIIAAAAiAAAA", | 
 |  |  |               "ViewState": "AQIAAJEAAAAAAAAAAAArwKwAAAAlAAAA", | 
 |  |  |               "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", | 
 |  |  |               "WhenOpened": "2025-02-28T15:12:12.623Z", | 
 |  |  |               "EditorCaption": "" | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | using System; | 
 |  |  | using System.Collections.Generic; | 
 |  |  | using System.ComponentModel; | 
 |  |  | using System.Linq; | 
 |  |  | using System.Text; | 
 |  |  | using System.Threading.Tasks; | 
 |  |  |  | 
 |  |  | namespace WIDESEAWCS_Common.StockEnum | 
 |  |  | { | 
 |  |  |     public enum stockEnum | 
 |  |  |     { | 
 |  |  |         /// <summary> | 
 |  |  |         /// ç©ºé² | 
 |  |  |         /// </summary> | 
 |  |  |         [Description("空é²")] | 
 |  |  |         Free = 0, | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 |  |  |         /// éå® | 
 |  |  |         /// </summary> | 
 |  |  |         [Description("é¢å®")] | 
 |  |  |         Lock = 1, | 
 |  |  |     } | 
 |  |  | } | 
 
 |  |  | 
 |  |  |         InNew = 200, | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 |  |  |         /// å¤©è½¦åè´§å®æ | 
 |  |  |         /// å¤©è½¦å
¥åºåè´§å®æ | 
 |  |  |         /// </summary> | 
 |  |  |         [Description("天车åè´§å®æ")] | 
 |  |  |         [Description("天车å
¥åºåè´§å®æ")] | 
 |  |  |         Line_Ingrab = 210, | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | using System; | 
 |  |  | using System.Collections.Generic; | 
 |  |  | using System.Linq; | 
 |  |  | using System.Text; | 
 |  |  | using System.Threading.Tasks; | 
 |  |  | using WIDESEAWCS_Core.BaseServices; | 
 |  |  | using WIDESEAWCS_Model.Models; | 
 |  |  |  | 
 |  |  | namespace WIDESEAWCS_ISystemServices | 
 |  |  | { | 
 |  |  |     public interface Idt_ErrormsginfoService : IService<dt_errorInfo> | 
 |  |  |     { | 
 |  |  |     } | 
 |  |  | } | 
 
 |  |  | 
 |  |  | using WIDESEAWCS_Model.Models; | 
 |  |  | using WIDESEAWCS_Common.TaskEnum; | 
 |  |  | using WIDESEAWCS_Core.BaseRepository; | 
 |  |  | using WIDESEAWCS_Model.Models.System; | 
 |  |  |  | 
 |  |  | namespace WIDESEAWCS_ITaskInfoService | 
 |  |  | { | 
 |  |  | 
 |  |  |         /// </summary> | 
 |  |  |         /// <param name="taskNum">ä»»å¡ç¼å·</param> | 
 |  |  |         /// <returns>è¿åå¤çç»æ</returns> | 
 |  |  |         WebResponseContent StackCraneTaskCompleted(int taskNum); | 
 |  |  |         WebResponseContent StackCraneTaskCompleted(int taskNum,float weight); | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 |  |  |         /// æ¢å¤æèµ·ä»»å¡ | 
 
 |  |  | 
 |  |  |     /// <summary> | 
 |  |  |     /// æ¹æ¬¡ä¿¡æ¯ | 
 |  |  |     /// </summary> | 
 |  |  |     [SugarTable(nameof(dt_batchInfo), "åºåä¿¡æ¯")] | 
 |  |  |     [SugarTable(nameof(dt_batchInfo), "æ¹æ¬¡ä¿¡æ¯")] | 
 |  |  |     public class dt_batchInfo : BaseEntity | 
 |  |  |     { | 
 |  |  |         /// <summary> | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | using SqlSugar; | 
 |  |  | using System; | 
 |  |  | using System.Collections.Generic; | 
 |  |  | using System.Linq; | 
 |  |  | using System.Text; | 
 |  |  | using System.Threading.Tasks; | 
 |  |  | using WIDESEAWCS_Core.DB.Models; | 
 |  |  |  | 
 |  |  | namespace WIDESEAWCS_Model.Models | 
 |  |  | { | 
 |  |  |     /// <summary> | 
 |  |  |     /// éè¯¯ä¿¡æ¯ | 
 |  |  |     /// </summary> | 
 |  |  |     [SugarTable(nameof(dt_batchInfo), "é误信æ¯")] | 
 |  |  |     public class dt_errorInfo : BaseEntity | 
 |  |  |     { | 
 |  |  |         /// <summary> | 
 |  |  |         /// ä¸»é® | 
 |  |  |         /// </summary> | 
 |  |  |         [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] | 
 |  |  |         public int Id { get; set; } | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 |  |  |         /// æè¿° | 
 |  |  |         /// </summary> | 
 |  |  |         [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "æè¿°")] | 
 |  |  |         public string mesg { get; set; } | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 |  |  |         /// éè¯¯ä¿¡æ¯ | 
 |  |  |         /// </summary> | 
 |  |  |         [SugarColumn(IsNullable = true, Length = 255, ColumnDescription = "é误信æ¯")] | 
 |  |  |         public string errormsg { get; set; } | 
 |  |  |     } | 
 |  |  | } | 
 
 |  |  | 
 |  |  |         /// <summary> | 
 |  |  |         /// ä»åºç¼å· | 
 |  |  |         /// </summary> | 
 |  |  |         [SugarColumn(IsNullable = false, ColumnDescription = "ä»åºç¼å·")] | 
 |  |  |         [SugarColumn(IsNullable = true, ColumnDescription = "ä»åºç¼å·")] | 
 |  |  |         public int WarehouseId { get; set; } | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | using Microsoft.AspNetCore.Mvc; | 
 |  |  | using WIDESEAWCS_Core.BaseController; | 
 |  |  | using WIDESEAWCS_ISystemServices; | 
 |  |  | using WIDESEAWCS_Model.Models; | 
 |  |  |  | 
 |  |  | namespace WIDESEAWCS_Server.Controllers.System | 
 |  |  | { | 
 |  |  |     [Route("api/Batch")] | 
 |  |  |     [ApiController] | 
 |  |  |     public class ErrorInfoController : ApiBaseController<Idt_ErrormsginfoService, dt_errorInfo> | 
 |  |  |     { | 
 |  |  |         private readonly IHttpContextAccessor _httpContextAccessor; | 
 |  |  |         public ErrorInfoController(Idt_ErrormsginfoService service, IHttpContextAccessor httpContextAccessor) : base(service) | 
 |  |  |         { | 
 |  |  |             _httpContextAccessor = httpContextAccessor; | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  | } | 
 
 |  |  | 
 |  |  | using Microsoft.AspNetCore.Builder; | 
 |  |  | using WIDESEAWCS_Server.HostedService; | 
 |  |  | using WIDESEAWCS_Server.Filter; | 
 |  |  | using WIDESEAWCS_Tasks.OHT; | 
 |  |  |  | 
 |  |  | var builder = WebApplication.CreateBuilder(args); | 
 |  |  |  | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | using AutoMapper; | 
 |  |  | using System; | 
 |  |  | using System.Collections.Generic; | 
 |  |  | using System.Linq; | 
 |  |  | using System.Text; | 
 |  |  | using System.Threading.Tasks; | 
 |  |  | using WIDESEAWCS_Core.BaseRepository; | 
 |  |  | using WIDESEAWCS_Core.BaseServices; | 
 |  |  | using WIDESEAWCS_ISystemServices; | 
 |  |  | using WIDESEAWCS_Model.Models; | 
 |  |  |  | 
 |  |  | namespace WIDESEAWCS_SystemServices | 
 |  |  | { | 
 |  |  |     public class dt_errormsginfoService : ServiceBase<dt_errorInfo, IRepository<dt_errorInfo>>, Idt_ErrormsginfoService | 
 |  |  |     { | 
 |  |  |         private readonly IMapper _mapper; | 
 |  |  |         /// <summary> | 
 |  |  |         /// ä»å¨å±(æ°æ®åºè®¿é®) | 
 |  |  |         /// </summary> | 
 |  |  |         public IRepository<dt_errorInfo> Repository => BaseDal; | 
 |  |  |         public dt_errormsginfoService(IRepository<dt_errorInfo> BaseDal, IMapper mapper) : base(BaseDal) | 
 |  |  |         { | 
 |  |  |             _mapper = mapper; | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  | } | 
 
 |  |  | 
 |  |  | #endregion << ç æ¬ æ³¨ é >> | 
 |  |  |  | 
 |  |  | using AutoMapper; | 
 |  |  | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; | 
 |  |  | using SqlSugar; | 
 |  |  | using System.Diagnostics.CodeAnalysis; | 
 |  |  | using WIDESEAWCS_Common.LocationEnum; | 
 |  |  | using WIDESEAWCS_Common.StockEnum; | 
 |  |  | using WIDESEAWCS_Common.TaskEnum; | 
 |  |  | using WIDESEAWCS_Core; | 
 |  |  | using WIDESEAWCS_Core.BaseRepository; | 
 |  |  | 
 |  |  | using WIDESEAWCS_ITaskInfoService; | 
 |  |  | using WIDESEAWCS_IWMSPart; | 
 |  |  | using WIDESEAWCS_Model.Models; | 
 |  |  | using WIDESEAWCS_Model.Models.System; | 
 |  |  | using WIDESEAWCS_QuartzJob.Models; | 
 |  |  | using WIDESEAWCS_QuartzJob.Service; | 
 |  |  |  | 
 |  |  | 
 |  |  |         private readonly IRepository<Dt_StockInfo> _stockRepository; | 
 |  |  |         private readonly IRepository<Dt_LocationInfo> _locationRepository; | 
 |  |  |         private readonly IRepository<dt_batchInfo> _batchinfoRepository; | 
 |  |  |  | 
 |  |  |         private readonly IRepository<Dt_Task_hty> _taskhtyRepository; | 
 |  |  |         private readonly IUnitOfWorkManage _unitOfWorkManage; | 
 |  |  |         private readonly IMapper _mapper; | 
 |  |  |  | 
 |  |  |         private Dictionary<string, OrderByType> _taskOrderBy = new() | 
 |  |  | 
 |  |  |         /// </summary> | 
 |  |  |         public IRepository<Dt_Task> Repository => BaseDal; | 
 |  |  |  | 
 |  |  |         //SBText ITaskService.text { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } | 
 |  |  |  | 
 |  |  |         public TaskService(IRepository<Dt_Task> BaseDal, IRouterService routerService,  | 
 |  |  |             ITaskExecuteDetailService taskExecuteDetailService,  | 
 |  |  |             IRepository<Dt_TaskExecuteDetail> taskExecuteDetailRepository, | 
 |  |  |             IRepository<Dt_StockInfo> stockRepository, | 
 |  |  |             IRepository<Dt_LocationInfo> locationRepository, | 
 |  |  |             IRepository<dt_batchInfo> batchRepository, | 
 |  |  |             IRepository<Dt_Task_hty> taskhtyRepository, | 
 |  |  |             IUnitOfWorkManage unitOfWorkManage, | 
 |  |  |             IMapper mapper) : base(BaseDal) | 
 |  |  |         { | 
 |  |  |             _routerService = routerService; | 
 |  |  | 
 |  |  |             _stockRepository = stockRepository; | 
 |  |  |             _locationRepository = locationRepository; | 
 |  |  |             _batchinfoRepository = batchRepository; | 
 |  |  |             _taskhtyRepository = taskhtyRepository; | 
 |  |  |             _unitOfWorkManage = unitOfWorkManage; | 
 |  |  |             _mapper = mapper; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  | 
 |  |  |         /// <param name="deviceNo">设å¤ç¼å·</param> | 
 |  |  |         /// <param name="currentAddress">å½åå°å</param> | 
 |  |  |         /// <returns>è¿åä»»å¡å®ä½å¯¹è±¡ï¼å¯è½ä¸ºnull</returns> | 
 |  |  |         public Dt_Task QueryStackerCraneTask(string deviceNo, string currentAddress = "") | 
 |  |  |         public Dt_Task QueryStackerCraneTask(string workTpe, string currentAddress = "") | 
 |  |  |         { | 
 |  |  |             if (string.IsNullOrEmpty(currentAddress)) | 
 |  |  |                 return BaseDal.QueryFirst(x => x.Roadway == deviceNo && (TaskInboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskInStatusEnum.Line_InFinish || TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskOutStatusEnum.OutNew), TaskOrderBy); | 
 |  |  |             else | 
 |  |  |                 return BaseDal.QueryFirst(x => x.Roadway == deviceNo && x.CurrentAddress == currentAddress && (TaskInboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskInStatusEnum.Line_InFinish || TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskOutStatusEnum.OutNew), TaskOrderBy); | 
 |  |  |             Dt_Task task = new Dt_Task(); | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 //ä¼å
æ¥è¯¢å½å任塿± ä¸æ¯å¦æåè´§å®æçä»»å¡ | 
 |  |  |                 task = BaseDal.QueryFirst(v => v.TaskState == (int)TaskInStatusEnum.Line_Ingrab || v.TaskState == (int)TaskOutStatusEnum.SC_OutExecuting); | 
 |  |  |                 if (task != null) | 
 |  |  |                 { | 
 |  |  |                     //ä¼å
è¿åæ§è¡å°ä¸åçä»»å¡ç»§ç»æ§è¡ | 
 |  |  |                     return task; | 
 |  |  |                 } | 
 |  |  |                 //æ¥è¯¢å½å任塿± ä¸æ¯å¦åå¨ç¶æä¸ºéæ°å»ºç | 
 |  |  |                 task= BaseDal.QueryFirst(v => v.TaskState != (int)TaskInStatusEnum.InNew || v.TaskState != (int)TaskOutStatusEnum.OutNew); | 
 |  |  |                 if (task != null) | 
 |  |  |                 { | 
 |  |  |                     throw new Exception($"å½å任塿± ä¸å卿§è¡ä¸çä»»å¡,ä»»å¡å·:ã{task.TaskNum}ã"); | 
 |  |  |                 } | 
 |  |  |                 if (workTpe.Equals("In")) | 
 |  |  |                 { | 
 |  |  |                     task = BaseDal.QueryData(v=>v.TaskType==(int)TaskInboundTypeEnum.Inbound && v.TaskState==(int)TaskInStatusEnum.InNew).OrderBy(v=>v.CreateDate).First(); | 
 |  |  |                 } | 
 |  |  |                 else if (workTpe.Equals("Out")) | 
 |  |  |                 { | 
 |  |  |                     task = BaseDal.QueryData(v => v.TaskType == (int)TaskOutboundTypeEnum.Outbound && v.TaskState == (int)TaskOutStatusEnum.OutNew).OrderBy(v => v.CreateDate).First(); | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |             catch (Exception) | 
 |  |  |             { | 
 |  |  |                 //å°éè¯¯ä¿¡æ¯æ´æ°è³é误信æ¯è®°å½è¡¨ | 
 |  |  |  | 
 |  |  |             } | 
 |  |  |             return task; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 |  |  | 
 |  |  |             { | 
 |  |  |                 Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum); | 
 |  |  |                 if (task == null) return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥ä»»å¡ä¿¡æ¯,ä»»å¡å·:ã{taskNum}ã"); | 
 |  |  |                 if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) | 
 |  |  |                 { | 
 |  |  |                     task.TaskState = (int)TaskOutStatusEnum.OutPending; | 
 |  |  |                 } | 
 |  |  |                 else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup) | 
 |  |  |                 { | 
 |  |  |                     task.TaskState = (int)TaskInStatusEnum.InPending; | 
 |  |  |                 } | 
 |  |  |                 //if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) | 
 |  |  |                 //{ | 
 |  |  |                 //    task.TaskState = (int)TaskOutStatusEnum.OutPending; | 
 |  |  |                 //} | 
 |  |  |                 //else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup) | 
 |  |  |                 //{ | 
 |  |  |                 //    task.TaskState = (int)TaskInStatusEnum.InPending; | 
 |  |  |                 //} | 
 |  |  |                 task.ExceptionMessage = message; | 
 |  |  |                 task.ModifyDate = DateTime.Now; | 
 |  |  |                 BaseDal.UpdateData(task); | 
 |  |  |  | 
 |  |  |                 _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, task.ExceptionMessage); | 
 |  |  |                 //_taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, task.ExceptionMessage); | 
 |  |  |  | 
 |  |  |                 content = WebResponseContent.Instance.OK(); | 
 |  |  |             } | 
 |  |  | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 |  |  |         /// æ´æ°ä»»å¡ç¶æä¿¡æ¯ï¼å¹¶åæ¥è³WMS | 
 |  |  |         /// æ´æ°ä»»å¡ç¶æä¿¡æ¯ | 
 |  |  |         /// </summary> | 
 |  |  |         /// <param name="taskNum">ä»»å¡å·</param> | 
 |  |  |         /// <param name="status">ä»»å¡ç¶æ</param> | 
 |  |  |         public void UpdateTaskStatus(int taskNum, int status) | 
 |  |  |         { | 
 |  |  |             Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum); | 
 |  |  |             if (task == null) return; | 
 |  |  |             task.TaskState = status; | 
 |  |  |             task.ModifyDate = DateTime.Now; | 
 |  |  |             BaseDal.UpdateData(task); | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum); | 
 |  |  |                 if (status == 2 && task.TaskType == (int)TaskInboundTypeEnum.Inbound) | 
 |  |  |                 { | 
 |  |  |                     task.TaskState = (int)TaskInStatusEnum.Line_InGrabExecuting; | 
 |  |  |                 } | 
 |  |  |                 else if (status == 2 && task.TaskType == (int)TaskOutboundTypeEnum.Outbound) | 
 |  |  |                 { | 
 |  |  |                     task.TaskState = (int)TaskOutStatusEnum.Line_OutGrabExecuting; | 
 |  |  |                 } | 
 |  |  |                 if (status == 3 && task.TaskType == (int)TaskInboundTypeEnum.Inbound) | 
 |  |  |                 { | 
 |  |  |                     task.TaskState = (int)TaskInStatusEnum.Line_InDownExecuting; | 
 |  |  |                 } | 
 |  |  |                 else if (status == 3 && task.TaskType == (int)TaskOutboundTypeEnum.Outbound) | 
 |  |  |                 { | 
 |  |  |                     task.TaskState = (int)TaskOutStatusEnum.Line_OutWownExecuting; | 
 |  |  |                 } | 
 |  |  |                 task.ModifyDate = DateTime.Now; | 
 |  |  |                 BaseDal.UpdateData(task); | 
 |  |  |             } | 
 |  |  |             catch (Exception ex) | 
 |  |  |             { | 
 |  |  |  | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 |  |  | 
 |  |  |         /// </summary> | 
 |  |  |         /// <param name="taskNum">ä»»å¡ç¼å·</param> | 
 |  |  |         /// <returns>è¿åå¤çç»æ</returns> | 
 |  |  |         public WebResponseContent StackCraneTaskCompleted(int taskNum) | 
 |  |  |         public WebResponseContent StackCraneTaskCompleted(int taskNum,float weight) | 
 |  |  |         { | 
 |  |  |             WebResponseContent content = new WebResponseContent(); | 
 |  |  |             try | 
 |  |  | 
 |  |  |                 } | 
 |  |  |                 if (nawtask.TaskType == (int)TaskInboundTypeEnum.Inbound) | 
 |  |  |                 { | 
 |  |  |                      | 
 |  |  |                     var batck = _batchinfoRepository.QueryFirst(v=>v.Id==1); | 
 |  |  |                     //æ°å»ºåºå | 
 |  |  |                     Dt_StockInfo stock = new Dt_StockInfo(); | 
 |  |  |                     stock.LocationCode = nawtask.TargetAddress; | 
 |  |  |                     stock.Weight = (decimal)weight; | 
 |  |  |                     stock.StockStatus = (int)stockEnum.Lock; | 
 |  |  |                     stock.BatchNo = batck.Batch; | 
 |  |  |                     //ä¿®æ¹è´§ä½ä¿¡æ¯ | 
 |  |  |                     var location = _locationRepository.QueryFirst(v=>v.LocationCode==nawtask.TargetAddress); | 
 |  |  |                     location.LocationStatus = (int)LocationStatusEnum.InStock; | 
 |  |  |                     //å¤çä»»å¡ä¿¡æ¯ | 
 |  |  |                     Dt_Task_hty taskhty = new Dt_Task_hty(); | 
 |  |  |                     taskhty.TaskNum = nawtask.TaskNum; | 
 |  |  |                     taskhty.Roadway = nawtask.Roadway; | 
 |  |  |                     taskhty.TaskType = nawtask.TaskType; | 
 |  |  |                     taskhty.TaskState = (int)TaskInStatusEnum.Line_InFinish; | 
 |  |  |                     taskhty.SourceAddress = nawtask.SourceAddress; | 
 |  |  |                     taskhty.TargetAddress = nawtask.TargetAddress; | 
 |  |  |                     taskhty.ExceptionMessage = nawtask.ExceptionMessage; | 
 |  |  |                     taskhty.Grade = nawtask.Grade; | 
 |  |  |                     taskhty.Dispatchertime = nawtask.Dispatchertime; | 
 |  |  |                     taskhty.Remark = nawtask.Remark; | 
 |  |  |                     //å¼å§æ°æ®åºäºå¡ | 
 |  |  |                     _unitOfWorkManage.BeginTran(); | 
 |  |  |                     _stockRepository.AddData(stock); | 
 |  |  |                     _locationRepository.UpdateData(location); | 
 |  |  |                     _taskhtyRepository.AddData(taskhty); | 
 |  |  |                     BaseDal.DeleteData(nawtask); | 
 |  |  |                     //æäº¤äºå¡ | 
 |  |  |                     _unitOfWorkManage.CommitTran(); | 
 |  |  |                 } | 
 |  |  |                 else if (nawtask.TaskType == (int)TaskOutboundTypeEnum.Outbound) | 
 |  |  |                 { | 
 |  |  |  | 
 |  |  |                     //æ¥æ¾åºå | 
 |  |  |                     var stock = _stockRepository.QueryFirst(v=>v.LocationCode== nawtask.TargetAddress); | 
 |  |  |                     if (stock == null)  | 
 |  |  |                     { | 
 |  |  |                         throw new Exception($"æªæ¾å°åºåä¿¡æ¯è´§ä½å·:ã{nawtask.TargetAddress}ã"); | 
 |  |  |                     } | 
 |  |  |                     //ä¿®æ¹è´§ä½ç¶æ | 
 |  |  |                     var location = _locationRepository.QueryFirst(v => v.LocationCode == nawtask.TargetAddress); | 
 |  |  |                     location.LocationStatus = (int)LocationStatusEnum.Free; | 
 |  |  |                     //åå¤åå²ä»»å¡æ°æ® | 
 |  |  |                     Dt_Task_hty taskhty = new Dt_Task_hty(); | 
 |  |  |                     taskhty.TaskNum = nawtask.TaskNum; | 
 |  |  |                     taskhty.Roadway = nawtask.Roadway; | 
 |  |  |                     taskhty.TaskType = nawtask.TaskType; | 
 |  |  |                     taskhty.TaskState = (int)TaskInStatusEnum.Line_InFinish; | 
 |  |  |                     taskhty.SourceAddress = nawtask.SourceAddress; | 
 |  |  |                     taskhty.TargetAddress = nawtask.TargetAddress; | 
 |  |  |                     taskhty.ExceptionMessage = nawtask.ExceptionMessage; | 
 |  |  |                     taskhty.Grade = nawtask.Grade; | 
 |  |  |                     taskhty.Dispatchertime = nawtask.Dispatchertime; | 
 |  |  |                     taskhty.Remark = nawtask.Remark; | 
 |  |  |                     //å¼å§æ°æ®åºäºå¡ | 
 |  |  |                     _unitOfWorkManage.BeginTran(); | 
 |  |  |                     _stockRepository.DeleteData(stock); | 
 |  |  |                     _locationRepository.UpdateData(location); | 
 |  |  |                     _taskhtyRepository.AddData(taskhty); | 
 |  |  |                     BaseDal.DeleteData(nawtask); | 
 |  |  |                     //æäº¤äºå¡ | 
 |  |  |                     _unitOfWorkManage.CommitTran(); | 
 |  |  |                 } | 
 |  |  |                 content = WebResponseContent.Instance.OK(); | 
 |  |  |             } | 
 |  |  |             catch (Exception ex) | 
 |  |  |             { | 
 |  |  |                 //åæ»äºå¡ | 
 |  |  |                 _unitOfWorkManage.RollbackTran(); | 
 |  |  |                 content = WebResponseContent.Instance.Error($"ä»»å¡å®æå¼å¸¸,ä»»å¡å·:ã{taskNum}ã"); | 
 |  |  |                 UpdateTaskExceptionMessage(taskNum,ex.Message); | 
 |  |  |             } | 
 |  |  |             return content; | 
 |  |  |         } | 
 
 |  |  | 
 |  |  |     [DisallowConcurrentExecution] | 
 |  |  |     public class OHTJob : JobBase, IJob | 
 |  |  |     { | 
 |  |  |         public static string InorOut = "In"; | 
 |  |  |         private readonly ITaskService _taskService; | 
 |  |  |         WebSocketServer _webSocketServer; | 
 |  |  |         public OHTJob(ITaskService taskService, WebSocketServer webSocketServer) | 
 |  |  | 
 |  |  |             _taskService = taskService;//注å
¥ | 
 |  |  |             _webSocketServer = webSocketServer; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         public Task Execute(IJobExecutionContext context) | 
 |  |  |         { | 
 |  |  |             | 
 |  |  | 
 |  |  |                     //device.SetValue  åå
¥ | 
 |  |  |                     //_taskService.Repository; //ä»å¨å±ï¼è¿è¡æ°æ®åºè®¿é® | 
 |  |  |                     OHTReadData oHTReadData = new OHTReadData(); | 
 |  |  |                      | 
 |  |  |                     #region è¯»åå¤©è½¦è®¾å¤æ°æ® | 
 |  |  |                     oHTReadData.R_HeartBeat = device.GetValue<DeviceDBName, bool>(DeviceDBName.R_HeartBeat); | 
 |  |  |                     oHTReadData.R_RunMode = device.GetValue<DeviceDBName, short>(DeviceDBName.R_RunMode); | 
 |  |  | 
 |  |  |                     string ohtData = JsonConvert.SerializeObject(oHTReadData); | 
 |  |  |                     _webSocketServer.PublishAllClientPayload(ohtData); | 
 |  |  |  | 
 |  |  |                     #region å¤©è½¦å®æä»»å¡é»è¾ | 
 |  |  |                     //å ä¸ºå¤©çä»»å¡éè¦å段åéï¼æä»¥åè´§å®æä¸æ¾è´§å®æéè¦åç¬åé»è¾æ§å¶ | 
 |  |  |                     //å¤æå¤©è½¦å½åææ²¡æåè´§å®æä»»å¡ä¿¡å· | 
 |  |  |                     if (oHTReadData.R_RunState == (int)RunStateEnum.PickUpCompleted && oHTReadData.R_TaskState==(int)TaskStateEnum.TaskComplete) | 
 |  |  |                     if (oHTReadData.R_RunState == (int)RunStateEnum.PickUpCompleted && oHTReadData.R_TaskState == (int)TaskStateEnum.TaskComplete) | 
 |  |  |                     { | 
 |  |  |                         //天车åè´§å®æé»è¾ | 
 |  |  |                         var nawtask = _taskService.QueryTakNnmTask(oHTReadData.R_TaskNumber); | 
 |  |  |                         if (nawtask==null) | 
 |  |  |                         if (nawtask == null) | 
 |  |  |                         { | 
 |  |  |                             throw new Exception(string.Format("天车åè´§å®æä»»å¡æªæ¥è¯¢å°ä»»å¡å·{0}",oHTReadData.R_TaskNumber)); | 
 |  |  |                             throw new Exception(string.Format("天车åè´§å®æä»»å¡æªæ¥è¯¢å°ä»»å¡å·{0}", oHTReadData.R_TaskNumber)); | 
 |  |  |                         } | 
 |  |  |                         if (nawtask.TaskType== (int)TaskInboundTypeEnum.Inbound) | 
 |  |  |                         if (nawtask.TaskType == (int)TaskInboundTypeEnum.Inbound) | 
 |  |  |                         { | 
 |  |  |                             //妿任å¡çç¶ææ¯å¤©è½¦å
¥åºåè´§æ§è¡ä¸ | 
 |  |  |                             if (nawtask.TaskState==(int)TaskInStatusEnum.Line_InGrabExecuting) | 
 |  |  |                             if (nawtask.TaskState == (int)TaskInStatusEnum.Line_InGrabExecuting) | 
 |  |  |                             { | 
 |  |  |                                 WebResponseContent result=_taskService.UpdateTaskStatusToLine_Ingrab(nawtask); | 
 |  |  |                                 if (result.Status)  | 
 |  |  |                                 WebResponseContent result = _taskService.UpdateTaskStatusToLine_Ingrab(nawtask); | 
 |  |  |                                 if (result.Status) | 
 |  |  |                                 { | 
 |  |  |                                     device.SetValue(DeviceDBName.W_ConfirmSignal, 3); | 
 |  |  |                                 } | 
 |  |  | 
 |  |  |                                 } | 
 |  |  |                             } | 
 |  |  |                         } | 
 |  |  |                         return Task.CompletedTask; | 
 |  |  |                     } | 
 |  |  |                     else if (oHTReadData.R_RunState == (int)RunStateEnum.PutCompleted && oHTReadData.R_TaskState == (int)TaskStateEnum.TaskComplete) | 
 |  |  |                     { | 
 |  |  |                         //天车æ¾è´§å®æé»è¾ | 
 |  |  |                         _taskService.StackCraneTaskCompleted(oHTReadData.R_TaskNumber); | 
 |  |  |                         WebResponseContent result = _taskService.StackCraneTaskCompleted(oHTReadData.R_TaskNumber, oHTReadData.weight); | 
 |  |  |                         if (result.Status) | 
 |  |  |                         { | 
 |  |  |                             device.SetValue(DeviceDBName.W_ConfirmSignal, 3); | 
 |  |  |                         } | 
 |  |  |                         return Task.CompletedTask; | 
 |  |  |                     } | 
 |  |  |                     #endregion | 
 |  |  |  | 
 |  |  |  | 
 |  |  |                     #region å¤©è½¦åéä»»å¡é»è¾ | 
 |  |  |                     if (oHTReadData.R_RunMode == (int)RunModeEnum.Automatic && oHTReadData.R_AlarmCode == (int)AlarmCodeEnum.Normal) | 
 |  |  |                     { | 
 |  |  |                         if (oHTReadData.R_RunState == (int)RunStateEnum.Standby) | 
 |  |  |                         { | 
 |  |  |                             Dt_Task? task = GetTask(); | 
 |  |  |                             Dt_Task? task = GetTask(InorOut); | 
 |  |  |                             if (task != null) | 
 |  |  |                             { | 
 |  |  |                                 OHTTaskCommand? oHTTaskCommand = ConvertToOHTTaskCommand(task); | 
 |  |  | 
 |  |  |                                     device.SetValue(DeviceDBName.W_Task_Type, oHTTaskCommand.W_Task_Type); | 
 |  |  |                                     device.SetValue(DeviceDBName.W_Pick_Line, oHTTaskCommand.W_Pick_Line); | 
 |  |  |                                     device.SetValue(DeviceDBName.W_Pick_Column, oHTTaskCommand.W_Pick_Column); | 
 |  |  |                                     device.SetValue(DeviceDBName.W_Pick_Layer, oHTTaskCommand.W_Pick_Layer); | 
 |  |  |                                     device.SetValue(DeviceDBName.W_Put_Line, oHTTaskCommand.W_Put_Line); | 
 |  |  |                                     device.SetValue(DeviceDBName.W_Put_Column, oHTTaskCommand.W_Put_Column); | 
 |  |  |                                     device.SetValue(DeviceDBName.W_Put_Layer, oHTTaskCommand.W_Put_Layer); | 
 |  |  |                                     device.SetValue(DeviceDBName.W_Catch_1, oHTTaskCommand.W_Catch_1); | 
 |  |  |                                     device.SetValue(DeviceDBName.W_Catch_2, oHTTaskCommand.W_Catch_2); | 
 |  |  |                                     device.SetValue(DeviceDBName.W_TaskNumber, oHTTaskCommand.W_TaskNumber); | 
 |  |  |                                     device.SetValue(DeviceDBName.W_TaskNumber, oHTTaskCommand.W_TaskNumber); | 
 |  |  |                                     device.SetValue(DeviceDBName.W_CheckValue, oHTTaskCommand.W_CheckValue); | 
 |  |  |                                     //确认信å·åå
¥1ï¼ä»»å¡ä¸è¾¾å®æ | 
 |  |  |                                     device.SetValue(DeviceDBName.W_ConfirmSignal, 1); | 
 |  |  |                                     Thread.Sleep(500); | 
 |  |  |                                     //WCSæ£æµå°å¤©è½¦çR_TaskState=1ï¼éè¿W_ConfirmSignalç½®2表示让天车å¼å§æ§è¡ä»»å¡ | 
 |  |  |                                     int R_TaskState = device.GetValue<DeviceDBName, short>(DeviceDBName.R_TaskState); | 
 |  |  |                                     if (R_TaskState == 1) | 
 |  |  |                                     { | 
 |  |  |                                         device.SetValue(DeviceDBName.W_ConfirmSignal, 2); | 
 |  |  |                                     } | 
 |  |  |                                     //ä¸åæåï¼ä¿®æ¹ä»»å¡ç¶æ | 
 |  |  |                                     _taskService.UpdateTaskStatus(task.TaskNum, oHTTaskCommand.W_Task_Type); | 
 |  |  |                                 } | 
 |  |  |  | 
 |  |  |                             } | 
 |  |  |  | 
 |  |  |                         } | 
 |  |  |  | 
 |  |  |                     } | 
 |  |  |                     WriteInfo(device.DeviceName, "infoLog"); | 
 |  |  |  | 
 |  |  |                     WriteDebug(device.DeviceName, "debugLog"); | 
 |  |  |                     #endregion | 
 |  |  |                 } | 
 |  |  |                 catch (Exception ex) | 
 |  |  |                 { | 
 |  |  |                     WriteError(device.DeviceName, "é误", ex); | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |             return Task.CompletedTask; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  | 
 |  |  |         { | 
 |  |  |             OHTTaskCommand oHtTaskCommand = new OHTTaskCommand(); | 
 |  |  |  | 
 |  |  |             oHtTaskCommand.W_Task_Type = 1; | 
 |  |  |             oHtTaskCommand.W_Load_Layer = 0; | 
 |  |  |             oHtTaskCommand.W_Pick_Line = 1; | 
 |  |  |             | 
 |  |  |             string[] SourceCodes = task.SourceAddress.Split("-"); | 
 |  |  |             if (SourceCodes.Length == 3) | 
 |  |  |             if (task.TaskState==(int)TaskInStatusEnum.InNew || task.TaskState == (int)TaskOutStatusEnum.OutNew) | 
 |  |  |             { | 
 |  |  |                 oHtTaskCommand.W_Pick_Line = Convert.ToInt16(SourceCodes[1]); | 
 |  |  |                 oHtTaskCommand.W_Put_Column = Convert.ToInt16(SourceCodes[2]); | 
 |  |  |                 oHtTaskCommand.W_Put_Layer = Convert.ToInt16(SourceCodes[3]); | 
 |  |  |                 oHtTaskCommand.W_Task_Type = 2; | 
 |  |  |                 string[] SourceCodes = task.SourceAddress.Split("-"); | 
 |  |  |                 if (SourceCodes.Length == 3) | 
 |  |  |                 { | 
 |  |  |                     oHtTaskCommand.W_Pick_Line = Convert.ToInt16(SourceCodes[0]); | 
 |  |  |                     oHtTaskCommand.W_Pick_Column = Convert.ToInt16(SourceCodes[1]); | 
 |  |  |                     oHtTaskCommand.W_Put_Line = 0; | 
 |  |  |                     oHtTaskCommand.W_Put_Column = 0; | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     //æ°æ®é
ç½®é误 | 
 |  |  |                     _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"任塿ºå°åé
ç½®é误ï¼"); | 
 |  |  |                     return null; | 
 |  |  |                 } | 
 |  |  |                 oHtTaskCommand.W_CheckValue = task.TaskType + Convert.ToInt16(SourceCodes[0]) + Convert.ToInt16(SourceCodes[1]); | 
 |  |  |             } | 
 |  |  |             else | 
 |  |  |             else if (task.TaskState == (int)TaskInStatusEnum.Line_Ingrab || task.TaskState == (int)TaskOutStatusEnum.SC_OutExecuting) | 
 |  |  |             { | 
 |  |  |                 //æ°æ®é
ç½®é误 | 
 |  |  |                 _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"任塿ºå°åé
ç½®é误ï¼"); | 
 |  |  |                 return null; | 
 |  |  |                 oHtTaskCommand.W_Task_Type = 3; | 
 |  |  |                 string[] SourceCodes = task.TargetAddress.Split("-"); | 
 |  |  |                 if (SourceCodes.Length == 3) | 
 |  |  |                 { | 
 |  |  |                     oHtTaskCommand.W_Pick_Line = 0; | 
 |  |  |                     oHtTaskCommand.W_Pick_Column =0; | 
 |  |  |                     oHtTaskCommand.W_Put_Line = Convert.ToInt16(SourceCodes[0]); | 
 |  |  |                     oHtTaskCommand.W_Put_Column = Convert.ToInt16(SourceCodes[1]); | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     //æ°æ®é
ç½®é误 | 
 |  |  |                     _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"任塿ºå°åé
ç½®é误ï¼"); | 
 |  |  |                     return null; | 
 |  |  |                 } | 
 |  |  |                 oHtTaskCommand.W_CheckValue = task.TaskType + Convert.ToInt16(SourceCodes[0]) + Convert.ToInt16(SourceCodes[1]); | 
 |  |  |             } | 
 |  |  |             string[] targetCodes = task.TargetAddress.Split("-"); | 
 |  |  |             if (targetCodes.Length == 3) | 
 |  |  |              | 
 |  |  |             if (task.WMSId==1) | 
 |  |  |             { | 
 |  |  |                 oHtTaskCommand.W_Put_Line = Convert.ToInt16(targetCodes[1]); | 
 |  |  |                 oHtTaskCommand.W_Put_Column = Convert.ToInt16(targetCodes[2]); | 
 |  |  |                 oHtTaskCommand.W_Put_Layer = Convert.ToInt16(targetCodes[3]); | 
 |  |  |                 oHtTaskCommand.W_Catch_1 = 1; | 
 |  |  |                 oHtTaskCommand.W_Catch_2 = 0; | 
 |  |  |                 oHtTaskCommand.W_CheckValue += 1; | 
 |  |  |             } | 
 |  |  |             else | 
 |  |  |             else if (task.WMSId == 2) | 
 |  |  |             { | 
 |  |  |                 //æ°æ®é
ç½®é误 | 
 |  |  |                 _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"ä»»å¡ç®æ å°åé
ç½®é误"); | 
 |  |  |                 return null; | 
 |  |  |                 oHtTaskCommand.W_Catch_1 = 0; | 
 |  |  |                 oHtTaskCommand.W_Catch_2 = 1; | 
 |  |  |                 oHtTaskCommand.W_CheckValue += 1; | 
 |  |  |             } | 
 |  |  |             else if (task.WMSId == 3) | 
 |  |  |             { | 
 |  |  |                 oHtTaskCommand.W_Catch_1 = 1; | 
 |  |  |                 oHtTaskCommand.W_Catch_2 = 1; | 
 |  |  |                 oHtTaskCommand.W_CheckValue += 2; | 
 |  |  |             } | 
 |  |  |             oHtTaskCommand.W_TaskNumber = task.TaskNum; | 
 |  |  |             oHtTaskCommand.W_CheckValue += task.TaskNum; | 
 |  |  |             return oHtTaskCommand; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  | 
 |  |  |         /// è·åä»»å¡ | 
 |  |  |         /// </summary> | 
 |  |  |         /// <returns></returns> | 
 |  |  |         private Dt_Task? GetTask() | 
 |  |  |         private Dt_Task? GetTask(string workType) | 
 |  |  |         { | 
 |  |  |             Dt_Task task; | 
 |  |  |             task = _taskService.QueryStackerCraneTask("R01"); | 
 |  |  |             task = _taskService.QueryStackerCraneTask(workType); | 
 |  |  |             if (task!=null && (task.TaskState==(int)TaskInStatusEnum.InNew|| task.TaskState == (int)TaskOutStatusEnum.OutNew)) | 
 |  |  |             { | 
 |  |  |                 if (task.TaskType == (int)TaskInboundTypeEnum.Inbound) | 
 |  |  |                 { | 
 |  |  |                     InorOut = "Out"; | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     InorOut = "In"; | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |             return task; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  |         /// <summary> | 
 |  |  |         /// ä»»å¡å· | 
 |  |  |         /// </summary> | 
 |  |  |         public short W_TaskNumber { get; set; } | 
 |  |  |         public int W_TaskNumber { get; set; } | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 |  |  |         /// æ ¡éªå¼  (ä»»å¡ç±»å+è£
è½¦å±æ°+åè¡+åå+åå±+æ¾è¡+æ¾å+æ¾å±+W_Catch_1+W_Catch_2+ä»»å¡å·) | 
 |  |  |         /// </summary> | 
 |  |  |         public short W_CheckValue { get; set; } | 
 |  |  |         public int W_CheckValue { get; set; } | 
 |  |  |  | 
 |  |  |         /// <summary> | 
 |  |  |         /// ç¡®è®¤ä¿¡å· | 
 |  |  |         /// </summary> | 
 |  |  |         public int W_ConfirmSignal { get; set; } | 
 |  |  |         public short W_ConfirmSignal { get; set; } | 
 |  |  |     } | 
 |  |  | } |