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

ibiz4j 发布系统代码

上级 f24c3f20
......@@ -41,7 +41,7 @@ zuul:
stripPrefix: false
sys_emp:
path: /sysemployees/**
serviceId: ${ibiz.ref.service.ibzrt-api:ibzrt-api}
serviceId: ${ibiz.ref.service.ibzou-api:ibzou-api}
stripPrefix: false
sys_team:
path: /systeams/**
......
......@@ -48,6 +48,10 @@ zuul:
path: /sys_deptmembers/**
serviceId: ${ibiz.ref.service.ibzou-api:ibzou-api}
stripPrefix: false
sys_emp:
path: /sys_emps/**
serviceId: ${ibiz.ref.service.ibzou-api:ibzou-api}
stripPrefix: false
sys_open_access:
path: /sys_open_accesses/**
serviceId: ${ibiz.ref.service.ibzuaa-api:ibzuaa-api}
......
......@@ -16,10 +16,6 @@ import java.util.*;
@Service("SysEmployeeExService")
public class SysEmployeeExService extends SysEmployeeServiceImpl {
@Override
protected Class currentModelClass() {
return com.baomidou.mybatisplus.core.toolkit.ReflectionKit.getSuperClassGenericType(this.getClass().getSuperclass(), 1);
}
/**
* 自定义行为[InitPwd]用户扩展
......
......@@ -23,313 +23,300 @@ import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.util.annotation.Audit;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.util.domain.EntityMP;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import cn.ibizlab.util.domain.EntityClient;
/**
* 实体[人员]
* ServiceApi [人员] 对象
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "IBZEMP",resultMap = "SysEmployeeResultMap")
public class SysEmployee extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
@Data
public class SysEmployee extends EntityClient implements Serializable {
/**
* 用户标识
*/
@DEField(isKeyField=true)
@TableId(value= "userid",type=IdType.ASSIGN_UUID)
@JSONField(name = "userid")
@JsonProperty("userid")
private String userid;
/**
* 用户全局名
*/
@TableField(value = "username")
@JSONField(name = "username")
@JsonProperty("username")
private String username;
/**
* 姓名
*/
@TableField(value = "personname")
@JSONField(name = "personname")
@JsonProperty("personname")
private String personname;
/**
* 用户工号
*/
@TableField(value = "usercode")
@JSONField(name = "usercode")
@JsonProperty("usercode")
private String usercode;
/**
* 登录名
*/
@TableField(value = "loginname")
@JSONField(name = "loginname")
@JsonProperty("loginname")
private String loginname;
/**
* 密码
*/
@TableField(value = "password")
@JSONField(name = "password")
@JsonProperty("password")
private String password;
/**
* 区属
*/
@TableField(value = "domains")
@JSONField(name = "domains")
@JsonProperty("domains")
private String domains;
/**
* 主部门
*/
@TableField(value = "mdeptid")
@JSONField(name = "mdeptid")
@JsonProperty("mdeptid")
private String mdeptid;
/**
* 主部门代码
*/
@TableField(value = "mdeptcode")
@JSONField(name = "mdeptcode")
@JsonProperty("mdeptcode")
private String mdeptcode;
/**
* 主部门名称
*/
@TableField(value = "mdeptname")
@JSONField(name = "mdeptname")
@JsonProperty("mdeptname")
private String mdeptname;
/**
* 业务编码
*/
@TableField(value = "bcode")
@JSONField(name = "bcode")
@JsonProperty("bcode")
private String bcode;
/**
* 岗位标识
*/
@TableField(value = "postid")
@JSONField(name = "postid")
@JsonProperty("postid")
private String postid;
/**
* 岗位代码
*/
@TableField(value = "postcode")
@JSONField(name = "postcode")
@JsonProperty("postcode")
private String postcode;
/**
* 岗位名称
*/
@TableField(value = "postname")
@JSONField(name = "postname")
@JsonProperty("postname")
private String postname;
/**
* 单位
*/
@DEField(preType = DEPredefinedFieldType.ORGID)
@TableField(value = "orgid")
@JSONField(name = "orgid")
@JsonProperty("orgid")
private String orgid;
/**
* 单位代码
*/
@TableField(value = "orgcode")
@JSONField(name = "orgcode")
@JsonProperty("orgcode")
private String orgcode;
/**
* 单位名称
*/
@DEField(preType = DEPredefinedFieldType.ORGNAME)
@TableField(value = "orgname")
@JSONField(name = "orgname")
@JsonProperty("orgname")
private String orgname;
/**
* 昵称别名
*/
@TableField(value = "nickname")
@JSONField(name = "nickname")
@JsonProperty("nickname")
private String nickname;
/**
* 性别
*/
@TableField(value = "sex")
@JSONField(name = "sex")
@JsonProperty("sex")
private String sex;
/**
* 证件号码
*/
@TableField(value = "certcode")
@JSONField(name = "certcode")
@JsonProperty("certcode")
private String certcode;
/**
* 联系方式
*/
@TableField(value = "phone")
@JSONField(name = "phone")
@JsonProperty("phone")
private String phone;
/**
* 出生日期
*/
@TableField(value = "birthday")
@JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
@JSONField(name = "birthday" , format="yyyy-MM-dd")
@JsonProperty("birthday")
private Timestamp birthday;
/**
* 邮件
*/
@TableField(value = "email")
@JSONField(name = "email")
@JsonProperty("email")
private String email;
/**
* 社交账号
*/
@TableField(value = "avatar")
@JSONField(name = "avatar")
@JsonProperty("avatar")
private String avatar;
/**
* 地址
*/
@TableField(value = "addr")
@JSONField(name = "addr")
@JsonProperty("addr")
private String addr;
/**
* 照片
*/
@TableField(value = "usericon")
@JSONField(name = "usericon")
@JsonProperty("usericon")
private String usericon;
/**
* ip地址
*/
@TableField(value = "ipaddr")
@JSONField(name = "ipaddr")
@JsonProperty("ipaddr")
private String ipaddr;
/**
* 样式
*/
@TableField(value = "theme")
@JSONField(name = "theme")
@JsonProperty("theme")
private String theme;
/**
* 语言
*/
@TableField(value = "lang")
@JSONField(name = "lang")
@JsonProperty("lang")
private String lang;
/**
* 字号
*/
@TableField(value = "fontsize")
@JSONField(name = "fontsize")
@JsonProperty("fontsize")
private String fontsize;
/**
* 备注
*/
@TableField(value = "memo")
@JSONField(name = "memo")
@JsonProperty("memo")
private String memo;
/**
* 保留
*/
@TableField(value = "reserver")
@JSONField(name = "reserver")
@JsonProperty("reserver")
private String reserver;
/**
* 排序
*/
@TableField(value = "showorder")
@JSONField(name = "showorder")
@JsonProperty("showorder")
private Integer showorder;
/**
* 逻辑有效
*/
@DEField(preType = DEPredefinedFieldType.LOGICVALID, logicval = "1" , logicdelval="0")
@TableLogic(value= "1",delval="0")
@TableField(value = "enable")
@JSONField(name = "enable")
@JsonProperty("enable")
private Integer enable;
/**
* 创建时间
*/
@DEField(preType = DEPredefinedFieldType.CREATEDATE)
@TableField(value = "createdate" , fill = FieldFill.INSERT)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 最后修改时间
*/
@DEField(preType = DEPredefinedFieldType.UPDATEDATE)
@TableField(value = "updatedate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
@JSONField(name = "maindept")
@JsonProperty("maindept")
private cn.ibizlab.core.ou.domain.SysDepartment maindept;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
@JSONField(name = "org")
@JsonProperty("org")
private cn.ibizlab.core.ou.domain.SysOrganization org;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
@JSONField(name = "post")
@JsonProperty("post")
private cn.ibizlab.core.ou.domain.SysPost post;
/**
* 设置 [用户全局名]
*/
......@@ -580,7 +567,6 @@ public class SysEmployee extends EntityMP implements Serializable {
this.modify("showorder",showorder);
}
/**
* 复制当前对象数据到目标对象(粘贴重置)
* @param targetEntity 目标数据对象
......
......@@ -17,107 +17,36 @@ import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.core.ou.domain.SysEmployee;
import cn.ibizlab.util.filter.SearchContextBase;
/**
* 关系型数据实体[SysEmployee] 查询条件对象
* ServiceApi数据实体[SysEmployee] 查询条件对象
*/
@Slf4j
@Data
public class SysEmployeeSearchContext extends QueryWrapperContext<SysEmployee> {
public class SysEmployeeSearchContext extends SearchContextBase {
private String n_personname_like;//[姓名]
public void setN_personname_like(String n_personname_like) {
this.n_personname_like = n_personname_like;
if(!ObjectUtils.isEmpty(this.n_personname_like)){
this.getSearchCond().like("personname", n_personname_like);
}
}
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_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_mdeptname_like;//[主部门名称]
public void setN_mdeptname_like(String n_mdeptname_like) {
this.n_mdeptname_like = n_mdeptname_like;
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_postname_eq;//[岗位名称]
public void setN_postname_eq(String n_postname_eq) {
this.n_postname_eq = n_postname_eq;
if(!ObjectUtils.isEmpty(this.n_postname_eq)){
this.getSearchCond().eq("postname", n_postname_eq);
}
}
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_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_sex_eq;//[性别]
public void setN_sex_eq(String n_sex_eq) {
this.n_sex_eq = n_sex_eq;
if(!ObjectUtils.isEmpty(this.n_sex_eq)){
this.getSearchCond().eq("sex", n_sex_eq);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("personname", query)
);
}
}
}
}
......@@ -19,12 +19,10 @@ import cn.ibizlab.core.ou.domain.SysEmployee;
import cn.ibizlab.core.ou.filter.SysEmployeeSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[SysEmployee] 服务对象接口
*/
public interface ISysEmployeeService extends IService<SysEmployee>{
public interface ISysEmployeeService{
boolean create(SysEmployee et) ;
@CacheEvict(value="sysemployee",allEntries=true)
......@@ -52,23 +50,8 @@ public interface ISysEmployeeService extends IService<SysEmployee>{
List<SysEmployee> selectByPostid(String postid) ;
@CacheEvict(value="sysemployee",allEntries=true)
void removeByPostid(String postid) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
List<SysEmployee> getSysemployeeByIds(List<String> ids) ;
List<SysEmployee> getSysemployeeByEntities(List<SysEmployee> entities) ;
}
......@@ -45,9 +45,6 @@ public class SysDepartmentServiceImpl implements ISysDepartmentService {
@Autowired
SysDepartmentFeignClient sysDepartmentFeignClient;
@Autowired
@Lazy
protected cn.ibizlab.core.ou.service.ISysEmployeeService sysemployeeService;
@Override
public boolean create(SysDepartment et) {
......
......@@ -33,114 +33,79 @@ import cn.ibizlab.util.helper.CachedBeanCopier;
import cn.ibizlab.util.helper.DEFieldCacheMap;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.ou.mapper.SysEmployeeMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
import cn.ibizlab.core.ou.client.SysEmployeeFeignClient;
/**
* 实体[人员] 服务对象接口实现
*/
@Slf4j
@Service("SysEmployeeServiceImpl")
public class SysEmployeeServiceImpl extends ServiceImpl<SysEmployeeMapper, SysEmployee> implements ISysEmployeeService {
@Service
public class SysEmployeeServiceImpl implements ISysEmployeeService {
@Autowired
@Lazy
protected cn.ibizlab.core.ou.service.ISysDeptMemberService sysdeptmemberService;
@Autowired
@Lazy
protected cn.ibizlab.core.ou.service.ISysTeamMemberService systeammemberService;
@Autowired
@Lazy
protected cn.ibizlab.core.ou.service.ISysDepartmentService sysdepartmentService;
@Autowired
@Lazy
protected cn.ibizlab.core.ou.service.ISysOrganizationService sysorganizationService;
@Autowired
@Lazy
protected cn.ibizlab.core.ou.service.ISysPostService syspostService;
SysEmployeeFeignClient sysEmployeeFeignClient;
@Autowired
@Lazy
protected cn.ibizlab.core.ou.service.logic.ISysEmployeesaveDeptMemberLogic savedeptmemberLogic;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(SysEmployee et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
SysEmployee rt = sysEmployeeFeignClient.create(et);
if(rt==null)
return false;
CachedBeanCopier.copy(get(et.getUserid()),et);
CachedBeanCopier.copy(rt,et);
savedeptmemberLogic.execute(et);
return true;
}
@Override
@Transactional
public void createBatch(List<SysEmployee> list) {
list.forEach(item->fillParentData(item));
this.saveBatch(list,batchSize);
public void createBatch(List<SysEmployee> list){
sysEmployeeFeignClient.createBatch(list) ;
}
@Override
@Transactional
public boolean update(SysEmployee et) {
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("userid",et.getUserid())))
SysEmployee rt = sysEmployeeFeignClient.update(et.getUserid(),et);
if(rt==null)
return false;
CachedBeanCopier.copy(get(et.getUserid()),et);
CachedBeanCopier.copy(rt,et);
savedeptmemberLogic.execute(et);
return true;
}
@Override
@Transactional
public void updateBatch(List<SysEmployee> list) {
list.forEach(item->fillParentData(item));
updateBatchById(list,batchSize);
public void updateBatch(List<SysEmployee> list){
sysEmployeeFeignClient.updateBatch(list) ;
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
public boolean remove(String userid) {
boolean result=sysEmployeeFeignClient.remove(userid) ;
return result;
}
@Override
@Transactional
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
public void removeBatch(Collection<String> idList){
sysEmployeeFeignClient.removeBatch(idList);
}
@Override
@Transactional
public SysEmployee get(String key) {
SysEmployee et = getById(key);
public SysEmployee get(String userid) {
SysEmployee et=sysEmployeeFeignClient.get(userid);
if(et==null){
et=new SysEmployee();
et.setUserid(key);
et.setUserid(userid);
}
else{
}
return et;
return et;
}
@Override
public SysEmployee getDraft(SysEmployee et) {
fillParentData(et);
et=sysEmployeeFeignClient.getDraft();
return et;
}
@Override
public boolean checkKey(SysEmployee et) {
return (!ObjectUtils.isEmpty(et.getUserid()))&&(!Objects.isNull(this.getById(et.getUserid())));
return sysEmployeeFeignClient.checkKey(et);
}
@Override
@Transactional
......@@ -152,171 +117,84 @@ public class SysEmployeeServiceImpl extends ServiceImpl<SysEmployeeMapper, SysEm
@Override
@Transactional
public boolean save(SysEmployee et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(SysEmployee et) {
if (null == et) {
if(et.getUserid()==null) et.setUserid((String)et.getDefaultKey(true));
if(!sysEmployeeFeignClient.save(et))
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
@Transactional
public boolean saveBatch(Collection<SysEmployee> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
@Transactional
public void saveBatch(List<SysEmployee> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
sysEmployeeFeignClient.saveBatch(list) ;
}
@Override
public List<SysEmployee> selectByMdeptid(String deptid) {
return baseMapper.selectByMdeptid(deptid);
SysEmployeeSearchContext context=new SysEmployeeSearchContext();
context.setSize(Integer.MAX_VALUE);
context.setN_mdeptid_eq(deptid);
return sysEmployeeFeignClient.searchDefault(context).getContent();
}
@Override
public void removeByMdeptid(String deptid) {
this.remove(new QueryWrapper<SysEmployee>().eq("mdeptid",deptid));
Set<String> delIds=new HashSet<String>();
for(SysEmployee before:selectByMdeptid(deptid)){
delIds.add(before.getUserid());
}
if(delIds.size()>0)
this.removeBatch(delIds);
}
@Override
public List<SysEmployee> selectByOrgid(String orgid) {
return baseMapper.selectByOrgid(orgid);
SysEmployeeSearchContext context=new SysEmployeeSearchContext();
context.setSize(Integer.MAX_VALUE);
context.setN_orgid_eq(orgid);
return sysEmployeeFeignClient.searchDefault(context).getContent();
}
@Override
public void removeByOrgid(String orgid) {
this.remove(new QueryWrapper<SysEmployee>().eq("orgid",orgid));
Set<String> delIds=new HashSet<String>();
for(SysEmployee before:selectByOrgid(orgid)){
delIds.add(before.getUserid());
}
if(delIds.size()>0)
this.removeBatch(delIds);
}
@Override
public List<SysEmployee> selectByPostid(String postid) {
return baseMapper.selectByPostid(postid);
SysEmployeeSearchContext context=new SysEmployeeSearchContext();
context.setSize(Integer.MAX_VALUE);
context.setN_postid_eq(postid);
return sysEmployeeFeignClient.searchDefault(context).getContent();
}
@Override
public void removeByPostid(String postid) {
this.remove(new QueryWrapper<SysEmployee>().eq("postid",postid));
Set<String> delIds=new HashSet<String>();
for(SysEmployee before:selectByPostid(postid)){
delIds.add(before.getUserid());
}
if(delIds.size()>0)
this.removeBatch(delIds);
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<SysEmployee> searchDefault(SysEmployeeSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<SysEmployee> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<SysEmployee>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(SysEmployee et){
//实体关系[DER1N_SYS_EMP_SYS_DEPT_MDEPTID]
if(!ObjectUtils.isEmpty(et.getMdeptid())){
cn.ibizlab.core.ou.domain.SysDepartment maindept=et.getMaindept();
if(ObjectUtils.isEmpty(maindept)){
cn.ibizlab.core.ou.domain.SysDepartment majorEntity=sysdepartmentService.getById(et.getMdeptid());
if(ObjectUtils.isEmpty(majorEntity))
return;
et.setMaindept(majorEntity);
maindept=majorEntity;
}
et.setMdeptcode(maindept.getDeptcode());
et.setMdeptname(maindept.getDeptname());
}
//实体关系[DER1N_SYS_EMP_SYS_ORG_ORGID]
if(!ObjectUtils.isEmpty(et.getOrgid())){
cn.ibizlab.core.ou.domain.SysOrganization org=et.getOrg();
if(ObjectUtils.isEmpty(org)){
cn.ibizlab.core.ou.domain.SysOrganization majorEntity=sysorganizationService.getById(et.getOrgid());
if(ObjectUtils.isEmpty(majorEntity))
return;
et.setOrg(majorEntity);
org=majorEntity;
}
et.setOrgcode(org.getOrgcode());
et.setOrgname(org.getOrgname());
}
//实体关系[DER1N_SYS_EMP_SYS_POST_POSTID]
if(!ObjectUtils.isEmpty(et.getPostid())){
cn.ibizlab.core.ou.domain.SysPost post=et.getPost();
if(ObjectUtils.isEmpty(post)){
cn.ibizlab.core.ou.domain.SysPost majorEntity=syspostService.getById(et.getPostid());
if(ObjectUtils.isEmpty(majorEntity))
return;
et.setPost(majorEntity);
post=majorEntity;
}
et.setPostcode(post.getPostcode());
et.setPostname(post.getPostname());
}
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
Page<SysEmployee> sysEmployees=sysEmployeeFeignClient.searchDefault(context);
return sysEmployees;
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<SysEmployee> getSysemployeeByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<SysEmployee> getSysemployeeByEntities(List<SysEmployee> entities) {
List ids =new ArrayList();
for(SysEmployee entity : entities){
Serializable id=entity.getUserid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
......
......@@ -45,9 +45,6 @@ public class SysOrganizationServiceImpl implements ISysOrganizationService {
@Autowired
SysOrganizationFeignClient sysOrganizationFeignClient;
@Autowired
@Lazy
protected cn.ibizlab.core.ou.service.ISysEmployeeService sysemployeeService;
@Override
public boolean create(SysOrganization et) {
......
......@@ -45,9 +45,6 @@ public class SysPostServiceImpl implements ISysPostService {
@Autowired
SysPostFeignClient sysPostFeignClient;
@Autowired
@Lazy
protected cn.ibizlab.core.ou.service.ISysEmployeeService sysemployeeService;
@Override
public boolean create(SysPost et) {
......
......@@ -25,84 +25,6 @@
<!--输出实体[SYS_EMP]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_emp-1-1">
<createTable tableName="IBZEMP">
<column name="USERID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_EMP_USERID"/>
</column>
<column name="USERNAME" remarks="" type="VARCHAR(100)">
</column>
<column name="PERSONNAME" remarks="" type="VARCHAR(100)">
</column>
<column name="USERCODE" remarks="" type="VARCHAR(100)">
</column>
<column name="LOGINNAME" remarks="" type="VARCHAR(100)">
</column>
<column name="PASSWORD" remarks="" type="VARCHAR(100)">
</column>
<column name="DOMAINS" remarks="" type="VARCHAR(100)">
</column>
<column name="MDEPTID" remarks="" type="VARCHAR(100)">
</column>
<column name="MDEPTCODE" remarks="" type="VARCHAR(100)">
</column>
<column name="MDEPTNAME" remarks="" type="VARCHAR(100)">
</column>
<column name="BCODE" remarks="" type="VARCHAR(100)">
</column>
<column name="POSTID" remarks="" type="VARCHAR(100)">
</column>
<column name="POSTCODE" remarks="" type="VARCHAR(100)">
</column>
<column name="POSTNAME" remarks="" type="VARCHAR(100)">
</column>
<column name="ORGID" remarks="" type="VARCHAR(100)">
</column>
<column name="ORGCODE" remarks="" type="VARCHAR(100)">
</column>
<column name="ORGNAME" remarks="" type="VARCHAR(100)">
</column>
<column name="NICKNAME" remarks="" type="VARCHAR(100)">
</column>
<column name="SEX" remarks="" type="VARCHAR(20)">
</column>
<column name="CERTCODE" remarks="" type="VARCHAR(100)">
</column>
<column name="PHONE" remarks="" type="VARCHAR(100)">
</column>
<column name="BIRTHDAY" remarks="" type="DATETIME">
</column>
<column name="EMAIL" remarks="" type="VARCHAR(100)">
</column>
<column name="AVATAR" remarks="" type="VARCHAR(100)">
</column>
<column name="ADDR" remarks="" type="VARCHAR(255)">
</column>
<column name="USERICON" remarks="" type="VARCHAR(255)">
</column>
<column name="IPADDR" remarks="" type="VARCHAR(100)">
</column>
<column name="THEME" remarks="" type="VARCHAR(100)">
</column>
<column name="LANG" remarks="" type="VARCHAR(100)">
</column>
<column name="FONTSIZE" remarks="" type="VARCHAR(10)">
</column>
<column name="MEMO" remarks="" type="VARCHAR(255)">
</column>
<column name="RESERVER" remarks="" type="VARCHAR(255)">
</column>
<column name="SHOWORDER" remarks="" type="INT">
</column>
<column name="ENABLE" remarks="" type="INT">
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
</createTable>
</changeSet>
......@@ -148,15 +70,5 @@
<!--输出实体[SYS_EMP]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-sys_emp-1-2">
<addForeignKeyConstraint baseColumnNames="MDEPTID" baseTableName="IBZEMP" constraintName="DER1N_SYS_EMP_SYS_DEPT_MDEPTID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="DEPTID" referencedTableName="IBZDEPT" validate="true"/>
</changeSet>
<changeSet author="a_A_5d9d78509" id="fk-sys_emp-1-3">
<addForeignKeyConstraint baseColumnNames="ORGID" baseTableName="IBZEMP" constraintName="DER1N_SYS_EMP_SYS_ORG_ORGID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ORGID" referencedTableName="IBZORG" validate="true"/>
</changeSet>
<changeSet author="a_A_5d9d78509" id="fk-sys_emp-1-4">
<addForeignKeyConstraint baseColumnNames="POSTID" baseTableName="IBZEMP" constraintName="DER1N_SYS_EMP_SYS_POST_POSTID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="POSTID" referencedTableName="IBZPOST" validate="true"/>
</changeSet>
</databaseChangeLog>
......@@ -47,7 +47,6 @@ public class SysEmployeeResource {
@Lazy
public SysEmployeeMapping sysemployeeMapping;
@PreAuthorize("hasPermission(this.sysemployeeMapping.toDomain(#sysemployeedto),'ibzrt-SysEmployee-Create')")
@ApiOperation(value = "新建人员", tags = {"人员" }, notes = "新建人员")
@RequestMapping(method = RequestMethod.POST, value = "/sysemployees")
public ResponseEntity<SysEmployeeDTO> create(@Validated @RequestBody SysEmployeeDTO sysemployeedto) {
......@@ -57,7 +56,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.sysemployeeMapping.toDomain(#sysemployeedtos),'ibzrt-SysEmployee-Create')")
@ApiOperation(value = "批量新建人员", tags = {"人员" }, notes = "批量新建人员")
@RequestMapping(method = RequestMethod.POST, value = "/sysemployees/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<SysEmployeeDTO> sysemployeedtos) {
......@@ -66,7 +64,6 @@ public class SysEmployeeResource {
}
@VersionCheck(entity = "sysemployee" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.sysemployeeService.get(#sysemployee_id),'ibzrt-SysEmployee-Update')")
@ApiOperation(value = "更新人员", tags = {"人员" }, notes = "更新人员")
@RequestMapping(method = RequestMethod.PUT, value = "/sysemployees/{sysemployee_id}")
public ResponseEntity<SysEmployeeDTO> update(@PathVariable("sysemployee_id") String sysemployee_id, @RequestBody SysEmployeeDTO sysemployeedto) {
......@@ -77,7 +74,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.sysemployeeService.getSysemployeeByEntities(this.sysemployeeMapping.toDomain(#sysemployeedtos)),'ibzrt-SysEmployee-Update')")
@ApiOperation(value = "批量更新人员", tags = {"人员" }, notes = "批量更新人员")
@RequestMapping(method = RequestMethod.PUT, value = "/sysemployees/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<SysEmployeeDTO> sysemployeedtos) {
......@@ -85,14 +81,12 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.sysemployeeService.get(#sysemployee_id),'ibzrt-SysEmployee-Remove')")
@ApiOperation(value = "删除人员", tags = {"人员" }, notes = "删除人员")
@RequestMapping(method = RequestMethod.DELETE, value = "/sysemployees/{sysemployee_id}")
public ResponseEntity<Boolean> remove(@PathVariable("sysemployee_id") String sysemployee_id) {
return ResponseEntity.status(HttpStatus.OK).body(sysemployeeService.remove(sysemployee_id));
}
@PreAuthorize("hasPermission(this.sysemployeeService.getSysemployeeByIds(#ids),'ibzrt-SysEmployee-Remove')")
@ApiOperation(value = "批量删除人员", tags = {"人员" }, notes = "批量删除人员")
@RequestMapping(method = RequestMethod.DELETE, value = "/sysemployees/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
......@@ -100,7 +94,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.sysemployeeMapping.toDomain(returnObject.body),'ibzrt-SysEmployee-Get')")
@ApiOperation(value = "获取人员", tags = {"人员" }, notes = "获取人员")
@RequestMapping(method = RequestMethod.GET, value = "/sysemployees/{sysemployee_id}")
public ResponseEntity<SysEmployeeDTO> get(@PathVariable("sysemployee_id") String sysemployee_id) {
......@@ -121,7 +114,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(sysemployeeService.checkKey(sysemployeeMapping.toDomain(sysemployeedto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzrt-SysEmployee-InitPwd-all')")
@ApiOperation(value = "初始化密码", tags = {"人员" }, notes = "初始化密码")
@RequestMapping(method = RequestMethod.POST, value = "/sysemployees/{sysemployee_id}/initpwd")
public ResponseEntity<SysEmployeeDTO> initPwd(@PathVariable("sysemployee_id") String sysemployee_id, @RequestBody SysEmployeeDTO sysemployeedto) {
......@@ -132,14 +124,12 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(sysemployeedto);
}
@PreAuthorize("hasPermission(this.sysemployeeMapping.toDomain(#sysemployeedto),'ibzrt-SysEmployee-Save')")
@ApiOperation(value = "保存人员", tags = {"人员" }, notes = "保存人员")
@RequestMapping(method = RequestMethod.POST, value = "/sysemployees/save")
public ResponseEntity<Boolean> save(@RequestBody SysEmployeeDTO sysemployeedto) {
return ResponseEntity.status(HttpStatus.OK).body(sysemployeeService.save(sysemployeeMapping.toDomain(sysemployeedto)));
}
@PreAuthorize("hasPermission(this.sysemployeeMapping.toDomain(#sysemployeedtos),'ibzrt-SysEmployee-Save')")
@ApiOperation(value = "批量保存人员", tags = {"人员" }, notes = "批量保存人员")
@RequestMapping(method = RequestMethod.POST, value = "/sysemployees/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<SysEmployeeDTO> sysemployeedtos) {
......@@ -147,7 +137,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzrt-SysEmployee-searchDefault-all') and hasPermission(#context,'ibzrt-SysEmployee-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"人员" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/sysemployees/fetchdefault")
public ResponseEntity<List<SysEmployeeDTO>> fetchDefault(SysEmployeeSearchContext context) {
......@@ -160,7 +149,6 @@ public class SysEmployeeResource {
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzrt-SysEmployee-searchDefault-all') and hasPermission(#context,'ibzrt-SysEmployee-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"人员" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/sysemployees/searchdefault")
public ResponseEntity<Page<SysEmployeeDTO>> searchDefault(@RequestBody SysEmployeeSearchContext context) {
......@@ -168,7 +156,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(sysemployeeMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.sysemployeeMapping.toDomain(#sysemployeedto),'ibzrt-SysEmployee-Create')")
@ApiOperation(value = "根据部门建立人员", tags = {"人员" }, notes = "根据部门建立人员")
@RequestMapping(method = RequestMethod.POST, value = "/sysdepartments/{sysdepartment_id}/sysemployees")
public ResponseEntity<SysEmployeeDTO> createBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody SysEmployeeDTO sysemployeedto) {
......@@ -179,7 +166,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.sysemployeeMapping.toDomain(#sysemployeedtos),'ibzrt-SysEmployee-Create')")
@ApiOperation(value = "根据部门批量建立人员", tags = {"人员" }, notes = "根据部门批量建立人员")
@RequestMapping(method = RequestMethod.POST, value = "/sysdepartments/{sysdepartment_id}/sysemployees/batch")
public ResponseEntity<Boolean> createBatchBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody List<SysEmployeeDTO> sysemployeedtos) {
......@@ -192,7 +178,6 @@ public class SysEmployeeResource {
}
@VersionCheck(entity = "sysemployee" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.sysemployeeService.get(#sysemployee_id),'ibzrt-SysEmployee-Update')")
@ApiOperation(value = "根据部门更新人员", tags = {"人员" }, notes = "根据部门更新人员")
@RequestMapping(method = RequestMethod.PUT, value = "/sysdepartments/{sysdepartment_id}/sysemployees/{sysemployee_id}")
public ResponseEntity<SysEmployeeDTO> updateBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, @PathVariable("sysemployee_id") String sysemployee_id, @RequestBody SysEmployeeDTO sysemployeedto) {
......@@ -204,7 +189,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.sysemployeeService.getSysemployeeByEntities(this.sysemployeeMapping.toDomain(#sysemployeedtos)),'ibzrt-SysEmployee-Update')")
@ApiOperation(value = "根据部门批量更新人员", tags = {"人员" }, notes = "根据部门批量更新人员")
@RequestMapping(method = RequestMethod.PUT, value = "/sysdepartments/{sysdepartment_id}/sysemployees/batch")
public ResponseEntity<Boolean> updateBatchBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody List<SysEmployeeDTO> sysemployeedtos) {
......@@ -216,14 +200,12 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.sysemployeeService.get(#sysemployee_id),'ibzrt-SysEmployee-Remove')")
@ApiOperation(value = "根据部门删除人员", tags = {"人员" }, notes = "根据部门删除人员")
@RequestMapping(method = RequestMethod.DELETE, value = "/sysdepartments/{sysdepartment_id}/sysemployees/{sysemployee_id}")
public ResponseEntity<Boolean> removeBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, @PathVariable("sysemployee_id") String sysemployee_id) {
return ResponseEntity.status(HttpStatus.OK).body(sysemployeeService.remove(sysemployee_id));
}
@PreAuthorize("hasPermission(this.sysemployeeService.getSysemployeeByIds(#ids),'ibzrt-SysEmployee-Remove')")
@ApiOperation(value = "根据部门批量删除人员", tags = {"人员" }, notes = "根据部门批量删除人员")
@RequestMapping(method = RequestMethod.DELETE, value = "/sysdepartments/{sysdepartment_id}/sysemployees/batch")
public ResponseEntity<Boolean> removeBatchBySysDepartment(@RequestBody List<String> ids) {
......@@ -231,7 +213,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.sysemployeeMapping.toDomain(returnObject.body),'ibzrt-SysEmployee-Get')")
@ApiOperation(value = "根据部门获取人员", tags = {"人员" }, notes = "根据部门获取人员")
@RequestMapping(method = RequestMethod.GET, value = "/sysdepartments/{sysdepartment_id}/sysemployees/{sysemployee_id}")
public ResponseEntity<SysEmployeeDTO> getBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, @PathVariable("sysemployee_id") String sysemployee_id) {
......@@ -254,7 +235,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(sysemployeeService.checkKey(sysemployeeMapping.toDomain(sysemployeedto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzrt-SysEmployee-InitPwd-all')")
@ApiOperation(value = "根据部门人员", tags = {"人员" }, notes = "根据部门人员")
@RequestMapping(method = RequestMethod.POST, value = "/sysdepartments/{sysdepartment_id}/sysemployees/{sysemployee_id}/initpwd")
public ResponseEntity<SysEmployeeDTO> initPwdBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, @PathVariable("sysemployee_id") String sysemployee_id, @RequestBody SysEmployeeDTO sysemployeedto) {
......@@ -265,7 +245,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(sysemployeedto);
}
@PreAuthorize("hasPermission(this.sysemployeeMapping.toDomain(#sysemployeedto),'ibzrt-SysEmployee-Save')")
@ApiOperation(value = "根据部门保存人员", tags = {"人员" }, notes = "根据部门保存人员")
@RequestMapping(method = RequestMethod.POST, value = "/sysdepartments/{sysdepartment_id}/sysemployees/save")
public ResponseEntity<Boolean> saveBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody SysEmployeeDTO sysemployeedto) {
......@@ -274,7 +253,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(sysemployeeService.save(domain));
}
@PreAuthorize("hasPermission(this.sysemployeeMapping.toDomain(#sysemployeedtos),'ibzrt-SysEmployee-Save')")
@ApiOperation(value = "根据部门批量保存人员", tags = {"人员" }, notes = "根据部门批量保存人员")
@RequestMapping(method = RequestMethod.POST, value = "/sysdepartments/{sysdepartment_id}/sysemployees/savebatch")
public ResponseEntity<Boolean> saveBatchBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody List<SysEmployeeDTO> sysemployeedtos) {
......@@ -286,7 +264,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzrt-SysEmployee-searchDefault-all') and hasPermission(#context,'ibzrt-SysEmployee-Get')")
@ApiOperation(value = "根据部门获取DEFAULT", tags = {"人员" } ,notes = "根据部门获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/sysdepartments/{sysdepartment_id}/sysemployees/fetchdefault")
public ResponseEntity<List<SysEmployeeDTO>> fetchSysEmployeeDefaultBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id,SysEmployeeSearchContext context) {
......@@ -300,7 +277,6 @@ public class SysEmployeeResource {
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzrt-SysEmployee-searchDefault-all') and hasPermission(#context,'ibzrt-SysEmployee-Get')")
@ApiOperation(value = "根据部门查询DEFAULT", tags = {"人员" } ,notes = "根据部门查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/sysdepartments/{sysdepartment_id}/sysemployees/searchdefault")
public ResponseEntity<Page<SysEmployeeDTO>> searchSysEmployeeDefaultBySysDepartment(@PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody SysEmployeeSearchContext context) {
......@@ -309,7 +285,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(sysemployeeMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.sysemployeeMapping.toDomain(#sysemployeedto),'ibzrt-SysEmployee-Create')")
@ApiOperation(value = "根据单位机构建立人员", tags = {"人员" }, notes = "根据单位机构建立人员")
@RequestMapping(method = RequestMethod.POST, value = "/sysorganizations/{sysorganization_id}/sysemployees")
public ResponseEntity<SysEmployeeDTO> createBySysOrganization(@PathVariable("sysorganization_id") String sysorganization_id, @RequestBody SysEmployeeDTO sysemployeedto) {
......@@ -320,7 +295,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.sysemployeeMapping.toDomain(#sysemployeedtos),'ibzrt-SysEmployee-Create')")
@ApiOperation(value = "根据单位机构批量建立人员", tags = {"人员" }, notes = "根据单位机构批量建立人员")
@RequestMapping(method = RequestMethod.POST, value = "/sysorganizations/{sysorganization_id}/sysemployees/batch")
public ResponseEntity<Boolean> createBatchBySysOrganization(@PathVariable("sysorganization_id") String sysorganization_id, @RequestBody List<SysEmployeeDTO> sysemployeedtos) {
......@@ -333,7 +307,6 @@ public class SysEmployeeResource {
}
@VersionCheck(entity = "sysemployee" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.sysemployeeService.get(#sysemployee_id),'ibzrt-SysEmployee-Update')")
@ApiOperation(value = "根据单位机构更新人员", tags = {"人员" }, notes = "根据单位机构更新人员")
@RequestMapping(method = RequestMethod.PUT, value = "/sysorganizations/{sysorganization_id}/sysemployees/{sysemployee_id}")
public ResponseEntity<SysEmployeeDTO> updateBySysOrganization(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysemployee_id") String sysemployee_id, @RequestBody SysEmployeeDTO sysemployeedto) {
......@@ -345,7 +318,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.sysemployeeService.getSysemployeeByEntities(this.sysemployeeMapping.toDomain(#sysemployeedtos)),'ibzrt-SysEmployee-Update')")
@ApiOperation(value = "根据单位机构批量更新人员", tags = {"人员" }, notes = "根据单位机构批量更新人员")
@RequestMapping(method = RequestMethod.PUT, value = "/sysorganizations/{sysorganization_id}/sysemployees/batch")
public ResponseEntity<Boolean> updateBatchBySysOrganization(@PathVariable("sysorganization_id") String sysorganization_id, @RequestBody List<SysEmployeeDTO> sysemployeedtos) {
......@@ -357,14 +329,12 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.sysemployeeService.get(#sysemployee_id),'ibzrt-SysEmployee-Remove')")
@ApiOperation(value = "根据单位机构删除人员", tags = {"人员" }, notes = "根据单位机构删除人员")
@RequestMapping(method = RequestMethod.DELETE, value = "/sysorganizations/{sysorganization_id}/sysemployees/{sysemployee_id}")
public ResponseEntity<Boolean> removeBySysOrganization(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysemployee_id") String sysemployee_id) {
return ResponseEntity.status(HttpStatus.OK).body(sysemployeeService.remove(sysemployee_id));
}
@PreAuthorize("hasPermission(this.sysemployeeService.getSysemployeeByIds(#ids),'ibzrt-SysEmployee-Remove')")
@ApiOperation(value = "根据单位机构批量删除人员", tags = {"人员" }, notes = "根据单位机构批量删除人员")
@RequestMapping(method = RequestMethod.DELETE, value = "/sysorganizations/{sysorganization_id}/sysemployees/batch")
public ResponseEntity<Boolean> removeBatchBySysOrganization(@RequestBody List<String> ids) {
......@@ -372,7 +342,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.sysemployeeMapping.toDomain(returnObject.body),'ibzrt-SysEmployee-Get')")
@ApiOperation(value = "根据单位机构获取人员", tags = {"人员" }, notes = "根据单位机构获取人员")
@RequestMapping(method = RequestMethod.GET, value = "/sysorganizations/{sysorganization_id}/sysemployees/{sysemployee_id}")
public ResponseEntity<SysEmployeeDTO> getBySysOrganization(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysemployee_id") String sysemployee_id) {
......@@ -395,7 +364,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(sysemployeeService.checkKey(sysemployeeMapping.toDomain(sysemployeedto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzrt-SysEmployee-InitPwd-all')")
@ApiOperation(value = "根据单位机构人员", tags = {"人员" }, notes = "根据单位机构人员")
@RequestMapping(method = RequestMethod.POST, value = "/sysorganizations/{sysorganization_id}/sysemployees/{sysemployee_id}/initpwd")
public ResponseEntity<SysEmployeeDTO> initPwdBySysOrganization(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysemployee_id") String sysemployee_id, @RequestBody SysEmployeeDTO sysemployeedto) {
......@@ -406,7 +374,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(sysemployeedto);
}
@PreAuthorize("hasPermission(this.sysemployeeMapping.toDomain(#sysemployeedto),'ibzrt-SysEmployee-Save')")
@ApiOperation(value = "根据单位机构保存人员", tags = {"人员" }, notes = "根据单位机构保存人员")
@RequestMapping(method = RequestMethod.POST, value = "/sysorganizations/{sysorganization_id}/sysemployees/save")
public ResponseEntity<Boolean> saveBySysOrganization(@PathVariable("sysorganization_id") String sysorganization_id, @RequestBody SysEmployeeDTO sysemployeedto) {
......@@ -415,7 +382,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(sysemployeeService.save(domain));
}
@PreAuthorize("hasPermission(this.sysemployeeMapping.toDomain(#sysemployeedtos),'ibzrt-SysEmployee-Save')")
@ApiOperation(value = "根据单位机构批量保存人员", tags = {"人员" }, notes = "根据单位机构批量保存人员")
@RequestMapping(method = RequestMethod.POST, value = "/sysorganizations/{sysorganization_id}/sysemployees/savebatch")
public ResponseEntity<Boolean> saveBatchBySysOrganization(@PathVariable("sysorganization_id") String sysorganization_id, @RequestBody List<SysEmployeeDTO> sysemployeedtos) {
......@@ -427,7 +393,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzrt-SysEmployee-searchDefault-all') and hasPermission(#context,'ibzrt-SysEmployee-Get')")
@ApiOperation(value = "根据单位机构获取DEFAULT", tags = {"人员" } ,notes = "根据单位机构获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/sysorganizations/{sysorganization_id}/sysemployees/fetchdefault")
public ResponseEntity<List<SysEmployeeDTO>> fetchSysEmployeeDefaultBySysOrganization(@PathVariable("sysorganization_id") String sysorganization_id,SysEmployeeSearchContext context) {
......@@ -441,7 +406,6 @@ public class SysEmployeeResource {
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzrt-SysEmployee-searchDefault-all') and hasPermission(#context,'ibzrt-SysEmployee-Get')")
@ApiOperation(value = "根据单位机构查询DEFAULT", tags = {"人员" } ,notes = "根据单位机构查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/sysorganizations/{sysorganization_id}/sysemployees/searchdefault")
public ResponseEntity<Page<SysEmployeeDTO>> searchSysEmployeeDefaultBySysOrganization(@PathVariable("sysorganization_id") String sysorganization_id, @RequestBody SysEmployeeSearchContext context) {
......@@ -450,7 +414,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(sysemployeeMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.sysemployeeMapping.toDomain(#sysemployeedto),'ibzrt-SysEmployee-Create')")
@ApiOperation(value = "根据单位机构部门建立人员", tags = {"人员" }, notes = "根据单位机构部门建立人员")
@RequestMapping(method = RequestMethod.POST, value = "/sysorganizations/{sysorganization_id}/sysdepartments/{sysdepartment_id}/sysemployees")
public ResponseEntity<SysEmployeeDTO> createBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody SysEmployeeDTO sysemployeedto) {
......@@ -461,7 +424,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.sysemployeeMapping.toDomain(#sysemployeedtos),'ibzrt-SysEmployee-Create')")
@ApiOperation(value = "根据单位机构部门批量建立人员", tags = {"人员" }, notes = "根据单位机构部门批量建立人员")
@RequestMapping(method = RequestMethod.POST, value = "/sysorganizations/{sysorganization_id}/sysdepartments/{sysdepartment_id}/sysemployees/batch")
public ResponseEntity<Boolean> createBatchBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody List<SysEmployeeDTO> sysemployeedtos) {
......@@ -474,7 +436,6 @@ public class SysEmployeeResource {
}
@VersionCheck(entity = "sysemployee" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.sysemployeeService.get(#sysemployee_id),'ibzrt-SysEmployee-Update')")
@ApiOperation(value = "根据单位机构部门更新人员", tags = {"人员" }, notes = "根据单位机构部门更新人员")
@RequestMapping(method = RequestMethod.PUT, value = "/sysorganizations/{sysorganization_id}/sysdepartments/{sysdepartment_id}/sysemployees/{sysemployee_id}")
public ResponseEntity<SysEmployeeDTO> updateBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, @PathVariable("sysemployee_id") String sysemployee_id, @RequestBody SysEmployeeDTO sysemployeedto) {
......@@ -486,7 +447,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.sysemployeeService.getSysemployeeByEntities(this.sysemployeeMapping.toDomain(#sysemployeedtos)),'ibzrt-SysEmployee-Update')")
@ApiOperation(value = "根据单位机构部门批量更新人员", tags = {"人员" }, notes = "根据单位机构部门批量更新人员")
@RequestMapping(method = RequestMethod.PUT, value = "/sysorganizations/{sysorganization_id}/sysdepartments/{sysdepartment_id}/sysemployees/batch")
public ResponseEntity<Boolean> updateBatchBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody List<SysEmployeeDTO> sysemployeedtos) {
......@@ -498,14 +458,12 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.sysemployeeService.get(#sysemployee_id),'ibzrt-SysEmployee-Remove')")
@ApiOperation(value = "根据单位机构部门删除人员", tags = {"人员" }, notes = "根据单位机构部门删除人员")
@RequestMapping(method = RequestMethod.DELETE, value = "/sysorganizations/{sysorganization_id}/sysdepartments/{sysdepartment_id}/sysemployees/{sysemployee_id}")
public ResponseEntity<Boolean> removeBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, @PathVariable("sysemployee_id") String sysemployee_id) {
return ResponseEntity.status(HttpStatus.OK).body(sysemployeeService.remove(sysemployee_id));
}
@PreAuthorize("hasPermission(this.sysemployeeService.getSysemployeeByIds(#ids),'ibzrt-SysEmployee-Remove')")
@ApiOperation(value = "根据单位机构部门批量删除人员", tags = {"人员" }, notes = "根据单位机构部门批量删除人员")
@RequestMapping(method = RequestMethod.DELETE, value = "/sysorganizations/{sysorganization_id}/sysdepartments/{sysdepartment_id}/sysemployees/batch")
public ResponseEntity<Boolean> removeBatchBySysOrganizationSysDepartment(@RequestBody List<String> ids) {
......@@ -513,7 +471,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.sysemployeeMapping.toDomain(returnObject.body),'ibzrt-SysEmployee-Get')")
@ApiOperation(value = "根据单位机构部门获取人员", tags = {"人员" }, notes = "根据单位机构部门获取人员")
@RequestMapping(method = RequestMethod.GET, value = "/sysorganizations/{sysorganization_id}/sysdepartments/{sysdepartment_id}/sysemployees/{sysemployee_id}")
public ResponseEntity<SysEmployeeDTO> getBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, @PathVariable("sysemployee_id") String sysemployee_id) {
......@@ -536,7 +493,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(sysemployeeService.checkKey(sysemployeeMapping.toDomain(sysemployeedto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzrt-SysEmployee-InitPwd-all')")
@ApiOperation(value = "根据单位机构部门人员", tags = {"人员" }, notes = "根据单位机构部门人员")
@RequestMapping(method = RequestMethod.POST, value = "/sysorganizations/{sysorganization_id}/sysdepartments/{sysdepartment_id}/sysemployees/{sysemployee_id}/initpwd")
public ResponseEntity<SysEmployeeDTO> initPwdBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, @PathVariable("sysemployee_id") String sysemployee_id, @RequestBody SysEmployeeDTO sysemployeedto) {
......@@ -547,7 +503,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(sysemployeedto);
}
@PreAuthorize("hasPermission(this.sysemployeeMapping.toDomain(#sysemployeedto),'ibzrt-SysEmployee-Save')")
@ApiOperation(value = "根据单位机构部门保存人员", tags = {"人员" }, notes = "根据单位机构部门保存人员")
@RequestMapping(method = RequestMethod.POST, value = "/sysorganizations/{sysorganization_id}/sysdepartments/{sysdepartment_id}/sysemployees/save")
public ResponseEntity<Boolean> saveBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody SysEmployeeDTO sysemployeedto) {
......@@ -556,7 +511,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(sysemployeeService.save(domain));
}
@PreAuthorize("hasPermission(this.sysemployeeMapping.toDomain(#sysemployeedtos),'ibzrt-SysEmployee-Save')")
@ApiOperation(value = "根据单位机构部门批量保存人员", tags = {"人员" }, notes = "根据单位机构部门批量保存人员")
@RequestMapping(method = RequestMethod.POST, value = "/sysorganizations/{sysorganization_id}/sysdepartments/{sysdepartment_id}/sysemployees/savebatch")
public ResponseEntity<Boolean> saveBatchBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody List<SysEmployeeDTO> sysemployeedtos) {
......@@ -568,7 +522,6 @@ public class SysEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzrt-SysEmployee-searchDefault-all') and hasPermission(#context,'ibzrt-SysEmployee-Get')")
@ApiOperation(value = "根据单位机构部门获取DEFAULT", tags = {"人员" } ,notes = "根据单位机构部门获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/sysorganizations/{sysorganization_id}/sysdepartments/{sysdepartment_id}/sysemployees/fetchdefault")
public ResponseEntity<List<SysEmployeeDTO>> fetchSysEmployeeDefaultBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id,SysEmployeeSearchContext context) {
......@@ -582,7 +535,6 @@ public class SysEmployeeResource {
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzrt-SysEmployee-searchDefault-all') and hasPermission(#context,'ibzrt-SysEmployee-Get')")
@ApiOperation(value = "根据单位机构部门查询DEFAULT", tags = {"人员" } ,notes = "根据单位机构部门查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/sysorganizations/{sysorganization_id}/sysdepartments/{sysdepartment_id}/sysemployees/searchdefault")
public ResponseEntity<Page<SysEmployeeDTO>> searchSysEmployeeDefaultBySysOrganizationSysDepartment(@PathVariable("sysorganization_id") String sysorganization_id, @PathVariable("sysdepartment_id") String sysdepartment_id, @RequestBody SysEmployeeSearchContext context) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册