新平台增加界面控制服务
时间:2020-04-21 访问量:1167
新平台增加界面控制服务:用于基于系统界面的外部数据交互(第三方系统交互、物联网应用等)
--------------------
平台受控指令格式(JSON):
{"FunctionCode":"@T:9:I:10","TopShow":false,"DataSetName":"tabledoc","AppendData":true,"AutoPost":true,"HelpInputEdits":"DPanelInputDesignTDBEdit1","IsDataSetJsonStr":false,"DataSetJsonStr":{"data":[{"单位名称":"宏达软件"},{"单位名称":"云赋软件"}]},"Script":""}
------------------
DLL调用:
//DDE
function SendFunctionCodeEx(FunctionCode: string; AppendData, AutoPost: Boolean;
DataSetName, HelpInputEdits, DataJsonStr, Script: string): Boolean; stdcall;
external 'HdSendFunction.dll';
//HTTP
function SendFunctionCodeHttpEx(UrlTop, FunctionCode: string;
AppendData, AutoPost: Boolean; DataSetName, HelpInputEdits, DataJsonStr,
Script: string): Boolean; stdcall; external 'HdSendFunction.dll';
调用示例:
//DDE
SendFunctionCodeEx('@T:8:G', true, true, 'Tabledoc', '',
FDQuery1.ToJSONString(false, true), '');
//HTTP
SendFunctionCodeHttpEx('http://127.0.0.1/','@T:8:G', true, true, 'Tabledoc', '',
FDQuery1.ToJSONString(false, true), '');
-------------------
浏览器调试(同时支持GET和POST两种方式):
http://127.0.0.1/{"FunctionCode":"@T:9:I:10","TopShow":false,"DataSetName":"tabledoc","AppendData":true,"AutoPost":true,"HelpInputEdits":"DPanelInputDesignTDBEdit1","IsDataSetJsonStr":false,"DataSetJsonStr":{"data":[{"单位名称":"宏达软件"},{"单位名称":"云赋软件"}]},"Script":""}
***********
注意
json格式逻辑变量是true和false,不需要双引号,并且必须小写,否则会导致json解析异常!!!!
************
最新测试示例
http://127.0.0.1:80/{"FunctionCode":"@T:4:I:2","DataSetName":"tabledoc","AppendData":true,"AutoPost":true,"HelpInputEdits":"DPanelInputDesignTDBEdit0","IsDataSetJsonStr":false,"DataSetJsonStr":{"data":[{"刷指纹":"1007"}]},"FocusControlName":"DPanelInputDesignTDBGridEh0"}
------------------------
平台启动HTTP服务开启设置(DDE内置支持,不需要设置开启):
info.ini
[HttpFunctionServer]
Port=0