wanshenmean
2026-02-06 f9d341542aaacdd8595154c2d0bcae89f4865fa7
添加HTTP助手、系统配置模型及机器人任务层

引入HTTP工具和配置驱动的HTTP支持,以及初始机器人任务/领域脚手架。新增HttpRequestHelper、Sys_Config实体及相关枚举(Category、ConfigKey)以支持可配置的外部API调用;为WCS/WMS添加StockDTOs。创建了机器人任务抽象及实现:Dt_RobotTask模型、IRobotTaskRepository、IRobotTaskService、RobotTaskRepository、RobotTaskService,并更新了RobotJob和appsettings.json以集成这些变更。更新.gitignore以忽略额外的.vs/Copilot产物,并包含IDE DocumentLayout更新(工作空间状态)及部分WMS库存服务/接口变更。
已添加11个文件
已重命名1个文件
已修改12个文件
1408 ■■■■ 文件已修改
.gitignore 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/18.0.988.22099/CodeChunks.db 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/18.0.988.22099/SemanticSymbols.db 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/v18/DocumentLayout.json 220 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/HttpEnum/Category.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/HttpEnum/ConfigKey.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Http/HttpRequestHelper.cs 182 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Http/Sys_Config.cs 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/Stock/StockDTO.cs 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoRepository/IRobotTaskRepository.cs 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/IRobotTaskService.cs 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/TaskInfo/Dt_RobotTask.cs 114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoRepository/RobotTaskRepository.cs 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/RobotTaskService.cs 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotJob.cs 76 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/18.0.988.22099/CodeChunks.db 补丁 | 查看 | 原始文档 | blame | 历史
Code/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/18.0.988.22099/SemanticSymbols.db 补丁 | 查看 | 原始文档 | blame | 历史
Code/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/v18/DocumentLayout.backup.json 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/v18/DocumentLayout.json 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Stock/StockDTO.cs 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WMS/WIDESEA_WMSServer/WIDESEA_IStockService/IStockService.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockSerivce.cs 262 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目资料/设备协议/上位系统对接/QKNY-MES-FW-MES系统设备集成接口文档-V2.35-20250711.docx 补丁 | 查看 | 原始文档 | blame | 历史
.gitignore
@@ -410,3 +410,6 @@
*.db
Code/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/18.0.988.22099/CodeChunks.db
Code/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/18.0.988.22099/SemanticSymbols.db
/Code/WMS/WIDESEA_WMSServer/.vs/CopilotSnapshots
/Code/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/copilot-chat
/Code/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/v18
Code/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/18.0.988.22099/CodeChunks.db
Binary files differ
Code/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/18.0.988.22099/SemanticSymbols.db
Binary files differ
Code/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/v18/DocumentLayout.json
@@ -3,48 +3,28 @@
  "WorkspaceRootPath": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\",
  "Documents": [
    {
      "AbsoluteMoniker": "D:0:0:{294E4915-0241-4C8C-BA99-7588B945863A}|WIDESEAWCS_Tasks\\WIDESEAWCS_Tasks.csproj|d:\\git\\shanmeixinnengyuan\\code\\wcs\\wideseawcs_server\\wideseawcs_tasks\\stackercranejob\\commonstackercranejob.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
      "RelativeMoniker": "D:0:0:{294E4915-0241-4C8C-BA99-7588B945863A}|WIDESEAWCS_Tasks\\WIDESEAWCS_Tasks.csproj|solutionrelative:wideseawcs_tasks\\stackercranejob\\commonstackercranejob.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
      "AbsoluteMoniker": "D:0:0:{294E4915-0241-4C8C-BA99-7588B945863A}|WIDESEAWCS_Tasks\\WIDESEAWCS_Tasks.csproj|d:\\git\\shanmeixinnengyuan\\code\\wcs\\wideseawcs_server\\wideseawcs_tasks\\robotjob\\robotjob.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
      "RelativeMoniker": "D:0:0:{294E4915-0241-4C8C-BA99-7588B945863A}|WIDESEAWCS_Tasks\\WIDESEAWCS_Tasks.csproj|solutionrelative:wideseawcs_tasks\\robotjob\\robotjob.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
    },
    {
      "AbsoluteMoniker": "D:0:0:{6236BFFF-173D-44A8-9FC3-7C001EA30347}|WIDESEAWCS_QuartzJob\\WIDESEAWCS_QuartzJob.csproj|d:\\git\\shanmeixinnengyuan\\code\\wcs\\wideseawcs_server\\wideseawcs_quartzjob\\quartznet\\quartznetextension.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
      "RelativeMoniker": "D:0:0:{6236BFFF-173D-44A8-9FC3-7C001EA30347}|WIDESEAWCS_QuartzJob\\WIDESEAWCS_QuartzJob.csproj|solutionrelative:wideseawcs_quartzjob\\quartznet\\quartznetextension.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
      "AbsoluteMoniker": "D:0:0:{487FA45B-EA1A-4ACA-BB5B-0F6708F462C0}|WIDESEAWCS_Server\\WIDESEAWCS_Server.csproj|d:\\git\\shanmeixinnengyuan\\code\\wcs\\wideseawcs_server\\wideseawcs_server\\appsettings.json||{90A6B3A7-C1A3-4009-A288-E2FF89E96FA0}",
      "RelativeMoniker": "D:0:0:{487FA45B-EA1A-4ACA-BB5B-0F6708F462C0}|WIDESEAWCS_Server\\WIDESEAWCS_Server.csproj|solutionrelative:wideseawcs_server\\appsettings.json||{90A6B3A7-C1A3-4009-A288-E2FF89E96FA0}"
    },
    {
      "AbsoluteMoniker": "D:0:0:{6236BFFF-173D-44A8-9FC3-7C001EA30347}|WIDESEAWCS_QuartzJob\\WIDESEAWCS_QuartzJob.csproj|d:\\git\\shanmeixinnengyuan\\code\\wcs\\wideseawcs_server\\wideseawcs_quartzjob\\service\\deviceprotocoldetailservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
      "RelativeMoniker": "D:0:0:{6236BFFF-173D-44A8-9FC3-7C001EA30347}|WIDESEAWCS_QuartzJob\\WIDESEAWCS_QuartzJob.csproj|solutionrelative:wideseawcs_quartzjob\\service\\deviceprotocoldetailservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
      "AbsoluteMoniker": "D:0:0:{294E4915-0241-4C8C-BA99-7588B945863A}|WIDESEAWCS_Tasks\\WIDESEAWCS_Tasks.csproj|d:\\git\\shanmeixinnengyuan\\code\\wcs\\wideseawcs_server\\wideseawcs_tasks\\socketserver\\tcpsocketserver.messaging.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
      "RelativeMoniker": "D:0:0:{294E4915-0241-4C8C-BA99-7588B945863A}|WIDESEAWCS_Tasks\\WIDESEAWCS_Tasks.csproj|solutionrelative:wideseawcs_tasks\\socketserver\\tcpsocketserver.messaging.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
    },
    {
      "AbsoluteMoniker": "D:0:0:{6236BFFF-173D-44A8-9FC3-7C001EA30347}|WIDESEAWCS_QuartzJob\\WIDESEAWCS_QuartzJob.csproj|d:\\git\\shanmeixinnengyuan\\code\\wcs\\wideseawcs_server\\wideseawcs_quartzjob\\service\\ideviceprotocoldetailservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
      "RelativeMoniker": "D:0:0:{6236BFFF-173D-44A8-9FC3-7C001EA30347}|WIDESEAWCS_QuartzJob\\WIDESEAWCS_QuartzJob.csproj|solutionrelative:wideseawcs_quartzjob\\service\\ideviceprotocoldetailservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
      "AbsoluteMoniker": "D:0:0:{7F200FE8-CAF6-4131-BD25-8D438FE0ABAC}|WIDESEAWCS_Model\\WIDESEAWCS_Model.csproj|d:\\git\\shanmeixinnengyuan\\code\\wcs\\wideseawcs_server\\wideseawcs_model\\models\\taskinfo\\dt_robottask.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
      "RelativeMoniker": "D:0:0:{7F200FE8-CAF6-4131-BD25-8D438FE0ABAC}|WIDESEAWCS_Model\\WIDESEAWCS_Model.csproj|solutionrelative:wideseawcs_model\\models\\taskinfo\\dt_robottask.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
    },
    {
      "AbsoluteMoniker": "D:0:0:{6236BFFF-173D-44A8-9FC3-7C001EA30347}|WIDESEAWCS_QuartzJob\\WIDESEAWCS_QuartzJob.csproj|d:\\git\\shanmeixinnengyuan\\code\\wcs\\wideseawcs_server\\wideseawcs_quartzjob\\stackercrane\\spec\\spetemperaturestackercrane.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
      "RelativeMoniker": "D:0:0:{6236BFFF-173D-44A8-9FC3-7C001EA30347}|WIDESEAWCS_QuartzJob\\WIDESEAWCS_QuartzJob.csproj|solutionrelative:wideseawcs_quartzjob\\stackercrane\\spec\\spetemperaturestackercrane.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
      "AbsoluteMoniker": "D:0:0:{83F18A31-5983-4587-A0B2-414BF70E50B5}|WIDESEAWCS_TaskInfoService\\WIDESEAWCS_TaskInfoService.csproj|d:\\git\\shanmeixinnengyuan\\code\\wcs\\wideseawcs_server\\wideseawcs_taskinfoservice\\robottaskservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
      "RelativeMoniker": "D:0:0:{83F18A31-5983-4587-A0B2-414BF70E50B5}|WIDESEAWCS_TaskInfoService\\WIDESEAWCS_TaskInfoService.csproj|solutionrelative:wideseawcs_taskinfoservice\\robottaskservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
    },
    {
      "AbsoluteMoniker": "D:0:0:{6236BFFF-173D-44A8-9FC3-7C001EA30347}|WIDESEAWCS_QuartzJob\\WIDESEAWCS_QuartzJob.csproj|d:\\git\\shanmeixinnengyuan\\code\\wcs\\wideseawcs_server\\wideseawcs_quartzjob\\stackercrane\\spec\\speformationstackercrane.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
      "RelativeMoniker": "D:0:0:{6236BFFF-173D-44A8-9FC3-7C001EA30347}|WIDESEAWCS_QuartzJob\\WIDESEAWCS_QuartzJob.csproj|solutionrelative:wideseawcs_quartzjob\\stackercrane\\spec\\speformationstackercrane.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
    },
    {
      "AbsoluteMoniker": "D:0:0:{6236BFFF-173D-44A8-9FC3-7C001EA30347}|WIDESEAWCS_QuartzJob\\WIDESEAWCS_QuartzJob.csproj|d:\\git\\shanmeixinnengyuan\\code\\wcs\\wideseawcs_server\\wideseawcs_quartzjob\\stackercrane\\common\\commonstackercrane.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
      "RelativeMoniker": "D:0:0:{6236BFFF-173D-44A8-9FC3-7C001EA30347}|WIDESEAWCS_QuartzJob\\WIDESEAWCS_QuartzJob.csproj|solutionrelative:wideseawcs_quartzjob\\stackercrane\\common\\commonstackercrane.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
    },
    {
      "AbsoluteMoniker": "D:0:0:{6236BFFF-173D-44A8-9FC3-7C001EA30347}|WIDESEAWCS_QuartzJob\\WIDESEAWCS_QuartzJob.csproj|d:\\git\\shanmeixinnengyuan\\code\\wcs\\wideseawcs_server\\wideseawcs_quartzjob\\stackercrane\\istackercrane.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
      "RelativeMoniker": "D:0:0:{6236BFFF-173D-44A8-9FC3-7C001EA30347}|WIDESEAWCS_QuartzJob\\WIDESEAWCS_QuartzJob.csproj|solutionrelative:wideseawcs_quartzjob\\stackercrane\\istackercrane.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
    },
    {
      "AbsoluteMoniker": "D:0:0:{6236BFFF-173D-44A8-9FC3-7C001EA30347}|WIDESEAWCS_QuartzJob\\WIDESEAWCS_QuartzJob.csproj|d:\\git\\shanmeixinnengyuan\\code\\wcs\\wideseawcs_server\\wideseawcs_quartzjob\\stackercrane\\common\\istackercranebase.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
      "RelativeMoniker": "D:0:0:{6236BFFF-173D-44A8-9FC3-7C001EA30347}|WIDESEAWCS_QuartzJob\\WIDESEAWCS_QuartzJob.csproj|solutionrelative:wideseawcs_quartzjob\\stackercrane\\common\\istackercranebase.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
    },
    {
      "AbsoluteMoniker": "D:0:0:{6236BFFF-173D-44A8-9FC3-7C001EA30347}|WIDESEAWCS_QuartzJob\\WIDESEAWCS_QuartzJob.csproj|d:\\git\\shanmeixinnengyuan\\code\\wcs\\wideseawcs_server\\wideseawcs_quartzjob\\stackercrane\\common\\stackercranebase.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
      "RelativeMoniker": "D:0:0:{6236BFFF-173D-44A8-9FC3-7C001EA30347}|WIDESEAWCS_QuartzJob\\WIDESEAWCS_QuartzJob.csproj|solutionrelative:wideseawcs_quartzjob\\stackercrane\\common\\stackercranebase.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
    },
    {
      "AbsoluteMoniker": "D:0:0:{294E4915-0241-4C8C-BA99-7588B945863A}|WIDESEAWCS_Tasks\\WIDESEAWCS_Tasks.csproj|d:\\git\\shanmeixinnengyuan\\code\\wcs\\wideseawcs_server\\wideseawcs_tasks\\formationstackercranejob\\formationcommonstackercranejob.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
      "RelativeMoniker": "D:0:0:{294E4915-0241-4C8C-BA99-7588B945863A}|WIDESEAWCS_Tasks\\WIDESEAWCS_Tasks.csproj|solutionrelative:wideseawcs_tasks\\formationstackercranejob\\formationcommonstackercranejob.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
      "AbsoluteMoniker": "D:0:0:{7279A2AE-8D1F-4E66-A73A-01AF7927A336}|WIDESEAWCS_ITaskInfoService\\WIDESEAWCS_ITaskInfoService.csproj|d:\\git\\shanmeixinnengyuan\\code\\wcs\\wideseawcs_server\\wideseawcs_itaskinfoservice\\irobottaskservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
      "RelativeMoniker": "D:0:0:{7279A2AE-8D1F-4E66-A73A-01AF7927A336}|WIDESEAWCS_ITaskInfoService\\WIDESEAWCS_ITaskInfoService.csproj|solutionrelative:wideseawcs_itaskinfoservice\\irobottaskservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
    }
  ],
  "DocumentGroupContainers": [
@@ -54,34 +34,8 @@
      "DocumentGroups": [
        {
          "DockedWidth": 200,
          "SelectedChildIndex": 13,
          "SelectedChildIndex": 7,
          "Children": [
            {
              "$type": "Document",
              "DocumentIndex": 3,
              "Title": "IDeviceProtocolDetailService.cs",
              "DocumentMoniker": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_QuartzJob\\Service\\IDeviceProtocolDetailService.cs",
              "RelativeDocumentMoniker": "WIDESEAWCS_QuartzJob\\Service\\IDeviceProtocolDetailService.cs",
              "ToolTip": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_QuartzJob\\Service\\IDeviceProtocolDetailService.cs",
              "RelativeToolTip": "WIDESEAWCS_QuartzJob\\Service\\IDeviceProtocolDetailService.cs",
              "ViewState": "AgIAABMAAAAAAAAAAAAWwCkAAAAAAAAAAAAAAA==",
              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
              "WhenOpened": "2026-02-05T02:09:38.844Z",
              "EditorCaption": ""
            },
            {
              "$type": "Document",
              "DocumentIndex": 2,
              "Title": "DeviceProtocolDetailService.cs",
              "DocumentMoniker": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_QuartzJob\\Service\\DeviceProtocolDetailService.cs",
              "RelativeDocumentMoniker": "WIDESEAWCS_QuartzJob\\Service\\DeviceProtocolDetailService.cs",
              "ToolTip": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_QuartzJob\\Service\\DeviceProtocolDetailService.cs",
              "RelativeToolTip": "WIDESEAWCS_QuartzJob\\Service\\DeviceProtocolDetailService.cs",
              "ViewState": "AgIAACgAAAAAAAAAAAAuwEIAAABPAAAAAAAAAA==",
              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
              "WhenOpened": "2026-02-05T02:02:05.669Z",
              "EditorCaption": ""
            },
            {
              "$type": "Bookmark",
              "Name": "ST:128:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
@@ -97,119 +51,75 @@
            {
              "$type": "Document",
              "DocumentIndex": 1,
              "Title": "QuartzNetExtension.cs",
              "DocumentMoniker": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_QuartzJob\\QuartzNet\\QuartzNetExtension.cs",
              "RelativeDocumentMoniker": "WIDESEAWCS_QuartzJob\\QuartzNet\\QuartzNetExtension.cs",
              "ToolTip": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_QuartzJob\\QuartzNet\\QuartzNetExtension.cs",
              "RelativeToolTip": "WIDESEAWCS_QuartzJob\\QuartzNet\\QuartzNetExtension.cs",
              "ViewState": "AgIAAEcAAAAAAAAAAAApwF8AAACaAAAAAAAAAA==",
              "Title": "appsettings.json",
              "DocumentMoniker": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Server\\appsettings.json",
              "RelativeDocumentMoniker": "WIDESEAWCS_Server\\appsettings.json",
              "ToolTip": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Server\\appsettings.json",
              "RelativeToolTip": "WIDESEAWCS_Server\\appsettings.json",
              "ViewState": "AgIAACEAAAAAAAAAAAAAADoAAAABAAAAAAAAAA==",
              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001642|",
              "WhenOpened": "2026-02-05T09:49:23.094Z"
            },
            {
              "$type": "Document",
              "DocumentIndex": 3,
              "Title": "Dt_RobotTask.cs",
              "DocumentMoniker": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Model\\Models\\TaskInfo\\Dt_RobotTask.cs",
              "RelativeDocumentMoniker": "WIDESEAWCS_Model\\Models\\TaskInfo\\Dt_RobotTask.cs",
              "ToolTip": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Model\\Models\\TaskInfo\\Dt_RobotTask.cs",
              "RelativeToolTip": "WIDESEAWCS_Model\\Models\\TaskInfo\\Dt_RobotTask.cs",
              "ViewState": "AgIAAAAAAAAAAAAAAAAAAA8AAAAqAAAAAAAAAA==",
              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
              "WhenOpened": "2026-02-05T01:58:27.882Z",
              "EditorCaption": ""
              "WhenOpened": "2026-02-05T06:59:50.829Z"
            },
            {
              "$type": "Document",
              "DocumentIndex": 4,
              "Title": "SpeTemperatureStackerCrane.cs",
              "DocumentMoniker": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_QuartzJob\\StackerCrane\\Spec\\SpeTemperatureStackerCrane.cs",
              "RelativeDocumentMoniker": "WIDESEAWCS_QuartzJob\\StackerCrane\\Spec\\SpeTemperatureStackerCrane.cs",
              "ToolTip": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_QuartzJob\\StackerCrane\\Spec\\SpeTemperatureStackerCrane.cs",
              "RelativeToolTip": "WIDESEAWCS_QuartzJob\\StackerCrane\\Spec\\SpeTemperatureStackerCrane.cs",
              "ViewState": "AgIAAHgAAAAAAAAAAAArwAAAAAAAAAAAAAAAAA==",
              "Title": "RobotTaskService.cs",
              "DocumentMoniker": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_TaskInfoService\\RobotTaskService.cs",
              "RelativeDocumentMoniker": "WIDESEAWCS_TaskInfoService\\RobotTaskService.cs",
              "ToolTip": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_TaskInfoService\\RobotTaskService.cs",
              "RelativeToolTip": "WIDESEAWCS_TaskInfoService\\RobotTaskService.cs",
              "ViewState": "AgIAADYAAAAAAAAAAAA+wEkAAAB+AAAAAAAAAA==",
              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
              "WhenOpened": "2026-02-05T01:47:49.291Z",
              "EditorCaption": ""
            },
            {
              "$type": "Document",
              "DocumentIndex": 8,
              "Title": "IStackerCraneBase.cs",
              "DocumentMoniker": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_QuartzJob\\StackerCrane\\Common\\IStackerCraneBase.cs",
              "RelativeDocumentMoniker": "WIDESEAWCS_QuartzJob\\StackerCrane\\Common\\IStackerCraneBase.cs",
              "ToolTip": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_QuartzJob\\StackerCrane\\Common\\IStackerCraneBase.cs",
              "RelativeToolTip": "WIDESEAWCS_QuartzJob\\StackerCrane\\Common\\IStackerCraneBase.cs",
              "ViewState": "AgIAAAAAAAAAAAAAAAAAAAoAAAAmAAAAAAAAAA==",
              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
              "WhenOpened": "2026-02-05T01:35:31.591Z",
              "EditorCaption": ""
            },
            {
              "$type": "Document",
              "DocumentIndex": 7,
              "Title": "IStackerCrane.cs",
              "DocumentMoniker": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_QuartzJob\\StackerCrane\\IStackerCrane.cs",
              "RelativeDocumentMoniker": "WIDESEAWCS_QuartzJob\\StackerCrane\\IStackerCrane.cs",
              "ToolTip": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_QuartzJob\\StackerCrane\\IStackerCrane.cs",
              "RelativeToolTip": "WIDESEAWCS_QuartzJob\\StackerCrane\\IStackerCrane.cs",
              "ViewState": "AgIAAAAAAAAAAAAAAAAAAEUAAAAVAAAAAAAAAA==",
              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
              "WhenOpened": "2026-02-05T01:33:41.091Z",
              "EditorCaption": ""
              "WhenOpened": "2026-02-05T06:22:00.192Z"
            },
            {
              "$type": "Document",
              "DocumentIndex": 5,
              "Title": "SpeFormationStackerCrane.cs",
              "DocumentMoniker": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_QuartzJob\\StackerCrane\\Spec\\SpeFormationStackerCrane.cs",
              "RelativeDocumentMoniker": "WIDESEAWCS_QuartzJob\\StackerCrane\\Spec\\SpeFormationStackerCrane.cs",
              "ToolTip": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_QuartzJob\\StackerCrane\\Spec\\SpeFormationStackerCrane.cs",
              "RelativeToolTip": "WIDESEAWCS_QuartzJob\\StackerCrane\\Spec\\SpeFormationStackerCrane.cs",
              "ViewState": "AgIAAJgBAAAAAAAAAAAmwAAAAAAAAAAAAAAAAA==",
              "Title": "IRobotTaskService.cs",
              "DocumentMoniker": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_ITaskInfoService\\IRobotTaskService.cs",
              "RelativeDocumentMoniker": "WIDESEAWCS_ITaskInfoService\\IRobotTaskService.cs",
              "ToolTip": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_ITaskInfoService\\IRobotTaskService.cs",
              "RelativeToolTip": "WIDESEAWCS_ITaskInfoService\\IRobotTaskService.cs",
              "ViewState": "AgIAACQAAAAAAAAAAAAAADgAAAA5AAAAAAAAAA==",
              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
              "WhenOpened": "2026-02-05T01:32:15.17Z",
              "EditorCaption": ""
            },
            {
              "$type": "Document",
              "DocumentIndex": 10,
              "Title": "FormationCommonStackerCraneJob.cs",
              "DocumentMoniker": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Tasks\\FormationStackerCraneJob\\FormationCommonStackerCraneJob.cs",
              "RelativeDocumentMoniker": "WIDESEAWCS_Tasks\\FormationStackerCraneJob\\FormationCommonStackerCraneJob.cs",
              "ToolTip": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Tasks\\FormationStackerCraneJob\\FormationCommonStackerCraneJob.cs",
              "RelativeToolTip": "WIDESEAWCS_Tasks\\FormationStackerCraneJob\\FormationCommonStackerCraneJob.cs",
              "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
              "WhenOpened": "2026-02-05T01:25:52.745Z",
              "EditorCaption": ""
            },
            {
              "$type": "Document",
              "DocumentIndex": 9,
              "Title": "StackerCraneBase.cs",
              "DocumentMoniker": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_QuartzJob\\StackerCrane\\Common\\StackerCraneBase.cs",
              "RelativeDocumentMoniker": "WIDESEAWCS_QuartzJob\\StackerCrane\\Common\\StackerCraneBase.cs",
              "ToolTip": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_QuartzJob\\StackerCrane\\Common\\StackerCraneBase.cs",
              "RelativeToolTip": "WIDESEAWCS_QuartzJob\\StackerCrane\\Common\\StackerCraneBase.cs",
              "ViewState": "AgIAAAMAAAAAAAAAAAAAABoAAAAAAAAAAAAAAA==",
              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
              "WhenOpened": "2026-02-04T09:07:44.097Z",
              "EditorCaption": ""
            },
            {
              "$type": "Document",
              "DocumentIndex": 6,
              "Title": "CommonStackerCrane.cs",
              "DocumentMoniker": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_QuartzJob\\StackerCrane\\Common\\CommonStackerCrane.cs",
              "RelativeDocumentMoniker": "WIDESEAWCS_QuartzJob\\StackerCrane\\Common\\CommonStackerCrane.cs",
              "ToolTip": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_QuartzJob\\StackerCrane\\Common\\CommonStackerCrane.cs",
              "RelativeToolTip": "WIDESEAWCS_QuartzJob\\StackerCrane\\Common\\CommonStackerCrane.cs",
              "ViewState": "AgIAAJUAAAAAAAAAAAAuwKIAAABXAAAAAAAAAA==",
              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
              "WhenOpened": "2026-02-04T09:07:35.823Z",
              "EditorCaption": ""
              "WhenOpened": "2026-02-05T06:20:31.002Z"
            },
            {
              "$type": "Document",
              "DocumentIndex": 0,
              "Title": "CommonStackerCraneJob.cs",
              "DocumentMoniker": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Tasks\\StackerCraneJob\\CommonStackerCraneJob.cs",
              "RelativeDocumentMoniker": "WIDESEAWCS_Tasks\\StackerCraneJob\\CommonStackerCraneJob.cs",
              "ToolTip": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Tasks\\StackerCraneJob\\CommonStackerCraneJob.cs",
              "RelativeToolTip": "WIDESEAWCS_Tasks\\StackerCraneJob\\CommonStackerCraneJob.cs",
              "ViewState": "AgIAACoAAAAAAAAAAAAkwDwAAABIAAAAAAAAAA==",
              "Title": "RobotJob.cs",
              "DocumentMoniker": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Tasks\\RobotJob\\RobotJob.cs",
              "RelativeDocumentMoniker": "WIDESEAWCS_Tasks\\RobotJob\\RobotJob.cs",
              "ToolTip": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Tasks\\RobotJob\\RobotJob.cs",
              "RelativeToolTip": "WIDESEAWCS_Tasks\\RobotJob\\RobotJob.cs",
              "ViewState": "AgIAAHYAAAAAAAAAAAAMwJQAAABAAAAAAAAAAA==",
              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
              "WhenOpened": "2026-02-04T07:48:56.632Z",
              "WhenOpened": "2026-02-05T05:38:04.031Z",
              "EditorCaption": ""
            },
            {
              "$type": "Document",
              "DocumentIndex": 2,
              "Title": "TcpSocketServer.Messaging.cs",
              "DocumentMoniker": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Tasks\\SocketServer\\TcpSocketServer.Messaging.cs",
              "RelativeDocumentMoniker": "WIDESEAWCS_Tasks\\SocketServer\\TcpSocketServer.Messaging.cs",
              "ToolTip": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Tasks\\SocketServer\\TcpSocketServer.Messaging.cs",
              "RelativeToolTip": "WIDESEAWCS_Tasks\\SocketServer\\TcpSocketServer.Messaging.cs",
              "ViewState": "AgIAABEAAAAAAAAAAADwvzYAAAAYAAAAAAAAAA==",
              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
              "WhenOpened": "2026-02-05T01:11:51.439Z"
            }
          ]
        }
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/HttpEnum/Category.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_Common.HttpEnum
{
    public enum Category
    {
        ERP,
        WMS,
        MES,
    }
}
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/HttpEnum/ConfigKey.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_Common.HttpEnum
{
    public enum ConfigKey
    {
        ERP_API_Base,
        ERP_API_Url,
        ERP_API_Timeout,
        WMS_API_Base,
        WMS_API_Url,
        WMS_API_Timeout,
        MES_API_Base,
        MES_API_Url,
        MES_API_Timeout
    }
}
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Http/HttpRequestHelper.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,182 @@
using SqlSugar;
using System.Text;
using WIDESEAWCS_Code;
using WIDESEAWCS_Core.Helper;
namespace WIDESEAWCS_Core.Http
{
    public static class HttpRequestHelper
    {
        /// <summary>
        /// å¼‚步发送HTTP请求并返回响应内容
        /// </summary>
        /// <param name="serviceAddress">请求地址</param>
        /// <param name="method">请求方法</param>
        /// <param name="requestContent">请求内容</param>
        /// <param name="contentType">内容类型</param>
        /// <param name="timeOut">超时时间(秒)</param>
        /// <param name="headers">请求头</param>
        /// <returns>响应内容</returns>
        public static async Task<string> SendAsync(string serviceAddress, HttpMethod method, string? requestContent = null, string contentType = "application/json", int timeOut = 60, Dictionary<string, string>? headers = null)
        {
            using HttpClient httpClient = new HttpClient();
            httpClient.Timeout = new TimeSpan(0, 0, timeOut);
            using HttpRequestMessage request = new HttpRequestMessage(method, serviceAddress);
            if (!string.IsNullOrWhiteSpace(requestContent))
            {
                request.Content = new StringContent(requestContent, Encoding.UTF8, contentType);
            }
            if (headers != null)
            {
                foreach (var header in headers)
                {
                    request.Headers.TryAddWithoutValidation(header.Key, header.Value);
                }
            }
            using HttpResponseMessage response = await httpClient.SendAsync(request);
            string result = await response.Content.ReadAsStringAsync();
            if (!response.IsSuccessStatusCode)
            {
                throw new Exception($"异常,响应码:{(int)response.StatusCode},原因:{response.ReasonPhrase}");
            }
            return result;
        }
        /// <summary>
        /// å¼‚步发送HTTP GET请求并返回响应内容
        /// </summary>
        public static Task<string> GetAsync(string serviceAddress, int timeOut = 60, Dictionary<string, string>? headers = null)
        {
            return SendAsync(serviceAddress, HttpMethod.Get, null, "application/json", timeOut, headers);
        }
        /// <summary>
        /// å¼‚步发送HTTP POST请求并返回响应内容
        /// </summary>
        public static Task<string> PostAsync(string serviceAddress, string? requestJson = null, string contentType = "application/json", int timeOut = 60, Dictionary<string, string>? headers = null)
        {
            return SendAsync(serviceAddress, HttpMethod.Post, requestJson, contentType, timeOut, headers);
        }
        /// <summary>
        /// å¼‚步发送HTTP PUT请求并返回响应内容
        /// </summary>
        public static Task<string> PutAsync(string serviceAddress, string? requestJson = null, string contentType = "application/json", int timeOut = 60, Dictionary<string, string>? headers = null)
        {
            return SendAsync(serviceAddress, HttpMethod.Put, requestJson, contentType, timeOut, headers);
        }
        /// <summary>
        /// å¼‚步发送HTTP DELETE请求并返回响应内容
        /// </summary>
        public static Task<string> DeleteAsync(string serviceAddress, int timeOut = 60, Dictionary<string, string>? headers = null)
        {
            return SendAsync(serviceAddress, HttpMethod.Delete, null, "application/json", timeOut, headers);
        }
        /// <summary>
        /// æ ¹æ®æ•°æ®åº“配置发送HTTP请求并返回响应内容
        /// </summary>
        /// <param name="requestContent">请求内容</param>
        /// <param name="method">请求方法</param>
        /// <param name="category">配置分类</param>
        /// <param name="categoryItem">配置项</param>
        /// <param name="contentType">内容类型</param>
        /// <param name="timeOut">超时时间(秒)</param>
        /// <returns>响应内容</returns>
        public static async Task<string> SendAsync(string? requestContent, HttpMethod method, string? category, string? configKey, string contentType = "application/json", int timeOut = 60)
        {
            ISqlSugarClient? db = App.GetService<ISqlSugarClient>();
            if (db == null)
            {
                throw new InvalidOperationException("数据库服务未初始化");
            }
            var configs = await db.Ado.SqlQueryAsync<Sys_Config>(
                "SELECT * FROM Sys_Config WHERE Category = @Category",
                new { Category = category });
            if (configs.IsNullOrEmpty())
            {
                throw new Exception($"未找到配置分类:{category}");
            }
            string address = string.Empty;
            string servicePath = string.Empty;
            Dictionary<string, string> configDict = new Dictionary<string, string>();
            foreach (var config in configs)
            {
                if (config.CategoryItem == "Header")
                {
                    configDict[config.ConfigKey] = config.ConfigValue;
                    continue;
                }
                if (config.ConfigKey == "BASE")
                {
                    address = config.ConfigValue;
                    continue;
                }
                if (!string.IsNullOrWhiteSpace(configKey) && config.ConfigKey == configKey)
                {
                    servicePath = config.ConfigValue;
                }
            }
            if (string.IsNullOrWhiteSpace(address))
            {
                throw new Exception($"未找到配置地址:{category} - BASE");
            }
            string normalizedPath = string.IsNullOrWhiteSpace(servicePath)
                ? string.Empty
                : (servicePath.StartsWith("/") ? servicePath : $"/{servicePath}");
            string serviceAddress = $"{address}{normalizedPath}";
            if (method == HttpMethod.Get)
            {
                return await GetAsync(serviceAddress, timeOut, configDict);
            }
            if (method == HttpMethod.Post)
            {
                return await PostAsync(serviceAddress, requestContent, contentType, timeOut, configDict);
            }
            if (method == HttpMethod.Put)
            {
                return await PutAsync(serviceAddress, requestContent, contentType, timeOut, configDict);
            }
            if (method == HttpMethod.Delete)
            {
                return await DeleteAsync(serviceAddress, timeOut, configDict);
            }
            throw new NotSupportedException($"不支持的请求方法:{method}");
        }
        /// <summary>
        /// æŒ‰é…ç½®åˆ†ç±»å‘送GET请求
        /// </summary>
        public static Task<string> HTTPGetAsync(string category, string? requestContent, string? configKey, int timeOut = 60)
        {
            return SendAsync(requestContent, HttpMethod.Get, category, configKey, "application/json", timeOut);
        }
        /// <summary>
        /// æŒ‰é…ç½®åˆ†ç±»å‘送POST请求
        /// </summary>
        public static Task<string> HTTPPostAsync(string category, string? requestContent, string? configKey, int timeOut = 60)
        {
            return SendAsync(requestContent, HttpMethod.Post, category, configKey, "application/json", timeOut);
        }
    }
}
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Http/Sys_Config.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,89 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core.Tenants;
namespace WIDESEAWCS_Code
{
    /// <summary>
    /// é…ç½®è¡¨å®žä½“
    /// </summary>
    [SugarTable("Sys_Config", "组织架构"), MultiTenant]
    public class Sys_Config
    {
        /// <summary>
        /// ä¸»é”®ID
        /// </summary>
        [SugarColumn(IsIdentity = true, IsPrimaryKey = true, ColumnDescription = "主键ID")]
        public int Id { get; set; }
        /// <summary>
        /// é…ç½®é”®
        /// </summary>
        [SugarColumn(Length = 255, ColumnDescription = "配置键")]
        public string ConfigKey { get; set; }
        /// <summary>
        /// é…ç½®å€¼
        /// </summary>
        [SugarColumn(ColumnDataType = "text", ColumnDescription = "配置值")]
        public string ConfigValue { get; set; }
        /// <summary>
        /// åˆ†ç±»
        /// </summary>
        [SugarColumn(Length = 255, ColumnDescription = "分类")]
        public string Category { get; set; }
        /// <summary>
        /// å¤‡æ³¨
        /// </summary>
        [SugarColumn(Length = 255, ColumnDescription = "备注")]
        public string Remark { get; set; }
        /// <summary>
        /// æŽ’序码
        /// </summary>
        [SugarColumn(ColumnDescription = "排序码")]
        public int SortCode { get; set; }
        /// <summary>
        /// çŠ¶æ€
        /// </summary>
        [SugarColumn(Length = 20, ColumnDescription = "状态")]
        public string Status { get; set; }
        /// <summary>
        /// åˆ›å»ºäºº
        /// </summary>
        [SugarColumn(Length = 255, ColumnDescription = "创建人")]
        public string Creater { get; set; }
        /// <summary>
        /// åˆ›å»ºæ—¶é—´
        /// </summary>
        [SugarColumn(ColumnDescription = "创建时间")]
        public DateTime CreateDate { get; set; }
        /// <summary>
        /// ä¿®æ”¹äºº
        /// </summary>
        [SugarColumn(Length = 255, ColumnDescription = "修改人")]
        public string Modifier { get; set; }
        /// <summary>
        /// ä¿®æ”¹æ—¶é—´
        /// </summary>
        [SugarColumn(ColumnDescription = "修改时间")]
        public DateTime ModifyDate { get; set; }
        /// <summary>
        /// åˆ†ç±»é¡¹ç›®
        /// </summary>
        [SugarColumn(Length = 255, ColumnDescription = "分类项目")]
        public string CategoryItem { get; set; }
    }
}
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/Stock/StockDTO.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_DTO.Stock
{
    public class StockDTO
    {
        /// <summary>
        /// æ¥æºæ‰˜ç›˜å·
        /// </summary>
        public string? SourcePalletNo { get; set; }
        /// <summary>
        /// ç›®æ ‡æ‰˜ç›˜å·
        /// </summary>
        public string? TargetPalletNo { get; set; }
        /// <summary>
        /// æ¥æºçº¿ä½“编号
        /// </summary>
        public string? SourceLineNo { get; set; } = string.Empty;
        /// <summary>
        /// ç›®æ ‡çº¿ä½“编号
        /// </summary>
        public string? TargetLineNo { get; set; } = string.Empty;
        public List<StockDetailDTO> Details { get; set; } = new List<StockDetailDTO>();
    }
    public class StockDetailDTO
    {
        /// <summary>
        /// æ•°é‡
        /// </summary>
        public int Quantity { get; set; }
        /// <summary>
        /// é€šé“
        /// </summary>
        public int Channel { get; set; }
        /// <summary>
        /// è´§æ ¼æ¡ç 
        /// </summary>
        public string CellBarcode { get; set; }
    }
}
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoRepository/IRobotTaskRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,32 @@
#region << ç‰ˆ æœ¬ æ³¨ é‡Š >>
/*----------------------------------------------------------------
 * å‘½åç©ºé—´ï¼šWIDESEAWCS_ITaskInfoRepository
 * åˆ›å»ºè€…:胡童庆
 * åˆ›å»ºæ—¶é—´ï¼š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;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_ITaskInfoRepository
{
    public interface IRobotTaskRepository : IRepository<Dt_RobotTask>
    {
    }
}
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/IRobotTaskService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,59 @@
#region << ç‰ˆ æœ¬ æ³¨ é‡Š >>
/*----------------------------------------------------------------
 * å‘½åç©ºé—´ï¼šWIDESEAWCS_ITaskInfoService
 * åˆ›å»ºè€…:胡童庆
 * åˆ›å»ºæ—¶é—´ï¼š2024/8/2 16:13:36
 * ç‰ˆæœ¬ï¼šV1.0.0
 * æè¿°ï¼š
 *
 * ----------------------------------------------------------------
 * ä¿®æ”¹äººï¼š
 * ä¿®æ”¹æ—¶é—´ï¼š
 * ç‰ˆæœ¬ï¼šV1.0.1
 * ä¿®æ”¹è¯´æ˜Žï¼š
 *
 *----------------------------------------------------------------*/
#endregion << ç‰ˆ æœ¬ æ³¨ é‡Š >>
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Core.Enums;
using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_Common.TaskEnum;
namespace WIDESEAWCS_ITaskInfoService
{
    public interface IRobotTaskService : IService<Dt_RobotTask>
    {
        /// <summary>
        /// ä»»åŠ¡æŽ’åº
        /// </summary>
        public Dictionary<string, OrderByType> TaskOrderBy { get; set; }
        /// <summary>
        /// æ‰€æœ‰å…¥åº“任务类型
        /// </summary>
        public List<int> TaskInboundTypes { get; }
        /// <summary>
        /// æ‰€æœ‰å‡ºåº“任务类型
        /// </summary>
        public List<int> TaskOutboundTypes { get; }
        /// <summary>
        /// æ‰€æœ‰å‡ºåº“任务类型
        /// </summary>
        public List<int> TaskRobotTypes { get; }
        public Dt_RobotTask? QueryRobotCraneTask(string deviceCode);
    }
}
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/TaskInfo/Dt_RobotTask.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,114 @@
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_RobotTask), "任务信息")]
    public class Dt_RobotTask : BaseEntity
    {
        /// <summary>
        /// æœºå™¨äººä»»åŠ¡ID
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, ColumnDescription = "机器人任务ID")]
        public int RobotTaskId { get; set; }
        /// <summary>
        /// æœºå™¨äººä»»åŠ¡ç¼–å·
        /// </summary>
        [SugarColumn(ColumnDescription = "机器人任务编号")]
        public int RobotTaskNum { get; set; }
        /// <summary>
        /// æœºå™¨äººå··é“
        /// </summary>
        [SugarColumn(Length = 20, ColumnDescription = "机器人巷道")]
        public string RobotRoadway { get; set; }
        /// <summary>
        /// æœºå™¨äººä»»åŠ¡ç±»åž‹
        /// </summary>
        [SugarColumn(ColumnDescription = "机器人任务类型")]
        public int RobotTaskType { get; set; }
        /// <summary>
        /// æœºå™¨äººä»»åŠ¡çŠ¶æ€
        /// </summary>
        [SugarColumn(ColumnDescription = "机器人任务状态")]
        public int RobotTaskState { get; set; }
        /// <summary>
        /// æœºå™¨äººä»»åŠ¡æ€»æ•°
        /// </summary>
        [SugarColumn(ColumnDescription = "机器人任务总数")]
        public int RobotTaskTotalNum { get; set; }
        /// <summary>
        /// æœºå™¨äººæ¥æºåœ°å€
        /// </summary>
        [SugarColumn(Length = 20, ColumnDescription = "机器人来源地址")]
        public string RobotSourceAddress { get; set; }
        /// <summary>
        /// æœºå™¨äººç›®æ ‡åœ°å€
        /// </summary>
        [SugarColumn(Length = 20, ColumnDescription = "机器人目标地址")]
        public string RobotTargetAddress { get; set; }
        /// <summary>
        /// æœºå™¨äººæ¥æºåœ°å€çº¿ä»£ç 
        /// </summary>
        [SugarColumn(Length = 20, ColumnDescription = "机器人来源地址线代码")]
        public string RobotSourceAddressLineCode { get; set; }
        /// <summary>
        /// æœºå™¨äººç›®æ ‡åœ°å€çº¿ä»£ç 
        /// </summary>
        [SugarColumn(Length = 20, ColumnDescription = "机器人目标地址线代码")]
        public string RobotTargetAddressLineCode { get; set; }
        /// <summary>
        /// æœºå™¨äººæ¥æºåœ°å€çº¿æ‰˜ç›˜ä»£ç 
        /// </summary>
        [SugarColumn(Length = 20, ColumnDescription = "机器人来源地址线托盘代码")]
        public string RobotSourceAddressPalletCode { get; set; }
        /// <summary>
        /// æœºå™¨äººç›®æ ‡åœ°å€çº¿æ‰˜ç›˜ä»£ç 
        /// </summary>
        [SugarColumn(Length = 20, ColumnDescription = "机器人目标地址线托盘代码")]
        public string RobotTargetAddressPalletCode { get; set; }
        /// <summary>
        /// æœºå™¨äººå¼‚常信息
        /// </summary>
        [SugarColumn(ColumnDescription = "机器人异常信息")]
        public string RobotExceptionMessage { get; set; }
        /// <summary>
        /// æœºå™¨äººç­‰çº§/优先级
        /// </summary>
        [SugarColumn(ColumnDescription = "机器人等级/优先级")]
        public int RobotGrade { get; set; }
        /// <summary>
        /// æœºå™¨äººè°ƒåº¦æ—¶é—´
        /// </summary>
        [SugarColumn(ColumnDescription = "机器人调度时间")]
        public DateTime? RobotDispatchertime { get; set; }
        /// <summary>
        /// æœºå™¨äººå¤‡æ³¨
        /// </summary>
        [SugarColumn(Length = 50, ColumnDescription = "机器人备注")]
        public string RobotRemark { get; set; }
    }
}
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json
@@ -52,7 +52,7 @@
    "Backlog": 1000,   //最大连接数 
    "EncodingName": "utf-8",  //编码方式
    "AutoDetectEncoding": true,   //是否自动检测编码
    "IdleTimeoutSeconds": 300,   //空闲超时时间,单位秒,0表示不超时
    "IdleTimeoutSeconds": 0,   //空闲超时时间,单位秒,0表示不超时
    "EnableHeartbeat": true,   //是否启用心跳检测
    "LogFilePath": "socketserver.log"  //日志文件路径
  }
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoRepository/RobotTaskRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,35 @@
#region << ç‰ˆ æœ¬ æ³¨ é‡Š >>
/*----------------------------------------------------------------
 * å‘½åç©ºé—´ï¼šWIDESEAWCS_TaskInfoRepository
 * åˆ›å»ºè€…:胡童庆
 * åˆ›å»ºæ—¶é—´ï¼š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;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_TaskInfoRepository
{
    public class RobotTaskRepository : RepositoryBase<Dt_RobotTask>, IRobotTaskRepository
    {
        public RobotTaskRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
        {
        }
    }
}
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/RobotTaskService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,77 @@
#region << ç‰ˆ æœ¬ æ³¨ é‡Š >>
/*----------------------------------------------------------------
 * å‘½åç©ºé—´ï¼šWIDESEAWCS_TaskInfoService
 * åˆ›å»ºè€…:胡童庆
 * åˆ›å»ºæ—¶é—´ï¼š2024/8/2 16:13:36
 * ç‰ˆæœ¬ï¼šV1.0.0
 * æè¿°ï¼š
 *
 * ----------------------------------------------------------------
 * ä¿®æ”¹äººï¼š
 * ä¿®æ”¹æ—¶é—´ï¼š
 * ç‰ˆæœ¬ï¼šV1.0.1
 * ä¿®æ”¹è¯´æ˜Žï¼š
 *
 *----------------------------------------------------------------*/
