mirror of
https://gitee.com/ssssssss-team/magic-boot.git
synced 2025-02-08 04:42:49 +08:00
247 lines
12 KiB
Plaintext
247 lines
12 KiB
Plaintext
|
{
|
||
|
"properties" : { },
|
||
|
"id" : "f7d2fc76c0034060bcb09d89da4c34e8",
|
||
|
"script" : null,
|
||
|
"groupId" : "4f0230049d7e4f39b1e0897cc0f46f9a",
|
||
|
"name" : "导入",
|
||
|
"createTime" : null,
|
||
|
"updateTime" : 1648867085142,
|
||
|
"lock" : null,
|
||
|
"createBy" : null,
|
||
|
"updateBy" : null,
|
||
|
"path" : "/import",
|
||
|
"method" : "POST",
|
||
|
"parameters" : [ ],
|
||
|
"options" : [ ],
|
||
|
"requestBody" : "{\r\n \"datas\": [{\"登录名称\":\"test1\",\"密码\":1,\"姓名/昵称\":\"test1\",\"所属机构(编码)\":\"mxd\",\"角色(编码)\":\"admin\",\"手机号\":15300393296},{\"登录名称\":\"test2\",\"密码\":2,\"姓名/昵称\":\"test2\",\"所属机构(编码)\":\"mxd\",\"角色(编码)\":\"admin\",\"手机号\":15300393297},{\"登录名称\":\"test3\",\"密码\":3,\"姓名/昵称\":\"test3\",\"所属机构(编码)\":\"mxd\",\"角色(编码)\":\"admin\",\"手机号\":15300393298},{\"登录名称\":\"test4\",\"密码\":4,\"姓名/昵称\":\"test4\",\"所属机构(编码)\":\"mxd\",\"角色(编码)\":\"admin\",\"手机号\":15300393299},{\"登录名称\":\"test5\",\"密码\":5,\"姓名/昵称\":\"test5\",\"所属机构(编码)\":\"mxd\",\"角色(编码)\":\"admin\",\"手机号\":15300393300},{\"登录名称\":\"test6\",\"密码\":6,\"姓名/昵称\":\"test6\",\"所属机构(编码)\":\"mxd\",\"角色(编码)\":\"admin\",\"手机号\":15300393301},{\"登录名称\":\"test7\",\"密码\":7,\"姓名/昵称\":\"test7\",\"所属机构(编码)\":\"mxd\",\"角色(编码)\":\"admin\",\"手机号\":15300393302},{\"登录名称\":\"test8\",\"密码\":8,\"姓名/昵称\":\"test8\",\"所属机构(编码)\":\"mxd\",\"角色(编码)\":\"admin\",\"手机号\":15300393303},{\"登录名称\":\"test9\",\"密码\":9,\"姓名/昵称\":\"test9\",\"所属机构(编码)\":\"mxd\",\"角色(编码)\":\"admin\",\"手机号\":15300393304},{\"登录名称\":\"test10\",\"密码\":10,\"姓名/昵称\":\"test10\",\"所属机构(编码)\":\"mxd\",\"角色(编码)\":\"admin\",\"手机号\":15300393305},{\"登录名称\":\"test11\",\"密码\":11,\"姓名/昵称\":\"test11\",\"所属机构(编码)\":\"mxd\",\"角色(编码)\":\"admin\",\"手机号\":15300393306},{\"登录名称\":\"test12\",\"密码\":12,\"姓名/昵称\":\"test12\",\"所属机构(编码)\":\"mxd\",\"角色(编码)\":\"admin\",\"手机号\":15300393307},{\"登录名称\":\"test13\",\"密码\":13,\"姓名/昵称\":\"test13\",\"所属机构(编码)\":\"mxd\",\"角色(编码)\":\"admin\",\"手机号\":15300393308},{\"登录名称\":\"test14\",\"密码\":14,\"姓名/昵称\":\"test14\",\"所属机构(编码)\":\"mxd\",\"角色(编码)\":\"admin\",\"手机号\":15300393309},{\"登录名称\":\"test15\",\"密码\":15,\"姓名/昵称\":\"test15\",\"所属机构(编码)\":\"mxd\",\"角色(编码)\":\"admin\",\"手机号\":15300393310},{\"登录名称\":\"test16\",\"密码\":16,\"姓名/昵称\":\"test16\",\"所属机构(编码)\":\"mxd\",\"角色(编码)\":\"admin\",\"手机号\":15300393311},{\"登录名称\":\"test17\",\"密码\":17,\"姓名/昵称\":\"test17\",\"所属机构(编码)\":\"mxd\",\"角色(编码)\":\"admin\",\"手机号\":15300393312},{\"登录名称\":\"test18\",\"密码\":18,\"姓名/昵称\":\"test18\",\"所属机构(编码)\":\"mxd\",\"角色(编码)\":\"admin\",\"手机号\":15300393313},{\"登录名称\":\"test19\",\"密码\":19,\"姓名/昵称\":\"test19\",\"所属机构(编码)\":\"mxd\",\"角色(编码)\":\"admin\",\"手机号\":15300393314},{\"登录名称\":\"test20\",\"密码\":20,\"姓名/昵称\":\"test20\",\"所属机构(编码)\":\"mxd\",\"角色(编码)\":\"admin\",\"手机号\":15300393315},{\"登录名称\":\"test21\",\"密码\":21,\"姓名/昵称\":\"test21\",\"所属机构(编码)\":\"mxd\",\"角色(编码)\":\"admin\",\"手机号\":15300393316},{\"登录名称\":\"test22\",\"密码\":22,\"姓名/昵称\":\"test22\",\"所属机构(编码)\":\"mxd\",\"角色(编码)\":\"admin\",\"手机号\":15300393317},{\"登录名称\":\"test23\",\"密码\":23,\"姓名/昵称\":\"test23\",\"所属机构(编码)\":\"mxd\",\"角色(编码)\":\"admin\",\"手机号\":15300393318},{\"登录名称\":\"test24\",\"密码\":24,\"姓名/昵称\":\"test24\",\"所属机构(编码)\":\"mxd\",\"角色(编码)\":\"admin\",\"手机号\":15300393319},{\"登录名称\":\"test25
|
||
|
"headers" : [ ],
|
||
|
"paths" : [ ],
|
||
|
"responseBody" : "{\n \"code\": 0,\n \"message\": \"登录名称已存在\",\n \"data\": null,\n \"timestamp\": 1648866276963,\n \"executeTime\": 21\n}",
|
||
|
"description" : null,
|
||
|
"requestBodyDefinition" : {
|
||
|
"name" : "",
|
||
|
"value" : "",
|
||
|
"description" : "",
|
||
|
"required" : false,
|
||
|
"dataType" : "Object",
|
||
|
"type" : null,
|
||
|
"defaultValue" : null,
|
||
|
"validateType" : "",
|
||
|
"error" : "",
|
||
|
"expression" : "",
|
||
|
"children" : [ {
|
||
|
"name" : "datas",
|
||
|
"value" : "",
|
||
|
"description" : "",
|
||
|
"required" : false,
|
||
|
"dataType" : "Array",
|
||
|
"type" : null,
|
||
|
"defaultValue" : null,
|
||
|
"validateType" : "",
|
||
|
"error" : "",
|
||
|
"expression" : "",
|
||
|
"children" : [ {
|
||
|
"name" : "",
|
||
|
"value" : "",
|
||
|
"description" : "",
|
||
|
"required" : false,
|
||
|
"dataType" : "Object",
|
||
|
"type" : null,
|
||
|
"defaultValue" : null,
|
||
|
"validateType" : "",
|
||
|
"error" : "",
|
||
|
"expression" : "",
|
||
|
"children" : [ {
|
||
|
"name" : "登录名称",
|
||
|
"value" : "test1",
|
||
|
"description" : "",
|
||
|
"required" : false,
|
||
|
"dataType" : "String",
|
||
|
"type" : null,
|
||
|
"defaultValue" : null,
|
||
|
"validateType" : "",
|
||
|
"error" : "",
|
||
|
"expression" : "",
|
||
|
"children" : [ ]
|
||
|
}, {
|
||
|
"name" : "密码",
|
||
|
"value" : "1",
|
||
|
"description" : "",
|
||
|
"required" : false,
|
||
|
"dataType" : "Integer",
|
||
|
"type" : null,
|
||
|
"defaultValue" : null,
|
||
|
"validateType" : "",
|
||
|
"error" : "",
|
||
|
"expression" : "",
|
||
|
"children" : [ ]
|
||
|
}, {
|
||
|
"name" : "姓名/昵称",
|
||
|
"value" : "test1",
|
||
|
"description" : "",
|
||
|
"required" : false,
|
||
|
"dataType" : "String",
|
||
|
"type" : null,
|
||
|
"defaultValue" : null,
|
||
|
"validateType" : "",
|
||
|
"error" : "",
|
||
|
"expression" : "",
|
||
|
"children" : [ ]
|
||
|
}, {
|
||
|
"name" : "所属机构(编码)",
|
||
|
"value" : "mxd",
|
||
|
"description" : "",
|
||
|
"required" : false,
|
||
|
"dataType" : "String",
|
||
|
"type" : null,
|
||
|
"defaultValue" : null,
|
||
|
"validateType" : "",
|
||
|
"error" : "",
|
||
|
"expression" : "",
|
||
|
"children" : [ ]
|
||
|
}, {
|
||
|
"name" : "角色(编码)",
|
||
|
"value" : "admin",
|
||
|
"description" : "",
|
||
|
"required" : false,
|
||
|
"dataType" : "String",
|
||
|
"type" : null,
|
||
|
"defaultValue" : null,
|
||
|
"validateType" : "",
|
||
|
"error" : "",
|
||
|
"expression" : "",
|
||
|
"children" : [ ]
|
||
|
}, {
|
||
|
"name" : "手机号",
|
||
|
"value" : "15300393296",
|
||
|
"description" : "",
|
||
|
"required" : false,
|
||
|
"dataType" : "Long",
|
||
|
"type" : null,
|
||
|
"defaultValue" : null,
|
||
|
"validateType" : "",
|
||
|
"error" : "",
|
||
|
"expression" : "",
|
||
|
"children" : [ ]
|
||
|
} ]
|
||
|
} ]
|
||
|
} ]
|
||
|
},
|
||
|
"responseBodyDefinition" : {
|
||
|
"name" : "",
|
||
|
"value" : "",
|
||
|
"description" : "",
|
||
|
"required" : false,
|
||
|
"dataType" : "Object",
|
||
|
"type" : null,
|
||
|
"defaultValue" : null,
|
||
|
"validateType" : "",
|
||
|
"error" : "",
|
||
|
"expression" : "",
|
||
|
"children" : [ {
|
||
|
"name" : "code",
|
||
|
"value" : "0",
|
||
|
"description" : "",
|
||
|
"required" : false,
|
||
|
"dataType" : "Integer",
|
||
|
"type" : null,
|
||
|
"defaultValue" : null,
|
||
|
"validateType" : "",
|
||
|
"error" : "",
|
||
|
"expression" : "",
|
||
|
"children" : [ ]
|
||
|
}, {
|
||
|
"name" : "message",
|
||
|
"value" : "登录名称已存在",
|
||
|
"description" : "",
|
||
|
"required" : false,
|
||
|
"dataType" : "String",
|
||
|
"type" : null,
|
||
|
"defaultValue" : null,
|
||
|
"validateType" : "",
|
||
|
"error" : "",
|
||
|
"expression" : "",
|
||
|
"children" : [ ]
|
||
|
}, {
|
||
|
"name" : "data",
|
||
|
"value" : "null",
|
||
|
"description" : "",
|
||
|
"required" : false,
|
||
|
"dataType" : "Object",
|
||
|
"type" : null,
|
||
|
"defaultValue" : null,
|
||
|
"validateType" : "",
|
||
|
"error" : "",
|
||
|
"expression" : "",
|
||
|
"children" : [ ]
|
||
|
}, {
|
||
|
"name" : "timestamp",
|
||
|
"value" : "1648866276963",
|
||
|
"description" : "",
|
||
|
"required" : false,
|
||
|
"dataType" : "Long",
|
||
|
"type" : null,
|
||
|
"defaultValue" : null,
|
||
|
"validateType" : "",
|
||
|
"error" : "",
|
||
|
"expression" : "",
|
||
|
"children" : [ ]
|
||
|
}, {
|
||
|
"name" : "executeTime",
|
||
|
"value" : "21",
|
||
|
"description" : "",
|
||
|
"required" : false,
|
||
|
"dataType" : "Integer",
|
||
|
"type" : null,
|
||
|
"defaultValue" : null,
|
||
|
"validateType" : "",
|
||
|
"error" : "",
|
||
|
"expression" : "",
|
||
|
"children" : [ ]
|
||
|
} ]
|
||
|
}
|
||
|
}
|
||
|
================================
|
||
|
import "@post:/system/user/save" as userSave;
|
||
|
import log
|
||
|
|
||
|
body.datas.each(data => {
|
||
|
var username
|
||
|
var name
|
||
|
var password
|
||
|
var phone
|
||
|
var officeId
|
||
|
var roles
|
||
|
var i = 0
|
||
|
data.each((key, value) => {
|
||
|
log.info(i + '')
|
||
|
if(i == 0){
|
||
|
username = value
|
||
|
}
|
||
|
if(i == 1){
|
||
|
password = value + ''
|
||
|
}
|
||
|
if(i == 2){
|
||
|
name = value
|
||
|
}
|
||
|
if(i == 3){
|
||
|
officeId = db.selectValue("""
|
||
|
select id from sys_office where is_del = 0 and code = #{value}
|
||
|
""")
|
||
|
log.info(officeId)
|
||
|
}
|
||
|
if(i == 4){
|
||
|
roles = db.selectValue("""
|
||
|
select id from sys_role where is_del = 0 and code = #{value}
|
||
|
""")
|
||
|
log.info(roles)
|
||
|
}
|
||
|
if(i == 5){
|
||
|
phone = value
|
||
|
}
|
||
|
i++
|
||
|
})
|
||
|
userSave()
|
||
|
|
||
|
})
|
||
|
return 1
|