For Claude: REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
Goal: 将“前处理要素参数 / SOP维护 / SOP文件类型”三页按源平台语义(DevMonitor/QualitySegmentImage/ImageType)收敛,并删除现有不一致的 sop-document/sop-file-type 新表语义实现。
Architecture: 后端保留菜单与前端路由不变;API 路由保持 /api/s0/manufacturing/sop-documents、/api/s0/manufacturing/sop-file-types、(新增/改造)前处理要素参数接口,但内部数据模型切换到方案建议的表/字段语义。SOP 列表使用 SqlSugar Queryable 做左联,仅展示联表字段。
Tech Stack: .NET / Admin.NET Plugin, SqlSugar, C# DTO/Controller/Entity, SugarTable/SugarColumn
Files:
AiDOPWarehouse/server/Plugins/Admin.NET.Plugin.AiDOP/SeedData/SysMenuSeedData.csAiDOPWarehouse/server/Plugins/Admin.NET.Plugin.AiDOP/Controllers/S0/Manufacturing/AdoS0MfgSopDocumentsController.csAiDOPWarehouse/server/Plugins/Admin.NET.Plugin.AiDOP/Controllers/S0/Manufacturing/AdoS0MfgSopFileTypesController.csAiDOPWarehouse/server/Plugins/Admin.NET.Plugin.AiDOP/Controllers/S0/Manufacturing/AdoS0MfgElementParamsController.csAiDOPWarehouse/server/Plugins/Admin.NET.Plugin.AiDOP/Dto/S0/Manufacturing/AdoS0ManufacturingDtos.csAiDOPWarehouse/server/Plugins/Admin.NET.Plugin.AiDOP/Entity/S0/Manufacturing/AdoS0DevMonitor.csAiDOPWarehouse/server/Plugins/Admin.NET.Plugin.AiDOP/Entity/S0/Manufacturing/AdoS0MfgMastersAndSop.csStep 1: Search all references
Run:
rg -n "sop-documents|sop-file-types|AdoS0MfgSopDocument|AdoS0MfgSopFileType|SopMaintenanceList|SopFileTypeList" AiDOPWarehouse/server/Plugins/Admin.NET.Plugin.AiDOP -SExpected:
Step 2: No code changes yet
CodeType='PrevProcess'Files:
AiDOPWarehouse/server/Plugins/Admin.NET.Plugin.AiDOP/Controllers/S0/Manufacturing/AdoS0MfgElementParamsController.csAiDOPWarehouse/server/Plugins/Admin.NET.Plugin.AiDOP/Dto/S0/Manufacturing/AdoS0ManufacturingDtos.cs(若需要分离 PrevProcess Query/Upsert DTO)AiDOPWarehouse/server/Plugins/Admin.NET.Plugin.AiDOP/Controllers/S0/Manufacturing/AdoS0MfgPreprocessElementParamsController.csStep 1: Decide endpoint shape
preprocess-element-params)避免与生产要素参数(Prod)混用。element-params 路由但加 codeType 参数;本项目当前 element-params 已强制 "Prod",与本次方案冲突。Step 2: Implement minimal changes (Option A)
GET/POST/PUT/DELETE 基于 AdoS0DevMonitor,所有读写强制 CodeType = "PrevProcess".Domain 必填;keyword 匹配 DeviceNumber/DeviceDescr/MessageCode/CodeDescr.Step 3: Quick verify Run:
dotnet build AiDOPWarehouse/server/Plugins/Admin.NET.Plugin.AiDOP/Admin.NET.Plugin.AiDOP.csproj -c Release
Expected: build success.ImageType(按方案表/字段)Files:
AiDOPWarehouse/server/Plugins/Admin.NET.Plugin.AiDOP/Entity/S0/Manufacturing/AdoS0ImageType.csAiDOPWarehouse/server/Plugins/Admin.NET.Plugin.AiDOP/Dto/S0/Manufacturing/AdoS0ManufacturingDtos.cs(SOP 文件类型 Query/Upsert DTO 改为 Domain + ImageTypeID/Descr)Step 1: Add entity
[SugarTable("ado_s0_mfg_image_type", "S0 SOP 文件类型(源平台 ImageType)")]Id (bigint pk)、ImageTypeID (string)、Descr (string?)、Domain (string)。Step 2: Add/adjust DTOs
Domain 必填 + 分页 + keyword(匹配 ImageTypeID/Descr)。Domain、ImageTypeID、Descr。Step 3: Build
Run dotnet build ... 期望成功。
QualitySegmentImage(按方案表/字段)Files:
AiDOPWarehouse/server/Plugins/Admin.NET.Plugin.AiDOP/Entity/S0/Manufacturing/AdoS0QualitySegmentImage.csAiDOPWarehouse/server/Plugins/Admin.NET.Plugin.AiDOP/Dto/S0/Manufacturing/AdoS0ManufacturingDtos.cs(SOP 维护 Query/Upsert DTO 改为 Domain + 方案字段)Step 1: Add entity
[SugarTable("ado_s0_mfg_quality_segment_image", "S0 SOP 维护(源平台 QualitySegmentImage)")]Id、Line、ItemNum、Op、ImageTypeID、Path、Descr、Rev、SortID、Domain。Step 2: Add DTOs
Domain 必填 + keyword(匹配 ItemNum/Op/Descr/Path 等)Step 3: Build
Run dotnet build ...
sop-file-types Controller:从 AdoS0MfgSopFileType 切到 AdoS0ImageTypeFiles:
AiDOPWarehouse/server/Plugins/Admin.NET.Plugin.AiDOP/Controllers/S0/Manufacturing/AdoS0MfgSopFileTypesController.csAiDOPWarehouse/server/Plugins/Admin.NET.Plugin.AiDOP/Entity/S0/Manufacturing/AdoS0MfgMastersAndSop.cs 中 AdoS0MfgSopFileType(或迁移后再删)Step 1: Replace repository type
_rep 从 SqlSugarRepository<AdoS0MfgSopFileType> 改为 SqlSugarRepository<AdoS0ImageType>Step 2: Implement list
Domain 过滤(必填)ImageTypeID/DescrStep 3: Implement CRUD
Create/Update 按 DTO 写 Domain/ImageTypeID/DescrStep 4: Build
Run dotnet build ...
sop-documents Controller:从 AdoS0MfgSopDocument 切到 AdoS0QualitySegmentImage + 左联展示Files:
AiDOPWarehouse/server/Plugins/Admin.NET.Plugin.AiDOP/Controllers/S0/Manufacturing/AdoS0MfgSopDocumentsController.csLineMaster(或项目中已有对应实体)RoutingOpDetail(或项目中已有对应实体)Step 1: Replace repository type
_rep 改为 SqlSugarRepository<AdoS0QualitySegmentImage>Step 2: Implement list with left joins
QualitySegmentImage qImageType i(按 q.ImageTypeID == i.ImageTypeID && q.Domain == i.Domain)LineMaster l(按 q.Line == l.Line && q.Domain == l.Domain)RoutingOpDetail r(按 q.Op == r.Op && q.Domain == r.Domain && r.RoutingCode == q.ItemNum)idLine(拼接展示字段)ItemNumOp(拼接展示字段)imgType(i.Descr)Path/Descr/Rev/SortIDStep 3: Implement Get(id)/Create/Update/Delete
Step 4: Build
Run dotnet build ...
Files:
AiDOPWarehouse/server/Plugins/Admin.NET.Plugin.AiDOP/Entity/S0/Manufacturing/AdoS0MfgMastersAndSop.cs(移除 AdoS0MfgSopFileType、AdoS0MfgSopDocument 类)AiDOPWarehouse/server/Plugins/Admin.NET.Plugin.AiDOP/Dto/S0/Manufacturing/AdoS0ManufacturingDtos.cs(移除/替换旧 DTO:CompanyRefId/FactoryRefId/Code/Name 等)Step 1: Delete old entities
Step 2: Search & fix Run:
rg -n "AdoS0MfgSopDocument|AdoS0MfgSopFileType|SopFileTypeId|DocStatus|FileId|CreatedAt|UpdatedAt" AiDOPWarehouse/server/Plugins/Admin.NET.Plugin.AiDOP -S
Expected: 不再出现旧语义实体/字段引用(除非其他模块确实还需要——如出现则回到设计拆分)。Step 3: Build
Run dotnet build ...
Expected: success.
Files:
AiDOPWarehouse/server/Plugins/Admin.NET.Plugin.AiDOP/SeedData/SysMenuSeedData.csStep 1: Confirm paths unchanged
SOP 文件类型: /aidop/s0/manufacturing/sop-file-typeSOP 维护: /aidop/s0/manufacturing/sop-document前处理要素参数: /aidop/s0/manufacturing/preprocess-element-param(页面侧)对应的后端接口需能按方案提供数据Run:
dotnet build AiDOPWarehouse/server/Plugins/Admin.NET.Plugin.AiDOP/Admin.NET.Plugin.AiDOP.csproj -c Releasedotnet build AiDOPWarehouse/server -c ReleaseExpected: build success.