|
@@ -262,12 +262,15 @@ public class DingDingController {
|
|
|
//员工离职
|
|
|
String corpId = bizItem.getString("corp_id");
|
|
|
String unionId = actionBizData.getString("unionid");
|
|
|
- Integer companyId = companyDingdingMapper.selectById(corpId).getCompanyId();
|
|
|
- User user = userMapper.selectOne(new QueryWrapper<User>().eq("company_id", companyId).eq("dingding_unionid", unionId));
|
|
|
- if (user != null && user.getIsActive() == 1) {
|
|
|
- user.setIsActive(0);
|
|
|
- user.setInactiveDate(LocalDate.now());
|
|
|
- userMapper.updateById(user);
|
|
|
+ CompanyDingding companyDingding = companyDingdingMapper.selectById(corpId);
|
|
|
+ if (companyDingding != null) {
|
|
|
+ Integer companyId = companyDingding.getCompanyId();
|
|
|
+ User user = userMapper.selectOne(new QueryWrapper<User>().eq("company_id", companyId).eq("dingding_unionid", unionId));
|
|
|
+ if (user != null && user.getIsActive() == 1) {
|
|
|
+ user.setIsActive(0);
|
|
|
+ user.setInactiveDate(LocalDate.now());
|
|
|
+ userMapper.updateById(user);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|