namespace Admin.NET.Plugin.AiDOP.Dto.S0.Manufacturing; /// /// 制造列表查询公共段:公司/工厂、keyword、isEnabled、分页。 /// S0 使用 pageNo 时可通过 绑定,控制器内取 EffectivePage。 /// public class AdoS0MfgPagedQueryBase { public long? CompanyRefId { get; set; } public long? FactoryRefId { get; set; } public string? Keyword { get; set; } public bool? IsEnabled { get; set; } /// 与 Gitee Demo 一致的页码(默认 1)。 public int Page { get; set; } = 1; /// S0 PagedQuery.pageNo;若传入则优先于 public int? PageNo { get; set; } public int PageSize { get; set; } = 20; public int EffectivePage => PageNo is > 0 ? PageNo.Value : (Page < 1 ? 1 : Page); } #region 附录 F 扩展 Query /// 标准工序主数据列表(StdOpMaster 语义)。 public class AdoS0StdOpMasterQueryDto : AdoS0MfgPagedQueryBase { /// 按标准工序名称(std_op)模糊过滤。 public string? StdOp { get; set; } public string? MilestoneOp { get; set; } } /// 生产线主数据列表(LineMaster 语义)。 public class AdoS0LineMasterQueryDto : AdoS0MfgPagedQueryBase { /// 按生产线编码(line)模糊过滤。 public string? Line { get; set; } public string? Workshop { get; set; } } public class AdoS0MfgPreprocessElementQueryDto : AdoS0MfgPagedQueryBase { public string? Domain { get; set; } public string? MaterialCode { get; set; } public string? MaterialName { get; set; } public string? Op { get; set; } public string? ElementCode { get; set; } } public class AdoS0MfgPreprocessElementUpsertDto { [Required(ErrorMessage = "工厂域不能为空")] [MaxLength(50)] public string Domain { get; set; } = string.Empty; [Required(ErrorMessage = "物料编码不能为空")] [MaxLength(100)] public string ItemNum { get; set; } = string.Empty; [MaxLength(100)] public string? Op { get; set; } [MaxLength(100)] public string? Line { get; set; } [MaxLength(100)] public string? Typed { get; set; } [MaxLength(100)] public string? ItemCode { get; set; } [MaxLength(255)] public string? Descr { get; set; } public bool IsMain { get; set; } [MaxLength(64)] public string? CreateUser { get; set; } public DateTime? CreateTime { get; set; } [MaxLength(64)] public string? UpdateUser { get; set; } public DateTime? UpdateTime { get; set; } } public class AdoS0MfgMaterialProcessElementQueryDto : AdoS0MfgPagedQueryBase { public string? MaterialCode { get; set; } public string? MaterialName { get; set; } public string? ElementType { get; set; } public string? ElementCode { get; set; } } /// /// SOP 维护(源平台 QualitySegmentImage):列表查询 /// public class AdoS0MfgSopDocumentQueryDto { [Required(ErrorMessage = "工厂域不能为空")] [MaxLength(50)] public string Domain { get; set; } = string.Empty; public string? Keyword { get; set; } public int Page { get; set; } = 1; public int PageSize { get; set; } = 20; } /// 列表须支持 elementCategory 过滤(§7 / 附录 F)。 public class AdoS0MfgElementParamQueryDto : AdoS0MfgPagedQueryBase { public string? ElementCategory { get; set; } } #endregion #region 仅 PagedQuery 等价的列表 Query /// 标准 BOM 行级列表(ProductStructureMaster 路线 A)。 public class AdoS0ProductStructureQueryDto : AdoS0MfgPagedQueryBase; public class AdoS0MfgRoutingOpDetailQueryDto : AdoS0MfgPagedQueryBase; public class AdoS0MfgLinePostQueryDto : AdoS0MfgPagedQueryBase; public class AdoS0MfgPersonSkillQueryDto : AdoS0MfgPagedQueryBase; public class AdoS0MfgPersonSkillAssignmentQueryDto : AdoS0MfgPagedQueryBase; public class AdoS0MfgWorkOrderControlQueryDto : AdoS0MfgPagedQueryBase; public class AdoS0MfgWorkCenterQueryDto : AdoS0MfgPagedQueryBase; public class AdoS0MfgLineMaterialQueryDto : AdoS0MfgPagedQueryBase; /// /// SOP 文件类型(源平台 ImageType):列表查询 /// public class AdoS0MfgSopFileTypeQueryDto { [Required(ErrorMessage = "工厂域不能为空")] [MaxLength(50)] public string Domain { get; set; } = string.Empty; public string? Keyword { get; set; } public int Page { get; set; } = 1; public int PageSize { get; set; } = 20; } #endregion #region 标准资源 Upsert(12 个非聚合) public class AdoS0StdOpMasterUpsertDto { [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")] public long CompanyRefId { get; set; } [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")] public long FactoryRefId { get; set; } [Required(ErrorMessage = "工厂域编码不能为空")] [MaxLength(50)] public string Domain { get; set; } = string.Empty; [Required(ErrorMessage = "标准工序名称不能为空")] [MaxLength(100)] public string StdOp { get; set; } = string.Empty; [MaxLength(20)] public string? MilestoneOp { get; set; } [MaxLength(64)] public string? CreateUser { get; set; } [MaxLength(64)] public string? UpdateUser { get; set; } } public class AdoS0LineMasterUpsertDto { [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")] public long CompanyRefId { get; set; } [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")] public long FactoryRefId { get; set; } [Required(ErrorMessage = "工厂域编码不能为空")] [MaxLength(50)] public string Domain { get; set; } = string.Empty; [Required(ErrorMessage = "生产线编码不能为空")] [MaxLength(100)] public string Line { get; set; } = string.Empty; [MaxLength(255)] public string? Describe { get; set; } [MaxLength(50)] public string? LineType { get; set; } [MaxLength(50)] public string? LineCategory { get; set; } [MaxLength(50)] public string? Location { get; set; } [MaxLength(50)] public string? Workshop { get; set; } [MaxLength(50)] public string? VLocation { get; set; } [MaxLength(50)] public string? Location2 { get; set; } [MaxLength(50)] public string? Location3 { get; set; } [MaxLength(50)] public string? PickingLocation { get; set; } [MaxLength(50)] public string? MidLocation { get; set; } public bool IsActive { get; set; } = true; [MaxLength(64)] public string? CreateUser { get; set; } [MaxLength(64)] public string? UpdateUser { get; set; } } public class AdoS0MfgSopFileTypeUpsertDto { [Required(ErrorMessage = "工厂域不能为空")] [MaxLength(50)] public string Domain { get; set; } = string.Empty; [Required(ErrorMessage = "文件类型编码不能为空")] [MaxLength(100)] public string ImageTypeID { get; set; } = string.Empty; [MaxLength(255)] public string? Descr { get; set; } } public class AdoS0MfgElementParamUpsertDto { public long CompanyRefId { get; set; } public long FactoryRefId { get; set; } public string? ElementCode { get; set; } public string? ElementName { get; set; } public string? ElementCategory { get; set; } public string Code { get; set; } = string.Empty; public string Name { get; set; } = string.Empty; public string? ParamType { get; set; } public string? Unit { get; set; } public string? StdValue { get; set; } public decimal? UpperLimit { get; set; } public decimal? LowerLimit { get; set; } public string? EnumOptions { get; set; } public string? Remark { get; set; } public bool IsEnabled { get; set; } = true; } /// /// 生产要素参数(DevMonitor;固定 CodeType='Prod'):列表查询 /// public class AdoS0DevMonitorQueryDto { [Required(ErrorMessage = "工厂域不能为空")] [MaxLength(50)] public string Domain { get; set; } = string.Empty; public string? Keyword { get; set; } public int Page { get; set; } = 1; public int PageSize { get; set; } = 20; } public class AdoS0MfgPreprocessElementParamQueryDto { [Required(ErrorMessage = "工厂域不能为空")] [MaxLength(50)] public string Domain { get; set; } = string.Empty; public string? Keyword { get; set; } public int Page { get; set; } = 1; public int PageSize { get; set; } = 20; } public class AdoS0DevMonitorUpsertDto { [Required(ErrorMessage = "工厂域不能为空")] [MaxLength(50)] public string Domain { get; set; } = string.Empty; [Required(ErrorMessage = "要素编码不能为空")] [MaxLength(100)] public string DeviceNumber { get; set; } = string.Empty; public string? DeviceDescr { get; set; } [Required(ErrorMessage = "参数编码不能为空")] [MaxLength(100)] public string MessageCode { get; set; } = string.Empty; public string? CodeDescr { get; set; } public string? ValueType { get; set; } public string? UM { get; set; } public string? StdValue { get; set; } public decimal? TopLimit { get; set; } public decimal? LowLimit { get; set; } public string? Ufld1 { get; set; } /// 固定为 Prod public string CodeType { get; set; } = "Prod"; public string? CreateUser { get; set; } public DateTime? CreateTime { get; set; } public string? UpdateUser { get; set; } public DateTime? UpdateTime { get; set; } } public class AdoS0MfgPreprocessElementParamUpsertDto { [Required(ErrorMessage = "工厂域不能为空")] [MaxLength(50)] public string Domain { get; set; } = string.Empty; [Required(ErrorMessage = "要素编码不能为空")] [MaxLength(100)] public string DeviceNumber { get; set; } = string.Empty; public string? DeviceDescr { get; set; } [Required(ErrorMessage = "参数编码不能为空")] [MaxLength(100)] public string MessageCode { get; set; } = string.Empty; public string? CodeDescr { get; set; } public string? ValueType { get; set; } public string? UM { get; set; } public string? StdValue { get; set; } public decimal? TopLimit { get; set; } public decimal? LowLimit { get; set; } public string? Ufld1 { get; set; } [MaxLength(64)] public string? CreateUser { get; set; } public DateTime? CreateTime { get; set; } [MaxLength(64)] public string? UpdateUser { get; set; } public DateTime? UpdateTime { get; set; } } /// /// 物料工序生产要素(ItemOpCondition;固定 CodeType='Prod'):列表查询 /// public class AdoS0ItemOpConditionQueryDto { [Required(ErrorMessage = "工厂域不能为空")] [MaxLength(50)] public string Domain { get; set; } = string.Empty; public string? Keyword { get; set; } public string? ItemNum { get; set; } public string? Op { get; set; } public string? Line { get; set; } public string? Typed { get; set; } public string? ItemCode { get; set; } public int Page { get; set; } = 1; public int PageSize { get; set; } = 20; } public class AdoS0ItemOpConditionUpsertDto { [Required(ErrorMessage = "工厂域不能为空")] [MaxLength(50)] public string Domain { get; set; } = string.Empty; [Required(ErrorMessage = "物料编码不能为空")] [MaxLength(100)] public string ItemNum { get; set; } = string.Empty; public string? Op { get; set; } public string? Line { get; set; } public string? Typed { get; set; } public string? ItemCode { get; set; } public string? Descr { get; set; } public bool IsMain { get; set; } /// 固定为 Prod public string CodeType { get; set; } = "Prod"; public string? CreateUser { get; set; } public DateTime? CreateTime { get; set; } public string? UpdateUser { get; set; } public DateTime? UpdateTime { get; set; } } public class AdoS0MfgPersonSkillUpsertDto { public long CompanyRefId { get; set; } public long FactoryRefId { get; set; } public string Code { get; set; } = string.Empty; public string Name { get; set; } = string.Empty; public string? SkillLevel { get; set; } public string? Remark { get; set; } public bool IsEnabled { get; set; } = true; } public class AdoS0MfgPersonSkillAssignmentUpsertDto { public long CompanyRefId { get; set; } public long FactoryRefId { get; set; } public string PersonCode { get; set; } = string.Empty; public string? WorkGroup { get; set; } public long SkillId { get; set; } public int SkillLevel { get; set; } public decimal ProductionEfficiency { get; set; } = 1m; public string? Remark { get; set; } public bool IsEnabled { get; set; } = true; } /// /// 人员技能维护(EmpSkills):列表查询。 /// public class AdoS0EmpSkillsQueryDto : AdoS0MfgPagedQueryBase { /// 工厂域(Domain) public string? Domain { get; set; } /// 人员编号(Employee) public string? Employee { get; set; } /// 工作组(Site) public string? Site { get; set; } /// 技能编码(SkillNo) public string? SkillNo { get; set; } } public class AdoS0EmpSkillsUpsertDto { [Required(ErrorMessage = "人员编号不能为空")] [MaxLength(100)] public string Employee { get; set; } = string.Empty; [MaxLength(100)] public string? EmployeeId { get; set; } [MaxLength(100)] public string? EmployeeName { get; set; } [MaxLength(100)] public string? Site { get; set; } [Required(ErrorMessage = "技能编码不能为空")] [MaxLength(100)] public string SkillNo { get; set; } = string.Empty; [MaxLength(255)] public string? SkillDescription { get; set; } [MaxLength(50)] public string? SkillLevel { get; set; } public decimal? EfficiencyCoefficient { get; set; } public DateTime? DateSkill { get; set; } [Required(ErrorMessage = "工厂域不能为空")] [MaxLength(50)] public string Domain { get; set; } = string.Empty; [MaxLength(64)] public string? CreateUser { get; set; } public DateTime? CreateTime { get; set; } [MaxLength(64)] public string? UpdateUser { get; set; } public DateTime? UpdateTime { get; set; } } public class AdoS0MfgWorkCenterUpsertDto { public long CompanyRefId { get; set; } public long FactoryRefId { get; set; } public string Code { get; set; } = string.Empty; public string Name { get; set; } = string.Empty; public string? CenterType { get; set; } public decimal? Capacity { get; set; } public long? DepartmentId { get; set; } public string? Remark { get; set; } public bool IsEnabled { get; set; } = true; } public class AdoS0MfgLineMaterialUpsertDto { public long CompanyRefId { get; set; } public long FactoryRefId { get; set; } public long? ProductionLineId { get; set; } public long MaterialId { get; set; } public long? OperationId { get; set; } public long? WorkCenterId { get; set; } public string? EquipmentCode { get; set; } public decimal? StdCapacityPerUnit { get; set; } public decimal? ChangeoverTime { get; set; } public string? EquipmentTypeCode { get; set; } public string? MoldTypeCode { get; set; } public string? RequiredSkillCode { get; set; } public string? MaterialRole { get; set; } public string? Remark { get; set; } public bool IsEnabled { get; set; } = true; } /// /// 工作中心(WorkCtrMaster):列表查询 /// public class AdoS0WorkCtrMasterQueryDto { [Required(ErrorMessage = "工厂域不能为空")] [MaxLength(50)] public string Domain { get; set; } = string.Empty; public string? Keyword { get; set; } public int Page { get; set; } = 1; public int PageSize { get; set; } = 20; } public class AdoS0WorkCtrMasterUpsertDto { [Required(ErrorMessage = "工作中心编码不能为空")] [MaxLength(100)] public string WorkCtr { get; set; } = string.Empty; [MaxLength(255)] public string? Descr { get; set; } [MaxLength(100)] public string? Department { get; set; } public bool IsActive { get; set; } = true; [Required(ErrorMessage = "工厂域不能为空")] [MaxLength(50)] public string Domain { get; set; } = string.Empty; [MaxLength(64)] public string? CreateUser { get; set; } public DateTime? CreateTime { get; set; } [MaxLength(64)] public string? UpdateUser { get; set; } public DateTime? UpdateTime { get; set; } } /// /// 生产线物料(ProdLineDetail):列表查询 /// public class AdoS0ProdLineDetailQueryDto : AdoS0MfgPagedQueryBase { public string? Domain { get; set; } public string? Part { get; set; } public string? Op { get; set; } public string? Site { get; set; } public string? Line { get; set; } } public class AdoS0ProdLineDetailUpsertDto { [Required(ErrorMessage = "物料编码不能为空")] [MaxLength(100)] public string Part { get; set; } = string.Empty; [MaxLength(100)] public string? Op { get; set; } [MaxLength(100)] public string? Site { get; set; } [MaxLength(100)] public string? Line { get; set; } public decimal? Rate { get; set; } public decimal? SetupTime { get; set; } public string? SkillNo { get; set; } public string? InternalEquipmentTypeCode { get; set; } public string? MoldTypeCode { get; set; } public int? StandardStaffCount { get; set; } public int? Start { get; set; } public bool IsActive { get; set; } = true; public bool IsConfirm { get; set; } [Required(ErrorMessage = "工厂域不能为空")] [MaxLength(50)] public string Domain { get; set; } = string.Empty; [MaxLength(64)] public string? CreateUser { get; set; } public DateTime? CreateTime { get; set; } [MaxLength(64)] public string? UpdateUser { get; set; } public DateTime? UpdateTime { get; set; } } public class AdoS0MfgWorkOrderControlUpsertDto { public long CompanyRefId { get; set; } public long FactoryRefId { get; set; } public string Code { get; set; } = string.Empty; public string Name { get; set; } = string.Empty; public string? ControlType { get; set; } public string? ParamValue { get; set; } public string? Remark { get; set; } public bool IsEnabled { get; set; } = true; } /// /// 工单控制参数设置(WorkOrdControl):按 Domain 查询单记录。 /// public class AdoS0WorkOrdControlGetDto { [Required(ErrorMessage = "工厂域不能为空")] [MaxLength(50)] public string Domain { get; set; } = string.Empty; } public class AdoS0WorkOrdControlUpsertDto { /// RecID → Id;存在则按 Id 更新。 public long? Id { get; set; } [Required(ErrorMessage = "工厂域不能为空")] [MaxLength(50)] public string Domain { get; set; } = string.Empty; public decimal? EnteringPer { get; set; } public decimal? PaintingPer { get; set; } public decimal? IssuedInterval { get; set; } public bool PostVarsatSFC { get; set; } public bool IsIssued { get; set; } public bool IsPrintRejectBarcode { get; set; } public bool IsPrintScrapBarcode { get; set; } public bool IsQualityConfirm { get; set; } public bool IsActive { get; set; } = true; public bool IsConfirm { get; set; } [MaxLength(64)] public string? CreateUser { get; set; } public DateTime? CreateTime { get; set; } [MaxLength(64)] public string? UpdateUser { get; set; } public DateTime? UpdateTime { get; set; } } public class AdoS0MfgMaterialProcessElementUpsertDto { public long CompanyRefId { get; set; } public long FactoryRefId { get; set; } public long MaterialId { get; set; } public long OperationId { get; set; } public long? ProductionLineId { get; set; } public string? ElementType { get; set; } public string? ElementCode { get; set; } public string? ElementName { get; set; } public long ElementParamId { get; set; } public string? ParamValue { get; set; } public bool IsKeyElement { get; set; } public string? Remark { get; set; } public bool IsEnabled { get; set; } = true; } public class AdoS0MfgSopDocumentUpsertDto { [Required(ErrorMessage = "工厂域不能为空")] [MaxLength(50)] public string Domain { get; set; } = string.Empty; [MaxLength(100)] public string? Line { get; set; } [MaxLength(100)] public string? ItemNum { get; set; } [MaxLength(100)] public string? Op { get; set; } [MaxLength(100)] public string? ImageTypeID { get; set; } [MaxLength(1000)] public string? Path { get; set; } [MaxLength(255)] public string? Descr { get; set; } [MaxLength(50)] public string? Rev { get; set; } public int? SortID { get; set; } } #endregion #region 聚合 Upsert(步骤 9) /// 标准 BOM 行维护 Upsert(含多工序号,对应 ProductStructureOp)。 public class AdoS0ProductStructureUpsertDto { [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")] public long CompanyRefId { get; set; } [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")] public long FactoryRefId { get; set; } [Range(1, long.MaxValue, ErrorMessage = "父项物料不能为空")] public long ParentMaterialId { get; set; } [Range(1, long.MaxValue, ErrorMessage = "子项物料不能为空")] public long ComponentMaterialId { get; set; } public decimal Qty { get; set; } = 1m; public string? UM { get; set; } public decimal Scrap { get; set; } public decimal QtyConsumed { get; set; } public int? LineOp { get; set; } public string? Refs { get; set; } public string? Remark { get; set; } public DateTime? StartEff { get; set; } public DateTime? EndEff { get; set; } public string? StructureType { get; set; } public bool IsEnabled { get; set; } = true; /// 多工序号(去重排序后落 ProductStructureOp)。 public List OpNos { get; set; } = new(); } /// 标准工艺路线明细行(RoutingOpDetail 复刻)Upsert。 public class AdoS0MfgRoutingOpDetailUpsertDto { [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")] public long CompanyRefId { get; set; } [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")] public long FactoryRefId { get; set; } [Required(ErrorMessage = "工艺路线编码不能为空")] public string RouteCode { get; set; } = string.Empty; [Required(ErrorMessage = "工艺路线名称不能为空")] public string RouteName { get; set; } = string.Empty; [Required(ErrorMessage = "物料编码不能为空")] public string MaterialCode { get; set; } = string.Empty; [Required(ErrorMessage = "工序编码不能为空")] public string OperationCode { get; set; } = string.Empty; public string? OperationDescription { get; set; } public string? WorkCenterCode { get; set; } public string? MilestoneOperation { get; set; } public string? Ufld1 { get; set; } public string? Ufld2 { get; set; } public decimal? UDeci1 { get; set; } public string? Ufld3 { get; set; } public string? Ufld4 { get; set; } public string? Ufld5 { get; set; } public decimal? UDeci2 { get; set; } public string? Ufld6 { get; set; } public string? Ufld7 { get; set; } public string? Ufld8 { get; set; } public decimal? UDeci3 { get; set; } public string? Ufld9 { get; set; } public decimal? UDeci4 { get; set; } public decimal? UDeci5 { get; set; } public string? SupplierCode { get; set; } public int OutsourcedLeadTime { get; set; } public int SortNo { get; set; } public bool IsEnabled { get; set; } = true; public bool IsConfirm { get; set; } public int? CommentIndex { get; set; } public string? CreateUser { get; set; } public string? UpdateUser { get; set; } } public class AdoS0MfgLinePostSkillUpsertDto { public long? Id { get; set; } [Range(1, long.MaxValue, ErrorMessage = "人员技能不能为空")] public long PersonSkillId { get; set; } public string? RequiredLevel { get; set; } public string? Remark { get; set; } public DateTime? EffectiveDate { get; set; } public bool IsEnabled { get; set; } = true; } public class AdoS0MfgLinePostUpsertDto { [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")] public long CompanyRefId { get; set; } [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")] public long FactoryRefId { get; set; } [Required(ErrorMessage = "线体岗位编码不能为空")] public string Code { get; set; } = string.Empty; [Required(ErrorMessage = "线体岗位名称不能为空")] public string Name { get; set; } = string.Empty; public long? ProductionLineId { get; set; } public string? Remark { get; set; } public bool IsEnabled { get; set; } = true; public List Skills { get; set; } = new(); } /// /// 产线岗位维护(LineSkillMaster):列表查询 /// public class AdoS0LineSkillMasterQueryDto { [Required(ErrorMessage = "工厂域不能为空")] [MaxLength(50)] public string Domain { get; set; } = string.Empty; /// 匹配生产线/岗位编码/岗位描述 public string? Keyword { get; set; } public int Page { get; set; } = 1; public int PageSize { get; set; } = 20; } public class AdoS0LineSkillDetailUpsertDto { [Range(1, long.MaxValue, ErrorMessage = "人员技能不能为空")] public long PersonSkillId { get; set; } public string? RequiredLevel { get; set; } public string? Remark { get; set; } public DateTime? EffectiveDate { get; set; } public bool IsEnabled { get; set; } = true; } public class AdoS0LineSkillMasterUpsertDto { [Required(ErrorMessage = "工厂域不能为空")] [MaxLength(50)] public string Domain { get; set; } = string.Empty; [Required(ErrorMessage = "生产线不能为空")] [MaxLength(100)] public string ProdLine { get; set; } = string.Empty; [Required(ErrorMessage = "岗位编码不能为空")] [MaxLength(100)] public string JOBNo { get; set; } = string.Empty; [MaxLength(255)] public string? JOBDescr { get; set; } [MaxLength(64)] public string? CreateUser { get; set; } public DateTime? CreateTime { get; set; } [MaxLength(64)] public string? UpdateUser { get; set; } public DateTime? UpdateTime { get; set; } public List Skills { get; set; } = new(); } #endregion