提交 64b32a1d 编写于 作者: ibizdev's avatar ibizdev

ibiz4j 发布系统代码 [ibiz-uaa,UAA鉴权]

上级 202d2e68
......@@ -271,6 +271,44 @@ mock.onPost(new RegExp(/^\/sysusers\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((c
return [status, data];
});
// SaveSysUser
mock.onPost(new RegExp(/^\/sysusers\/?([a-zA-Z0-9\-\;]{0,35})\/savesysuser$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuser 方法: SaveSysUser");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['userid'];
const matchArray:any = new RegExp(/^\/sysusers\/([a-zA-Z0-9\-\;]{1,35})\/savesysuser$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.userid, tempValue.userid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['userid'] == tempValue['userid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// FetchDefault
mock.onGet(new RegExp(/^\/sysusers\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuser 方法: FetchDefault");
......
......@@ -171,6 +171,20 @@ export default class SysUserServiceBase extends EntityService {
return res;
}
/**
* SaveSysUser接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysUserServiceBase
*/
public async SaveSysUser(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/sysusers/${context.sysuser}/savesysuser`,data,isloading);
return res;
}
/**
* FetchDefault接口方法
*
......
......@@ -27,6 +27,20 @@ import cn.ibizlab.core.uaa.domain.SysUser;
@Data
public class SysUserSearchContext extends QueryWrapperContext<SysUser> {
private String n_userid_eq;//[用户标识]
public void setN_userid_eq(String n_userid_eq) {
this.n_userid_eq = n_userid_eq;
if(!ObjectUtils.isEmpty(this.n_userid_eq)){
this.getSearchCond().eq("userid", n_userid_eq);
}
}
private String n_userid_in;//[用户标识]
public void setN_userid_in(String n_userid_in) {
this.n_userid_in = n_userid_in;
if(!ObjectUtils.isEmpty(this.n_userid_in)){
this.getSearchCond().in("userid",this.n_userid_in.split(";"));
}
}
private String n_username_like;//[用户全局名]
public void setN_username_like(String n_username_like) {
this.n_username_like = n_username_like;
......@@ -40,6 +54,20 @@ public class SysUserSearchContext extends QueryWrapperContext<SysUser> {
if(!ObjectUtils.isEmpty(this.n_personname_like)){
this.getSearchCond().like("personname", n_personname_like);
}
}
private String n_usercode_eq;//[用户工号]
public void setN_usercode_eq(String n_usercode_eq) {
this.n_usercode_eq = n_usercode_eq;
if(!ObjectUtils.isEmpty(this.n_usercode_eq)){
this.getSearchCond().eq("usercode", n_usercode_eq);
}
}
private String n_usercode_like;//[用户工号]
public void setN_usercode_like(String n_usercode_like) {
this.n_usercode_like = n_usercode_like;
if(!ObjectUtils.isEmpty(this.n_usercode_like)){
this.getSearchCond().like("usercode", n_usercode_like);
}
}
private String n_loginname_like;//[登录名]
public void setN_loginname_like(String n_loginname_like) {
......@@ -47,6 +75,27 @@ public class SysUserSearchContext extends QueryWrapperContext<SysUser> {
if(!ObjectUtils.isEmpty(this.n_loginname_like)){
this.getSearchCond().like("loginname", n_loginname_like);
}
}
private String n_mdeptid_eq;//[主部门]
public void setN_mdeptid_eq(String n_mdeptid_eq) {
this.n_mdeptid_eq = n_mdeptid_eq;
if(!ObjectUtils.isEmpty(this.n_mdeptid_eq)){
this.getSearchCond().eq("mdeptid", n_mdeptid_eq);
}
}
private String n_mdeptid_in;//[主部门]
public void setN_mdeptid_in(String n_mdeptid_in) {
this.n_mdeptid_in = n_mdeptid_in;
if(!ObjectUtils.isEmpty(this.n_mdeptid_in)){
this.getSearchCond().in("mdeptid",this.n_mdeptid_in.split(";"));
}
}
private String n_mdeptcode_like;//[主部门代码]
public void setN_mdeptcode_like(String n_mdeptcode_like) {
this.n_mdeptcode_like = n_mdeptcode_like;
if(!ObjectUtils.isEmpty(this.n_mdeptcode_like)){
this.getSearchCond().like("mdeptcode", n_mdeptcode_like);
}
}
private String n_mdeptname_like;//[主部门名称]
public void setN_mdeptname_like(String n_mdeptname_like) {
......@@ -54,6 +103,69 @@ public class SysUserSearchContext extends QueryWrapperContext<SysUser> {
if(!ObjectUtils.isEmpty(this.n_mdeptname_like)){
this.getSearchCond().like("mdeptname", n_mdeptname_like);
}
}
private String n_bcode_like;//[业务编码]
public void setN_bcode_like(String n_bcode_like) {
this.n_bcode_like = n_bcode_like;
if(!ObjectUtils.isEmpty(this.n_bcode_like)){
this.getSearchCond().like("bcode", n_bcode_like);
}
}
private String n_postid_eq;//[岗位标识]
public void setN_postid_eq(String n_postid_eq) {
this.n_postid_eq = n_postid_eq;
if(!ObjectUtils.isEmpty(this.n_postid_eq)){
this.getSearchCond().eq("postid", n_postid_eq);
}
}
private String n_postid_in;//[岗位标识]
public void setN_postid_in(String n_postid_in) {
this.n_postid_in = n_postid_in;
if(!ObjectUtils.isEmpty(this.n_postid_in)){
this.getSearchCond().in("postid",this.n_postid_in.split(";"));
}
}
private String n_postname_like;//[岗位名称]
public void setN_postname_like(String n_postname_like) {
this.n_postname_like = n_postname_like;
if(!ObjectUtils.isEmpty(this.n_postname_like)){
this.getSearchCond().like("postname", n_postname_like);
}
}
private String n_orgid_eq;//[单位]
public void setN_orgid_eq(String n_orgid_eq) {
this.n_orgid_eq = n_orgid_eq;
if(!ObjectUtils.isEmpty(this.n_orgid_eq)){
this.getSearchCond().eq("orgid", n_orgid_eq);
}
}
private String n_orgid_in;//[单位]
public void setN_orgid_in(String n_orgid_in) {
this.n_orgid_in = n_orgid_in;
if(!ObjectUtils.isEmpty(this.n_orgid_in)){
this.getSearchCond().in("orgid",this.n_orgid_in.split(";"));
}
}
private String n_orgcode_eq;//[单位代码]
public void setN_orgcode_eq(String n_orgcode_eq) {
this.n_orgcode_eq = n_orgcode_eq;
if(!ObjectUtils.isEmpty(this.n_orgcode_eq)){
this.getSearchCond().eq("orgcode", n_orgcode_eq);
}
}
private String n_orgcode_leftlike;//[单位代码]
public void setN_orgcode_leftlike(String n_orgcode_leftlike) {
this.n_orgcode_leftlike = n_orgcode_leftlike;
if(!ObjectUtils.isEmpty(this.n_orgcode_leftlike)){
this.getSearchCond().likeRight("orgcode", n_orgcode_leftlike);
}
}
private String n_orgcode_like;//[单位代码]
public void setN_orgcode_like(String n_orgcode_like) {
this.n_orgcode_like = n_orgcode_like;
if(!ObjectUtils.isEmpty(this.n_orgcode_like)){
this.getSearchCond().like("orgcode", n_orgcode_like);
}
}
private String n_orgname_like;//[单位名称]
public void setN_orgname_like(String n_orgname_like) {
......@@ -62,6 +174,13 @@ public class SysUserSearchContext extends QueryWrapperContext<SysUser> {
this.getSearchCond().like("orgname", n_orgname_like);
}
}
private String n_certcode_like;//[证件号码]
public void setN_certcode_like(String n_certcode_like) {
this.n_certcode_like = n_certcode_like;
if(!ObjectUtils.isEmpty(this.n_certcode_like)){
this.getSearchCond().like("certcode", n_certcode_like);
}
}
/**
* 启用快速搜索
......
......@@ -40,6 +40,7 @@ public interface ISysUserService extends IService<SysUser> {
boolean save(SysUser et);
@CacheEvict(value = "sysuser",allEntries = true)
void saveBatch(List<SysUser> list);
SysUser saveSysUser(SysUser et);
Page<SysUser> searchDefault(SysUserSearchContext context);
/**
*自定义查询SQL
......
......@@ -54,6 +54,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
@Autowired
@Lazy
protected cn.ibizlab.core.uaa.service.ISysUserRoleService sysuserroleService;
@Autowired
@Lazy
protected cn.ibizlab.core.uaa.service.logic.ISysUsersaveSysUserLogic savesysuserLogic;
@Autowired
@Lazy
ISysUserService proxyService;
......@@ -187,6 +191,13 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
}
}
@Override
@Transactional
public SysUser saveSysUser(SysUser et) {
savesysuserLogic.execute(et);
return et ;
}
/**
......
......@@ -35,7 +35,8 @@ public class RocketMQConfig {
public ConsumeConcurrentlyStatus consumeMessage(
List<MessageExt> msgs, ConsumeConcurrentlyContext context) {
for (MessageExt msg : msgs) {
log.info("接收到[]消息,但未配置实体输入过滤行为,消息将被忽略。"+new String(msg.getBody()));
cn.ibizlab.core.uaa.domain.SysUser domain = JSON.parseObject(new String(msg.getBody()),cn.ibizlab.core.uaa.domain.SysUser.class);
SysUserService.remove(domain);
}
return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
}
......@@ -62,7 +63,8 @@ public class RocketMQConfig {
public ConsumeConcurrentlyStatus consumeMessage(
List<MessageExt> msgs, ConsumeConcurrentlyContext context) {
for (MessageExt msg : msgs) {
log.info("接收到[]消息,但未配置实体输入过滤行为,消息将被忽略。"+new String(msg.getBody()));
cn.ibizlab.core.uaa.domain.SysUser domain = JSON.parseObject(new String(msg.getBody()),cn.ibizlab.core.uaa.domain.SysUser.class);
SysUserService.saveSysUser(domain);
}
return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
}
......
......@@ -6,7 +6,7 @@
<!--输出实体[SYS_AUTHLOG]数据结构 -->
<changeSet author="root" id="tab-sys_authlog-3-1">
<changeSet author="a_A_5d9d78509" id="tab-sys_authlog-3-1">
<createTable tableName="IBZAUTHLOG">
<column name="LOGID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_AUTHLOG_LOGID"/>
......@@ -32,7 +32,7 @@
<!--输出实体[SYS_OPEN_ACCESS]数据结构 -->
<changeSet author="root" id="tab-sys_open_access-37-2">
<changeSet author="a_A_5d9d78509" id="tab-sys_open_access-37-2">
<createTable tableName="IBZOPENACCESS">
<column name="ACCESSID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_OPEN_ACCESS_ACCESSID"/>
......@@ -64,7 +64,7 @@
<!--输出实体[SYS_PSSYSTEM]数据结构 -->
<changeSet author="root" id="tab-sys_pssystem-1-3">
<changeSet author="a_A_5d9d78509" id="tab-sys_pssystem-1-3">
<createTable tableName="IBZPSSYSTEM">
<column name="PSSYSTEMID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_PSSYSTEM_PSSYSTEMID"/>
......@@ -84,7 +84,7 @@
<!--输出实体[SYS_PERMISSION]数据结构 -->
<changeSet author="root" id="tab-sys_permission-8-4">
<changeSet author="a_A_5d9d78509" id="tab-sys_permission-8-4">
<createTable tableName="IBZPERMISSION">
<column name="SYS_PERMISSIONID" remarks="" type="VARCHAR(200)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_PERMISSION_SYS_PERMISSI"/>
......@@ -106,7 +106,7 @@
<!--输出实体[SYS_ROLE]数据结构 -->
<changeSet author="root" id="tab-sys_role-49-5">
<changeSet author="a_A_5d9d78509" id="tab-sys_role-49-5">
<createTable tableName="IBZROLE">
<column name="SYS_ROLEID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_ROLE_SYS_ROLEID"/>
......@@ -130,7 +130,7 @@
<!--输出实体[SYS_ROLE_PERMISSION]数据结构 -->
<changeSet author="root" id="tab-sys_role_permission-25-6">
<changeSet author="a_A_5d9d78509" id="tab-sys_role_permission-25-6">
<createTable tableName="IBZROLE_PERMISSION">
<column name="SYS_ROLE_PERMISSIONID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_ROLE_PERMISSION_SYS_ROL"/>
......@@ -150,7 +150,7 @@
<!--输出实体[SYS_USER_AUTH]数据结构 -->
<changeSet author="root" id="tab-sys_user_auth-22-7">
<changeSet author="a_A_5d9d78509" id="tab-sys_user_auth-22-7">
<createTable tableName="IBZUSERAUTH">
<column name="AUTHID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_USER_AUTH_AUTHID"/>
......@@ -168,7 +168,7 @@
<!--输出实体[SYS_USER_ROLE]数据结构 -->
<changeSet author="root" id="tab-sys_user_role-13-8">
<changeSet author="a_A_5d9d78509" id="tab-sys_user_role-13-8">
<createTable tableName="IBZUSER_ROLE">
<column name="SYS_USER_ROLEID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_USER_ROLE_SYS_USER_ROLE"/>
......@@ -189,13 +189,13 @@
<!--输出实体[SYS_PSSYSTEM]外键关系 -->
<!--输出实体[SYS_PERMISSION]外键关系 -->
<!--输出实体[SYS_ROLE]外键关系 -->
<changeSet author="root" id="fk-sys_role-49-9">
<changeSet author="a_A_5d9d78509" id="fk-sys_role-49-9">
<addForeignKeyConstraint baseColumnNames="PROLEID" baseTableName="IBZROLE" constraintName="DER1N_SYS_ROLE_SYS_ROLE_PROLEI" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SYS_ROLEID" referencedTableName="IBZROLE" validate="true"/>
</changeSet>
<!--输出实体[SYS_ROLE_PERMISSION]外键关系 -->
<!--输出实体[SYS_USER_AUTH]外键关系 -->
<!--输出实体[SYS_USER_ROLE]外键关系 -->
<changeSet author="root" id="fk-sys_user_role-13-10">
<changeSet author="a_A_5d9d78509" id="fk-sys_user_role-13-10">
<addForeignKeyConstraint baseColumnNames="SYS_ROLEID" baseTableName="IBZUSER_ROLE" constraintName="DER1N_SYS_USER_ROLE_SYS_ROLE_S" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SYS_ROLEID" referencedTableName="IBZROLE" validate="true"/>
</changeSet>
......
......@@ -64,7 +64,7 @@
"delogicname":"系统用户",
"sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"SaveSysUser" , "name":"保存用户信息" , "type":"DELOGIC" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"curorg","name":"当前单位"},{"id":"porg","name":"上级单位"},{"id":"sorg","name":"下级单位"} ]
}
, {
......
......@@ -135,6 +135,17 @@ public class SysUserResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-SaveSysUser-all')")
@ApiOperation(value = "保存用户信息", tags = {"系统用户" }, notes = "保存用户信息")
@RequestMapping(method = RequestMethod.POST, value = "/sysusers/{sysuser_id}/savesysuser")
public ResponseEntity<SysUserDTO> saveSysUser(@PathVariable("sysuser_id") String sysuser_id, @RequestBody SysUserDTO sysuserdto) {
SysUser domain = sysuserMapping.toDomain(sysuserdto);
domain.setUserid(sysuser_id);
domain = sysuserService.saveSysUser(domain);
sysuserdto = sysuserMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(sysuserdto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-searchDefault-all') and hasPermission(#context,'ibzuaa-SysUser-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"系统用户" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/sysusers/fetchdefault")
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册