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

ibiz4j 发布系统代码

上级 6a49ea5e
......@@ -174,14 +174,6 @@ public class IBZDepartment extends EntityMP implements Serializable {
private cn.ibizlab.core.ou.domain.IBZOrganization org;
/**
* 部门成员
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private List<cn.ibizlab.core.ou.domain.IBZDeptMember> ibzdeptmember;
/**
* 设置 [部门代码]
......
......@@ -315,14 +315,6 @@ public class IBZEmployee extends EntityMP implements Serializable {
private cn.ibizlab.core.ou.domain.IBZOrganization org;
/**
* 部门成员
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private List<cn.ibizlab.core.ou.domain.IBZDeptMember> ibzdeptmember;
/**
* 设置 [用户全局名]
......
......@@ -31,7 +31,7 @@ public interface IBZDepartmentMapper extends BaseMapper<IBZDepartment>{
@CacheEvict( value="ibzdepartment",key = "'row:'+#p0.deptid")
int updateById(@Param(Constants.ENTITY) IBZDepartment entity);
@CacheEvict(value="ibzdepartment",key = "'row:'+#p0.deptid")
int update(@Param(Constants.ENTITY) IBZDepartment entity, @Param("ew") Wrapper<ibzdepartment> updateWrapper);
int update(@Param(Constants.ENTITY) IBZDepartment entity, @Param("ew") Wrapper<IBZDepartment> updateWrapper);
@Override
@CacheEvict( value="ibzdepartment",key = "'row:'+#p0")
int deleteById(Serializable id);
......
......@@ -26,7 +26,7 @@ public interface IBZDeptMemberMapper extends BaseMapper<IBZDeptMember>{
int insert(IBZDeptMember entity);
@Override
int updateById(@Param(Constants.ENTITY) IBZDeptMember entity);
int update(@Param(Constants.ENTITY) IBZDeptMember entity, @Param("ew") Wrapper<ibzdeptmember> updateWrapper);
int update(@Param(Constants.ENTITY) IBZDeptMember entity, @Param("ew") Wrapper<IBZDeptMember> updateWrapper);
@Override
int deleteById(Serializable id);
/**
......
......@@ -30,7 +30,7 @@ public interface IBZEmployeeMapper extends BaseMapper<IBZEmployee>{
@CacheEvict( value="ibzemployee",key = "'row:'+#p0.userid")
int updateById(@Param(Constants.ENTITY) IBZEmployee entity);
@CacheEvict(value="ibzemployee",key = "'row:'+#p0.userid")
int update(@Param(Constants.ENTITY) IBZEmployee entity, @Param("ew") Wrapper<ibzemployee> updateWrapper);
int update(@Param(Constants.ENTITY) IBZEmployee entity, @Param("ew") Wrapper<IBZEmployee> updateWrapper);
@Override
@CacheEvict( value="ibzemployee",key = "'row:'+#p0")
int deleteById(Serializable id);
......
......@@ -32,7 +32,7 @@ public interface IBZOrganizationMapper extends BaseMapper<IBZOrganization>{
@CacheEvict( value="ibzorganization",key = "'row:'+#p0.orgid")
int updateById(@Param(Constants.ENTITY) IBZOrganization entity);
@CacheEvict(value="ibzorganization",key = "'row:'+#p0.orgid")
int update(@Param(Constants.ENTITY) IBZOrganization entity, @Param("ew") Wrapper<ibzorganization> updateWrapper);
int update(@Param(Constants.ENTITY) IBZOrganization entity, @Param("ew") Wrapper<IBZOrganization> updateWrapper);
@Override
@CacheEvict( value="ibzorganization",key = "'row:'+#p0")
int deleteById(Serializable id);
......
......@@ -38,10 +38,8 @@ public interface IIBZDeptMemberService extends IService<IBZDeptMember>{
Page<IBZDeptMember> searchDefault(IBZDeptMemberSearchContext context) ;
List<IBZDeptMember> selectByDeptid(String deptid) ;
void removeByDeptid(String deptid) ;
void saveByDeptid(String deptid,List<IBZDeptMember> list) ;
List<IBZDeptMember> selectByUserid(String userid) ;
void removeByUserid(String userid) ;
void saveByUserid(String userid,List<IBZDeptMember> list) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
......
......@@ -64,7 +64,6 @@ public class IBZDepartmentServiceImpl extends ServiceImpl<IBZDepartmentMapper, I
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
ibzdeptmemberService.saveByDeptid(et.getDeptid(),et.getIbzdeptmember());
CachedBeanCopier.copy(get(et.getDeptid()),et);
return true;
}
......@@ -84,7 +83,6 @@ public class IBZDepartmentServiceImpl extends ServiceImpl<IBZDepartmentMapper, I
et.setDeptid(key);
}
else{
et.setIbzdeptmember(ibzdeptmemberService.selectByDeptid(key));
}
return et;
}
......@@ -129,7 +127,6 @@ public class IBZDepartmentServiceImpl extends ServiceImpl<IBZDepartmentMapper, I
@Override
@Transactional
public boolean remove(String key) {
ibzdeptmemberService.removeByDeptid(key) ;
boolean result=removeById(key);
return result ;
}
......@@ -145,7 +142,6 @@ public class IBZDepartmentServiceImpl extends ServiceImpl<IBZDepartmentMapper, I
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("deptid",et.getDeptid())))
return false;
ibzdeptmemberService.saveByDeptid(et.getDeptid(),et.getIbzdeptmember());
CachedBeanCopier.copy(get(et.getDeptid()),et);
return true;
}
......
......@@ -158,35 +158,6 @@ public class IBZDeptMemberServiceImpl extends ServiceImpl<IBZDeptMemberMapper, I
this.remove(new QueryWrapper<IBZDeptMember>().eq("deptid",deptid));
}
@Override
public void saveByDeptid(String deptid,List<IBZDeptMember> list) {
if(list==null)
return;
Set<String> delIds=new HashSet<String>();
List<IBZDeptMember> _update=new ArrayList<IBZDeptMember>();
List<IBZDeptMember> _create=new ArrayList<IBZDeptMember>();
for(IBZDeptMember before:selectByDeptid(deptid)){
delIds.add(before.getMemberid());
}
for(IBZDeptMember sub:list) {
sub.setDeptid(deptid);
if(ObjectUtils.isEmpty(sub.getMemberid()))
sub.setMemberid((String)sub.getDefaultKey(true));
if(delIds.contains(sub.getMemberid())) {
delIds.remove(sub.getMemberid());
_update.add(sub);
}
else
_create.add(sub);
}
if(_update.size()>0)
this.updateBatch(_update);
if(_create.size()>0)
this.createBatch(_create);
if(delIds.size()>0)
this.removeBatch(delIds);
}
@Override
public List<IBZDeptMember> selectByUserid(String userid) {
return baseMapper.selectByUserid(userid);
......@@ -197,35 +168,6 @@ public class IBZDeptMemberServiceImpl extends ServiceImpl<IBZDeptMemberMapper, I
this.remove(new QueryWrapper<IBZDeptMember>().eq("userid",userid));
}
@Override
public void saveByUserid(String userid,List<IBZDeptMember> list) {
if(list==null)
return;
Set<String> delIds=new HashSet<String>();
List<IBZDeptMember> _update=new ArrayList<IBZDeptMember>();
List<IBZDeptMember> _create=new ArrayList<IBZDeptMember>();
for(IBZDeptMember before:selectByUserid(userid)){
delIds.add(before.getMemberid());
}
for(IBZDeptMember sub:list) {
sub.setUserid(userid);
if(ObjectUtils.isEmpty(sub.getMemberid()))
sub.setMemberid((String)sub.getDefaultKey(true));
if(delIds.contains(sub.getMemberid())) {
delIds.remove(sub.getMemberid());
_update.add(sub);
}
else
_create.add(sub);
}
if(_update.size()>0)
this.updateBatch(_update);
if(_create.size()>0)
this.createBatch(_create);
if(delIds.size()>0)
this.removeBatch(delIds);
}
/**
* 查询集合 DEFAULT
......
......@@ -63,7 +63,6 @@ public class IBZEmployeeServiceImpl extends ServiceImpl<IBZEmployeeMapper, IBZEm
@Override
@Transactional
public boolean remove(String key) {
ibzdeptmemberService.removeByUserid(key) ;
boolean result=removeById(key);
return result ;
}
......@@ -86,7 +85,6 @@ public class IBZEmployeeServiceImpl extends ServiceImpl<IBZEmployeeMapper, IBZEm
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
ibzdeptmemberService.saveByUserid(et.getUserid(),et.getIbzdeptmember());
CachedBeanCopier.copy(get(et.getUserid()),et);
savedeptmemberLogic.execute(et);
return true;
......@@ -109,7 +107,6 @@ public class IBZEmployeeServiceImpl extends ServiceImpl<IBZEmployeeMapper, IBZEm
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("userid",et.getUserid())))
return false;
ibzdeptmemberService.saveByUserid(et.getUserid(),et.getIbzdeptmember());
CachedBeanCopier.copy(get(et.getUserid()),et);
savedeptmemberLogic.execute(et);
return true;
......@@ -156,7 +153,6 @@ public class IBZEmployeeServiceImpl extends ServiceImpl<IBZEmployeeMapper, IBZEm
et.setUserid(key);
}
else{
et.setIbzdeptmember(ibzdeptmemberService.selectByUserid(key));
}
return et;
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册