#endregion << ç‰ˆ æœ¬ æ³¨ é‡Š >>
using AutoMapper;
using SqlSugar;
using System.Diagnostics.CodeAnalysis;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Core.Enums;
using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob.Models;
using WIDESEAWCS_QuartzJob.Service;
namespace WIDESEAWCS_TaskInfoService
{
    public class RobotTaskService : ServiceBase<Dt_RobotTask, IRobotTaskRepository>, IRobotTaskService
    {
        private readonly IMapper _mapper;
        private Dictionary<string, OrderByType> _taskOrderBy = new()
            {
                {nameof(Dt_RobotTask.RobotGrade),OrderByType.Desc },
                {nameof(Dt_RobotTask.CreateDate),OrderByType.Asc},
            };
        public Dictionary<string, OrderByType> TaskOrderBy
        { get { return _taskOrderBy; } set { _taskOrderBy = value; } }
        public List<int> TaskInboundTypes => typeof(TaskInboundTypeEnum).GetEnumIndexList();
        public List<int> TaskOutboundTypes => typeof(TaskOutboundTypeEnum).GetEnumIndexList();
        public List<int> TaskRobotTypes => typeof(TaskOtherTypeEnum).GetEnumIndexList();
        public RobotTaskService(IRobotTaskRepository BaseDal, IMapper mapper) : base(BaseDal)
        {
            _mapper = mapper;
        }
        public override WebResponseContent DeleteData(object[] keys)
        {
            List<int> taskKeys = new List<int>();
            for (int i = 0; i < keys.Length; i++)
            {
                taskKeys.Add(Convert.ToInt32(keys[i]));
            }
            List<Dt_RobotTask> tasks = BaseDal.QueryData(x => taskKeys.Contains(x.RobotTaskId));
            BaseDal.DeleteAndMoveIntoHty(tasks, OperateTypeEnum.人工删除);
            return WebResponseContent.Instance.OK($"成功删除{tasks.Count}条数据");
        }
        public Dt_RobotTask? QueryRobotCraneTask(string deviceCode)
        {
            return BaseDal.QueryFirst(x => x.RobotRoadway == deviceCode && x.RobotTaskState <= (int)TaskRobotStatusEnum.RobotExecuting, TaskOrderBy);
        }
    }
}
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotJob.cs
@@ -2,6 +2,7 @@
using System.Collections.Concurrent;
using System.Net.Sockets;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_DTO.Stock;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
@@ -17,27 +18,24 @@
        private readonly TcpSocketServer _TcpSocket;
        private static readonly ConcurrentDictionary<string, RobotSocketState> _socketStates = new();
        private static int _eventSubscribedFlag;
        private readonly ITaskService _taskService;
        private readonly IRobotTaskService _taskService;
        private readonly ITaskExecuteDetailService _taskExecuteDetailService;
        private readonly ITaskRepository _taskRepository;
        private readonly IRouterService _routerService;
        public RobotJob(TcpSocketServer TcpSocket, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService)
        public RobotJob(TcpSocketServer TcpSocket, IRobotTaskService taskService)
        {
            _TcpSocket = TcpSocket;
            _taskService = taskService;
            _taskExecuteDetailService = taskExecuteDetailService;
            _taskRepository = taskRepository;
            _routerService = routerService;
        }
        public Task Execute(IJobExecutionContext context)
        public async Task Execute(IJobExecutionContext context)
        {
            bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value);
            RobotCraneDevice robotCrane = (RobotCraneDevice?)value ?? new RobotCraneDevice();
            if (!flag || robotCrane.IsNullOrEmpty())
            {
                return Task.CompletedTask;
                return;
            }
            string ipAddress = robotCrane.IPAddress;
