Files
HDCApi/_custom/GatemaSD/uHeOObj_CustomSDG.pas
2025-05-21 21:14:32 +02:00

267 lines
9.1 KiB
ObjectPascal

unit uHeOObj_CustomSDG;
{$RTTI EXPLICIT METHODS([vcPublic, vcPublished]) FIELDS([vcPrivate, vcProtected, vcPublic, vcPublished]) PROPERTIES([vcPublic, vcPublished])}
interface
{$I 'GlobalDefs.inc'}
uses
System.Generics.Collections,
MVCFramework.Serializer.Commons,
MVCFramework.ActiveRecord,
MVCFramework.Nullables,
{$IFDEF SWAGGER}
MVCFramework.Swagger.Commons,
{$ENDIF}
helTabsBIDs,
uHeoObj_Base;
const
tblGSDDoklady = '[dbo].[Gatema_SDDoklady]';
tblGSDScanData = '[dbo].[Gatema_SDScanData]';
type
[MVCNameCase(ncLowerCase)]
TGatemaSDScanData = class(THeliosObjekty)
private
FIDDokladSD: integer;
FIDZdrojSD: NullableInt32;
FIDPolozky: NullableInt32;
FIDPrikaz: NullableInt32;
FDokladPrKV: NullableInt32;
FDokladPrVPV: NullableInt32;
FIDPohZbo: NullableInt32;
FIDVyrCS_Obj: NullableInt32;
FIDInvItem: NullableInt32;
FIDPohZbo_New: NullableInt32;
FIDKmenZbozi: NullableInt32;
FIDStavSkladu: NullableInt32;
FVyrCislo: NullableString;
FPopisSarze: NullableString;
FMnozstvi: Single;
FMnozstviEvidence: Single;
FMJ: NullableString;
FMJEvidence: NullableString;
FBarCode: NullableString;
FDatumExpirace: NullableTDateTime;
FKodBaleni: NullableString;
FDatPorizeni: TDateTime;
FGenerovat: NullableBoolean;
FJedinecneCislo: NullableString;
public
{
[MVCTableField('ID', [foPrimaryKey, foReadOnly])]
[MVCColumn('ID')]
[MVCSwagJsonSchemaField(stInteger, 'ID', 'ID výrobní operace', true, false)] // typ, sysName, nazev, required, nullable, minLength, maxLength
property ID: integer read FID write FID;
}
[MVCColumn('IDDokladSD', false)]
[MVCSwagJsonSchemaField(stInteger, 'IDDokladSD', 'ID dokladu SD', true, false)]
property IDDokladSD: integer read FIDDokladSD write FIDDokladSD;
[MVCColumn('IDZdrojSD', false)]
[MVCSwagJsonSchemaField(stInteger, 'IDZdrojSD', 'ID zdorj SD', false, true)]
property IDZdrojSD: NullableInt32 read FIDZdrojSD write FIDZdrojSD;
[MVCColumn('IDPolozky', false)]
[MVCSwagJsonSchemaField(stInteger, 'IDPolozky', 'ID položky', false, true)]
property IDPolozky: NullableInt32 read FIDPolozky write FIDPolozky;
[MVCColumn('IDPrikaz', false)]
[MVCSwagJsonSchemaField(stInteger, 'IDPrikaz', 'ID výrobního příkazu', false, true)]
property IDPrikaz: NullableInt32 read FIDPrikaz write FIDPrikaz;
[MVCColumn('VyrCislo', false)]
[MVCSwagJsonSchemaField(stString, 'VyrCislo', 'Výrobní číslo', true, false, 1, 100)]
property VyrCislo: NullableString read FVyrCislo write FVyrCislo;
[MVCColumn('PopisSarze', false)]
[MVCSwagJsonSchemaField(stString, 'PopisSarze', 'Popis šarže', true, false, 1, 100)]
property PopisSarze: NullableString read FPopisSarze write FPopisSarze;
[MVCColumn('Mnozstvi')]
[MVCSwagJsonSchemaField('Mnozstvi', 'Množství', true, false)]
property Mnozstvi: Single read FMnozstvi write FMnozstvi;
[MVCColumn('MnozstviEvidence')]
[MVCSwagJsonSchemaField('MnozstviEvidence', 'Množství v evidenční jednotce', true, false)]
property MnozstviEvidence: Single read FMnozstviEvidence write FMnozstviEvidence;
[MVCColumn('DatumExpirace')]
[MVCSwagJsonSchemaField('DatumExpirace', 'Datum expirace', false, true)]
property DatumExpirace: NullableTDatetime read FDatumExpirace write FDatumExpirace;
[MVCColumn('DatPorizeni')]
[MVCSwagJsonSchemaField('DatPorizeni', 'Datum pořízení', true, false)]
property DatPorizeni: TDatetime read FDatPorizeni write FDatPorizeni;
end;
[MVCNameCase(ncLowerCase)]
TGatemaSDZdrojData = class(THeliosObjekty)
private
FIDDokladSD: integer;
FIDDokZbo: NullableInt32;
FIDPrikaz: NullableInt32;
FGUIDDokladu: NullableTGUID;
public
[MVCColumn('IDDokladSD', false)]
[MVCSwagJsonSchemaField(stInteger, 'IDDokladSD', 'ID dokladu SD', true, false)]
property IDDokladSD: integer read FIDDokladSD write FIDDokladSD;
[MVCColumn('IDDokZbo', false)]
[MVCSwagJsonSchemaField(stInteger, 'FIDDokZbo', 'ID dokladu OZ', false, true)]
property IDDokZbo: NullableInt32 read FIDDokZbo write FIDDokZbo;
[MVCColumn('IDPrikaz', false)]
[MVCSwagJsonSchemaField(stInteger, 'IDPrikaz', 'ID výrobního příkazu', false, true)]
property IDPrikaz: NullableInt32 read FIDPrikaz write FIDPrikaz;
[MVCColumn('GUIDDokladu', false)]
[MVCSwagJsonSchemaField(stGuid, 'GUIDDokladu', 'GUID dokladu', false, true)]
property GUIDDokladu: NullableTGUID read FGUIDDokladu write FGUIDDokladu;
end;
[MVCNameCase(ncLowerCase)]
TGatemaSDDoklad = class(THeliosObjekty)
private
FTypDokladu: integer;
FPodtypDokladu: NullableInt32;
FRadaDokladu: NullableString;
FDruhPohybuZbo: NullableInt32;
FSklad: NullableString;
FSkladCil: NullableString;
FIDPrikaz: NullableInt32;
FIDDokZbo: NullableInt32;
FIDDokZbo_New: NullableInt32;
FGUIDDokZbo: NullableTGUID;
FGUIDDokZbo_New: NullableTGUID;
FIDInvHead: NullableInt32;
FIDOrg: NullableInt32;
FCisloOrg: NullableInt32;
FDatumPripadu: NullableTDateTime;
FDatPorizeni: TDateTime;
FDatGenerovani: NullableTDateTime;
FScanData: TObjectList<TGatemaSDScanData>;
procedure SetSDScanData (const Value: TObjectList<TGatemaSDScanData>);
public
constructor Create; virtual;
destructor Destroy; override;
{
[MVCTableField('ID', [foPrimaryKey, foReadOnly])]
[MVCColumn('ID')]
[MVCSwagJsonSchemaField(stInteger, 'ID', 'ID výrobní operace', true, false)] // typ, sysName, nazev, required, nullable, minLength, maxLength
property ID: integer read FID write FID;
}
[MVCColumn('TypDokladu', false)]
[MVCSwagJsonSchemaField(stInteger, 'TypDokladu', 'Typ dokladu', true, false)]
property TypDokladu: integer read FTypDokladu write FTypDokladu;
[MVCColumn('PodtypDokladu', false)]
[MVCSwagJsonSchemaField(stInteger, 'PodtypDokladu', 'Podtyp dokladu', false, true)]
property PodtypDokladu: NullableInt32 read FPodtypDokladu write FPodtypDokladu;
[MVCColumn('RadaDokladu', false)]
[MVCSwagJsonSchemaField(stString, 'RadaDokladu', 'Řada dokladu', false, true)]
property RadaDokladu: NullableString read FRadaDokladu write FRadaDokladu;
[MVCColumn('DruhPohybuZbo', false)]
[MVCSwagJsonSchemaField(stInteger, 'DruhPohybuZbo', 'Druh pohybu zboží', false, true)]
property DruhPohybuZbo: NullableInt32 read FDruhPohybuZbo write FDruhPohybuZbo;
[MVCColumn('Sklad', false)]
[MVCSwagJsonSchemaField(stString, 'Sklad', 'Sklad', false, true)]
property Sklad: NullableString read FSklad write FSklad;
[MVCColumn('SkladCil', false)]
[MVCSwagJsonSchemaField(stString, 'SkladCil', 'Cílový sklad', false, true)]
property SkladCil: NullableString read FSkladCil write FSkladCil;
[MVCColumn('IDPrikaz', false)]
[MVCSwagJsonSchemaField(stInteger, 'IDPrikaz', 'ID výrobního příkazu', false, true)]
property IDPrikaz: NullableInt32 read FIDPrikaz write FIDPrikaz;
[MVCColumn('IDDokZbo', false)]
[MVCSwagJsonSchemaField(stInteger, 'IDDokZbo', 'ID dokladu OZ', false, true)]
property IDDokZbo: NullableInt32 read FIDDokZbo write FIDDokZbo;
[MVCColumn('IDDokZbo_New', false)]
[MVCSwagJsonSchemaField(stInteger, 'IDDokZbo_New', 'ID nového dokladu OZ', false, true)]
property IDDokZbo_New: NullableInt32 read FIDDokZbo_New write FIDDokZbo_New;
[MVCColumn('IDInvHead', false)]
[MVCSwagJsonSchemaField(stInteger, 'IDInvHead', 'ID dokladu inventury', false, true)]
property IDInvHead: NullableInt32 read FIDInvHead write FIDInvHead;
[MVCColumn('IDOrg', false)]
[MVCSwagJsonSchemaField(stInteger, 'IDOrg', 'ID organizace', false, true)]
property IDOrg: NullableInt32 read FIDOrg write FIDOrg;
[MVCColumn('CisloOrg', false)]
[MVCSwagJsonSchemaField(stInteger, 'CisloOrg', 'Číslo organizace', false, true)]
property CisloOrg: NullableInt32 read FCisloOrg write FCisloOrg;
[MVCColumn('DatumPripadu')]
[MVCSwagJsonSchemaField('DatumPripadu', 'Datum případu', false, true)]
property DatumPripadu: NullableTDatetime read FDatumPripadu write FDatumPripadu;
[MVCColumn('DatPorizeni')]
[MVCSwagJsonSchemaField('DatPorizeni', 'Datum pořízení', true, false)]
property DatPorizeni: TDatetime read FDatPorizeni write FDatPorizeni;
[MVCColumn('DatGenerovani')]
[MVCSwagJsonSchemaField('DatGenerovani', 'Datum generování dokladu OZ', false, true)]
property DatGenerovani: NullableTDatetime read FDatGenerovani write FDatGenerovani;
[MVCListOfAttribute(TGatemaSDScanData)]
property ScanData: TObjectList<TGatemaSDScanData> read FScanData write SetSDScanData;
end;
implementation
uses
System.SysUtils,
System.StrUtils,
System.RegularExpressions;
{ TGatemaSDDoklad }
constructor TGatemaSDDoklad.Create;
begin
inherited;
FScanData:= TObjectList<TGatemaSDScanData>.Create;
end;
destructor TGatemaSDDoklad.Destroy;
begin
// if (FPohybyOZ<>nil) then
// FPohybyOZ.Free;
inherited;
end;
procedure TGatemaSDDoklad.SetSDScanData(const Value: TObjectList<TGatemaSDScanData>);
begin
if (Value<>FScanData) then
begin
FScanData.Free;
FScanData:= Value;
end;
end;
end.