REQ-3581: 用户离职
This commit is contained in:
parent
78c1ec2475
commit
b72722368e
@ -1,19 +1,21 @@
|
||||
|
||||
package cn.axzo.nanopart.ess.server.dao;
|
||||
|
||||
import cn.axzo.nanopart.ess.api.domain.OrgPerson;
|
||||
import cn.axzo.nanopart.ess.api.enums.EssPersonState;
|
||||
import cn.axzo.nanopart.ess.server.entity.EssPerson;
|
||||
import cn.axzo.nanopart.ess.server.mapper.EssPersonMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import cn.axzo.nanopart.ess.api.domain.OrgPerson;
|
||||
import cn.axzo.nanopart.ess.api.enums.EssPersonState;
|
||||
import cn.axzo.nanopart.ess.server.entity.EssPerson;
|
||||
import cn.axzo.nanopart.ess.server.mapper.EssPersonMapper;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@ -40,10 +42,10 @@ public class EssPersonDao extends ServiceImpl<EssPersonMapper, EssPerson> {
|
||||
.oneOpt();
|
||||
}
|
||||
|
||||
public void setOrgPersonState(EssPerson person, EssPersonState state) {
|
||||
public void setOrgPersonState(OrgPerson person, EssPersonState state) {
|
||||
lambdaUpdate() //
|
||||
.eq(EssPerson::getOuId, person.getOuId()) //
|
||||
.eq(EssPerson::getId, person.getId()) //
|
||||
.eq(EssPerson::getPersonId, person.getPersonId()) //
|
||||
.set(EssPerson::getState, state) //
|
||||
.update();
|
||||
}
|
||||
|
||||
@ -9,6 +9,7 @@ import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import cn.axzo.nanopart.ess.api.domain.OrgPerson;
|
||||
import cn.axzo.nanopart.ess.api.utils.YesOrNo;
|
||||
import cn.axzo.nanopart.ess.server.entity.EssSealPerson;
|
||||
import cn.axzo.nanopart.ess.server.mapper.EssSealPersonMapper;
|
||||
@ -64,4 +65,11 @@ public class EssSealPersonDao extends ServiceImpl<EssSealPersonMapper, EssSealPe
|
||||
.list();
|
||||
}
|
||||
|
||||
public void deleteByPersonIds(OrgPerson person) {
|
||||
lambdaUpdate()
|
||||
.eq(EssSealPerson::getOuId, person.getOuId())
|
||||
.eq(EssSealPerson::getPersonId, person.getPersonId())
|
||||
.remove();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -203,6 +203,7 @@ public class OrgManager {
|
||||
|
||||
public void setOrgPersonResign(EssPerson person) {
|
||||
essPersonDao.setOrgPersonState(person, EssPersonState.RESIGNED);
|
||||
essSealPersonDao.deleteByPersonIds(person);
|
||||
log.info("set person resigned: {}", person);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user