@@ -56,7 +54,7 @@
            var clientIds = _TcpSocket.GetClientIds();
            if (!clientIds.Contains(ipAddress))
            {
                return Task.CompletedTask;
                return;
            }
            // è®¢é˜…一次 message äº‹ä»¶ï¼ˆå…¨å±€ä¸€æ¬¡ï¼‰
@@ -74,13 +72,34 @@
            }
            // èŽ·å–ä»»åŠ¡å¹¶ç¼“å­˜åˆ°çŠ¶æ€ä¸­
            Dt_Task? task = GetTask(robotCrane);
            Dt_RobotTask? task = GetTask(robotCrane);
            if (task != null)
            {
                state.CurrentTask = task;
                if (task.RobotTaskTotalNum != 48)
                {
                    // å¤„理正在执行的任务
                    if (state.RobotRunMode == 1 && state.RobotControlMode == 1)
                    {
                        await Task.Delay(1000);
                        if ((state.CurrentAction == "Homed" || state.CurrentAction == "PickFinished" || state.CurrentAction == "PutFinished") && state.OperStatus == "Running")
                        {
                            // TODO è¯»å–线体电池条码,发送取电池指令
                            if (true)
                            {
                                // æ¨¡æ‹Ÿè¯»å–条码
                                state.CellBarcode = new string[] { "CellBarcode1", "CellBarcode2", "CellBarcode3", "CellBarcode4" };
                                string taskString = $"Pickbattery,{task.RobotSourceAddress}";
                                // å‘送任务指令
                                bool result = await _TcpSocket.SendToClientAsync(ipAddress, taskString);
                            }
                        }
                    }
                }
            }
            return Task.CompletedTask;
            return;
        }
        /// <summary>
