|
@@ -161,6 +161,12 @@ public class WeComUserServiceImpl implements WeComUserService {
|
|
|
staffWithUser.setIsDelete(0);
|
|
|
staffWithUser.setNewIsDelete(0);
|
|
|
staffWithUserMapper.updateByPrimaryKeySelective(staffWithUser);
|
|
|
+ Long userId = staffWithUser.getUserId();
|
|
|
+ WeComUser weComUser1 = weComUserMapper.selectByPrimaryKey(userId);
|
|
|
+ if(weComUser1.getIsDelete() == 1){
|
|
|
+ weComUser1.setIsDelete(0);
|
|
|
+ weComUserMapper.updateByPrimaryKeySelective(weComUser1);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -193,6 +199,17 @@ public class WeComUserServiceImpl implements WeComUserService {
|
|
|
staffWithUser.setDeleteTime(new Date());
|
|
|
staffWithUser.setIsDelete(1);
|
|
|
staffWithUserMapper.updateByPrimaryKeySelective(staffWithUser);
|
|
|
+ StaffWithUserExample staffWithUserExample = new StaffWithUserExample();
|
|
|
+ staffWithUserExample.createCriteria().andUserIdEqualTo(weComUser.getId()).andIsDeleteEqualTo(0);
|
|
|
+ long l = staffWithUserMapper.countByExample(staffWithUserExample);
|
|
|
+ if (l == 0) {
|
|
|
+ Long userId = staffWithUser.getUserId();
|
|
|
+ WeComUser weComUser1 = weComUserMapper.selectByPrimaryKey(userId);
|
|
|
+ if(weComUser1.getIsDelete() == 0){
|
|
|
+ weComUser1.setIsDelete(1);
|
|
|
+ weComUserMapper.updateByPrimaryKeySelective(weComUser1);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -216,6 +233,16 @@ public class WeComUserServiceImpl implements WeComUserService {
|
|
|
staffWithUser.setIsDelete(1);
|
|
|
staffWithUser.setNewIsDelete(1);
|
|
|
staffWithUserMapper.updateByPrimaryKeySelective(staffWithUser);
|
|
|
+ StaffWithUserExample staffWithUserExample = new StaffWithUserExample();
|
|
|
+ staffWithUserExample.createCriteria().andUserIdEqualTo(userId).andIsDeleteEqualTo(0);
|
|
|
+ long l = staffWithUserMapper.countByExample(staffWithUserExample);
|
|
|
+ if (l == 0) {
|
|
|
+ WeComUser weComUser1 = weComUserMapper.selectByPrimaryKey(userId);
|
|
|
+ if(weComUser1.getIsDelete() == 0){
|
|
|
+ weComUser1.setIsDelete(1);
|
|
|
+ weComUserMapper.updateByPrimaryKeySelective(weComUser1);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|