| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446 |
- namespace Admin.NET.Plugin.AiDOP.Dto.S0.Manufacturing;
- /// <summary>
- /// 制造列表查询公共段:公司/工厂、keyword、isEnabled、分页。
- /// S0 使用 pageNo 时可通过 <see cref="PageNo"/> 绑定,控制器内取 EffectivePage。
- /// </summary>
- public class AdoS0MfgPagedQueryBase
- {
- public long? CompanyRefId { get; set; }
- public long? FactoryRefId { get; set; }
- public string? Keyword { get; set; }
- public bool? IsEnabled { get; set; }
- /// <summary>与 Gitee Demo 一致的页码(默认 1)。</summary>
- public int Page { get; set; } = 1;
- /// <summary>S0 PagedQuery.pageNo;若传入则优先于 <see cref="Page"/>。</summary>
- 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
- public class AdoS0MfgStandardOperationQueryDto : AdoS0MfgPagedQueryBase
- {
- public string? Name { get; set; }
- }
- public class AdoS0MfgProductionLineQueryDto : AdoS0MfgPagedQueryBase
- {
- public string? Line { get; set; }
- public long? LocationId { get; set; }
- }
- public class AdoS0MfgPreprocessElementQueryDto : AdoS0MfgPagedQueryBase
- {
- public string? MaterialCode { get; set; }
- public string? MaterialName { get; set; }
- public string? ElementCode { 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; }
- }
- public class AdoS0MfgSopDocumentQueryDto : AdoS0MfgPagedQueryBase
- {
- public long? ProductionLineId { get; set; }
- public string? MaterialCode { get; set; }
- }
- /// <summary>列表须支持 elementCategory 过滤(§7 / 附录 F)。</summary>
- public class AdoS0MfgElementParamQueryDto : AdoS0MfgPagedQueryBase
- {
- public string? ElementCategory { get; set; }
- }
- #endregion
- #region 仅 PagedQuery 等价的列表 Query
- public class AdoS0MfgBomQueryDto : AdoS0MfgPagedQueryBase;
- public class AdoS0MfgRoutingQueryDto : AdoS0MfgPagedQueryBase;
- public class AdoS0MfgLinePostQueryDto : AdoS0MfgPagedQueryBase;
- public class AdoS0MfgPersonSkillQueryDto : AdoS0MfgPagedQueryBase;
- public class AdoS0MfgPersonSkillAssignmentQueryDto : AdoS0MfgPagedQueryBase;
- public class AdoS0MfgMaterialSubstitutionQueryDto : AdoS0MfgPagedQueryBase;
- public class AdoS0MfgWorkOrderControlQueryDto : AdoS0MfgPagedQueryBase;
- public class AdoS0MfgWorkCenterQueryDto : AdoS0MfgPagedQueryBase;
- public class AdoS0MfgLineMaterialQueryDto : AdoS0MfgPagedQueryBase;
- public class AdoS0MfgSopFileTypeQueryDto : AdoS0MfgPagedQueryBase;
- public class AdoS0MfgPreprocessElementParamQueryDto : AdoS0MfgPagedQueryBase
- {
- public long? PreprocessElementId { get; set; }
- }
- #endregion
- #region 标准资源 Upsert(12 个非聚合)
- public class AdoS0MfgStandardOperationUpsertDto
- {
- 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 bool IsKeyOperation { get; set; }
- public string? OperationType { get; set; }
- public decimal? StdTime { get; set; }
- public string? Remark { get; set; }
- public bool IsEnabled { get; set; } = true;
- }
- public class AdoS0MfgProductionLineUpsertDto
- {
- 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? LineType { get; set; }
- public string? LineCategory { get; set; }
- public long? LocationId { get; set; }
- public long? WorkshopId { get; set; }
- public decimal? Capacity { get; set; }
- public string? Remark { get; set; }
- public bool IsEnabled { get; set; } = true;
- }
- public class AdoS0MfgSopFileTypeUpsertDto
- {
- 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? Remark { get; set; }
- public bool IsEnabled { get; set; } = true;
- }
- 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;
- }
- 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;
- }
- 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;
- }
- public class AdoS0MfgMaterialSubstitutionUpsertDto
- {
- public long CompanyRefId { get; set; }
- public long FactoryRefId { get; set; }
- public long MaterialId { get; set; }
- public long SubstituteMaterialId { get; set; }
- public decimal SubstituteRatio { get; set; } = 1m;
- public int Priority { get; set; }
- public long? ParentMaterialId { get; set; }
- public string? Remark { get; set; }
- public bool IsEnabled { get; set; } = true;
- }
- 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;
- }
- 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
- {
- 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 long? ProductionLineId { get; set; }
- public long SopFileTypeId { get; set; }
- public long? MaterialId { get; set; }
- public long? OperationId { get; set; }
- public string? FileVersion { get; set; }
- public long? FileId { get; set; }
- public string DocStatus { get; set; } = "draft";
- public string? Remark { get; set; }
- public bool IsEnabled { get; set; } = true;
- }
- public class AdoS0MfgPreprocessElementParamUpsertDto
- {
- [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 PreprocessElementId { get; set; }
- [Range(1, long.MaxValue, ErrorMessage = "生产要素参数不能为空")]
- public long ElementParamId { get; set; }
- public string? ParamValue { get; set; }
- public int SortNo { get; set; }
- public string? Remark { get; set; }
- public bool IsEnabled { get; set; } = true;
- }
- #endregion
- #region 聚合 Upsert(步骤 9)
- public class AdoS0MfgBomItemUpsertDto
- {
- public long? Id { get; set; }
- [Range(1, long.MaxValue, ErrorMessage = "子项物料不能为空")]
- public long MaterialId { get; set; }
- public decimal Qty { get; set; } = 1m;
- public decimal QtyNumerator { get; set; } = 1m;
- public decimal QtyDenominator { get; set; } = 1m;
- public decimal LossRate { get; set; }
- public decimal FixedLossQty { get; set; }
- public long? OperationId { get; set; }
- public bool IsPhantom { get; set; }
- public string? Unit { get; set; }
- public int SortNo { get; set; }
- public string? Remark { get; set; }
- public bool IsEnabled { get; set; } = true;
- }
- public class AdoS0MfgBomUpsertDto
- {
- [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
- public long CompanyRefId { get; set; }
- [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
- public long FactoryRefId { get; set; }
- [Required(ErrorMessage = "BOM 编码不能为空")]
- public string Code { get; set; } = string.Empty;
- [Required(ErrorMessage = "BOM 名称不能为空")]
- public string Name { get; set; } = string.Empty;
- public long? MaterialId { get; set; }
- public string BizVersion { get; set; } = "1.0";
- public string DocStatus { get; set; } = "draft";
- public string? Remark { get; set; }
- public bool IsEnabled { get; set; } = true;
- public List<AdoS0MfgBomItemUpsertDto> Items { get; set; } = new();
- }
- public class AdoS0MfgRoutingOperationUpsertDto
- {
- public long? Id { get; set; }
- [Range(1, long.MaxValue, ErrorMessage = "工序不能为空")]
- public long OperationId { get; set; }
- public int SortNo { get; set; }
- public long? WorkCenterId { get; set; }
- public long? ProductionLineId { get; set; }
- public decimal? StdTime { get; set; }
- public string? Remark { get; set; }
- public bool IsReportOperation { get; set; }
- public string? Activity1 { get; set; }
- public decimal? Activity1Qty { get; set; }
- public string? Activity1Unit { get; set; }
- public string? Activity2 { get; set; }
- public decimal? Activity2Qty { get; set; }
- public string? Activity2Unit { get; set; }
- public string? Activity3 { get; set; }
- public decimal? Activity3Qty { get; set; }
- public string? Activity3Unit { get; set; }
- public decimal BaseQty { get; set; } = 1m;
- public bool IsOutsourced { get; set; }
- public long? SupplierId { get; set; }
- public int OutsourcedLeadTime { get; set; }
- public bool IsEnabled { get; set; } = true;
- }
- public class AdoS0MfgRoutingUpsertDto
- {
- [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? MaterialId { get; set; }
- public string BizVersion { get; set; } = "1.0";
- public string DocStatus { get; set; } = "draft";
- public string? Remark { get; set; }
- public bool IsEnabled { get; set; } = true;
- public List<AdoS0MfgRoutingOperationUpsertDto> Operations { get; set; } = new();
- }
- 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<AdoS0MfgLinePostSkillUpsertDto> Skills { get; set; } = new();
- }
- public class AdoS0MfgPreprocessElementParamLineUpsertDto
- {
- public long? Id { get; set; }
- [Range(1, long.MaxValue, ErrorMessage = "生产要素参数不能为空")]
- public long ElementParamId { get; set; }
- public string? ParamValue { get; set; }
- public int SortNo { get; set; }
- public string? Remark { get; set; }
- public bool IsEnabled { get; set; } = true;
- }
- public class AdoS0MfgPreprocessElementUpsertDto
- {
- [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? MaterialId { get; set; }
- public long? OperationId { get; set; }
- public bool IsKeyElement { get; set; }
- public string? Remark { get; set; }
- public bool IsEnabled { get; set; } = true;
- public List<AdoS0MfgPreprocessElementParamLineUpsertDto> Params { get; set; } = new();
- }
- #endregion
|