@@ -133,6 +152,24 @@
                        else if (cmd.StartsWith("putfinished"))
                        {
                            state.LastPutPositions = positions;
                            // å‘送数据给WMS组盘/换盘
                            StockDTO stockDTO = new StockDTO
                            {
                                SourceLineNo = state.CurrentTask?.RobotSourceAddressLineCode,
                                SourcePalletNo = state.CurrentTask?.RobotSourceAddressPalletCode,
                                TargetPalletNo = state.CurrentTask?.RobotTargetAddressPalletCode,
                                TargetLineNo = state.CurrentTask?.RobotTargetAddressLineCode,
                                Details = positions
                                    .Where(x => x > 0)
                                    .OrderBy(x => x)
                                    .Select((x, idx) => new StockDetailDTO
                                    {
                                        Quantity = state.CurrentTask?.RobotTaskTotalNum ?? 1,
                                        Channel = x > 0 ? x : throw new ArgumentOutOfRangeException(nameof(x), "Channel must be positive"),
                                        CellBarcode = state.CellBarcode[idx]
                                    })
                                    .ToList()
                            };
                            state.CurrentAction = "PutFinished";
                        }
                    }
@@ -173,10 +210,18 @@
                case "allpickfinished":
                    state.CurrentAction = "AllPickFinished";
                    if(state.CurrentTask?.RobotTaskType == 2|| state.CurrentTask?.RobotTaskType == 3)
                    {
                        // TODO æœºæ¢°æ‰‹å–货完成,判断是否换盘、拆盘任务,创建空托盘回库任务
                    }
                    return true;
                case "allputfinished":
                    state.CurrentAction = "AllPutFinished";
                    if (state.CurrentTask?.RobotTaskType == 1 )
                    {
                        // TODO æœºæ¢°æ‰‹å–货完成,判断是否组盘任务,创建组盘入库任务
                    }
                    return true;
                case "running":
