|
发表于 2016-6-6 15:29:15
|
显示全部楼层
按照你说的我也试验了一下,结果只保存了主表的数据,从表的数据没有保存,
我是这样做的,前台手动调用保存,传递tables,包含主表和从表的数据
justep.Baas.sendRequest({
"url" : "/nqcj/pick", // servlet请求地址
"action" : "saveNqcj", // action
"anync": false,
"params" : {"tables":[this.comp("pickData").toJson(),this.bodyData]}, // action对应的参数
"success" : function(data){
alert(JSON.stringify(data));
} // 请求成功后的回调方法
});
后台接收参数里,看到了我的两个表nyxx_nqcj_head,nyxx_nqcj_body
{"db":"nyxx","permissions":{"nyxx_nqcj_body":"","nyxx_nqcj_head":""}}
以及我传递过来的tables数据,
[
{
"@type": "table",
"rows": [
{
"billdate": {
"value": "2016-06-06"
},
"billno": {
"value": "NQCJ201606060001"
},
"deletesign": {
"value": 0
},
"maker": {
"value": "BRoedOSbRQRtfj9LjHjTj3RQe1m55i"
},
"pk_corp": {},
"ts": {
"changed": 1,
"originalValue": "2016-06-06T15:21:20.000Z",
"value": "2016-06-06T15:26:01.477Z"
},
"user_name": {
"value": "超级管理员"
},
"userdata": {
"id": {
"value": "ePGKo95VNG5WGqGfDPCzq313hW4FjW"
},
"isModified": true,
"recordState": "edit"
},
"version": {
"value": 0
},
"year": {
"value": "2016"
}
},
{
"billdate": {
"value": "2016-06-05"
},
"billno": {
"value": "NQCJ201606050002"
},
"deletesign": {
"value": 0
},
"maker": {
"value": "BRoedOSbRQRtfj9LjHjTj3RQe1m55i"
},
"pk_corp": {},
"ts": {
"value": "2016-06-05T12:11:55.000Z"
},
"user_name": {
"value": "超级管理员"
},
"userdata": {
"id": {
"value": "bKr22TNIZJzt9pHLTS0gfFCBbNTq3l"
},
"isModified": false,
"recordState": "none"
},
"version": {
"value": 0
},
"year": {
"value": "2016"
}
},
{
"billdate": {
"value": "2016-06-05"
},
"billno": {
"value": "NQCJ201606050003"
},
"deletesign": {
"value": 0
},
"maker": {
"value": "BRoedOSbRQRtfj9LjHjTj3RQe1m55i"
},
"pk_corp": {},
"ts": {
"value": "2016-06-05T12:11:30.000Z"
},
"user_name": {
"value": "超级管理员"
},
"userdata": {
"id": {
"value": "EgxgRIMKLOY0jHQUfuN7DQ6iNgOm3S"
},
"isModified": false,
"recordState": "none"
},
"version": {
"value": 0
},
"year": {
"value": "2016"
}
}
],
"userdata": {
"idColumnDefine": "primaryId",
"idColumnName": "primaryId",
"idColumnType": "String",
"model": "",
"relationAlias": "billdate,billno,deletesign,maker,pk_corp,ts,user_name,version,year",
"relationTypes": "Date,String,Integer,String,String,DateTime,String,Integer,String",
"relations": "billdate,billno,deletesign,maker,pk_corp,ts,EXPRESS,version,year",
"tableName": "nyxx_nqcj_head",
"updateMode": "whereVersion"
}
},
{
"@type": "table",
"rows": [
{
"area": {
"changed": 0,
"value": "11"
},
"deletesign": {
"changed": 0,
"value": 0
},
"enddate": {
"changed": 0,
"value": "2016-06-06"
},
"pk_crop": {
"changed": 0,
"value": "qirS6ZSWVF63AGFFZ4sV3XKEHvY8nG"
},
"pk_nqcj": {
"changed": 0,
"value": ""
},
"pk_nycs": {
"changed": 0,
"value": "1B63rQhrQhXGruzZw77Kr9KJvGYILB"
},
"startdate": {
"changed": 0,
"value": "2016-06-06"
},
"state": {
"changed": 0,
"value": 0
},
"ts": {
"changed": 0,
"value": "2016-06-06T15:26:01.475Z"
},
"userdata": {
"id": {
"changed": 0,
"value": "e5ZkrvawJ4Of8VdMoayluVA0q89Pk2"
},
"isModified": true,
"recordState": "new"
},
"version": {
"changed": 0,
"value": 0
}
}
],
"userdata": {
"idColumnDefine": "primaryId",
"idColumnName": "primaryId",
"idColumnType": "String",
"model": "",
"relationAlias": "area,deletesign,enddate,pk_crop,pk_nqcj,pk_nycs,startdate,state,ts,version",
"relationTypes": "Integer,Integer,Date,String,String,String,Date,Integer,DateTime,Integer",
"relations": "area,deletesign,enddate,pk_crop,pk_nqcj,pk_nycs,startdate,state,ts,version",
"updateMode": "whereVersion"
}
}
]
为从表的数据没有执行保存呢?
|
|