Dim jo As New JObject
Dim zbja As New JArray
Dim zbjo As New JObject
zbjo("TableName") = "表A"
Dim zblm() As String = {"rq","ckmc","bz","djh","djzt","leuser"} '主表列名
zbjo("columnNames") = New Jarray(zblm)
zbja.Add(zbjo)
jo("MainTables") = zbja
Dim zbcsja As New JArray
Dim zbcsja1 As New JArray
Dim zblz() As String = {"2018/08/16","原材料仓库","备注内容","SJD-20180424039","待启动流程","提交人"} '主表传值
Dim zbcsjo1 As New JObject
For Index As Integer = 0 To zblm.Length - 1
'MessageBox.Show(zblm(Index))
zbcsjo1("columnName") = zblm(Index)
zbcsjo1("Value") = zblz(Index)
zbcsja1.Add(zbcsjo1)
Next
zbcsja.Add(zbcsja1)
zbjo("ItemLists") = zbcsja
output.show(jo.ToString)
结果:
{
"MainTables": [
{
"TableName": "表A",
"columnNames": [
"rq",
"ckmc",
"bz",
"djh",
"djzt",
"leuser"
],
"ItemLists": [
[
{
"columnName": "leuser", 这里应该是日期才对,不知道什么原因
"Value": "提交人"
},
{
"columnName": "ckmc",
"Value": "原材料仓库"
},
{
"columnName": "bz",
"Value": "备注内容"
},
{
"columnName": "djh",
"Value": "单据号"
},
{
"columnName": "djzt",
"Value": "待启动流程"
},
{
"columnName": "leuser",
"Value": "提交人"
}
]
]
}
]
}