@@ -199,7 +244,7 @@
                    state.RobotRunMode = 1;
                    return true;
                case "runmodemode,2":
                case "runmode,2":
                    state.RobotRunMode = 2;
                    return true;
@@ -234,7 +279,7 @@
            return message.StartsWith("pickfinished") || message.StartsWith("putfinished");
        }
        private Dt_Task? GetTask(RobotCraneDevice robotCrane)
        private Dt_RobotTask? GetTask(RobotCraneDevice robotCrane)
        {
            return _taskService.QueryRobotCraneTask(robotCrane.DeviceCode);
        }
@@ -290,8 +335,13 @@
        public int[]? LastPutPositions { get; set; }
        /// <summary>
        /// æŠ“取位置条码
        /// </summary>
        public string[] CellBarcode { get; set; }
        /// <summary>
        /// å½“前抓取任务
        /// </summary>
        public Dt_Task? CurrentTask { get; set; }
        public Dt_RobotTask? CurrentTask { get; set; }
    }
}
Code/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/18.0.988.22099/CodeChunks.db
Binary files differ
Code/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/18.0.988.22099/SemanticSymbols.db
Binary files differ
Code/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/v18/DocumentLayout.backup.json
@@ -3,8 +3,16 @@
  "WorkspaceRootPath": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WMS\\WIDESEA_WMSServer\\",
  "Documents": [
    {
      "AbsoluteMoniker": "D:0:0:{D81A65B5-47D1-40C1-8FDE-7D24FF003F51}|WIDESEA_WMSServer\\WIDESEA_WMSServer.csproj|d:\\git\\shanmeixinnengyuan\\code\\wms\\widesea_wmsserver\\widesea_wmsserver\\appsettings.json||{90A6B3A7-C1A3-4009-A288-E2FF89E96FA0}",
      "RelativeMoniker": "D:0:0:{D81A65B5-47D1-40C1-8FDE-7D24FF003F51}|WIDESEA_WMSServer\\WIDESEA_WMSServer.csproj|solutionrelative:widesea_wmsserver\\appsettings.json||{90A6B3A7-C1A3-4009-A288-E2FF89E96FA0}"
      "AbsoluteMoniker": "D:0:0:{7DC26D42-D8EE-46F0-BA66-A13457086885}|WIDESEA_StockService\\WIDESEA_StockService.csproj|d:\\git\\shanmeixinnengyuan\\code\\wms\\widesea_wmsserver\\widesea_stockservice\\stockserivce.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
      "RelativeMoniker": "D:0:0:{7DC26D42-D8EE-46F0-BA66-A13457086885}|WIDESEA_StockService\\WIDESEA_StockService.csproj|solutionrelative:widesea_stockservice\\stockserivce.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
    },
    {
      "AbsoluteMoniker": "D:0:0:{49716D78-720D-475D-948C-0FC6C5F079E5}|WIDESEA_IStockService\\WIDESEA_IStockService.csproj|d:\\git\\shanmeixinnengyuan\\code\\wms\\widesea_wmsserver\\widesea_istockservice\\istockservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
      "RelativeMoniker": "D:0:0:{49716D78-720D-475D-948C-0FC6C5F079E5}|WIDESEA_IStockService\\WIDESEA_IStockService.csproj|solutionrelative:widesea_istockservice\\istockservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
    },
    {
      "AbsoluteMoniker": "D:0:0:{929DF936-042C-4EEC-8722-A831FC2F0AEA}|WIDESEA_DTO\\WIDESEA_DTO.csproj|d:\\git\\shanmeixinnengyuan\\code\\wms\\widesea_wmsserver\\widesea_dto\\stock\\stockdto.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
      "RelativeMoniker": "D:0:0:{929DF936-042C-4EEC-8722-A831FC2F0AEA}|WIDESEA_DTO\\WIDESEA_DTO.csproj|solutionrelative:widesea_dto\\stock\\stockdto.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
    }
  ],
  "DocumentGroupContainers": [
@@ -14,7 +22,7 @@
      "DocumentGroups": [
        {
          "DockedWidth": 200,
          "SelectedChildIndex": 3,
          "SelectedChildIndex": 4,
          "Children": [
            {
              "$type": "Bookmark",
@@ -25,20 +33,42 @@
              "Name": "ST:0:0:{40ea2e6b-2121-4bb8-a43e-c83c04b51041}"
            },
            {
              "$type": "Bookmark",
              "Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}"
              "$type": "Document",
              "DocumentIndex": 2,
              "Title": "StockDTO.cs",
              "DocumentMoniker": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WMS\\WIDESEA_WMSServer\\WIDESEA_DTO\\Stock\\StockDTO.cs",
              "RelativeDocumentMoniker": "WIDESEA_DTO\\Stock\\StockDTO.cs",
              "ToolTip": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WMS\\WIDESEA_WMSServer\\WIDESEA_DTO\\Stock\\StockDTO.cs",
              "RelativeToolTip": "WIDESEA_DTO\\Stock\\StockDTO.cs",
              "ViewState": "AgIAAAcAAAAAAAAAAAA9wBkAAAAWAAAAAAAAAA==",
              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
              "WhenOpened": "2026-02-06T02:56:51.397Z",
              "EditorCaption": ""
            },
            {
              "$type": "Document",
              "DocumentIndex": 1,
              "Title": "IStockService.cs",
              "DocumentMoniker": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WMS\\WIDESEA_WMSServer\\WIDESEA_IStockService\\IStockService.cs",
              "RelativeDocumentMoniker": "WIDESEA_IStockService\\IStockService.cs",
              "ToolTip": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WMS\\WIDESEA_WMSServer\\WIDESEA_IStockService\\IStockService.cs",
              "RelativeToolTip": "WIDESEA_IStockService\\IStockService.cs",
              "ViewState": "AgIAAAAAAAAAAAAAAAAAABkAAAAAAAAAAAAAAA==",
              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
              "WhenOpened": "2026-02-06T02:13:53.794Z",
              "EditorCaption": ""
            },
            {
              "$type": "Document",
              "DocumentIndex": 0,
              "Title": "appsettings.json",
              "DocumentMoniker": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WMS\\WIDESEA_WMSServer\\WIDESEA_WMSServer\\appsettings.json",
              "RelativeDocumentMoniker": "WIDESEA_WMSServer\\appsettings.json",
              "ToolTip": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WMS\\WIDESEA_WMSServer\\WIDESEA_WMSServer\\appsettings.json",
              "RelativeToolTip": "WIDESEA_WMSServer\\appsettings.json",
              "ViewState": "AgIAAAAAAAAAAAAAAAAAABwAAAAZAAAAAAAAAA==",
              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001642|",
              "WhenOpened": "2026-01-26T08:48:58.694Z",
              "Title": "StockSerivce.cs",
              "DocumentMoniker": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WMS\\WIDESEA_WMSServer\\WIDESEA_StockService\\StockSerivce.cs",
              "RelativeDocumentMoniker": "WIDESEA_StockService\\StockSerivce.cs",
              "ToolTip": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WMS\\WIDESEA_WMSServer\\WIDESEA_StockService\\StockSerivce.cs",
              "RelativeToolTip": "WIDESEA_StockService\\StockSerivce.cs",
              "ViewState": "AgIAAFEAAAAAAAAAAAAQwFoAAAAAAAAAAAAAAA==",
              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
              "WhenOpened": "2026-02-06T01:53:49.077Z",
              "EditorCaption": ""
            }
          ]
Code/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/v18/DocumentLayout.json
@@ -3,8 +3,16 @@
  "WorkspaceRootPath": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WMS\\WIDESEA_WMSServer\\",
  "Documents": [
    {
      "AbsoluteMoniker": "D:0:0:{D81A65B5-47D1-40C1-8FDE-7D24FF003F51}|WIDESEA_WMSServer\\WIDESEA_WMSServer.csproj|d:\\git\\shanmeixinnengyuan\\code\\wms\\widesea_wmsserver\\widesea_wmsserver\\appsettings.json||{90A6B3A7-C1A3-4009-A288-E2FF89E96FA0}",
      "RelativeMoniker": "D:0:0:{D81A65B5-47D1-40C1-8FDE-7D24FF003F51}|WIDESEA_WMSServer\\WIDESEA_WMSServer.csproj|solutionrelative:widesea_wmsserver\\appsettings.json||{90A6B3A7-C1A3-4009-A288-E2FF89E96FA0}"
      "AbsoluteMoniker": "D:0:0:{7DC26D42-D8EE-46F0-BA66-A13457086885}|WIDESEA_StockService\\WIDESEA_StockService.csproj|d:\\git\\shanmeixinnengyuan\\code\\wms\\widesea_wmsserver\\widesea_stockservice\\stockserivce.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
      "RelativeMoniker": "D:0:0:{7DC26D42-D8EE-46F0-BA66-A13457086885}|WIDESEA_StockService\\WIDESEA_StockService.csproj|solutionrelative:widesea_stockservice\\stockserivce.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
    },
    {
      "AbsoluteMoniker": "D:0:0:{929DF936-042C-4EEC-8722-A831FC2F0AEA}|WIDESEA_DTO\\WIDESEA_DTO.csproj|d:\\git\\shanmeixinnengyuan\\code\\wms\\widesea_wmsserver\\widesea_dto\\stock\\stockdto.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
      "RelativeMoniker": "D:0:0:{929DF936-042C-4EEC-8722-A831FC2F0AEA}|WIDESEA_DTO\\WIDESEA_DTO.csproj|solutionrelative:widesea_dto\\stock\\stockdto.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
    },
    {
      "AbsoluteMoniker": "D:0:0:{49716D78-720D-475D-948C-0FC6C5F079E5}|WIDESEA_IStockService\\WIDESEA_IStockService.csproj|d:\\git\\shanmeixinnengyuan\\code\\wms\\widesea_wmsserver\\widesea_istockservice\\istockservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
      "RelativeMoniker": "D:0:0:{49716D78-720D-475D-948C-0FC6C5F079E5}|WIDESEA_IStockService\\WIDESEA_IStockService.csproj|solutionrelative:widesea_istockservice\\istockservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
    }
  ],
  "DocumentGroupContainers": [
@@ -14,7 +22,7 @@
      "DocumentGroups": [
        {
          "DockedWidth": 200,
          "SelectedChildIndex": 3,
          "SelectedChildIndex": 4,
          "Children": [
            {
              "$type": "Bookmark",
@@ -25,20 +33,42 @@
              "Name": "ST:0:0:{40ea2e6b-2121-4bb8-a43e-c83c04b51041}"
            },
            {
              "$type": "Bookmark",
              "Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}"
              "$type": "Document",
              "DocumentIndex": 1,
              "Title": "StockDTO.cs",
              "DocumentMoniker": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WMS\\WIDESEA_WMSServer\\WIDESEA_DTO\\Stock\\StockDTO.cs",
              "RelativeDocumentMoniker": "WIDESEA_DTO\\Stock\\StockDTO.cs",
              "ToolTip": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WMS\\WIDESEA_WMSServer\\WIDESEA_DTO\\Stock\\StockDTO.cs",
              "RelativeToolTip": "WIDESEA_DTO\\Stock\\StockDTO.cs",
              "ViewState": "AgIAAAAAAAAAAAAAAAAAABYAAABBAAAAAAAAAA==",
              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
              "WhenOpened": "2026-02-06T02:56:51.397Z",
              "EditorCaption": ""
            },
            {
              "$type": "Document",
              "DocumentIndex": 2,
              "Title": "IStockService.cs",
              "DocumentMoniker": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WMS\\WIDESEA_WMSServer\\WIDESEA_IStockService\\IStockService.cs",
              "RelativeDocumentMoniker": "WIDESEA_IStockService\\IStockService.cs",
              "ToolTip": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WMS\\WIDESEA_WMSServer\\WIDESEA_IStockService\\IStockService.cs",
              "RelativeToolTip": "WIDESEA_IStockService\\IStockService.cs",
              "ViewState": "AgIAAAAAAAAAAAAAAAAAABsAAAAAAAAAAAAAAA==",
              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
              "WhenOpened": "2026-02-06T02:13:53.794Z",
              "EditorCaption": ""
            },
            {
              "$type": "Document",
              "DocumentIndex": 0,
              "Title": "appsettings.json",
              "DocumentMoniker": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WMS\\WIDESEA_WMSServer\\WIDESEA_WMSServer\\appsettings.json",
              "RelativeDocumentMoniker": "WIDESEA_WMSServer\\appsettings.json",
              "ToolTip": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WMS\\WIDESEA_WMSServer\\WIDESEA_WMSServer\\appsettings.json",
              "RelativeToolTip": "WIDESEA_WMSServer\\appsettings.json",
              "ViewState": "AgIAAAAAAAAAAAAAAAAAAB4AAAAZAAAAAAAAAA==",
              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001642|",
              "WhenOpened": "2026-01-26T08:48:58.694Z",
              "Title": "StockSerivce.cs",
              "DocumentMoniker": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WMS\\WIDESEA_WMSServer\\WIDESEA_StockService\\StockSerivce.cs",
              "RelativeDocumentMoniker": "WIDESEA_StockService\\StockSerivce.cs",
              "ToolTip": "D:\\Git\\ShanMeiXinNengYuan\\Code\\WMS\\WIDESEA_WMSServer\\WIDESEA_StockService\\StockSerivce.cs",
              "RelativeToolTip": "WIDESEA_StockService\\StockSerivce.cs",
              "ViewState": "AgIAAO8AAAAAAAAAAAAIwB8AAAAgAAAAAAAAAA==",
              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
              "WhenOpened": "2026-02-06T01:53:49.077Z",
              "EditorCaption": ""
            }
          ]
Code/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Stock/StockDTO.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,48 @@
namespace WIDESEA_DTO.Stock
{
    public class StockDTO
    {
        /// <summary>
        /// æ¥æºæ‰˜ç›˜å·
        /// </summary>
        public string? SourcePalletNo { get; set; }
        /// <summary>
        /// ç›®æ ‡æ‰˜ç›˜å·
        /// </summary>
        public string? TargetPalletNo { get; set; }
        /// <summary>
        /// æ¥æºçº¿ä½“编号
        /// </summary>
        public string? SourceLineNo { get; set; } = string.Empty;
        /// <summary>
        /// ç›®æ ‡çº¿ä½“编号
        /// </summary>
        public string? TargetLineNo { get; set; } = string.Empty;
        /// <summary>
        /// èŽ·å–æˆ–è®¾ç½®ä¸Žå®žä½“å…³è”çš„åº“å­˜æ˜Žç»†è®°å½•é›†åˆã€‚
        /// </summary>
        public List<StockDetailDTO> Details { get; set; } = new List<StockDetailDTO>();
    }
    public class StockDetailDTO
    {
        /// <summary>
        /// æ•°é‡
        /// </summary>
        public int Quantity { get; set; }
        /// <summary>
        /// é€šé“
        /// </summary>
        public int Channel { get; set; }
        /// <summary>
        /// è´§æ ¼æ¡ç 
        /// </summary>
        public string CellBarcode { get; set; }
    }
}
Code/WMS/WIDESEA_WMSServer/WIDESEA_IStockService/IStockService.cs
@@ -4,6 +4,7 @@
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core;
using WIDESEA_DTO.Stock;
namespace WIDESEA_IStockService
{
@@ -16,5 +17,11 @@
        IStockInfoDetail_HtyService StockInfoDetail_HtyService { get; }
        IStockInfo_HtyService StockInfo_HtyService { get; }
        Task<bool> GroupPallet(StockDTO stock);
        Task<bool> ChangePallet(StockDTO stock);
        Task<bool> SplitPallet(StockDTO stock);
    }
}
Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockSerivce.cs
@@ -1,12 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.StockEnum;
using WIDESEA_DTO.Stock;
using WIDESEA_IStockService;
using WIDESEA_Model.Models;
namespace WIDESEA_StockService
{
    /// <summary>
    /// åº“存服务
    /// </summary>
    public class StockSerivce:IStockService
    {
        public IStockInfoDetailService StockInfoDetailService { get; }
@@ -16,6 +17,13 @@
        public IStockInfo_HtyService StockInfo_HtyService { get; }
        /// <summary>
        /// æž„造函数
        /// </summary>
        /// <param name="stockInfoDetailService">库存明细服务</param>
        /// <param name="stockInfoService">库存服务</param>
        /// <param name="stockInfoDetail_HtyService">库存明细历史服务</param>
        /// <param name="stockInfo_HtyService">库存历史服务</param>
        public StockSerivce(IStockInfoDetailService stockInfoDetailService, IStockInfoService stockInfoService, IStockInfoDetail_HtyService stockInfoDetail_HtyService, IStockInfo_HtyService stockInfo_HtyService)
        {
            StockInfoDetailService = stockInfoDetailService;
@@ -23,5 +31,249 @@
            StockInfoDetail_HtyService = stockInfoDetail_HtyService;
            StockInfo_HtyService = stockInfo_HtyService;
        }
        /// <summary>
        /// ç»„盘
        /// </summary>
        /// <param name="stock">组盘数据</param>
        /// <returns>是否成功</returns>
        public async Task<bool> GroupPallet(StockDTO stock)
        {
            // ç»„装明细数据
            var now = DateTime.Now;
            var details = stock.Details.Select(item => new Dt_StockInfoDetail()
            {
                MaterielCode = "电芯",
                StockQuantity = item.Quantity,
                Unit = "PCS",
                Creater = "system",
                OrderNo = "111",
                ProductionDate = now.ToString(),
                EffectiveDate = now.AddYears(1).ToString(),
                SerialNumber = item.CellBarcode,
                InboundOrderRowNo = item.Channel,
                MaterielName = "电芯",
                Status = StockStatusEmun.组盘暂存.GetHashCode(),
            }).ToList();
            // å¦‚果托盘已存在,直接新增明细
            var existingStock = StockInfoService.Repository.QueryFirst(s => s.PalletCode == stock.TargetPalletNo);
            if (existingStock != null)
            {
                details.ForEach(detail => detail.StockId = existingStock.Id);
                return await StockInfoDetailService.Repository.AddDataAsync(details) > 0;
            }
            // æ‰˜ç›˜ä¸å­˜åœ¨åˆ™åˆ›å»ºå¹¶å†™å…¥æ˜Žç»†
            var entity = new Dt_StockInfo()
            {
                PalletCode = stock.TargetPalletNo,
                WarehouseId = 1,
                StockStatus = 1,
                Creater = "system",
                Details = details
            };
            //Dt_Task dt_Task = new Dt_Task()
            //{
            //    TaskNum = 0,
            //    PalletCode = stock.PalletNo,
            //    PalletType = 1,
            //    Roadway = "1",
            //    TaskType = TaskTypeEnum.Inbound.GetHashCode(),
            //    TaskStatus = TaskStatusEnum.New.GetHashCode(),
            //    SourceAddress = stock.LineNo,
            //    TargetAddress = "组盘区",
            //    CurrentAddress = stock.LineNo,
            //    NextAddress = "组盘区",
            //    WarehouseId = 1,
            //    Grade = 1,
            //    Creater = "system",
            //};
            return StockInfoService.Repository.AddData(entity, x => x.Details);
        }
        /// <summary>
        /// æ¢ç›˜
        /// </summary>
        /// <param name="stock">需要换盘的明细数据</param>
        /// <returns>是否成功</returns>
        public async Task<bool> ChangePallet(StockDTO stock)
        {
            // å‚数校验
            if (stock == null || string.IsNullOrWhiteSpace(stock.TargetPalletNo) || string.IsNullOrWhiteSpace(stock.SourcePalletNo))
            {
                return false;
            }
            // æ–°æ—§æ‰˜ç›˜ä¸€è‡´ä¸å¤„理
            if (string.Equals(stock.SourcePalletNo, stock.TargetPalletNo, StringComparison.OrdinalIgnoreCase))
            {
                return false;
            }
            // æŸ¥è¯¢æºæ‰˜ç›˜
            var sourceStock = StockInfoService.Repository.QueryFirst(s => s.PalletCode == stock.SourcePalletNo);
            if (sourceStock == null)
            {
                return false;
            }
            // æŸ¥è¯¢æˆ–创建目标托盘
            var targetStock = StockInfoService.Repository.QueryFirst(s => s.PalletCode == stock.TargetPalletNo);
            if (targetStock == null)
            {
                var newStock = new Dt_StockInfo()
                {
                    PalletCode = stock.TargetPalletNo,
                    WarehouseId = sourceStock.WarehouseId,
                    StockStatus = sourceStock.StockStatus,
                    Creater = "system"
                };
                var newId = StockInfoService.Repository.AddData(newStock);
                if (newId <= 0)
                {
                    return false;
                }
                targetStock = newStock;
                targetStock.Id = newId;
            }
            // èŽ·å–éœ€è¦è½¬ç§»çš„æ¡ç 
            var serialNumbers = stock.Details.Select(d => d.CellBarcode).Distinct().ToList();
            if (!serialNumbers.Any())
            {
                return false;
            }
            // æŸ¥è¯¢æºæ‰˜ç›˜å¯¹åº”的明细
            var detailEntities = StockInfoDetailService.Repository.QueryData(d => d.StockId == sourceStock.Id && serialNumbers.Contains(d.SerialNumber));
            if (!detailEntities.Any())
            {
                return false;
            }
            // å†™å…¥åŽ†å²è®°å½•
            var detailHistory = CreateDetailHistory(detailEntities, "换盘");
            if (await StockInfoDetail_HtyService.Repository.AddDataAsync(detailHistory) <= 0)
            {
                return false;
            }
            var stockHistory = CreateStockHistory(new List<Dt_StockInfo> { sourceStock, targetStock }, "换盘");
            if (await StockInfo_HtyService.Repository.AddDataAsync(stockHistory) <= 0)
            {
                return false;
            }
            // æ›´æ–°æ˜Žç»†çš„æ‰˜ç›˜ä¸»é”®
            detailEntities.ForEach(detail => detail.StockId = targetStock.Id);
            return await StockInfoDetailService.Repository.UpdateDataAsync(detailEntities);
        }
        /// <summary>
        /// æ‹†ç›˜
        /// </summary>
        /// <param name="stock">需要拆盘的明细数据</param>
        /// <returns>是否成功</returns>
        public async Task<bool> SplitPallet(StockDTO stock)
        {
            // å‚数校验
            if (stock == null || string.IsNullOrWhiteSpace(stock.SourcePalletNo))
            {
                return false;
            }
            // æŸ¥è¯¢æºæ‰˜ç›˜
            var sourceStock = StockInfoService.Repository.QueryFirst(s => s.PalletCode == stock.SourcePalletNo);
            if (sourceStock == null)
            {
                return false;
            }
            // èŽ·å–éœ€è¦æ‹†é™¤çš„æ¡ç 
            var serialNumbers = stock.Details.Select(d => d.CellBarcode).Distinct().ToList();
            if (!serialNumbers.Any())
            {
                return false;
            }
            // æŸ¥è¯¢æºæ‰˜ç›˜å¯¹åº”的明细
            var detailEntities = StockInfoDetailService.Repository.QueryData(d => d.StockId == sourceStock.Id && serialNumbers.Contains(d.SerialNumber));
            if (!detailEntities.Any())
            {
                return false;
            }
            // å†™å…¥åŽ†å²è®°å½•
            var detailHistory = CreateDetailHistory(detailEntities, "拆盘");
            if (await StockInfoDetail_HtyService.Repository.AddDataAsync(detailHistory) <= 0)
            {
                return false;
            }
            var stockHistory = CreateStockHistory(new List<Dt_StockInfo> { sourceStock }, "拆盘");
            if (await StockInfo_HtyService.Repository.AddDataAsync(stockHistory) <= 0)
            {
                return false;
            }
            // åˆ é™¤æ˜Žç»†
            return await StockInfoDetailService.Repository.DeleteDataAsync(detailEntities);
        }
        private List<Dt_StockInfoDetail_Hty> CreateDetailHistory(IEnumerable<Dt_StockInfoDetail> details, string operateType)
        {
            var now = DateTime.Now;
            return details.Select(detail => new Dt_StockInfoDetail_Hty
            {
                SourceId = detail.Id,
                OperateType = operateType,
                InsertTime = now,
                StockId = detail.StockId,
                MaterielCode = detail.MaterielCode,
                MaterielName = detail.MaterielName,
                OrderNo = detail.OrderNo,
                BatchNo = detail.BatchNo,
                ProductionDate = detail.ProductionDate,
                EffectiveDate = detail.EffectiveDate,
                SerialNumber = detail.SerialNumber,
                StockQuantity = detail.StockQuantity,
                OutboundQuantity = detail.OutboundQuantity,
                Status = detail.Status,
                Unit = detail.Unit,
                InboundOrderRowNo = detail.InboundOrderRowNo,
                Remark = detail.Remark,
                Creater = detail.Creater,
                CreateDate = detail.CreateDate,
                Modifier = detail.Modifier,
                ModifyDate = detail.ModifyDate
            }).ToList();
        }
        private List<Dt_StockInfo_Hty> CreateStockHistory(IEnumerable<Dt_StockInfo> stocks, string operateType)
        {
            var now = DateTime.Now;
            return stocks.Select(stock => new Dt_StockInfo_Hty
            {
                SourceId = stock.Id,
                OperateType = operateType,
                InsertTime = now,
                PalletCode = stock.PalletCode,
                PalletType = stock.PalletType,
                LocationCode = stock.LocationCode,
                WarehouseId = stock.WarehouseId,
                StockStatus = stock.StockStatus,
                Remark = stock.Remark,
                Creater = stock.Creater,
                CreateDate = stock.CreateDate,
                Modifier = stock.Modifier,
                ModifyDate = stock.ModifyDate
            }).ToList();
        }
    }
}
ÏîÄ¿×ÊÁÏ/É豸ЭÒé/ÉÏλϵͳ¶Ô½Ó/QKNY-MES-FW-MESϵͳÉ豸¼¯³É½Ó¿ÚÎĵµ-V2.35-20250711.docx
Binary files differ