Prvni verze
This commit is contained in:
3
_custom/Koramex/customDefs.inc
Normal file
3
_custom/Koramex/customDefs.inc
Normal file
@ -0,0 +1,3 @@
|
||||
,uHeOObj_Custom in 'uHeOObj_Custom.pas'
|
||||
,uCtrlCustom in 'uCtrlCustom.pas'
|
||||
,uSvcCustom in 'uSvcCustom.pas'
|
||||
586
_custom/Koramex/uCtrlCustom.pas
Normal file
586
_custom/Koramex/uCtrlCustom.pas
Normal file
@ -0,0 +1,586 @@
|
||||
unit uCtrlCustom;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
MVCframework,
|
||||
MVCframework.Commons,
|
||||
MVCframework.Serializer.Commons,
|
||||
// MVCframework.Serializer.Intf,
|
||||
System.Generics.Collections, // kvuli TDictionary
|
||||
System.RegularExpressions,
|
||||
// JsonDataObjects,
|
||||
uCommons, // kvuli EServiceException
|
||||
uCtrlBase,
|
||||
// uSvc_Base,
|
||||
uHeoObj_Base,
|
||||
uHeOObj_Custom,
|
||||
uSvcCustom,
|
||||
MVCFramework.Swagger.Commons; // kvuli dokumentaci
|
||||
|
||||
type
|
||||
|
||||
[MVCPath('/vyroba-pila')]
|
||||
TKRXVyrobaPilaController = class(TBaseController)
|
||||
strict private
|
||||
FSelfSvc: TKoramexService;
|
||||
strict protected
|
||||
function GetKoramexService: TKoramexService;
|
||||
public
|
||||
destructor Destroy; override;
|
||||
|
||||
[MVCPath('hlavicky')]
|
||||
[MVCHTTPMethod([httpGET])]
|
||||
[MVCSwagSummary('Hlavičky evidence práce pily', 'Vrátí seznam hlaviček evidence pily', 'GetHlavicky')]
|
||||
[MVCSwagParam(plQuery, 'cislozam', 'Osobní číslo zaměstnance', ptString, false)]
|
||||
[MVCSwagParam(plQuery, 'radky', 'Včetně řádků (0/1)', ptString, false)]
|
||||
procedure GetHlavicky ([MVCFromQueryString('cislozam', '')] cislozam: string='';
|
||||
[MVCFromQueryString('radky', '')] radky: string=''
|
||||
);
|
||||
|
||||
[MVCPath('operace')]
|
||||
[MVCHTTPMethod([httpGET])]
|
||||
[MVCSwagSummary('Výrobní operace', 'Vrátí seznam operací výrobních příkazů s živými kusy', 'GetOperace')]
|
||||
[MVCSwagParam(plQuery, 'idpracoviste', 'ID pracoviště', ptString, true)]
|
||||
[MVCSwagParam(plQuery, 'zakazka', 'Osobní číslo zaměstnance', ptString, false)]
|
||||
[MVCSwagParam(plQuery, 'idkmenmaterial', 'ID kmenové karty materiálu', ptString, false)]
|
||||
procedure GetOperace ([MVCFromQueryString('idpracoviste', '')] idPrac: string='';
|
||||
[MVCFromQueryString('zakazka', '')] zakazka: string='';
|
||||
[MVCFromQueryString('idkmenmaterial', '')] idKmenMat: string=''
|
||||
);
|
||||
|
||||
end;
|
||||
|
||||
|
||||
|
||||
[MVCPath('/kooperace')]
|
||||
TKRXVyrobaCisKooperaceController = class(TTPVCisKooperaciController)
|
||||
strict private
|
||||
FSelfSvc: TKoramexService;
|
||||
strict protected
|
||||
function GetKoramexService: TKoramexService;
|
||||
public
|
||||
destructor Destroy; override;
|
||||
|
||||
// [MVCDoc('Pomocí POST zapíše data DataZone tasků (kontroluje duplicitu,vrací NEW, OLD nebo NOT OK s textem chyby)')]
|
||||
[MVCPath('/zapis')] // zapis pozadavku prevodu na mezisklad
|
||||
[MVCHTTPMethod([httpPOST])]
|
||||
[MVCSwagSummary('Požadavek převodu na mezisklad', 'Zápis požadavku převodu na mezisklad', 'ZapisPozadavku')]
|
||||
[MVCConsumes(TMVCMediaType.APPLICATION_JSON)]
|
||||
procedure ZapisPozadavku(CTX: TWebContext);
|
||||
|
||||
[MVCPath('/potvrzeni')] // vracti potvrzeni zapisu pozadavku
|
||||
[MVCHTTPMethod([httpGET])]
|
||||
[MVCSwagSummary('Požadavek převodu na mezisklad', 'Potvrzení požadavku převodu na mezisklad', 'PotvrzeniPozadavku')]
|
||||
[MVCSwagParam(plPath, 'id', 'ID požadavku', ptString, false)]
|
||||
procedure PotvrzeniPozadavku(id: string=''
|
||||
);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[MVCPath('/sdserver/doklad')]
|
||||
TGatemaSDDokladController = class(TBaseController)
|
||||
strict private
|
||||
FSelfSvc: TGatemaSDDokladService;
|
||||
strict protected
|
||||
function GetGatemaSDDokladService: TGatemaSDDokladService;
|
||||
public
|
||||
destructor Destroy; override;
|
||||
|
||||
[MVCPath]
|
||||
[MVCHTTPMethod([httpGET])]
|
||||
[MVCSwagSummary('GatemaSD_Doklad', 'Vrací hlavičku dokladů SD Serveru', 'GetAll')]
|
||||
[MVCSwagParam(plQuery, 'od', 'Datum od ve formátu RRRRMMDD', ptString, false)]
|
||||
[MVCSwagParam(plQuery, 'seznam', '1=jen seznam se základními údaji', ptString, false)]
|
||||
procedure GetAll([MVCFromQueryString('od', '')] odDatum: string='';
|
||||
[MVCFromQueryString('seznam', '')] jenSeznam: string='0'
|
||||
);
|
||||
|
||||
[MVCPath('/meta')]
|
||||
[MVCHTTPMethod([httpGET])]
|
||||
[MVCSwagSummary('GatemaSD_Doklad', 'Vrací metadata', 'GetMeta')]
|
||||
procedure GetMeta;
|
||||
|
||||
[MVCPath('/($id)')]
|
||||
[MVCHTTPMethod([httpGET])]
|
||||
[MVCSwagSummary('GatemaSD_Doklad', 'Vrací data dokladu SD Serveru', 'GetByID')]
|
||||
[MVCSwagParam(plPath, 'id', 'ID dokladu', ptString, false)]
|
||||
[MVCSwagParam(plQuery, 'typdokl', 'Typ dokladu', ptString, false)]
|
||||
[MVCSwagParam(plQuery, 'druhpohybu', 'Druh pohybu zboží', ptString, false)]
|
||||
[MVCSwagParam(plQuery, 'sklad', 'Sklad', ptString, false)]
|
||||
[MVCSwagParam(plQuery, 'format', 'Formát (1=dokladOZ)', ptString, false)]
|
||||
[MVCSwagParam(plQuery, 'od', 'Datum od ve formátu RRRRMMDD', ptString, false)]
|
||||
[MVCSwagParam(plQuery, 'do', 'Datum do ve formátu RRRRMMDD', ptString, false)]
|
||||
[MVCSwagParam(plQuery, 'seznam', '1=jen seznam se základními údaji', ptString, false)]
|
||||
[MVCSwagResponses(200, 'Success', TGatemaSDDoklad, true)]
|
||||
procedure GetByID(id: string='';
|
||||
[MVCFromQueryString('typdokl', '')] typDokl: string='';
|
||||
[MVCFromQueryString('druhpohybu', '')] druhPohybu: string='';
|
||||
[MVCFromQueryString('sklad', '')] sklad: string='';
|
||||
[MVCFromQueryString('format', '')] formatX: string='';
|
||||
[MVCFromQueryString('od', '')] odDatum: string='';
|
||||
[MVCFromQueryString('do', '')] doDatum: string='';
|
||||
[MVCFromQueryString('seznam', '')] jenSeznam: string='0'
|
||||
);
|
||||
|
||||
end;
|
||||
|
||||
|
||||
|
||||
[MVCPath('/sdserver/dokladoz')]
|
||||
TGatemaSDDokladOZController = class(TBaseController)
|
||||
strict private
|
||||
FSelfSvc: TSDGDokladOZService;
|
||||
strict protected
|
||||
function GetSDGDokladOZService: TSDGDokladOZService;
|
||||
public
|
||||
destructor Destroy; override;
|
||||
|
||||
[MVCPath]
|
||||
[MVCHTTPMethod([httpGET])]
|
||||
[MVCSwagSummary('GatemaSD_DokladOZ', 'Vrací hlavičku dokladů OZ s vazbou na SD Server', 'GetAll')]
|
||||
[MVCSwagParam(plQuery, 'od', 'Datum od ve formátu RRRRMMDD', ptString, false)]
|
||||
[MVCSwagParam(plQuery, 'seznam', '1=jen seznam se základními údaji', ptString, false)]
|
||||
procedure GetAll([MVCFromQueryString('od', '')] odDatum: string='';
|
||||
[MVCFromQueryString('seznam', '')] jenSeznam: string='0'
|
||||
);
|
||||
|
||||
[MVCPath('/meta')]
|
||||
[MVCHTTPMethod([httpGET])]
|
||||
[MVCSwagSummary('GatemaSD_DokladOZ', 'Vrací metadata', 'GetMeta')]
|
||||
procedure GetMeta;
|
||||
|
||||
[MVCPath('/($id)')]
|
||||
[MVCHTTPMethod([httpGET])]
|
||||
[MVCSwagSummary('GatemaSD_DokladOZ', 'Vrací data dokladu OZ s vazbou na SD Server', 'GetByID')]
|
||||
[MVCSwagParam(plPath, 'id', 'ID dokladu', ptString, false)]
|
||||
[MVCSwagParam(plQuery, 'typdokl', 'Typ dokladu', ptString, false)]
|
||||
[MVCSwagParam(plQuery, 'druhpohybu', 'Druh pohybu zboží', ptString, false)]
|
||||
[MVCSwagParam(plQuery, 'sklad', 'Sklad', ptString, false)]
|
||||
[MVCSwagParam(plQuery, 'format', 'Formát (1=dokladOZ)', ptString, false)]
|
||||
[MVCSwagParam(plQuery, 'od', 'Datum od ve formátu RRRRMMDD', ptString, false)]
|
||||
[MVCSwagParam(plQuery, 'do', 'Datum do ve formátu RRRRMMDD', ptString, false)]
|
||||
[MVCSwagParam(plQuery, 'seznam', '1=jen seznam se základními údaji', ptString, false)]
|
||||
[MVCSwagResponses(200, 'Success', TGatemaSDDoklad, true)]
|
||||
procedure GetByID(id: string='';
|
||||
[MVCFromQueryString('typdokl', '')] typDokl: string='';
|
||||
[MVCFromQueryString('druhpohybu', '')] druhPohybu: string='';
|
||||
[MVCFromQueryString('sklad', '')] sklad: string='';
|
||||
[MVCFromQueryString('format', '')] formatX: string='';
|
||||
[MVCFromQueryString('od', '')] odDatum: string='';
|
||||
[MVCFromQueryString('do', '')] doDatum: string='';
|
||||
[MVCFromQueryString('seznam', '')] jenSeznam: string='0'
|
||||
);
|
||||
|
||||
end;
|
||||
|
||||
|
||||
|
||||
[MVCPath('/sdserver/scandata')]
|
||||
TGatemaSDScanDataController = class(TBaseController)
|
||||
strict private
|
||||
FSelfSvc: TGatemaSDScanDataService;
|
||||
strict protected
|
||||
function GetGatemaSDScanDataService: TGatemaSDScanDataService;
|
||||
public
|
||||
destructor Destroy; override;
|
||||
|
||||
[MVCPath('/meta')]
|
||||
[MVCHTTPMethod([httpGET])]
|
||||
[MVCSwagSummary('GatemaSD_ScanData', 'Vrací metadata', 'GetMeta')]
|
||||
procedure GetMeta;
|
||||
|
||||
[MVCPath('/($id)')]
|
||||
[MVCHTTPMethod([httpGET])]
|
||||
[MVCSwagSummary('GatemaSD_ScanData', 'Vrací naskenovaná data', 'GetByID')]
|
||||
[MVCSwagParam(plPath, 'id', 'ID scan data', ptString, false)]
|
||||
[MVCSwagParam(plQuery, 'iddoklad', 'ID dokladu SD', ptString, false)]
|
||||
[MVCSwagResponses(200, 'Success', TGatemaSDScanData, true)]
|
||||
procedure GetByID(id: string='';
|
||||
[MVCFromQueryString('iddoklad', '')] iddoklad: string=''
|
||||
);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
implementation
|
||||
uses
|
||||
FireDAC.Stan.Option,
|
||||
FireDAC.Comp.Client,
|
||||
FireDAC.Stan.Param,
|
||||
MVCFramework.FireDAC.Utils,
|
||||
MVCFramework.DataSet.Utils,
|
||||
System.StrUtils,
|
||||
System.SysUtils,
|
||||
System.JSON,
|
||||
JsonDataObjects,
|
||||
Winapi.ActiveX,
|
||||
uDataMod;
|
||||
|
||||
const
|
||||
selSloupce = '';
|
||||
|
||||
|
||||
|
||||
{ TKRXVyrobaPilaController }
|
||||
destructor TKRXVyrobaPilaController.Destroy;
|
||||
begin
|
||||
FSelfSvc.Free;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{ TGatemaSDDokladOZController }
|
||||
|
||||
destructor TGatemaSDDokladOZController.Destroy;
|
||||
begin
|
||||
FSelfSvc.Free;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
function TGatemaSDDokladOZController.GetSDGDokladOZService: TSDGDokladOZService;
|
||||
begin
|
||||
inherited;
|
||||
if not Assigned(FSelfSvc) then
|
||||
FSelfSvc:= TSDGDokladOZService.Create(datMod);
|
||||
result:= FSelfSvc;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
procedure TGatemaSDDokladOZController.GetAll(odDatum: string=''; jenSeznam: string='0');
|
||||
var params: TDictionary<string, string>;
|
||||
begin
|
||||
params:= TDictionary<string, string>.Create;
|
||||
odDatum:= sanitizeSQLString(odDatum);
|
||||
if (odDatum<>'') then
|
||||
params.Add('odDatum', odDatum);
|
||||
|
||||
jenSeznam:= sanitizeSQLString(jenSeznam);
|
||||
if (jenSeznam='1') then
|
||||
params.Add('seznam', '1');
|
||||
|
||||
try
|
||||
try
|
||||
Render(ObjectDict().Add('data', GetSDGDokladOZService.GetByParams(params))); // viz uSvcCustom.pas
|
||||
except
|
||||
on E: EServiceException do
|
||||
begin
|
||||
raise EMVCException.Create(E.Message, '', 0, 200);
|
||||
end;
|
||||
on E:Exception do
|
||||
begin
|
||||
raise EMVCException.Create(E.Message, '', 0, 200);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
params.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
procedure TGatemaSDDokladOZController.GetByID(id: string=''; typDokl: string=''; druhPohybu: string=''; sklad: string=''; formatX: string=''; odDatum: string=''; doDatum: string='';
|
||||
jenSeznam: string='0');
|
||||
var iId: integer;
|
||||
params: TDictionary<string, string>;
|
||||
begin
|
||||
params:= TDictionary<string, string>.Create;
|
||||
|
||||
iId:= 0;
|
||||
id:= sanitizeSQLString(id);
|
||||
if (id<>'') then
|
||||
if not(TryStrToInt(id, iId)) then
|
||||
iId:= 0;
|
||||
if (iId>0) then
|
||||
params.Add('id', iId.ToString);
|
||||
|
||||
typDokl:= sanitizeSQLString(sklad);
|
||||
if (typDokl<>'') then
|
||||
params.Add('typDokladu', typDokl);
|
||||
|
||||
druhPohybu:= sanitizeSQLString(sklad);
|
||||
if (druhPohybu<>'') then
|
||||
params.Add('druhPohybu', druhPohybu);
|
||||
|
||||
formatX:= sanitizeSQLString(formatX); // pro zobrazeni jako DokladOZ
|
||||
if (formatX<>'') then
|
||||
if (formatX='1') then
|
||||
params.Add('format', formatX);
|
||||
|
||||
sklad:= sanitizeSQLString(sklad);
|
||||
if (sklad<>'') then
|
||||
params.Add('sklad', sklad);
|
||||
|
||||
odDatum:= sanitizeSQLString(odDatum);
|
||||
if (odDatum<>'') then
|
||||
params.Add('odDatum', odDatum);
|
||||
|
||||
doDatum:= sanitizeSQLString(doDatum);
|
||||
if (doDatum<>'') then
|
||||
params.Add('doDatum', doDatum);
|
||||
|
||||
jenSeznam:= sanitizeSQLString(jenSeznam);
|
||||
if (jenSeznam='1') then
|
||||
params.Add('seznam', '1');
|
||||
|
||||
try
|
||||
try
|
||||
Render(ObjectDict().Add('data', GetSDGDokladOZService.GetByParams(params))); // viz uSvcCustom.pas
|
||||
except
|
||||
on E: EServiceException do
|
||||
begin
|
||||
raise EMVCException.Create(E.Message, '', 0, 200);
|
||||
end;
|
||||
on E:Exception do
|
||||
begin
|
||||
raise EMVCException.Create(E.Message, '', 0, 200);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
params.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
procedure TGatemaSDDokladOZController.GetMeta;
|
||||
begin
|
||||
try
|
||||
Render(ObjectDict().Add('data', GetSDGDokladOZService.GetMeta));
|
||||
except
|
||||
on E: EServiceException do
|
||||
begin
|
||||
raise EMVCException.Create(E.Message, '', 0, 200);
|
||||
end;
|
||||
on E:Exception do
|
||||
begin
|
||||
raise EMVCException.Create(E.Message, '', 0, 200);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{ TGatemaSDDokladController }
|
||||
|
||||
destructor TGatemaSDDokladController.Destroy;
|
||||
begin
|
||||
FSelfSvc.Free;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
|
||||
function TGatemaSDDokladController.GetGatemaSDDokladService: TGatemaSDDokladService;
|
||||
begin
|
||||
inherited;
|
||||
if not Assigned(FSelfSvc) then
|
||||
FSelfSvc:= TGatemaSDDokladService.Create(datMod);
|
||||
result:= FSelfSvc;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
procedure TGatemaSDDokladController.GetAll(odDatum: string=''; jenSeznam: string='0');
|
||||
var params: TDictionary<string, string>;
|
||||
begin
|
||||
params:= TDictionary<string, string>.Create;
|
||||
odDatum:= sanitizeSQLString(odDatum);
|
||||
if (odDatum<>'') then
|
||||
params.Add('odDatum', odDatum);
|
||||
|
||||
jenSeznam:= sanitizeSQLString(jenSeznam);
|
||||
if (jenSeznam='1') then
|
||||
params.Add('seznam', '1');
|
||||
|
||||
try
|
||||
try
|
||||
Render(ObjectDict().Add('data', GetGatemaSDDokladService.GetByParams(params))); // viz uSvcCustom.pas
|
||||
except
|
||||
on E: EServiceException do
|
||||
begin
|
||||
raise EMVCException.Create(E.Message, '', 0, 200);
|
||||
end;
|
||||
on E:Exception do
|
||||
begin
|
||||
raise EMVCException.Create(E.Message, '', 0, 200);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
params.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
procedure TGatemaSDDokladController.GetByID(id: string=''; typDokl: string=''; druhPohybu: string=''; sklad: string=''; formatX: string=''; odDatum: string=''; doDatum: string='';
|
||||
jenSeznam: string='0');
|
||||
var iId: integer;
|
||||
params: TDictionary<string, string>;
|
||||
begin
|
||||
params:= TDictionary<string, string>.Create;
|
||||
|
||||
iId:= 0;
|
||||
id:= sanitizeSQLString(id);
|
||||
if (id<>'') then
|
||||
if not(TryStrToInt(id, iId)) then
|
||||
iId:= 0;
|
||||
if (iId>0) then
|
||||
params.Add('id', iId.ToString);
|
||||
|
||||
typDokl:= sanitizeSQLString(sklad);
|
||||
if (typDokl<>'') then
|
||||
params.Add('typDokladu', typDokl);
|
||||
|
||||
druhPohybu:= sanitizeSQLString(sklad);
|
||||
if (druhPohybu<>'') then
|
||||
params.Add('druhPohybu', druhPohybu);
|
||||
|
||||
formatX:= sanitizeSQLString(formatX); // pro zobrazeni jako DokladOZ
|
||||
if (formatX<>'') then
|
||||
if (formatX='1') then
|
||||
params.Add('format', formatX);
|
||||
|
||||
sklad:= sanitizeSQLString(sklad);
|
||||
if (sklad<>'') then
|
||||
params.Add('sklad', sklad);
|
||||
|
||||
odDatum:= sanitizeSQLString(odDatum);
|
||||
if (odDatum<>'') then
|
||||
params.Add('odDatum', odDatum);
|
||||
|
||||
doDatum:= sanitizeSQLString(doDatum);
|
||||
if (doDatum<>'') then
|
||||
params.Add('doDatum', doDatum);
|
||||
|
||||
jenSeznam:= sanitizeSQLString(jenSeznam);
|
||||
if (jenSeznam='1') then
|
||||
params.Add('seznam', '1');
|
||||
|
||||
try
|
||||
try
|
||||
Render(ObjectDict().Add('data', GetGatemaSDDokladService.GetByParams(params))); // viz uSvcCustom.pas
|
||||
except
|
||||
on E: EServiceException do
|
||||
begin
|
||||
raise EMVCException.Create(E.Message, '', 0, 200);
|
||||
end;
|
||||
on E:Exception do
|
||||
begin
|
||||
raise EMVCException.Create(E.Message, '', 0, 200);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
params.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
procedure TGatemaSDDokladController.GetMeta;
|
||||
begin
|
||||
try
|
||||
Render(ObjectDict().Add('data', GetGatemaSDDokladService.GetMeta));
|
||||
except
|
||||
on E: EServiceException do
|
||||
begin
|
||||
raise EMVCException.Create(E.Message, '', 0, 200);
|
||||
end;
|
||||
on E:Exception do
|
||||
begin
|
||||
raise EMVCException.Create(E.Message, '', 0, 200);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{ TGatemaSDScanDataController }
|
||||
|
||||
destructor TGatemaSDScanDataController.Destroy;
|
||||
begin
|
||||
FSelfSvc.Free;
|
||||
end;
|
||||
|
||||
function TGatemaSDScanDataController.GetGatemaSDScanDataService: TGatemaSDScanDataService;
|
||||
begin
|
||||
inherited Create;
|
||||
if not Assigned(FSelfSvc) then
|
||||
FSelfSvc:= TGatemaSDScanDataService.Create(datMod);
|
||||
result:= FSelfSvc;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
procedure TGatemaSDScanDataController.GetByID(id: string=''; iddoklad: string='');
|
||||
var iId: integer;
|
||||
params: TDictionary<string, string>;
|
||||
begin
|
||||
params:= TDictionary<string, string>.Create;
|
||||
|
||||
iId:= 0;
|
||||
id:= sanitizeSQLString(id);
|
||||
if (id<>'') then
|
||||
if not(TryStrToInt(id, iId)) then
|
||||
iId:= 0;
|
||||
if (iId>0) then
|
||||
params.Add('id', iId.ToString);
|
||||
|
||||
try
|
||||
Render(ObjectDict().Add('data', GetGatemaSDScanDataService.GetByParams(params))); // viz uSvcCustom.pas
|
||||
except
|
||||
on E: EServiceException do
|
||||
begin
|
||||
raise EMVCException.Create(E.Message, '', 0, 200);
|
||||
end;
|
||||
on E:Exception do
|
||||
begin
|
||||
raise EMVCException.Create(E.Message, '', 0, 200);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
procedure TGatemaSDScanDataController.GetMeta;
|
||||
begin
|
||||
try
|
||||
Render(ObjectDict().Add('data', GetGatemaSDScanDataService.GetMeta));
|
||||
except
|
||||
on E: EServiceException do
|
||||
begin
|
||||
raise EMVCException.Create(E.Message, '', 0, 200);
|
||||
end;
|
||||
on E:Exception do
|
||||
begin
|
||||
raise EMVCException.Create(E.Message, '', 0, 200);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
end.
|
||||
29
_custom/Koramex/uHeOObj_Custom.pas
Normal file
29
_custom/Koramex/uHeOObj_Custom.pas
Normal file
@ -0,0 +1,29 @@
|
||||
unit uHeOObj_Custom;
|
||||
{$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;
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
System.SysUtils,
|
||||
System.StrUtils,
|
||||
System.RegularExpressions;
|
||||
|
||||
|
||||
|
||||
end.
|
||||
40
_custom/Koramex/uSvcCustom.pas
Normal file
40
_custom/Koramex/uSvcCustom.pas
Normal file
@ -0,0 +1,40 @@
|
||||
|
||||
unit uSvcCustom;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
System.Generics.Collections,
|
||||
Winapi.ActiveX,
|
||||
System.DateUtils,
|
||||
System.SysUtils,
|
||||
JsonDataObjects,
|
||||
uSvc_Base,
|
||||
uCommons, // kvuli EServiceException
|
||||
helTabsBIDs,
|
||||
uHeoObj_Base,
|
||||
uHeOObj_Custom;
|
||||
|
||||
|
||||
type
|
||||
TKoramexService = class(TServiceBase)
|
||||
public
|
||||
end;
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
System.StrUtils,
|
||||
FireDAC.Stan.Option,
|
||||
FireDAC.Comp.Client,
|
||||
FireDAC.Stan.Param,
|
||||
MVCFramework.FireDAC.Utils,
|
||||
MVCFramework.DataSet.Utils,
|
||||
MVCFramework.Serializer.Commons;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
end.
|
||||
1
_custom/Koramex/uWebModCustom.inc
Normal file
1
_custom/Koramex/uWebModCustom.inc
Normal file
@ -0,0 +1 @@
|
||||
FEngine.AddController(TKRXVyrobaCisKooperaceController);
|
||||
Reference in New Issue
Block a user