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

zhouweidong@lab.ibiz5.com 发布系统代码

上级 a223d1f5
...@@ -97,7 +97,7 @@ zuul: ...@@ -97,7 +97,7 @@ zuul:
stripPrefix: false stripPrefix: false
ibzemp: ibzemp:
path: /ibzemployees/** path: /ibzemployees/**
serviceId: ${ibiz.ref.service.ibzou-api:ibzou-api} serviceId: ${ibiz.ref.service.ibzrt-api:ibzrt-api}
stripPrefix: false stripPrefix: false
sys_app: sys_app:
path: /sysapps/** path: /sysapps/**
......
...@@ -20,10 +20,6 @@ zuul: ...@@ -20,10 +20,6 @@ zuul:
path: /ibzdeptmembers/** path: /ibzdeptmembers/**
serviceId: ${ibiz.ref.service.ibzou-api:ibzou-api} serviceId: ${ibiz.ref.service.ibzou-api:ibzou-api}
stripPrefix: false stripPrefix: false
ibzemp:
path: /ibzemps/**
serviceId: ${ibiz.ref.service.ibzou-api:ibzou-api}
stripPrefix: false
ibzorg: ibzorg:
path: /ibzorgs/** path: /ibzorgs/**
serviceId: ${ibiz.ref.service.ibzou-api:ibzou-api} serviceId: ${ibiz.ref.service.ibzou-api:ibzou-api}
......
...@@ -16,6 +16,10 @@ import java.util.*; ...@@ -16,6 +16,10 @@ import java.util.*;
@Service("IBZEmployeeExService") @Service("IBZEmployeeExService")
public class IBZEmployeeExService extends IBZEmployeeServiceImpl { public class IBZEmployeeExService extends IBZEmployeeServiceImpl {
@Override
protected Class currentModelClass() {
return com.baomidou.mybatisplus.core.toolkit.ReflectionKit.getSuperClassGenericType(this.getClass().getSuperclass(), 1);
}
/** /**
* 自定义行为[InitPwd]用户扩展 * 自定义行为[InitPwd]用户扩展
......
...@@ -23,300 +23,312 @@ import lombok.*; ...@@ -23,300 +23,312 @@ import lombok.*;
import org.springframework.data.annotation.Transient; import org.springframework.data.annotation.Transient;
import cn.ibizlab.util.annotation.Audit; import cn.ibizlab.util.annotation.Audit;
import cn.ibizlab.util.domain.EntityClient;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.util.domain.EntityMP;
/** /**
* ServiceApi [人员] 对象 * 实体[人员]
*/ */
@Data @Getter
public class IBZEmployee extends EntityClient implements Serializable { @Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "IBZEMP",resultMap = "IBZEmployeeResultMap")
public class IBZEmployee extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/** /**
* 用户标识 * 用户标识
*/ */
@DEField(isKeyField=true) @DEField(isKeyField=true)
@TableId(value= "userid",type=IdType.ASSIGN_UUID)
@JSONField(name = "userid") @JSONField(name = "userid")
@JsonProperty("userid") @JsonProperty("userid")
private String userid; private String userid;
/** /**
* 用户全局名 * 用户全局名
*/ */
@TableField(value = "username")
@JSONField(name = "username") @JSONField(name = "username")
@JsonProperty("username") @JsonProperty("username")
private String username; private String username;
/** /**
* 姓名 * 姓名
*/ */
@TableField(value = "personname")
@JSONField(name = "personname") @JSONField(name = "personname")
@JsonProperty("personname") @JsonProperty("personname")
private String personname; private String personname;
/** /**
* 用户工号 * 用户工号
*/ */
@TableField(value = "usercode")
@JSONField(name = "usercode") @JSONField(name = "usercode")
@JsonProperty("usercode") @JsonProperty("usercode")
private String usercode; private String usercode;
/** /**
* 登录名 * 登录名
*/ */
@TableField(value = "loginname")
@JSONField(name = "loginname") @JSONField(name = "loginname")
@JsonProperty("loginname") @JsonProperty("loginname")
private String loginname; private String loginname;
/** /**
* 密码 * 密码
*/ */
@TableField(value = "password")
@JSONField(name = "password") @JSONField(name = "password")
@JsonProperty("password") @JsonProperty("password")
private String password; private String password;
/** /**
* 区属 * 区属
*/ */
@TableField(value = "domains")
@JSONField(name = "domains") @JSONField(name = "domains")
@JsonProperty("domains") @JsonProperty("domains")
private String domains; private String domains;
/** /**
* 主部门 * 主部门
*/ */
@TableField(value = "mdeptid")
@JSONField(name = "mdeptid") @JSONField(name = "mdeptid")
@JsonProperty("mdeptid") @JsonProperty("mdeptid")
private String mdeptid; private String mdeptid;
/** /**
* 主部门代码 * 主部门代码
*/ */
@TableField(value = "mdeptcode")
@JSONField(name = "mdeptcode") @JSONField(name = "mdeptcode")
@JsonProperty("mdeptcode") @JsonProperty("mdeptcode")
private String mdeptcode; private String mdeptcode;
/** /**
* 主部门名称 * 主部门名称
*/ */
@TableField(value = "mdeptname")
@JSONField(name = "mdeptname") @JSONField(name = "mdeptname")
@JsonProperty("mdeptname") @JsonProperty("mdeptname")
private String mdeptname; private String mdeptname;
/** /**
* 业务编码 * 业务编码
*/ */
@TableField(value = "bcode")
@JSONField(name = "bcode") @JSONField(name = "bcode")
@JsonProperty("bcode") @JsonProperty("bcode")
private String bcode; private String bcode;
/** /**
* 岗位标识 * 岗位标识
*/ */
@TableField(value = "postid")
@JSONField(name = "postid") @JSONField(name = "postid")
@JsonProperty("postid") @JsonProperty("postid")
private String postid; private String postid;
/** /**
* 岗位代码 * 岗位代码
*/ */
@TableField(value = "postcode")
@JSONField(name = "postcode") @JSONField(name = "postcode")
@JsonProperty("postcode") @JsonProperty("postcode")
private String postcode; private String postcode;
/** /**
* 岗位名称 * 岗位名称
*/ */
@TableField(value = "postname")
@JSONField(name = "postname") @JSONField(name = "postname")
@JsonProperty("postname") @JsonProperty("postname")
private String postname; private String postname;
/** /**
* 单位 * 单位
*/ */
@DEField(preType = DEPredefinedFieldType.ORGID) @DEField(preType = DEPredefinedFieldType.ORGID)
@TableField(value = "orgid")
@JSONField(name = "orgid") @JSONField(name = "orgid")
@JsonProperty("orgid") @JsonProperty("orgid")
private String orgid; private String orgid;
/** /**
* 单位代码 * 单位代码
*/ */
@TableField(value = "orgcode")
@JSONField(name = "orgcode") @JSONField(name = "orgcode")
@JsonProperty("orgcode") @JsonProperty("orgcode")
private String orgcode; private String orgcode;
/** /**
* 单位名称 * 单位名称
*/ */
@DEField(preType = DEPredefinedFieldType.ORGNAME) @DEField(preType = DEPredefinedFieldType.ORGNAME)
@TableField(value = "orgname")
@JSONField(name = "orgname") @JSONField(name = "orgname")
@JsonProperty("orgname") @JsonProperty("orgname")
private String orgname; private String orgname;
/** /**
* 昵称别名 * 昵称别名
*/ */
@TableField(value = "nickname")
@JSONField(name = "nickname") @JSONField(name = "nickname")
@JsonProperty("nickname") @JsonProperty("nickname")
private String nickname; private String nickname;
/** /**
* 性别 * 性别
*/ */
@TableField(value = "sex")
@JSONField(name = "sex") @JSONField(name = "sex")
@JsonProperty("sex") @JsonProperty("sex")
private String sex; private String sex;
/** /**
* 证件号码 * 证件号码
*/ */
@TableField(value = "certcode")
@JSONField(name = "certcode") @JSONField(name = "certcode")
@JsonProperty("certcode") @JsonProperty("certcode")
private String certcode; private String certcode;
/** /**
* 联系方式 * 联系方式
*/ */
@TableField(value = "phone")
@JSONField(name = "phone") @JSONField(name = "phone")
@JsonProperty("phone") @JsonProperty("phone")
private String phone; private String phone;
/** /**
* 出生日期 * 出生日期
*/ */
@TableField(value = "birthday")
@JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8") @JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
@JSONField(name = "birthday" , format="yyyy-MM-dd") @JSONField(name = "birthday" , format="yyyy-MM-dd")
@JsonProperty("birthday") @JsonProperty("birthday")
private Timestamp birthday; private Timestamp birthday;
/** /**
* 邮件 * 邮件
*/ */
@TableField(value = "email")
@JSONField(name = "email") @JSONField(name = "email")
@JsonProperty("email") @JsonProperty("email")
private String email; private String email;
/** /**
* 社交账号 * 社交账号
*/ */
@TableField(value = "avatar")
@JSONField(name = "avatar") @JSONField(name = "avatar")
@JsonProperty("avatar") @JsonProperty("avatar")
private String avatar; private String avatar;
/** /**
* 地址 * 地址
*/ */
@TableField(value = "addr")
@JSONField(name = "addr") @JSONField(name = "addr")
@JsonProperty("addr") @JsonProperty("addr")
private String addr; private String addr;
/** /**
* 照片 * 照片
*/ */
@TableField(value = "usericon")
@JSONField(name = "usericon") @JSONField(name = "usericon")
@JsonProperty("usericon") @JsonProperty("usericon")
private String usericon; private String usericon;
/** /**
* ip地址 * ip地址
*/ */
@TableField(value = "ipaddr")
@JSONField(name = "ipaddr") @JSONField(name = "ipaddr")
@JsonProperty("ipaddr") @JsonProperty("ipaddr")
private String ipaddr; private String ipaddr;
/** /**
* 样式 * 样式
*/ */
@TableField(value = "theme")
@JSONField(name = "theme") @JSONField(name = "theme")
@JsonProperty("theme") @JsonProperty("theme")
private String theme; private String theme;
/** /**
* 语言 * 语言
*/ */
@TableField(value = "lang")
@JSONField(name = "lang") @JSONField(name = "lang")
@JsonProperty("lang") @JsonProperty("lang")
private String lang; private String lang;
/** /**
* 字号 * 字号
*/ */
@TableField(value = "fontsize")
@JSONField(name = "fontsize") @JSONField(name = "fontsize")
@JsonProperty("fontsize") @JsonProperty("fontsize")
private String fontsize; private String fontsize;
/** /**
* 备注 * 备注
*/ */
@TableField(value = "memo")
@JSONField(name = "memo") @JSONField(name = "memo")
@JsonProperty("memo") @JsonProperty("memo")
private String memo; private String memo;
/** /**
* 保留 * 保留
*/ */
@TableField(value = "reserver")
@JSONField(name = "reserver") @JSONField(name = "reserver")
@JsonProperty("reserver") @JsonProperty("reserver")
private String reserver; private String reserver;
/** /**
* 排序 * 排序
*/ */
@TableField(value = "showorder")
@JSONField(name = "showorder") @JSONField(name = "showorder")
@JsonProperty("showorder") @JsonProperty("showorder")
private Integer showorder; private Integer showorder;
/** /**
* 逻辑有效 * 逻辑有效
*/ */
@DEField(preType = DEPredefinedFieldType.LOGICVALID, logicval = "1" , logicdelval="0") @DEField(preType = DEPredefinedFieldType.LOGICVALID, logicval = "1" , logicdelval="0")
@TableLogic(value= "1",delval="0")
@TableField(value = "enable")
@JSONField(name = "enable") @JSONField(name = "enable")
@JsonProperty("enable") @JsonProperty("enable")
private Integer enable; private Integer enable;
/** /**
* 创建时间 * 创建时间
*/ */
@DEField(preType = DEPredefinedFieldType.CREATEDATE) @DEField(preType = DEPredefinedFieldType.CREATEDATE)
@TableField(value = "createdate" , fill = FieldFill.INSERT)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8") @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss") @JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate") @JsonProperty("createdate")
private Timestamp createdate; private Timestamp createdate;
/** /**
* 最后修改时间 * 最后修改时间
*/ */
@DEField(preType = DEPredefinedFieldType.UPDATEDATE) @DEField(preType = DEPredefinedFieldType.UPDATEDATE)
@TableField(value = "updatedate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8") @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss") @JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate") @JsonProperty("updatedate")
private Timestamp updatedate; private Timestamp updatedate;
/** /**
* *
*/ */
@JSONField(name = "maindept") @JsonIgnore
@JsonProperty("maindept") @JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.core.ou.domain.IBZDepartment maindept; private cn.ibizlab.core.ou.domain.IBZDepartment maindept;
/** /**
* *
*/ */
@JSONField(name = "org") @JsonIgnore
@JsonProperty("org") @JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.core.ou.domain.IBZOrganization org; private cn.ibizlab.core.ou.domain.IBZOrganization org;
/** /**
* *
*/ */
@JSONField(name = "post") @JsonIgnore
@JsonProperty("post") @JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.core.ou.domain.IBZPost post; private cn.ibizlab.core.ou.domain.IBZPost post;
/** /**
* 设置 [用户全局名] * 设置 [用户全局名]
*/ */
......
...@@ -17,36 +17,107 @@ import org.springframework.util.ObjectUtils; ...@@ -17,36 +17,107 @@ import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import cn.ibizlab.util.filter.SearchContextBase; import cn.ibizlab.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.core.ou.domain.IBZEmployee;
/** /**
* ServiceApi数据实体[IBZEmployee] 查询条件对象 * 关系型数据实体[IBZEmployee] 查询条件对象
*/ */
@Slf4j @Slf4j
@Data @Data
public class IBZEmployeeSearchContext extends SearchContextBase { public class IBZEmployeeSearchContext extends QueryWrapperContext<IBZEmployee> {
private String n_personname_like;//[姓名]
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;//[用户工号] 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;//[主部门] 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;//[主部门名称] 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;//[业务编码] 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;//[岗位标识] 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;//[岗位名称] 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;//[岗位名称] 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;//[单位] 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;//[单位代码] 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;//[性别] 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)
);
}
}
} }
...@@ -18,10 +18,12 @@ import cn.ibizlab.core.ou.domain.IBZEmployee; ...@@ -18,10 +18,12 @@ import cn.ibizlab.core.ou.domain.IBZEmployee;
import cn.ibizlab.core.ou.filter.IBZEmployeeSearchContext; import cn.ibizlab.core.ou.filter.IBZEmployeeSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/** /**
* 实体[IBZEmployee] 服务对象接口 * 实体[IBZEmployee] 服务对象接口
*/ */
public interface IIBZEmployeeService{ public interface IIBZEmployeeService extends IService<IBZEmployee>{
boolean create(IBZEmployee et) ; boolean create(IBZEmployee et) ;
@CacheEvict(value="ibzemployee",allEntries=true) @CacheEvict(value="ibzemployee",allEntries=true)
...@@ -49,8 +51,23 @@ public interface IIBZEmployeeService{ ...@@ -49,8 +51,23 @@ public interface IIBZEmployeeService{
List<IBZEmployee> selectByPostid(String postid) ; List<IBZEmployee> selectByPostid(String postid) ;
@CacheEvict(value="ibzemployee",allEntries=true) @CacheEvict(value="ibzemployee",allEntries=true)
void removeByPostid(String postid) ; 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<IBZEmployee> getIbzemployeeByIds(List<String> ids) ;
List<IBZEmployee> getIbzemployeeByEntities(List<IBZEmployee> entities) ;
} }
...@@ -43,6 +43,9 @@ public class IBZDepartmentServiceImpl implements IIBZDepartmentService { ...@@ -43,6 +43,9 @@ public class IBZDepartmentServiceImpl implements IIBZDepartmentService {
@Autowired @Autowired
IBZDepartmentFeignClient iBZDepartmentFeignClient; IBZDepartmentFeignClient iBZDepartmentFeignClient;
@Autowired
@Lazy
protected cn.ibizlab.core.ou.service.IIBZEmployeeService ibzemployeeService;
@Override @Override
public boolean create(IBZDepartment et) { public boolean create(IBZDepartment et) {
......
...@@ -31,79 +31,110 @@ import cn.ibizlab.util.helper.CachedBeanCopier; ...@@ -31,79 +31,110 @@ import cn.ibizlab.util.helper.CachedBeanCopier;
import cn.ibizlab.util.helper.DEFieldCacheMap; import cn.ibizlab.util.helper.DEFieldCacheMap;
import cn.ibizlab.core.ou.client.IBZEmployeeFeignClient; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.core.ou.mapper.IBZEmployeeMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/** /**
* 实体[人员] 服务对象接口实现 * 实体[人员] 服务对象接口实现
*/ */
@Slf4j @Slf4j
@Service @Service("IBZEmployeeServiceImpl")
public class IBZEmployeeServiceImpl implements IIBZEmployeeService { public class IBZEmployeeServiceImpl extends ServiceImpl<IBZEmployeeMapper, IBZEmployee> implements IIBZEmployeeService {
@Autowired @Autowired
IBZEmployeeFeignClient iBZEmployeeFeignClient; @Lazy
protected cn.ibizlab.core.ou.service.IIBZDeptMemberService ibzdeptmemberService;
@Autowired
@Lazy
protected cn.ibizlab.core.ou.service.IIBZTeamMemberService ibzteammemberService;
@Autowired
@Lazy
protected cn.ibizlab.core.ou.service.IIBZDepartmentService ibzdepartmentService;
@Autowired
@Lazy
protected cn.ibizlab.core.ou.service.IIBZOrganizationService ibzorganizationService;
@Autowired
@Lazy
protected cn.ibizlab.core.ou.service.IIBZPostService ibzpostService;
@Autowired
@Lazy
protected cn.ibizlab.core.ou.service.logic.IIBZEmployeesaveDeptMemberLogic savedeptmemberLogic;
protected int batchSize = 500;
@Override @Override
@Transactional
public boolean create(IBZEmployee et) { public boolean create(IBZEmployee et) {
IBZEmployee rt = iBZEmployeeFeignClient.create(et); fillParentData(et);
if(rt==null) if(!this.retBool(this.baseMapper.insert(et)))
return false; return false;
CachedBeanCopier.copy(rt,et); CachedBeanCopier.copy(get(et.getUserid()),et);
savedeptmemberLogic.execute(et); savedeptmemberLogic.execute(et);
return true; return true;
} }
public void createBatch(List<IBZEmployee> list){ @Override
iBZEmployeeFeignClient.createBatch(list) ; public void createBatch(List<IBZEmployee> list) {
list.forEach(item->fillParentData(item));
this.saveBatch(list,batchSize);
} }
@Override @Override
@Transactional
public boolean update(IBZEmployee et) { public boolean update(IBZEmployee et) {
IBZEmployee rt = iBZEmployeeFeignClient.update(et.getUserid(),et); fillParentData(et);
if(rt==null) if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("userid",et.getUserid())))
return false; return false;
CachedBeanCopier.copy(rt,et); CachedBeanCopier.copy(get(et.getUserid()),et);
savedeptmemberLogic.execute(et); savedeptmemberLogic.execute(et);
return true; return true;
} }
public void updateBatch(List<IBZEmployee> list){ @Override
iBZEmployeeFeignClient.updateBatch(list) ; public void updateBatch(List<IBZEmployee> list) {
list.forEach(item->fillParentData(item));
updateBatchById(list,batchSize);
} }
@Override @Override
public boolean remove(String userid) { @Transactional
boolean result=iBZEmployeeFeignClient.remove(userid) ; public boolean remove(String key) {
return result; boolean result=removeById(key);
return result ;
} }
public void removeBatch(Collection<String> idList){ @Override
iBZEmployeeFeignClient.removeBatch(idList); public void removeBatch(Collection<String> idList) {
removeByIds(idList);
} }
@Override @Override
public IBZEmployee get(String userid) { @Transactional
IBZEmployee et=iBZEmployeeFeignClient.get(userid); public IBZEmployee get(String key) {
IBZEmployee et = getById(key);
if(et==null){ if(et==null){
et=new IBZEmployee(); et=new IBZEmployee();
et.setUserid(userid); et.setUserid(key);
} }
else{ else{
} }
return et; return et;
} }
@Override @Override
public IBZEmployee getDraft(IBZEmployee et) { public IBZEmployee getDraft(IBZEmployee et) {
et=iBZEmployeeFeignClient.getDraft(); fillParentData(et);
return et; return et;
} }
@Override @Override
public boolean checkKey(IBZEmployee et) { public boolean checkKey(IBZEmployee et) {
return iBZEmployeeFeignClient.checkKey(et); return (!ObjectUtils.isEmpty(et.getUserid()))&&(!Objects.isNull(this.getById(et.getUserid())));
} }
@Override @Override
@Transactional @Transactional
...@@ -115,86 +146,164 @@ public class IBZEmployeeServiceImpl implements IIBZEmployeeService { ...@@ -115,86 +146,164 @@ public class IBZEmployeeServiceImpl implements IIBZEmployeeService {
@Override @Override
@Transactional @Transactional
public boolean save(IBZEmployee et) { public boolean save(IBZEmployee et) {
if(et.getUserid()==null) et.setUserid((String)et.getDefaultKey(true)); if(!saveOrUpdate(et))
if(!iBZEmployeeFeignClient.save(et))
return false; return false;
return true; return true;
} }
@Override @Override
public void saveBatch(List<IBZEmployee> list) { @Transactional
iBZEmployeeFeignClient.saveBatch(list) ; public boolean saveOrUpdate(IBZEmployee et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
} }
@Override
public boolean saveBatch(Collection<IBZEmployee> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<IBZEmployee> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
@Override @Override
public List<IBZEmployee> selectByMdeptid(String deptid) { public List<IBZEmployee> selectByMdeptid(String deptid) {
IBZEmployeeSearchContext context=new IBZEmployeeSearchContext(); return baseMapper.selectByMdeptid(deptid);
context.setSize(Integer.MAX_VALUE);
context.setN_mdeptid_eq(deptid);
return iBZEmployeeFeignClient.searchDefault(context).getContent();
} }
@Override @Override
public void removeByMdeptid(String deptid) { public void removeByMdeptid(String deptid) {
Set<String> delIds=new HashSet<String>(); this.remove(new QueryWrapper<IBZEmployee>().eq("mdeptid",deptid));
for(IBZEmployee before:selectByMdeptid(deptid)){
delIds.add(before.getUserid());
}
if(delIds.size()>0)
this.removeBatch(delIds);
} }
@Override @Override
public List<IBZEmployee> selectByOrgid(String orgid) { public List<IBZEmployee> selectByOrgid(String orgid) {
IBZEmployeeSearchContext context=new IBZEmployeeSearchContext(); return baseMapper.selectByOrgid(orgid);
context.setSize(Integer.MAX_VALUE);
context.setN_orgid_eq(orgid);
return iBZEmployeeFeignClient.searchDefault(context).getContent();
} }
@Override @Override
public void removeByOrgid(String orgid) { public void removeByOrgid(String orgid) {
Set<String> delIds=new HashSet<String>(); this.remove(new QueryWrapper<IBZEmployee>().eq("orgid",orgid));
for(IBZEmployee before:selectByOrgid(orgid)){
delIds.add(before.getUserid());
}
if(delIds.size()>0)
this.removeBatch(delIds);
} }
@Override @Override
public List<IBZEmployee> selectByPostid(String postid) { public List<IBZEmployee> selectByPostid(String postid) {
IBZEmployeeSearchContext context=new IBZEmployeeSearchContext(); return baseMapper.selectByPostid(postid);
context.setSize(Integer.MAX_VALUE);
context.setN_postid_eq(postid);
return iBZEmployeeFeignClient.searchDefault(context).getContent();
} }
@Override @Override
public void removeByPostid(String postid) { public void removeByPostid(String postid) {
Set<String> delIds=new HashSet<String>(); this.remove(new QueryWrapper<IBZEmployee>().eq("postid",postid));
for(IBZEmployee before:selectByPostid(postid)){
delIds.add(before.getUserid());
}
if(delIds.size()>0)
this.removeBatch(delIds);
} }
/** /**
* 查询集合 DEFAULT * 查询集合 DEFAULT
*/ */
@Override @Override
public Page<IBZEmployee> searchDefault(IBZEmployeeSearchContext context) { public Page<IBZEmployee> searchDefault(IBZEmployeeSearchContext context) {
Page<IBZEmployee> iBZEmployees=iBZEmployeeFeignClient.searchDefault(context); com.baomidou.mybatisplus.extension.plugins.pagination.Page<IBZEmployee> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return iBZEmployees; return new PageImpl<IBZEmployee>(pages.getRecords(), context.getPageable(), pages.getTotal());
} }
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(IBZEmployee et){
//实体关系[DER1N_IBZEMP_IBZDEPT_MDEPTID]
if(!ObjectUtils.isEmpty(et.getMdeptid())){
cn.ibizlab.core.ou.domain.IBZDepartment maindept=et.getMaindept();
if(ObjectUtils.isEmpty(maindept)){
cn.ibizlab.core.ou.domain.IBZDepartment majorEntity=ibzdepartmentService.get(et.getMdeptid());
et.setMaindept(majorEntity);
maindept=majorEntity;
}
et.setMdeptcode(maindept.getDeptcode());
et.setMdeptname(maindept.getDeptname());
}
//实体关系[DER1N_IBZEMP_IBZORG_ORGID]
if(!ObjectUtils.isEmpty(et.getOrgid())){
cn.ibizlab.core.ou.domain.IBZOrganization org=et.getOrg();
if(ObjectUtils.isEmpty(org)){
cn.ibizlab.core.ou.domain.IBZOrganization majorEntity=ibzorganizationService.get(et.getOrgid());
et.setOrg(majorEntity);
org=majorEntity;
}
et.setOrgcode(org.getOrgcode());
et.setOrgname(org.getOrgname());
}
//实体关系[DER1N_IBZEMP_IBZPOST_POSTID]
if(!ObjectUtils.isEmpty(et.getPostid())){
cn.ibizlab.core.ou.domain.IBZPost post=et.getPost();
if(ObjectUtils.isEmpty(post)){
cn.ibizlab.core.ou.domain.IBZPost majorEntity=ibzpostService.get(et.getPostid());
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);
}
@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<IBZEmployee> getIbzemployeeByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<IBZEmployee> getIbzemployeeByEntities(List<IBZEmployee> entities) {
List ids =new ArrayList();
for(IBZEmployee entity : entities){
Serializable id=entity.getUserid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
} }
......
...@@ -43,6 +43,9 @@ public class IBZOrganizationServiceImpl implements IIBZOrganizationService { ...@@ -43,6 +43,9 @@ public class IBZOrganizationServiceImpl implements IIBZOrganizationService {
@Autowired @Autowired
IBZOrganizationFeignClient iBZOrganizationFeignClient; IBZOrganizationFeignClient iBZOrganizationFeignClient;
@Autowired
@Lazy
protected cn.ibizlab.core.ou.service.IIBZEmployeeService ibzemployeeService;
@Override @Override
public boolean create(IBZOrganization et) { public boolean create(IBZOrganization et) {
......
...@@ -43,6 +43,9 @@ public class IBZPostServiceImpl implements IIBZPostService { ...@@ -43,6 +43,9 @@ public class IBZPostServiceImpl implements IIBZPostService {
@Autowired @Autowired
IBZPostFeignClient iBZPostFeignClient; IBZPostFeignClient iBZPostFeignClient;
@Autowired
@Lazy
protected cn.ibizlab.core.ou.service.IIBZEmployeeService ibzemployeeService;
@Override @Override
public boolean create(IBZPost et) { public boolean create(IBZPost et) {
......
<?xml version="1.1" encoding="UTF-8" standalone="no"?> !!!!模版产生代码错误:----
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----
----
FTL stack trace ("~" means nesting-related):
- Failed at: ${dbinst.getUserName()} [in template "CODETEMPL_zh_CN" at line 28, column 24]
----
\ No newline at end of file
</databaseChangeLog>
...@@ -11,7 +11,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -11,7 +11,7 @@ import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest; import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier; import org.springframework.cglib.beans.BeanCopier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
...@@ -47,9 +47,10 @@ public class IBZEmployeeResource { ...@@ -47,9 +47,10 @@ public class IBZEmployeeResource {
@Lazy @Lazy
public IBZEmployeeMapping ibzemployeeMapping; public IBZEmployeeMapping ibzemployeeMapping;
@PreAuthorize("hasPermission(this.ibzemployeeMapping.toDomain(#ibzemployeedto),'ibzrt-IBZEmployee-Create')")
@ApiOperation(value = "新建人员", tags = {"人员" }, notes = "新建人员") @ApiOperation(value = "新建人员", tags = {"人员" }, notes = "新建人员")
@RequestMapping(method = RequestMethod.POST, value = "/ibzemployees") @RequestMapping(method = RequestMethod.POST, value = "/ibzemployees")
@Transactional
public ResponseEntity<IBZEmployeeDTO> create(@RequestBody IBZEmployeeDTO ibzemployeedto) { public ResponseEntity<IBZEmployeeDTO> create(@RequestBody IBZEmployeeDTO ibzemployeedto) {
IBZEmployee domain = ibzemployeeMapping.toDomain(ibzemployeedto); IBZEmployee domain = ibzemployeeMapping.toDomain(ibzemployeedto);
ibzemployeeService.create(domain); ibzemployeeService.create(domain);
...@@ -57,6 +58,7 @@ public class IBZEmployeeResource { ...@@ -57,6 +58,7 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasPermission(this.ibzemployeeMapping.toDomain(#ibzemployeedtos),'ibzrt-IBZEmployee-Create')")
@ApiOperation(value = "批量新建人员", tags = {"人员" }, notes = "批量新建人员") @ApiOperation(value = "批量新建人员", tags = {"人员" }, notes = "批量新建人员")
@RequestMapping(method = RequestMethod.POST, value = "/ibzemployees/batch") @RequestMapping(method = RequestMethod.POST, value = "/ibzemployees/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<IBZEmployeeDTO> ibzemployeedtos) { public ResponseEntity<Boolean> createBatch(@RequestBody List<IBZEmployeeDTO> ibzemployeedtos) {
...@@ -65,9 +67,10 @@ public class IBZEmployeeResource { ...@@ -65,9 +67,10 @@ public class IBZEmployeeResource {
} }
@VersionCheck(entity = "ibzemployee" , versionfield = "updatedate") @VersionCheck(entity = "ibzemployee" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.ibzemployeeService.get(#ibzemployee_id),'ibzrt-IBZEmployee-Update')")
@ApiOperation(value = "更新人员", tags = {"人员" }, notes = "更新人员") @ApiOperation(value = "更新人员", tags = {"人员" }, notes = "更新人员")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzemployees/{ibzemployee_id}") @RequestMapping(method = RequestMethod.PUT, value = "/ibzemployees/{ibzemployee_id}")
@Transactional
public ResponseEntity<IBZEmployeeDTO> update(@PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZEmployeeDTO ibzemployeedto) { public ResponseEntity<IBZEmployeeDTO> update(@PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZEmployeeDTO ibzemployeedto) {
IBZEmployee domain = ibzemployeeMapping.toDomain(ibzemployeedto); IBZEmployee domain = ibzemployeeMapping.toDomain(ibzemployeedto);
domain .setUserid(ibzemployee_id); domain .setUserid(ibzemployee_id);
...@@ -76,6 +79,7 @@ public class IBZEmployeeResource { ...@@ -76,6 +79,7 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasPermission(this.ibzemployeeService.getIbzemployeeByEntities(this.ibzemployeeMapping.toDomain(#ibzemployeedtos)),'ibzrt-IBZEmployee-Update')")
@ApiOperation(value = "批量更新人员", tags = {"人员" }, notes = "批量更新人员") @ApiOperation(value = "批量更新人员", tags = {"人员" }, notes = "批量更新人员")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzemployees/batch") @RequestMapping(method = RequestMethod.PUT, value = "/ibzemployees/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<IBZEmployeeDTO> ibzemployeedtos) { public ResponseEntity<Boolean> updateBatch(@RequestBody List<IBZEmployeeDTO> ibzemployeedtos) {
...@@ -83,13 +87,15 @@ public class IBZEmployeeResource { ...@@ -83,13 +87,15 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasPermission(this.ibzemployeeService.get(#ibzemployee_id),'ibzrt-IBZEmployee-Remove')")
@ApiOperation(value = "删除人员", tags = {"人员" }, notes = "删除人员") @ApiOperation(value = "删除人员", tags = {"人员" }, notes = "删除人员")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzemployees/{ibzemployee_id}") @RequestMapping(method = RequestMethod.DELETE, value = "/ibzemployees/{ibzemployee_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("ibzemployee_id") String ibzemployee_id) { public ResponseEntity<Boolean> remove(@PathVariable("ibzemployee_id") String ibzemployee_id) {
return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.remove(ibzemployee_id)); return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.remove(ibzemployee_id));
} }
@PreAuthorize("hasPermission(this.ibzemployeeService.getIbzemployeeByIds(#ids),'ibzrt-IBZEmployee-Remove')")
@ApiOperation(value = "批量删除人员", tags = {"人员" }, notes = "批量删除人员") @ApiOperation(value = "批量删除人员", tags = {"人员" }, notes = "批量删除人员")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzemployees/batch") @RequestMapping(method = RequestMethod.DELETE, value = "/ibzemployees/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) { public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
...@@ -97,6 +103,7 @@ public class IBZEmployeeResource { ...@@ -97,6 +103,7 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PostAuthorize("hasPermission(this.ibzemployeeMapping.toDomain(returnObject.body),'ibzrt-IBZEmployee-Get')")
@ApiOperation(value = "获取人员", tags = {"人员" }, notes = "获取人员") @ApiOperation(value = "获取人员", tags = {"人员" }, notes = "获取人员")
@RequestMapping(method = RequestMethod.GET, value = "/ibzemployees/{ibzemployee_id}") @RequestMapping(method = RequestMethod.GET, value = "/ibzemployees/{ibzemployee_id}")
public ResponseEntity<IBZEmployeeDTO> get(@PathVariable("ibzemployee_id") String ibzemployee_id) { public ResponseEntity<IBZEmployeeDTO> get(@PathVariable("ibzemployee_id") String ibzemployee_id) {
...@@ -117,9 +124,10 @@ public class IBZEmployeeResource { ...@@ -117,9 +124,10 @@ public class IBZEmployeeResource {
return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.checkKey(ibzemployeeMapping.toDomain(ibzemployeedto))); return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.checkKey(ibzemployeeMapping.toDomain(ibzemployeedto)));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzrt-IBZEmployee-InitPwd-all')")
@ApiOperation(value = "初始化密码", tags = {"人员" }, notes = "初始化密码") @ApiOperation(value = "初始化密码", tags = {"人员" }, notes = "初始化密码")
@RequestMapping(method = RequestMethod.POST, value = "/ibzemployees/{ibzemployee_id}/initpwd") @RequestMapping(method = RequestMethod.POST, value = "/ibzemployees/{ibzemployee_id}/initpwd")
@Transactional
public ResponseEntity<IBZEmployeeDTO> initPwd(@PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZEmployeeDTO ibzemployeedto) { public ResponseEntity<IBZEmployeeDTO> initPwd(@PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZEmployeeDTO ibzemployeedto) {
IBZEmployee domain = ibzemployeeMapping.toDomain(ibzemployeedto); IBZEmployee domain = ibzemployeeMapping.toDomain(ibzemployeedto);
domain.setUserid(ibzemployee_id); domain.setUserid(ibzemployee_id);
...@@ -128,12 +136,14 @@ domain.setUserid(ibzemployee_id); ...@@ -128,12 +136,14 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK).body(ibzemployeedto); return ResponseEntity.status(HttpStatus.OK).body(ibzemployeedto);
} }
@PreAuthorize("hasPermission(this.ibzemployeeMapping.toDomain(#ibzemployeedto),'ibzrt-IBZEmployee-Save')")
@ApiOperation(value = "保存人员", tags = {"人员" }, notes = "保存人员") @ApiOperation(value = "保存人员", tags = {"人员" }, notes = "保存人员")
@RequestMapping(method = RequestMethod.POST, value = "/ibzemployees/save") @RequestMapping(method = RequestMethod.POST, value = "/ibzemployees/save")
public ResponseEntity<Boolean> save(@RequestBody IBZEmployeeDTO ibzemployeedto) { public ResponseEntity<Boolean> save(@RequestBody IBZEmployeeDTO ibzemployeedto) {
return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.save(ibzemployeeMapping.toDomain(ibzemployeedto))); return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.save(ibzemployeeMapping.toDomain(ibzemployeedto)));
} }
@PreAuthorize("hasPermission(this.ibzemployeeMapping.toDomain(#ibzemployeedtos),'ibzrt-IBZEmployee-Save')")
@ApiOperation(value = "批量保存人员", tags = {"人员" }, notes = "批量保存人员") @ApiOperation(value = "批量保存人员", tags = {"人员" }, notes = "批量保存人员")
@RequestMapping(method = RequestMethod.POST, value = "/ibzemployees/savebatch") @RequestMapping(method = RequestMethod.POST, value = "/ibzemployees/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<IBZEmployeeDTO> ibzemployeedtos) { public ResponseEntity<Boolean> saveBatch(@RequestBody List<IBZEmployeeDTO> ibzemployeedtos) {
...@@ -141,6 +151,7 @@ domain.setUserid(ibzemployee_id); ...@@ -141,6 +151,7 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzrt-IBZEmployee-searchDefault-all') and hasPermission(#context,'ibzrt-IBZEmployee-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"人员" } ,notes = "获取DEFAULT") @ApiOperation(value = "获取DEFAULT", tags = {"人员" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/ibzemployees/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/ibzemployees/fetchdefault")
public ResponseEntity<List<IBZEmployeeDTO>> fetchDefault(IBZEmployeeSearchContext context) { public ResponseEntity<List<IBZEmployeeDTO>> fetchDefault(IBZEmployeeSearchContext context) {
...@@ -153,6 +164,7 @@ domain.setUserid(ibzemployee_id); ...@@ -153,6 +164,7 @@ domain.setUserid(ibzemployee_id);
.body(list); .body(list);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzrt-IBZEmployee-searchDefault-all') and hasPermission(#context,'ibzrt-IBZEmployee-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"人员" } ,notes = "查询DEFAULT") @ApiOperation(value = "查询DEFAULT", tags = {"人员" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/ibzemployees/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/ibzemployees/searchdefault")
public ResponseEntity<Page<IBZEmployeeDTO>> searchDefault(@RequestBody IBZEmployeeSearchContext context) { public ResponseEntity<Page<IBZEmployeeDTO>> searchDefault(@RequestBody IBZEmployeeSearchContext context) {
...@@ -160,9 +172,10 @@ domain.setUserid(ibzemployee_id); ...@@ -160,9 +172,10 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(ibzemployeeMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements())); .body(new PageImpl(ibzemployeeMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
} }
@PreAuthorize("hasPermission(this.ibzemployeeMapping.toDomain(#ibzemployeedto),'ibzrt-IBZEmployee-Create')")
@ApiOperation(value = "根据部门建立人员", tags = {"人员" }, notes = "根据部门建立人员") @ApiOperation(value = "根据部门建立人员", tags = {"人员" }, notes = "根据部门建立人员")
@RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees") @RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees")
@Transactional
public ResponseEntity<IBZEmployeeDTO> createByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody IBZEmployeeDTO ibzemployeedto) { public ResponseEntity<IBZEmployeeDTO> createByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody IBZEmployeeDTO ibzemployeedto) {
IBZEmployee domain = ibzemployeeMapping.toDomain(ibzemployeedto); IBZEmployee domain = ibzemployeeMapping.toDomain(ibzemployeedto);
domain.setMdeptid(ibzdepartment_id); domain.setMdeptid(ibzdepartment_id);
...@@ -171,6 +184,7 @@ domain.setUserid(ibzemployee_id); ...@@ -171,6 +184,7 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasPermission(this.ibzemployeeMapping.toDomain(#ibzemployeedtos),'ibzrt-IBZEmployee-Create')")
@ApiOperation(value = "根据部门批量建立人员", tags = {"人员" }, notes = "根据部门批量建立人员") @ApiOperation(value = "根据部门批量建立人员", tags = {"人员" }, notes = "根据部门批量建立人员")
@RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/batch") @RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/batch")
public ResponseEntity<Boolean> createBatchByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody List<IBZEmployeeDTO> ibzemployeedtos) { public ResponseEntity<Boolean> createBatchByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody List<IBZEmployeeDTO> ibzemployeedtos) {
...@@ -183,9 +197,10 @@ domain.setUserid(ibzemployee_id); ...@@ -183,9 +197,10 @@ domain.setUserid(ibzemployee_id);
} }
@VersionCheck(entity = "ibzemployee" , versionfield = "updatedate") @VersionCheck(entity = "ibzemployee" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.ibzemployeeService.get(#ibzemployee_id),'ibzrt-IBZEmployee-Update')")
@ApiOperation(value = "根据部门更新人员", tags = {"人员" }, notes = "根据部门更新人员") @ApiOperation(value = "根据部门更新人员", tags = {"人员" }, notes = "根据部门更新人员")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}") @RequestMapping(method = RequestMethod.PUT, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}")
@Transactional
public ResponseEntity<IBZEmployeeDTO> updateByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZEmployeeDTO ibzemployeedto) { public ResponseEntity<IBZEmployeeDTO> updateByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZEmployeeDTO ibzemployeedto) {
IBZEmployee domain = ibzemployeeMapping.toDomain(ibzemployeedto); IBZEmployee domain = ibzemployeeMapping.toDomain(ibzemployeedto);
domain.setMdeptid(ibzdepartment_id); domain.setMdeptid(ibzdepartment_id);
...@@ -195,6 +210,7 @@ domain.setUserid(ibzemployee_id); ...@@ -195,6 +210,7 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasPermission(this.ibzemployeeService.getIbzemployeeByEntities(this.ibzemployeeMapping.toDomain(#ibzemployeedtos)),'ibzrt-IBZEmployee-Update')")
@ApiOperation(value = "根据部门批量更新人员", tags = {"人员" }, notes = "根据部门批量更新人员") @ApiOperation(value = "根据部门批量更新人员", tags = {"人员" }, notes = "根据部门批量更新人员")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/batch") @RequestMapping(method = RequestMethod.PUT, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/batch")
public ResponseEntity<Boolean> updateBatchByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody List<IBZEmployeeDTO> ibzemployeedtos) { public ResponseEntity<Boolean> updateBatchByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody List<IBZEmployeeDTO> ibzemployeedtos) {
...@@ -206,13 +222,15 @@ domain.setUserid(ibzemployee_id); ...@@ -206,13 +222,15 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasPermission(this.ibzemployeeService.get(#ibzemployee_id),'ibzrt-IBZEmployee-Remove')")
@ApiOperation(value = "根据部门删除人员", tags = {"人员" }, notes = "根据部门删除人员") @ApiOperation(value = "根据部门删除人员", tags = {"人员" }, notes = "根据部门删除人员")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}") @RequestMapping(method = RequestMethod.DELETE, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}")
@Transactional
public ResponseEntity<Boolean> removeByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id) { public ResponseEntity<Boolean> removeByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id) {
return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.remove(ibzemployee_id)); return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.remove(ibzemployee_id));
} }
@PreAuthorize("hasPermission(this.ibzemployeeService.getIbzemployeeByIds(#ids),'ibzrt-IBZEmployee-Remove')")
@ApiOperation(value = "根据部门批量删除人员", tags = {"人员" }, notes = "根据部门批量删除人员") @ApiOperation(value = "根据部门批量删除人员", tags = {"人员" }, notes = "根据部门批量删除人员")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/batch") @RequestMapping(method = RequestMethod.DELETE, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/batch")
public ResponseEntity<Boolean> removeBatchByIBZDepartment(@RequestBody List<String> ids) { public ResponseEntity<Boolean> removeBatchByIBZDepartment(@RequestBody List<String> ids) {
...@@ -220,6 +238,7 @@ domain.setUserid(ibzemployee_id); ...@@ -220,6 +238,7 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PostAuthorize("hasPermission(this.ibzemployeeMapping.toDomain(returnObject.body),'ibzrt-IBZEmployee-Get')")
@ApiOperation(value = "根据部门获取人员", tags = {"人员" }, notes = "根据部门获取人员") @ApiOperation(value = "根据部门获取人员", tags = {"人员" }, notes = "根据部门获取人员")
@RequestMapping(method = RequestMethod.GET, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}") @RequestMapping(method = RequestMethod.GET, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}")
public ResponseEntity<IBZEmployeeDTO> getByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id) { public ResponseEntity<IBZEmployeeDTO> getByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id) {
...@@ -242,9 +261,10 @@ domain.setUserid(ibzemployee_id); ...@@ -242,9 +261,10 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.checkKey(ibzemployeeMapping.toDomain(ibzemployeedto))); return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.checkKey(ibzemployeeMapping.toDomain(ibzemployeedto)));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzrt-IBZEmployee-InitPwd-all')")
@ApiOperation(value = "根据部门人员", tags = {"人员" }, notes = "根据部门人员") @ApiOperation(value = "根据部门人员", tags = {"人员" }, notes = "根据部门人员")
@RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}/initpwd") @RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}/initpwd")
@Transactional
public ResponseEntity<IBZEmployeeDTO> initPwdByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZEmployeeDTO ibzemployeedto) { public ResponseEntity<IBZEmployeeDTO> initPwdByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZEmployeeDTO ibzemployeedto) {
IBZEmployee domain = ibzemployeeMapping.toDomain(ibzemployeedto); IBZEmployee domain = ibzemployeeMapping.toDomain(ibzemployeedto);
domain.setMdeptid(ibzdepartment_id); domain.setMdeptid(ibzdepartment_id);
...@@ -253,6 +273,7 @@ domain.setUserid(ibzemployee_id); ...@@ -253,6 +273,7 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK).body(ibzemployeedto); return ResponseEntity.status(HttpStatus.OK).body(ibzemployeedto);
} }
@PreAuthorize("hasPermission(this.ibzemployeeMapping.toDomain(#ibzemployeedto),'ibzrt-IBZEmployee-Save')")
@ApiOperation(value = "根据部门保存人员", tags = {"人员" }, notes = "根据部门保存人员") @ApiOperation(value = "根据部门保存人员", tags = {"人员" }, notes = "根据部门保存人员")
@RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/save") @RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/save")
public ResponseEntity<Boolean> saveByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody IBZEmployeeDTO ibzemployeedto) { public ResponseEntity<Boolean> saveByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody IBZEmployeeDTO ibzemployeedto) {
...@@ -261,6 +282,7 @@ domain.setUserid(ibzemployee_id); ...@@ -261,6 +282,7 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.save(domain)); return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.save(domain));
} }
@PreAuthorize("hasPermission(this.ibzemployeeMapping.toDomain(#ibzemployeedtos),'ibzrt-IBZEmployee-Save')")
@ApiOperation(value = "根据部门批量保存人员", tags = {"人员" }, notes = "根据部门批量保存人员") @ApiOperation(value = "根据部门批量保存人员", tags = {"人员" }, notes = "根据部门批量保存人员")
@RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/savebatch") @RequestMapping(method = RequestMethod.POST, value = "/ibzdepartments/{ibzdepartment_id}/ibzemployees/savebatch")
public ResponseEntity<Boolean> saveBatchByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody List<IBZEmployeeDTO> ibzemployeedtos) { public ResponseEntity<Boolean> saveBatchByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody List<IBZEmployeeDTO> ibzemployeedtos) {
...@@ -272,6 +294,7 @@ domain.setUserid(ibzemployee_id); ...@@ -272,6 +294,7 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzrt-IBZEmployee-searchDefault-all') and hasPermission(#context,'ibzrt-IBZEmployee-Get')")
@ApiOperation(value = "根据部门获取DEFAULT", tags = {"人员" } ,notes = "根据部门获取DEFAULT") @ApiOperation(value = "根据部门获取DEFAULT", tags = {"人员" } ,notes = "根据部门获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/ibzdepartments/{ibzdepartment_id}/ibzemployees/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/ibzdepartments/{ibzdepartment_id}/ibzemployees/fetchdefault")
public ResponseEntity<List<IBZEmployeeDTO>> fetchIBZEmployeeDefaultByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id,IBZEmployeeSearchContext context) { public ResponseEntity<List<IBZEmployeeDTO>> fetchIBZEmployeeDefaultByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id,IBZEmployeeSearchContext context) {
...@@ -285,6 +308,7 @@ domain.setUserid(ibzemployee_id); ...@@ -285,6 +308,7 @@ domain.setUserid(ibzemployee_id);
.body(list); .body(list);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzrt-IBZEmployee-searchDefault-all') and hasPermission(#context,'ibzrt-IBZEmployee-Get')")
@ApiOperation(value = "根据部门查询DEFAULT", tags = {"人员" } ,notes = "根据部门查询DEFAULT") @ApiOperation(value = "根据部门查询DEFAULT", tags = {"人员" } ,notes = "根据部门查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/ibzdepartments/{ibzdepartment_id}/ibzemployees/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/ibzdepartments/{ibzdepartment_id}/ibzemployees/searchdefault")
public ResponseEntity<Page<IBZEmployeeDTO>> searchIBZEmployeeDefaultByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody IBZEmployeeSearchContext context) { public ResponseEntity<Page<IBZEmployeeDTO>> searchIBZEmployeeDefaultByIBZDepartment(@PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody IBZEmployeeSearchContext context) {
...@@ -293,9 +317,10 @@ domain.setUserid(ibzemployee_id); ...@@ -293,9 +317,10 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(ibzemployeeMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements())); .body(new PageImpl(ibzemployeeMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
} }
@PreAuthorize("hasPermission(this.ibzemployeeMapping.toDomain(#ibzemployeedto),'ibzrt-IBZEmployee-Create')")
@ApiOperation(value = "根据单位机构建立人员", tags = {"人员" }, notes = "根据单位机构建立人员") @ApiOperation(value = "根据单位机构建立人员", tags = {"人员" }, notes = "根据单位机构建立人员")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees") @RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees")
@Transactional
public ResponseEntity<IBZEmployeeDTO> createByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @RequestBody IBZEmployeeDTO ibzemployeedto) { public ResponseEntity<IBZEmployeeDTO> createByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @RequestBody IBZEmployeeDTO ibzemployeedto) {
IBZEmployee domain = ibzemployeeMapping.toDomain(ibzemployeedto); IBZEmployee domain = ibzemployeeMapping.toDomain(ibzemployeedto);
domain.setOrgid(ibzorganization_id); domain.setOrgid(ibzorganization_id);
...@@ -304,6 +329,7 @@ domain.setUserid(ibzemployee_id); ...@@ -304,6 +329,7 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasPermission(this.ibzemployeeMapping.toDomain(#ibzemployeedtos),'ibzrt-IBZEmployee-Create')")
@ApiOperation(value = "根据单位机构批量建立人员", tags = {"人员" }, notes = "根据单位机构批量建立人员") @ApiOperation(value = "根据单位机构批量建立人员", tags = {"人员" }, notes = "根据单位机构批量建立人员")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/batch") @RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/batch")
public ResponseEntity<Boolean> createBatchByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @RequestBody List<IBZEmployeeDTO> ibzemployeedtos) { public ResponseEntity<Boolean> createBatchByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @RequestBody List<IBZEmployeeDTO> ibzemployeedtos) {
...@@ -316,9 +342,10 @@ domain.setUserid(ibzemployee_id); ...@@ -316,9 +342,10 @@ domain.setUserid(ibzemployee_id);
} }
@VersionCheck(entity = "ibzemployee" , versionfield = "updatedate") @VersionCheck(entity = "ibzemployee" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.ibzemployeeService.get(#ibzemployee_id),'ibzrt-IBZEmployee-Update')")
@ApiOperation(value = "根据单位机构更新人员", tags = {"人员" }, notes = "根据单位机构更新人员") @ApiOperation(value = "根据单位机构更新人员", tags = {"人员" }, notes = "根据单位机构更新人员")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployee_id}") @RequestMapping(method = RequestMethod.PUT, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployee_id}")
@Transactional
public ResponseEntity<IBZEmployeeDTO> updateByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZEmployeeDTO ibzemployeedto) { public ResponseEntity<IBZEmployeeDTO> updateByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZEmployeeDTO ibzemployeedto) {
IBZEmployee domain = ibzemployeeMapping.toDomain(ibzemployeedto); IBZEmployee domain = ibzemployeeMapping.toDomain(ibzemployeedto);
domain.setOrgid(ibzorganization_id); domain.setOrgid(ibzorganization_id);
...@@ -328,6 +355,7 @@ domain.setUserid(ibzemployee_id); ...@@ -328,6 +355,7 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasPermission(this.ibzemployeeService.getIbzemployeeByEntities(this.ibzemployeeMapping.toDomain(#ibzemployeedtos)),'ibzrt-IBZEmployee-Update')")
@ApiOperation(value = "根据单位机构批量更新人员", tags = {"人员" }, notes = "根据单位机构批量更新人员") @ApiOperation(value = "根据单位机构批量更新人员", tags = {"人员" }, notes = "根据单位机构批量更新人员")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/batch") @RequestMapping(method = RequestMethod.PUT, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/batch")
public ResponseEntity<Boolean> updateBatchByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @RequestBody List<IBZEmployeeDTO> ibzemployeedtos) { public ResponseEntity<Boolean> updateBatchByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @RequestBody List<IBZEmployeeDTO> ibzemployeedtos) {
...@@ -339,13 +367,15 @@ domain.setUserid(ibzemployee_id); ...@@ -339,13 +367,15 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasPermission(this.ibzemployeeService.get(#ibzemployee_id),'ibzrt-IBZEmployee-Remove')")
@ApiOperation(value = "根据单位机构删除人员", tags = {"人员" }, notes = "根据单位机构删除人员") @ApiOperation(value = "根据单位机构删除人员", tags = {"人员" }, notes = "根据单位机构删除人员")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployee_id}") @RequestMapping(method = RequestMethod.DELETE, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployee_id}")
@Transactional
public ResponseEntity<Boolean> removeByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzemployee_id") String ibzemployee_id) { public ResponseEntity<Boolean> removeByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzemployee_id") String ibzemployee_id) {
return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.remove(ibzemployee_id)); return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.remove(ibzemployee_id));
} }
@PreAuthorize("hasPermission(this.ibzemployeeService.getIbzemployeeByIds(#ids),'ibzrt-IBZEmployee-Remove')")
@ApiOperation(value = "根据单位机构批量删除人员", tags = {"人员" }, notes = "根据单位机构批量删除人员") @ApiOperation(value = "根据单位机构批量删除人员", tags = {"人员" }, notes = "根据单位机构批量删除人员")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/batch") @RequestMapping(method = RequestMethod.DELETE, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/batch")
public ResponseEntity<Boolean> removeBatchByIBZOrganization(@RequestBody List<String> ids) { public ResponseEntity<Boolean> removeBatchByIBZOrganization(@RequestBody List<String> ids) {
...@@ -353,6 +383,7 @@ domain.setUserid(ibzemployee_id); ...@@ -353,6 +383,7 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PostAuthorize("hasPermission(this.ibzemployeeMapping.toDomain(returnObject.body),'ibzrt-IBZEmployee-Get')")
@ApiOperation(value = "根据单位机构获取人员", tags = {"人员" }, notes = "根据单位机构获取人员") @ApiOperation(value = "根据单位机构获取人员", tags = {"人员" }, notes = "根据单位机构获取人员")
@RequestMapping(method = RequestMethod.GET, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployee_id}") @RequestMapping(method = RequestMethod.GET, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployee_id}")
public ResponseEntity<IBZEmployeeDTO> getByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzemployee_id") String ibzemployee_id) { public ResponseEntity<IBZEmployeeDTO> getByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzemployee_id") String ibzemployee_id) {
...@@ -375,9 +406,10 @@ domain.setUserid(ibzemployee_id); ...@@ -375,9 +406,10 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.checkKey(ibzemployeeMapping.toDomain(ibzemployeedto))); return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.checkKey(ibzemployeeMapping.toDomain(ibzemployeedto)));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzrt-IBZEmployee-InitPwd-all')")
@ApiOperation(value = "根据单位机构人员", tags = {"人员" }, notes = "根据单位机构人员") @ApiOperation(value = "根据单位机构人员", tags = {"人员" }, notes = "根据单位机构人员")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployee_id}/initpwd") @RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/{ibzemployee_id}/initpwd")
@Transactional
public ResponseEntity<IBZEmployeeDTO> initPwdByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZEmployeeDTO ibzemployeedto) { public ResponseEntity<IBZEmployeeDTO> initPwdByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZEmployeeDTO ibzemployeedto) {
IBZEmployee domain = ibzemployeeMapping.toDomain(ibzemployeedto); IBZEmployee domain = ibzemployeeMapping.toDomain(ibzemployeedto);
domain.setOrgid(ibzorganization_id); domain.setOrgid(ibzorganization_id);
...@@ -386,6 +418,7 @@ domain.setUserid(ibzemployee_id); ...@@ -386,6 +418,7 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK).body(ibzemployeedto); return ResponseEntity.status(HttpStatus.OK).body(ibzemployeedto);
} }
@PreAuthorize("hasPermission(this.ibzemployeeMapping.toDomain(#ibzemployeedto),'ibzrt-IBZEmployee-Save')")
@ApiOperation(value = "根据单位机构保存人员", tags = {"人员" }, notes = "根据单位机构保存人员") @ApiOperation(value = "根据单位机构保存人员", tags = {"人员" }, notes = "根据单位机构保存人员")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/save") @RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/save")
public ResponseEntity<Boolean> saveByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @RequestBody IBZEmployeeDTO ibzemployeedto) { public ResponseEntity<Boolean> saveByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @RequestBody IBZEmployeeDTO ibzemployeedto) {
...@@ -394,6 +427,7 @@ domain.setUserid(ibzemployee_id); ...@@ -394,6 +427,7 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.save(domain)); return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.save(domain));
} }
@PreAuthorize("hasPermission(this.ibzemployeeMapping.toDomain(#ibzemployeedtos),'ibzrt-IBZEmployee-Save')")
@ApiOperation(value = "根据单位机构批量保存人员", tags = {"人员" }, notes = "根据单位机构批量保存人员") @ApiOperation(value = "根据单位机构批量保存人员", tags = {"人员" }, notes = "根据单位机构批量保存人员")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/savebatch") @RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzemployees/savebatch")
public ResponseEntity<Boolean> saveBatchByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @RequestBody List<IBZEmployeeDTO> ibzemployeedtos) { public ResponseEntity<Boolean> saveBatchByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @RequestBody List<IBZEmployeeDTO> ibzemployeedtos) {
...@@ -405,6 +439,7 @@ domain.setUserid(ibzemployee_id); ...@@ -405,6 +439,7 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzrt-IBZEmployee-searchDefault-all') and hasPermission(#context,'ibzrt-IBZEmployee-Get')")
@ApiOperation(value = "根据单位机构获取DEFAULT", tags = {"人员" } ,notes = "根据单位机构获取DEFAULT") @ApiOperation(value = "根据单位机构获取DEFAULT", tags = {"人员" } ,notes = "根据单位机构获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/ibzorganizations/{ibzorganization_id}/ibzemployees/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/ibzorganizations/{ibzorganization_id}/ibzemployees/fetchdefault")
public ResponseEntity<List<IBZEmployeeDTO>> fetchIBZEmployeeDefaultByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id,IBZEmployeeSearchContext context) { public ResponseEntity<List<IBZEmployeeDTO>> fetchIBZEmployeeDefaultByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id,IBZEmployeeSearchContext context) {
...@@ -418,6 +453,7 @@ domain.setUserid(ibzemployee_id); ...@@ -418,6 +453,7 @@ domain.setUserid(ibzemployee_id);
.body(list); .body(list);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzrt-IBZEmployee-searchDefault-all') and hasPermission(#context,'ibzrt-IBZEmployee-Get')")
@ApiOperation(value = "根据单位机构查询DEFAULT", tags = {"人员" } ,notes = "根据单位机构查询DEFAULT") @ApiOperation(value = "根据单位机构查询DEFAULT", tags = {"人员" } ,notes = "根据单位机构查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/ibzorganizations/{ibzorganization_id}/ibzemployees/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/ibzorganizations/{ibzorganization_id}/ibzemployees/searchdefault")
public ResponseEntity<Page<IBZEmployeeDTO>> searchIBZEmployeeDefaultByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @RequestBody IBZEmployeeSearchContext context) { public ResponseEntity<Page<IBZEmployeeDTO>> searchIBZEmployeeDefaultByIBZOrganization(@PathVariable("ibzorganization_id") String ibzorganization_id, @RequestBody IBZEmployeeSearchContext context) {
...@@ -426,9 +462,10 @@ domain.setUserid(ibzemployee_id); ...@@ -426,9 +462,10 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(ibzemployeeMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements())); .body(new PageImpl(ibzemployeeMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
} }
@PreAuthorize("hasPermission(this.ibzemployeeMapping.toDomain(#ibzemployeedto),'ibzrt-IBZEmployee-Create')")
@ApiOperation(value = "根据单位机构部门建立人员", tags = {"人员" }, notes = "根据单位机构部门建立人员") @ApiOperation(value = "根据单位机构部门建立人员", tags = {"人员" }, notes = "根据单位机构部门建立人员")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees") @RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees")
@Transactional
public ResponseEntity<IBZEmployeeDTO> createByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody IBZEmployeeDTO ibzemployeedto) { public ResponseEntity<IBZEmployeeDTO> createByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody IBZEmployeeDTO ibzemployeedto) {
IBZEmployee domain = ibzemployeeMapping.toDomain(ibzemployeedto); IBZEmployee domain = ibzemployeeMapping.toDomain(ibzemployeedto);
domain.setMdeptid(ibzdepartment_id); domain.setMdeptid(ibzdepartment_id);
...@@ -437,6 +474,7 @@ domain.setUserid(ibzemployee_id); ...@@ -437,6 +474,7 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasPermission(this.ibzemployeeMapping.toDomain(#ibzemployeedtos),'ibzrt-IBZEmployee-Create')")
@ApiOperation(value = "根据单位机构部门批量建立人员", tags = {"人员" }, notes = "根据单位机构部门批量建立人员") @ApiOperation(value = "根据单位机构部门批量建立人员", tags = {"人员" }, notes = "根据单位机构部门批量建立人员")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/batch") @RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/batch")
public ResponseEntity<Boolean> createBatchByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody List<IBZEmployeeDTO> ibzemployeedtos) { public ResponseEntity<Boolean> createBatchByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody List<IBZEmployeeDTO> ibzemployeedtos) {
...@@ -449,9 +487,10 @@ domain.setUserid(ibzemployee_id); ...@@ -449,9 +487,10 @@ domain.setUserid(ibzemployee_id);
} }
@VersionCheck(entity = "ibzemployee" , versionfield = "updatedate") @VersionCheck(entity = "ibzemployee" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.ibzemployeeService.get(#ibzemployee_id),'ibzrt-IBZEmployee-Update')")
@ApiOperation(value = "根据单位机构部门更新人员", tags = {"人员" }, notes = "根据单位机构部门更新人员") @ApiOperation(value = "根据单位机构部门更新人员", tags = {"人员" }, notes = "根据单位机构部门更新人员")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}") @RequestMapping(method = RequestMethod.PUT, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}")
@Transactional
public ResponseEntity<IBZEmployeeDTO> updateByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZEmployeeDTO ibzemployeedto) { public ResponseEntity<IBZEmployeeDTO> updateByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZEmployeeDTO ibzemployeedto) {
IBZEmployee domain = ibzemployeeMapping.toDomain(ibzemployeedto); IBZEmployee domain = ibzemployeeMapping.toDomain(ibzemployeedto);
domain.setMdeptid(ibzdepartment_id); domain.setMdeptid(ibzdepartment_id);
...@@ -461,6 +500,7 @@ domain.setUserid(ibzemployee_id); ...@@ -461,6 +500,7 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasPermission(this.ibzemployeeService.getIbzemployeeByEntities(this.ibzemployeeMapping.toDomain(#ibzemployeedtos)),'ibzrt-IBZEmployee-Update')")
@ApiOperation(value = "根据单位机构部门批量更新人员", tags = {"人员" }, notes = "根据单位机构部门批量更新人员") @ApiOperation(value = "根据单位机构部门批量更新人员", tags = {"人员" }, notes = "根据单位机构部门批量更新人员")
@RequestMapping(method = RequestMethod.PUT, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/batch") @RequestMapping(method = RequestMethod.PUT, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/batch")
public ResponseEntity<Boolean> updateBatchByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody List<IBZEmployeeDTO> ibzemployeedtos) { public ResponseEntity<Boolean> updateBatchByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody List<IBZEmployeeDTO> ibzemployeedtos) {
...@@ -472,13 +512,15 @@ domain.setUserid(ibzemployee_id); ...@@ -472,13 +512,15 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasPermission(this.ibzemployeeService.get(#ibzemployee_id),'ibzrt-IBZEmployee-Remove')")
@ApiOperation(value = "根据单位机构部门删除人员", tags = {"人员" }, notes = "根据单位机构部门删除人员") @ApiOperation(value = "根据单位机构部门删除人员", tags = {"人员" }, notes = "根据单位机构部门删除人员")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}") @RequestMapping(method = RequestMethod.DELETE, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}")
@Transactional
public ResponseEntity<Boolean> removeByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id) { public ResponseEntity<Boolean> removeByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id) {
return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.remove(ibzemployee_id)); return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.remove(ibzemployee_id));
} }
@PreAuthorize("hasPermission(this.ibzemployeeService.getIbzemployeeByIds(#ids),'ibzrt-IBZEmployee-Remove')")
@ApiOperation(value = "根据单位机构部门批量删除人员", tags = {"人员" }, notes = "根据单位机构部门批量删除人员") @ApiOperation(value = "根据单位机构部门批量删除人员", tags = {"人员" }, notes = "根据单位机构部门批量删除人员")
@RequestMapping(method = RequestMethod.DELETE, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/batch") @RequestMapping(method = RequestMethod.DELETE, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/batch")
public ResponseEntity<Boolean> removeBatchByIBZOrganizationIBZDepartment(@RequestBody List<String> ids) { public ResponseEntity<Boolean> removeBatchByIBZOrganizationIBZDepartment(@RequestBody List<String> ids) {
...@@ -486,6 +528,7 @@ domain.setUserid(ibzemployee_id); ...@@ -486,6 +528,7 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PostAuthorize("hasPermission(this.ibzemployeeMapping.toDomain(returnObject.body),'ibzrt-IBZEmployee-Get')")
@ApiOperation(value = "根据单位机构部门获取人员", tags = {"人员" }, notes = "根据单位机构部门获取人员") @ApiOperation(value = "根据单位机构部门获取人员", tags = {"人员" }, notes = "根据单位机构部门获取人员")
@RequestMapping(method = RequestMethod.GET, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}") @RequestMapping(method = RequestMethod.GET, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}")
public ResponseEntity<IBZEmployeeDTO> getByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id) { public ResponseEntity<IBZEmployeeDTO> getByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id) {
...@@ -508,9 +551,10 @@ domain.setUserid(ibzemployee_id); ...@@ -508,9 +551,10 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.checkKey(ibzemployeeMapping.toDomain(ibzemployeedto))); return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.checkKey(ibzemployeeMapping.toDomain(ibzemployeedto)));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzrt-IBZEmployee-InitPwd-all')")
@ApiOperation(value = "根据单位机构部门人员", tags = {"人员" }, notes = "根据单位机构部门人员") @ApiOperation(value = "根据单位机构部门人员", tags = {"人员" }, notes = "根据单位机构部门人员")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}/initpwd") @RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/{ibzemployee_id}/initpwd")
@Transactional
public ResponseEntity<IBZEmployeeDTO> initPwdByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZEmployeeDTO ibzemployeedto) { public ResponseEntity<IBZEmployeeDTO> initPwdByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @PathVariable("ibzemployee_id") String ibzemployee_id, @RequestBody IBZEmployeeDTO ibzemployeedto) {
IBZEmployee domain = ibzemployeeMapping.toDomain(ibzemployeedto); IBZEmployee domain = ibzemployeeMapping.toDomain(ibzemployeedto);
domain.setMdeptid(ibzdepartment_id); domain.setMdeptid(ibzdepartment_id);
...@@ -519,6 +563,7 @@ domain.setUserid(ibzemployee_id); ...@@ -519,6 +563,7 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK).body(ibzemployeedto); return ResponseEntity.status(HttpStatus.OK).body(ibzemployeedto);
} }
@PreAuthorize("hasPermission(this.ibzemployeeMapping.toDomain(#ibzemployeedto),'ibzrt-IBZEmployee-Save')")
@ApiOperation(value = "根据单位机构部门保存人员", tags = {"人员" }, notes = "根据单位机构部门保存人员") @ApiOperation(value = "根据单位机构部门保存人员", tags = {"人员" }, notes = "根据单位机构部门保存人员")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/save") @RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/save")
public ResponseEntity<Boolean> saveByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody IBZEmployeeDTO ibzemployeedto) { public ResponseEntity<Boolean> saveByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody IBZEmployeeDTO ibzemployeedto) {
...@@ -527,6 +572,7 @@ domain.setUserid(ibzemployee_id); ...@@ -527,6 +572,7 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.save(domain)); return ResponseEntity.status(HttpStatus.OK).body(ibzemployeeService.save(domain));
} }
@PreAuthorize("hasPermission(this.ibzemployeeMapping.toDomain(#ibzemployeedtos),'ibzrt-IBZEmployee-Save')")
@ApiOperation(value = "根据单位机构部门批量保存人员", tags = {"人员" }, notes = "根据单位机构部门批量保存人员") @ApiOperation(value = "根据单位机构部门批量保存人员", tags = {"人员" }, notes = "根据单位机构部门批量保存人员")
@RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/savebatch") @RequestMapping(method = RequestMethod.POST, value = "/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/savebatch")
public ResponseEntity<Boolean> saveBatchByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody List<IBZEmployeeDTO> ibzemployeedtos) { public ResponseEntity<Boolean> saveBatchByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody List<IBZEmployeeDTO> ibzemployeedtos) {
...@@ -538,6 +584,7 @@ domain.setUserid(ibzemployee_id); ...@@ -538,6 +584,7 @@ domain.setUserid(ibzemployee_id);
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzrt-IBZEmployee-searchDefault-all') and hasPermission(#context,'ibzrt-IBZEmployee-Get')")
@ApiOperation(value = "根据单位机构部门获取DEFAULT", tags = {"人员" } ,notes = "根据单位机构部门获取DEFAULT") @ApiOperation(value = "根据单位机构部门获取DEFAULT", tags = {"人员" } ,notes = "根据单位机构部门获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/fetchdefault")
public ResponseEntity<List<IBZEmployeeDTO>> fetchIBZEmployeeDefaultByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id,IBZEmployeeSearchContext context) { public ResponseEntity<List<IBZEmployeeDTO>> fetchIBZEmployeeDefaultByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id,IBZEmployeeSearchContext context) {
...@@ -551,6 +598,7 @@ domain.setUserid(ibzemployee_id); ...@@ -551,6 +598,7 @@ domain.setUserid(ibzemployee_id);
.body(list); .body(list);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzrt-IBZEmployee-searchDefault-all') and hasPermission(#context,'ibzrt-IBZEmployee-Get')")
@ApiOperation(value = "根据单位机构部门查询DEFAULT", tags = {"人员" } ,notes = "根据单位机构部门查询DEFAULT") @ApiOperation(value = "根据单位机构部门查询DEFAULT", tags = {"人员" } ,notes = "根据单位机构部门查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/ibzorganizations/{ibzorganization_id}/ibzdepartments/{ibzdepartment_id}/ibzemployees/searchdefault")
public ResponseEntity<Page<IBZEmployeeDTO>> searchIBZEmployeeDefaultByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody IBZEmployeeSearchContext context) { public ResponseEntity<Page<IBZEmployeeDTO>> searchIBZEmployeeDefaultByIBZOrganizationIBZDepartment(@PathVariable("ibzorganization_id") String ibzorganization_id, @PathVariable("ibzdepartment_id") String ibzdepartment_id, @RequestBody IBZEmployeeSearchContext context) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册