wanshenmean
7 天以前 559bb7b4be83575cc5fedee98484647243c96f89
分支
用户 wanshenmean <cathay_xy@163.com>
星期三, 四月 8, 2026 11:01 +0800
提交者 wanshenmean <cathay_xy@163.com>
星期三, 四月 8, 2026 15:57 +0800
提交559bb7b4be83575cc5fedee98484647243c96f89
目录 1eecfb31f3d8d6b5d350b0601a51d0e2ae6af1a3 目录 | zip | gz
上一版本 83743fe4641fcfad9effc2b6104c8dedefcbdcb5 查看 | 对比
feat: 空托盘出库完整流程 + 输送线调度优化 + S7Simulator 协议同步增强

feat: 空托盘出库完整流程 + 输送线调度优化 + S7Simulator 协议同步增强

【WCS - 空托盘出库完整流程】

- ConfigKey: 新增 OutboundFinishTaskTray 枚举,表示通知 WMS 空托盘出库完成
- ApiRouteCacheWarmupHostedService: 注册 OutboundFinishTaskTray API 路由
- OutboundTaskFlowService:
- 空托盘出库完成时调用 WMS 的 OutboundFinishTaskTray 接口通知完成
- 增加 GetWMSRobotTask 调用失败的错误处理
- RobotTaskService: 修正 RobotSourceAddress/TargetAddress 使用 taskDTO 的
SourceAddress/TargetAddress,替代之前的 lineNo

【WCS - 输送线调度优化】

- CommonConveyorLineNewJob:
- 禁用 Parallel.For 并行处理,改为串行 foreach,避免并发问题
- JsonSerializer 替换为 JsonConvert.DeserializeObject
- CV_State 判断从 .ObjToBool() 改为 == 1
- existingTask 查询改用 Db.Queryable 方式
- 修复 WMS 任务反序列化:WMSTaskDTO 替代 List<WMSTaskDTO>
- ConveyorLineDispatchHandler:
- 出库完成时将 WCS_ACK 确认移至 UpdateTaskStatusToNext 之后,
确保状态更新成功后再回复 PLC

【WMS - 空托盘出库完成接口 + 机械手任务地址规则】

- ILocationInfoService / LocationInfoService: 新增 GetLocationInfoAsync(int id)
- ITaskService: 新增 OutboundFinishTaskTrayAsync 接口声明
- TaskService_WCS:
- GetOutBoundTrayTaskAsync: 新增任务存在性检查(TargetAddress 查重),
有任务时直接返回;创建任务时增加货位锁定和事务包装
- CreateRobotTaskAsync: 从配置 RobotTaskAddressRules 读取源/目标地址,
而非直接使用 lineNo
- TaskController: 注册 OutboundFinishTaskTrayAsync 接口;
修正 CreateTaskInboundTrayAsync 方法注释(入库而非出库)
- appsettings.json:
- 修正 AGV 配置键名(AGV_OutTaskComplete → A0GV_OutTaskComplete)
- 新增 RobotTaskAddressRules 配置节

【S7Simulator - 协议同步增强】

- InstanceSyncService:
- 预计算 DB 编号缓存字典,避免在每个 FieldKey 中重复解析
- MemoryConfig.DBBlockNumbers 改为根据实际使用的 DB 编号动态生成
- 删除已废弃实例的 memory.json(instance-CWSC1/GWSC1/HCSC1/Line1/Line2)
- 新增实例目录:instance-1001、instance-1002、instance-1003、instance-PM
- protocol-templates.json: fieldKey 加上 DeviceChildCode 前缀(与 fieldKey
前缀变更一致,1600+ 行更新)

fix: 协议模板fieldKey加上DeviceChildCode前缀

例如 11001_Target

fix: 修复数据库同步问题 - DbType.SqlServer 和 SugarTable 属性

- DatabaseDeviceService 使用 DbType.SqlServer 显式设置
- DTO 添加 [SugarTable] 属性指定真实表名
- appsettings.json 添加 WcsDb 配置

fix: 将 Initial Catalog 改为 Database 尝试解决 SqlSugar 连接问题

chore: 构建验证通过

feat: Program.cs 注册同步服务并启动时同步

feat: 添加 SyncController API 接口

feat: 添加 InstanceSyncService 同步协调逻辑

feat: 添加 DatabaseDeviceService 读取 WCS 数据库

feat: 添加 WcsDbOptions 配置类

feat: 添加 WCS 设备 DTO

feat: 添加 SqlSugarCore 依赖用于数据库连接

fix: 整合启动同步逻辑,使用环境变量占位符

- 将WCS数据库同步整合到现有的启动Task.Run中
- 连接串密码使用${WCS_DB_PASSWORD}占位符
- 修正spec中DbType为整数类型

fix: 修正协议模板ID格式和数据类型映射

- 协议模板ID改为 protocol-{DeviceCode}(每个设备一个模板)
- 更新数据类型映射表以匹配 ProtocolDataType 枚举实际值
- Direction 改为 Bidirectional (2)

docs: 添加数据库实例同步实现计划

docs: 添加数据库实例同步设计文档
已添加10个文件
已重命名1个文件
已删除5个文件
已修改19个文件
4148 ■■■■■ 文件已修改
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/HttpEnum/ConfigKey.cs 5 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/HostedService/ApiRouteCacheWarmupHostedService.cs 3 ●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Flows/OutboundTaskFlowService.cs 24 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/RobotTaskService.cs 4 ●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/CommonConveyorLineNewJob.cs 39 ●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineDispatchHandler.cs 6 ●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/LocationInfoService.cs 10 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/ILocationInfoService.cs 7 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs 5 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_WCS.cs 34 ●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs 13 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json 7 ●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/测试工具/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Application/DTOs/WcsDeviceDto.cs 39 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/测试工具/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Application/DatabaseDeviceService.cs 74 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/测试工具/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Application/InstanceSyncService.cs 170 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/测试工具/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Application/WIDESEAWCS_S7Simulator.Application.csproj 1 ●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/测试工具/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Application/WcsDbOptions.cs 24 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/测试工具/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Server/Controllers/SyncController.cs 46 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/测试工具/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Server/Data/instance-1001/config.json 10 ●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/测试工具/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Server/Data/instance-1002/config.json 21 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/测试工具/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Server/Data/instance-1003/config.json 21 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/测试工具/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Server/Data/instance-CWSC1/config.json 8 ●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/测试工具/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Server/Data/instance-CWSC1/memory.json 10 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/测试工具/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Server/Data/instance-GWSC1/config.json 8 ●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/测试工具/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Server/Data/instance-GWSC1/memory.json 10 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/测试工具/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Server/Data/instance-HCSC1/config.json 12 ●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/测试工具/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Server/Data/instance-HCSC1/memory.json 10 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/测试工具/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Server/Data/instance-Line1/memory.json 10 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/测试工具/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Server/Data/instance-Line2/config.json 21 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/测试工具/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Server/Data/instance-PM/config.json 21 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/测试工具/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Server/Data/protocol-templates.json 2714 ●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/测试工具/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Server/Program.cs 19 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/测试工具/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Server/appsettings.json 7 ●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/测试工具/WIDESEAWCS_S7Simulator/docs/superpowers/plans/2026-04-08-database-instance-sync-plan.md 593 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史
Code/测试工具/WIDESEAWCS_S7Simulator/docs/superpowers/specs/2026-04-08-database-instance-sync-design.md 142 ●●●●● 对比 | 查看 | 原始文档 | blame | 历史