1.登录(获取token)
求路径:/runtime/login/loginwithciphertext2
示例:http://localhost:8080/obpm/runtime/login/loginwithciphertext2
请求包体:
{
"username": "admin1",
"password": "porfuytvqxsx",
"remember": "0",
"debug": "false",
"domainname": "测试",
"checkcode": "",
"language": "cn"
}
参数 类型 说明
username string 账号
password string 密码
remember string 是否记住密码
debug string 是否调式模式
checkcode string 验证码
language string 多语言
返回数据:
{
"msg": "登录成功",
"checkcodeimg": "",
"resultcode": "0",
"returnurl": "",
"accesstoken": ""
}
参数 类型 说明
msg string 返回提示
checkcodeimg string 验证码图片
resultcode string 登录状态(1成功|0失败)
returnurl string 跳转url
accesstoken string 访问令牌
js示例:
$.ajax({
url: path "runtime/login/loginwithciphertext2",
// url: "http://localhost:8080/signon2/runtime/login/loginwithciphertext2",
type: 'post',
async: false,
datatype: 'json',
contenttype: 'application/json',
data: json.stringify(data)
})
保存表单数
请求路径:
/runtime/sozu9kthmxyp8qqfq0e/documents/__v2co11rkfs9oeyzchtm?accesstoken={accesstoken}
示例:
http://localhost:8080/obpm/runtime/sozu9kthmx/documents/__v2co11rkfs9oeyzchtm?accesstoken={accesstoken}
请求包体:
{
"items": {
"名称": "11",
"单价": "22",
"库存": "33",
"备注": "444"
},
"applicationid": "sozu9kthmxyp8qqfq0e",
"id": "__v2co11rkfs9oeyzchtm",
"templateform": "",
"formid": "nkznglzerhg8wqmenhh",
"sign": "",
"parentid": "",
"isrelate": "false",
"subdocuments": [
{
"id": "__wdsib0fnx4bmexmflj2",
"formid": "__n7hjahgn7riwmotggmm",
"formname": "下拉子表",
"items": {},
"parentid": "__aoynihmhakg7efdeczv",
"isrelate": "true",
"delete": true
},
{
"id": "__qdqwos8p6f6mqrwtuaq",
"formid": "__n7hjahgn7riwmotggmm",
"items": {
"章节": "6",
"名称": "6",
"总金额": "6",
"计划总金额": "6"
},
"parentid": "__aoynihmhakg7efdeczv",
"isrelate": "true",
"edit": true
}
],
"versions": "0"
}
参数 类型 说明
items json 字段(控件名:值)
applicationid string 软件id
id string 文档id(主键)
templateform string 模板表单id
formid string 表单id
sign string 签章
parentid string 父文档id
isrelate string 是否父子关系
subdocuments list 子表单数据(数据格式同主表)
subdocuments[0].delete boolean 字表数据删除标识
subdocuments[1].edit boolean 字表数据新建或者更新标识
versions string 版本号
返回数据:
{
"errcode": 0,
"errmsg": "保存成功",
"data": {
"id": "__v2co11rkfs9oeyzchtm",
"authordeptindex": "zmmmgm5mngce4wvwfei",
"created": 1592365094789,
"lastmodified": 1592365094798,
"istmp": false,
"versions": 1,
"auditorlist": "{}",
"coauditorlist": "{}",
"stateint": 0,
"authorid": "m88fvl0rnprvkctzlkf",
"statelabelinfo": "[{\"nodes\":[{\"nodeid\":\"\",\"statelabel\":\"\",\"state\":\"\",\"auditors\":[],\"coauditors\":[]}]}]",
"formname": "表单示例/表单操作/表单操作_保存类型",
"formid": "nkznglzerhg8wqmenhh",
"delete": false,
"edit": false,
"relateflow": false,
"items": {
"单价": 22.0,
"名称": "11",
"备注": "444",
"库存": 33.0
}
}
}
js示例:
var result = null;
$.ajax({
url: contextpath '/runtime/' appid '/documents/' docid,
type: 'put',
datatype: 'json',
contenttype: 'application/json',
async: false,
data: json.stringify(docjson),
success: function (response) {
result = response;
}
})
3.上传附件
请求路径:
/portal/frontfileandimageuploadservlet?data=path:item_path,filesavemode:00,fieldid:null,allowedtypes:null,applicationid:sozu9kthmxyp8qqfq0e
示例:
http://localhost:8080/obpm/portal/frontfileandimageuploadservlet?data=path:item_path,filesavemode:00,fieldid:null,allowedtypes:null,applicationid:sozu9kthmxyp8qqfq0e
参数说明:
参数 类型 说明
path string 存储路径
filesavemode string 文件保存模式
fieldid string 表单控件id
allowedtypes string 允许上传的类型
applicationid string 软件id
文件数据:
返回数据:一字符串
"pdf签章方案.doc,/uploads/item/2020/1ee334a5-f233-4ec1-a82c-6e17d1a6bdfa.doc"
js示例:(百度的)
function uploadpic() {
var form = document.getelementbyid('upload'),
formdata = new formdata(form);
$.ajax({
url:"https://sscpre.boe.com/v1/medical-console/medical/file/upload",
type:"post",
data:formdata,
processdata:false,
contenttype:false,
success:function(res){
if(res){
alert("上传成功!");
}
console.log(res);
$("#pic").val("");
$(".showurl").html(res);
$(".showpic").attr("src",res);
},
error:function(err){
alert("网络连接失败,稍后重试",err);
}
})
}
想要上传的附件与表单关联,需再调用保存接口,将数据放在items里面
|