咏南中间件JSON序列类
咏南中间件JSON序列类
1)支持跨平台、跨语言
2)支持主从表数据序列、还原,支持任意数量的表
主从表数据序列为JSON字符串样式:
- {
- "rows": [
- {
- "FDBS": {
- "Version": 15,
- "Manager": {
- "UpdatesRegistry": true,
- "TableList": [
- {
- "class": "Table",
- "Name": "qryOpen",
- "SourceName": "tgoods",
- "SourceID": 1,
- "TabID": 0,
- "EnforceConstraints": false,
- "MinimumCapacity": 50,
- "CheckReadOnly": false,
- "ColumnList": [
- {
- "class": "Column",
- "Name": "goodsid",
- "SourceName": "goodsid",
- "SourceID": 1,
- "DataType": "AnsiString",
- "Size": 8,
- "Searchable": true,
- "Base": true,
- "OInUpdate": true,
- "OInWhere": true,
- "OInKey": true,
- "OriginColName": "goodsid",
- "SourcePrecision": 8,
- "SourceSize": 8
- },
- {
- "class": "Column",
- "Name": "barcode",
- "SourceName": "barcode",
- "SourceID": 2,
- "DataType": "AnsiString",
- "Size": 18,
- "Searchable": true,
- "AllowNull": true,
- "Base": true,
- "OAllowNull": true,
- "OInUpdate": true,
- "OInWhere": true,
- "OriginColName": "barcode",
- "SourcePrecision": 18,
- "SourceSize": 18
- },
- {
- "class": "Column",
- "Name": "goodsname",
- "SourceName": "goodsname",
- "SourceID": 3,
- "DataType": "AnsiString",
- "Size": 50,
- "Searchable": true,
- "Base": true,
- "OInUpdate": true,
- "OInWhere": true,
- "OriginColName": "goodsname",
- "SourcePrecision": 50,
- "SourceSize": 50
- },
- {
- "class": "Column",
- "Name": "pyjm",
- "SourceName": "pyjm",
- "SourceID": 4,
- "DataType": "AnsiString",
- "Size": 50,
- "Searchable": true,
- "AllowNull": true,
- "Base": true,
- "OAllowNull": true,
- "OInUpdate": true,
- "OInWhere": true,
- "OriginColName": "pyjm",
- "SourcePrecision": 50,
- "SourceSize": 50
- },
- {
- "class": "Column",
- "Name": "gg",
- "SourceName": "gg",
- "SourceID": 5,
- "DataType": "AnsiString",
- "Size": 30,
- "Searchable": true,
- "AllowNull": true,
- "Base": true,
- "OAllowNull": true,
- "OInUpdate": true,
- "OInWhere": true,
- "OriginColName": "gg",
- "SourcePrecision": 30,
- "SourceSize": 30
- },
- {
- "class": "Column",
- "Name": "kindid",
- "SourceName": "kindid",
- "SourceID": 6,
- "DataType": "AnsiString",
- "Size": 8,
- "Searchable": true,
- "AllowNull": true,
- "Base": true,
- "OAllowNull": true,
- "OInUpdate": true,
- "OInWhere": true,
- "OriginColName": "kindid",
- "SourcePrecision": 8,
- "SourceSize": 8
- },
- {
- "class": "Column",
- "Name": "jj",
- "SourceName": "jj",
- "SourceID": 7,
- "DataType": "BCD",
- "Precision": 18,
- "Scale": 4,
- "Searchable": true,
- "AllowNull": true,
- "Base": true,
- "OAllowNull": true,
- "OInUpdate": true,
- "OInWhere": true,
- "OriginColName": "jj",
- "SourcePrecision": 18,
- "SourceScale": 4
- },
- {
- "class": "Column",
- "Name": "lsj",
- "SourceName": "lsj",
- "SourceID": 8,
- "DataType": "BCD",
- "Precision": 18,
- "Scale": 4,
- "Searchable": true,
- "AllowNull": true,
- "Base": true,
- "OAllowNull": true,
- "OInUpdate": true,
- "OInWhere": true,
- "OriginColName": "lsj",
- "SourcePrecision": 18,
- "SourceScale": 4
- },
- {
- "class": "Column",
- "Name": "kcxx",
- "SourceName": "kcxx",
- "SourceID": 9,
- "DataType": "BCD",
- "Precision": 18,
- "Scale": 4,
- "Searchable": true,
- "AllowNull": true,
- "Base": true,
- "OAllowNull": true,
- "OInUpdate": true,
- "OInWhere": true,
- "OriginColName": "kcxx",
- "SourcePrecision": 18,
- "SourceScale": 4
- },
- {
- "class": "Column",
- "Name": "kcsx",
- "SourceName": "kcsx",
- "SourceID": 10,
- "DataType": "BCD",
- "Precision": 18,
- "Scale": 4,
- "Searchable": true,
- "AllowNull": true,
- "Base": true,
- "OAllowNull": true,
- "OInUpdate": true,
- "OInWhere": true,
- "OriginColName": "kcsx",
- "SourcePrecision": 18,
- "SourceScale": 4
- },
- {
- "class": "Column",
- "Name": "unitid",
- "SourceName": "unitid",
- "SourceID": 11,
- "DataType": "AnsiString",
- "Size": 8,
- "Searchable": true,
- "AllowNull": true,
- "Base": true,
- "OAllowNull": true,
- "OInUpdate": true,
- "OInWhere": true,
- "OriginColName": "unitid",
- "SourcePrecision": 8,
- "SourceSize": 8
- },
- {
- "class": "Column",
- "Name": "unitname",
- "SourceName": "unitname",
- "SourceID": 12,
- "DataType": "AnsiString",
- "Size": 10,
- "Searchable": true,
- "AllowNull": true,
- "Base": true,
- "OAllowNull": true,
- "OInUpdate": true,
- "OInWhere": true,
- "OriginColName": "unitname",
- "SourcePrecision": 10,
- "SourceSize": 10
- },
- {
- "class": "Column",
- "Name": "kindname",
- "SourceName": "kindname",
- "SourceID": 13,
- "DataType": "AnsiString",
- "Size": 30,
- "Searchable": true,
- "AllowNull": true,
- "Base": true,
- "OAllowNull": true,
- "OInUpdate": true,
- "OInWhere": true,
- "OriginColName": "kindname",
- "SourcePrecision": 30,
- "SourceSize": 30
- }
- ],
- "ConstraintList": [],
- "ViewList": [],
- "RowList": [
- {
- "RowID": 0,
- "Original": {
- "goodsid": "100036",
- "barcode": "100036",
- "goodsname": "秋冬四件套哦",
- "pyjm": "",
- "gg": "",
- "kindid": "12002",
- "jj": 100,
- "lsj": 430,
- "kcxx": 50,
- "kcsx": 5,
- "unitid": "15",
- "unitname": "箱套",
- "kindname": "床上用品"
- }
- },
- {
- "RowID": 1,
- "Original": {
- "goodsid": "100050",
- "barcode": "100050",
- "goodsname": "天堂伞",
- "pyjm": "wrth",
- "gg": "",
- "kindid": "1",
- "jj": 10,
- "lsj": 0,
- "kcxx": 0,
- "kcsx": 0,
- "unitid": "15",
- "unitname": "箱套",
- "kindname": "1111"
- }
- },
- {
- "RowID": 2,
- "Original": {
- "goodsid": "100054",
- "barcode": "100054",
- "goodsname": "我们的 哎",
- "pyjm": "WMD D7",
- "gg": "",
- "kindid": "11002",
- "jj": 0,
- "lsj": 0,
- "kcxx": 0,
- "kcsx": 0,
- "unitid": "18",
- "unitname": "公斤",
- "kindname": "饮料"
- }
- },
- {
- "RowID": 3,
- "Original": {
- "goodsid": "100055",
- "barcode": "100055",
- "goodsname": "娃哈哈纯净水500ML",
- "pyjm": "WHHCJS500ML",
- "kindid": "11001",
- "jj": 0,
- "lsj": 0,
- "kcxx": 0,
- "kcsx": 0,
- "unitid": "18",
- "unitname": "公斤",
- "kindname": "奶粉"
- }
- }
- ]
- }
- ],
- "RelationList": [],
- "UpdatesJournal": {
- "Changes": []
- }
- }
- }
- },
- {
- "FDBS": {
- "Version": 15,
- "Manager": {
- "UpdatesRegistry": true,
- "TableList": [
- {
- "class": "Table",
- "Name": "qryOpen",
- "SourceName": "tunit",
- "SourceID": 1,
- "TabID": 0,
- "EnforceConstraints": false,
- "MinimumCapacity": 50,
- "CheckReadOnly": false,
- "ColumnList": [
- {
- "class": "Column",
- "Name": "unitid",
- "SourceName": "unitid",
- "SourceID": 1,
- "DataType": "AnsiString",
- "Size": 4,
- "Searchable": true,
- "Base": true,
- "OInUpdate": true,
- "OInWhere": true,
- "OInKey": true,
- "OriginColName": "unitid",
- "SourcePrecision": 4,
- "SourceSize": 4
- },
- {
- "class": "Column",
- "Name": "unitname",
- "SourceName": "unitname",
- "SourceID": 2,
- "DataType": "AnsiString",
- "Size": 6,
- "Searchable": true,
- "AllowNull": true,
- "Base": true,
- "OAllowNull": true,
- "OInUpdate": true,
- "OInWhere": true,
- "OriginColName": "unitname",
- "SourcePrecision": 6,
- "SourceSize": 6
- }
- ],
- "ConstraintList": [],
- "ViewList": [],
- "RowList": [
- {
- "RowID": 0,
- "Original": {
- "unitid": "11",
- "unitname": "个"
- }
- },
- {
- "RowID": 1,
- "Original": {
- "unitid": "12",
- "unitname": "双"
- }
- }
- ]
- }
- ],
- "RelationList": [],
- "UpdatesJournal": {
- "Changes": []
- }
- }
- }
- }
- ]
- }
主从表查询调用代码:
- procedure TForm1.btnQueryClick(Sender: TObject);
- // 主从表 查询
- begin
- var url: TynUrl := TynUrl.Create;
- var serial: TynJsonSerial := TynJsonSerial.Create;
- var send: TMemoryStream := TMemoryStream.Create;
- try
- url.url := Edit1.Text;
- url.command := 'query91'; // 命令
- url.params.Add('count=2'); // 查询几个表的数据
- url.params.Add('accountno=1'); // 帐套号
- url.params.Add('sql=select * from tgoods'); // 查询SQL
- url.params.Add('sql2=select * from tunit'); // 查询SQL2
- // Memo1.Text := IdHTTP1.Post(url.text, send);
- serial.Text := IdHTTP1.Post(url.text, send);
- serial.ReadFDMemTable(0, FDMemTable1);
- serial.ReadFDMemTable(1, FDMemTable2);
- finally
- serial.DisposeOf;
- send.DisposeOf;
- url.DisposeOf;
- end;
- end;
主从表提交调用代码:
- procedure TForm1.btnPostClick(Sender: TObject);
- // 主从表 提交
- begin
- var url: TynUrl := TynUrl.Create;
- var serial: TynJsonSerial := TynJsonSerial.Create;
- var send: TMemoryStream := TMemoryStream.Create;
- try
- url.url := Edit1.Text;
- url.command := 'save91'; // 命令
- url.params.Add('count=2'); // 提交几个表的数据
- url.params.Add('accountno=1'); // 帐套号
- url.params.Add('tablename=tgoods'); // 表名
- url.params.Add('tablename2=tunit'); // 表名2
- url.params.Add('delta=' + serial.FDDeltaToJson(FDMemTable1)); // delta
- url.params.Add('delta2=' + serial.FDDeltaToJson(FDMemTable2)); // delta2
- serial.Text := IdHTTP1.Post(url.text, send);
- if Pos('true', serial.Text) > 0 then
- ShowMessage('数据提交成功')
- else
- ShowMessage('数据提交失败');
- finally
- serial.DisposeOf;
- send.DisposeOf;
- url.DisposeOf;
- end;
- end;
咏南中间件JSON序列类的更多相关文章
- 咏南中间件D7客户端演示
咏南中间件D7客户端演示 咏南中间件MORMOT(http.sys)支持D6.D7等老版本开发客户端.客户端使用TClientDataSet内存表控件,数据序列使用TynSerial类.
- 咏南中间件+开发框架支持最新的DELPHI XE10.1(BERLIN) UPDATE1
咏南中间件+开发框架支持最新的DELPHI XE10.1(BERLIN) UPDATE1 购买提供:中间件源码,价格十分优惠!有意者请向本人索取演示程序! 附带福利(赠送): CS开发框架源码BS开发 ...
- delphi 10.1 berlin最新的开发框架:咏南中间件+咏南开发框架,购买后提供全部的源码
咏南中间件+咏南开发框架支持最新的delphi 10.1(berlin),老用户提供免费升级. 购买提供:中间件源码 附带福利(赠送): CS开发框架源码BS开发框架源码移动APP源码中间件集群源码二 ...
- 专门为ADO二层升三层的咏南中间件(特种用途)
专门为ADO二层升三层的咏南中间件(特种用途) 演示下载:链接: https://pan.baidu.com/s/1bulGBIZ6A1nkeErxIrGsGA 密码: 22dk 解压后运行ynmai ...
- 咏南中间件支持JWT TOKEN
咏南中间件支持JWT TOKEN
- 咏南中间件新增MORMOT移动端演示
咏南中间件新增MORMOT移动端演示 基于FMX,支持安卓.IOS移动端. 1)使用INDY 的HTTP控件进行查询: procedure TForm1.查询1Click(Sender: TObjec ...
- 咏南中间件支持DELPHI6及以上版本开发的客户端
咏南中间件支持DELPHI6及以上版本开发的客户端 下面是测试用DELPHI7开发的客户端,调用DELPHI10.3.1开发的中间件,完全兼容. 这样,有利于维护原来用D7开发的老程序. 如上所述,只 ...
- 咏南中间件开始支持redis client接口调用
咏南中间件开始支持redis client接口调用 咏南中间件封装了redis client接口,可以支持REDIS了. 如下图,将数据集写入REDIS缓存,和从REDIS缓存获取数据: proced ...
- 咏南中间件支持TMS WEB CORE客户端
咏南中间件支持TMS WEB CORE客户端 TMS WEB CORE是优秀的JS前端,搭配咏南中间件后端,可以进行快速的企业应用开发.
随机推荐
- Ex 6_3 修建酒店所获得的利润..._第五次作业
假设profit[i]为在前i个位置修建酒店所获得的最大利润,当i=0时,profit[0]=0.当i>0时,若j为上一个满足m[i]-m[j]k的位置.若profit[i-1]>prof ...
- 判断Javascript变量是否为空 undefined 或者null(附样例)
1.变量申明未赋值 var type; //type 变量未赋值 1. type==undefined //true 2. type===undefined //true 3. typeof(type ...
- [学习笔记]Javascript采用二进制浮点数和四舍五入的错误
1.样例 var a = .3 - .2 //0.09999999999999998 var b = .2 - .1 //0.1 a == b //false 出现这样的原因在于 1.Javascri ...
- PYTHON-文件处理-练习
## 一.实现用户注册功能# 思路:# 用户输入用户名.密码# 将用户输入的内容按照固定的格式,比如:egon:123,存入文件# 可以往一个文件中重复注册新的用户名和密码# 附加:# 1.对输入的用 ...
- C++ Primer读书笔记(1)
指针和引用 引用本身不是一个对象,因此不能定义引用的指针:而指针是一个对象,因此可以定义指针的引用. 此外,要理解一个复合类型的变量到底是什么类型,最简单的办法是从右向左阅读其定义,离变量名最近的符号 ...
- python接口自动化测试一:http协议
1. http简介:http(超文本传输协议)是一个基于请求与响应模式的.无状态的.应用层的协议 2. url详解:百度搜索的一个url地址:https://www.baidu.com/s?wd=%E ...
- icomet研究
官方文档https://github.com/ideawu/icomet/wiki 如何实现的长连接:noop: 心跳消息+HTTP endless chunk 以班级ID为主键,进行班级通道的创建: ...
- hdu 1385 Floyd 输出路径
Floyd 输出路径 Sample Input50 3 22 -1 43 0 5 -1 -122 5 0 9 20-1 -1 9 0 44 -1 20 4 05 17 8 3 1 //收费1 3 // ...
- 删除input上传的文件路径
上传文件时,选择了文件后想清空文件路径,搜索了一下,用两种方法解决 <input type="file" id="fileupload" name=&qu ...
- Python安装scrapy过程中出现“Failed building wheel for xxx”
https://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml Python安装scrapy库过程中出现“ Failed building wheel for xxx ...