表单API接口

restful web服务接口通过 httpclient、spring restful等后台服务调用,服务调用token生成,所有调用web服务接口必须通过生成token作为访问系统的凭证

1. token生成
获取密钥:进入 系统管理》平台属性 设置接口调用密钥,如为123456
Jwt jwt = new Jwt();
String token = jwt.token("123456");

2. 获取表单目录
访问URL: http://localhost:9905/dmp/api/form/def/find_all_folder.htm?token="+token
移动端URL: http://localhost:9905/dmp/api/form/app/find_all_folder.htm?token="+token
返回数据格式: [{"id":86,"pId":0,"name":"test","isParent":true},{"id":69,"pId":0,"name":"表单数据录入","isParent":true}]

3. 新增表单目录
访问URL: http://localhost:8080/dmp/api/form/def/add_folder.htm?token="+token + “&folder=test”
移动端URL: http://localhost:8080/dmp/api/form/app/add_folder.htm?token="+token + “&folder=test”

参数:folder=test 创建名称为test的目录, parentId=0 上级目录ID,可为空
返回数据格式:{“id”:120,”name”:”test”,”folderType”:2,”parentId”:0}

4. 更新表单目录
访问URL: http://localhost:9905/dmp/api/form/def/mod_folder.htm?token="+token+"&folder=testForm&id=120
移动端URL: http://localhost:9905/dmp/api/form/app/mod_folder.htm?token="+token+"&folder=testForm&id=120

参数:folder=testForm 更新目录名称为testForm, id=120 表单目录ID
返回数据格式:{“id”:120,”name”:”testForm”,”folderType”:2,”parentId”:0}

5. 删除目录
访问URL: http://localhost:9905/dmp/api/form/def/del_folder.htm?token="+token + “&id=120”
移动端URL: http://localhost:9905/dmp/api/from/app/del_folder.htm?token="+token + “&id=120”
参数:id=120 表单目录ID
返回数据格式: 0 表示成功,其它表示失败

6. 查询表单与目录
访问URL: http://localhost:9905/dmp/api/form/def/query_forms.htm?token="+token
移动端URL: http://localhost:9905/dmp/api/form/app/query_forms.htm?token="+token

返回数据格式:

  1. [{"id":69,"name":"表单数据录入","isFile":false,"children":[{"id":658,"name":"每日上报","isFile":true}, {"id":657,"name":"校审单","isFile":true},{"id":656,"name":"质量评定表","isFile":true}]

7. 查询表单名称
访问URL: http://localhost:9905/dmp/api/form/query_form_name.htm?token="+token+"&formId=620
参数:formId=620 表单ID
返回数据格式: “设计任务通知单-ver-2”

8. 删除表单
访问URL: http://localhost:9905/dmp/api/form/del_form_tplt.htm?token="+token+"&formId=744
参数:formId=744 表单ID
返回数据格式: 0 表示成功,其它表示失败

9. 移动目录或表单
访问URL: http://localhost:9905/dmp/api/form/def/move_folder.htm?token="+token+"&id=x-745&destId=86
移动端URL: http://localhost:9905/dmp/api/form/app/move_folder.htm?token="+token+"&id=x-745&destId=86

参数:id=x-745 745是表单ID,id=1 不是以x-开始为目录id,destId=86, 移动至目录ID
返回数据格式: 0 表示成功,其它表示失败

10. 表单新增数据
访问URL: http://localhost:9905/dmp/api/form/add.htm?token="+token+"&formId=620&xx=xx“;
参数:formId=620 表单ID
返回JSON数据格式: {code:0}, code=0表示成功