|
|
@@ -57,7 +57,11 @@ public class FeishuAccountServiceImpl implements IFeishuAccountService {
|
|
|
Date now = new Date();
|
|
|
account.setCreateTime(now);
|
|
|
account.setUpdateTime(now);
|
|
|
- return feishuAccountMapper.insert(account);
|
|
|
+ int rows = feishuAccountMapper.insert(account);
|
|
|
+ if (rows > 0) {
|
|
|
+ clientPool.refreshPool(account.getCompanyUserId());
|
|
|
+ }
|
|
|
+ return rows;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -80,13 +84,27 @@ public class FeishuAccountServiceImpl implements IFeishuAccountService {
|
|
|
|
|
|
@Override
|
|
|
public int updateFeishuAccount(FeishuAccount account) {
|
|
|
+ FeishuAccount existing = account.getId() != null ? feishuAccountMapper.selectById(account.getId()) : null;
|
|
|
account.setUpdateTime(new Date());
|
|
|
- return feishuAccountMapper.update(account);
|
|
|
+ int rows = feishuAccountMapper.update(account);
|
|
|
+ if (rows > 0 && existing != null) {
|
|
|
+ clientPool.refreshPool(existing.getCompanyUserId());
|
|
|
+ Long newCompanyUserId = account.getCompanyUserId();
|
|
|
+ if (newCompanyUserId != null && !newCompanyUserId.equals(existing.getCompanyUserId())) {
|
|
|
+ clientPool.refreshPool(newCompanyUserId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rows;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public int deleteFeishuAccountById(Long id) {
|
|
|
- return feishuAccountMapper.deleteById(id);
|
|
|
+ FeishuAccount existing = feishuAccountMapper.selectById(id);
|
|
|
+ int rows = feishuAccountMapper.deleteById(id);
|
|
|
+ if (rows > 0 && existing != null) {
|
|
|
+ clientPool.refreshPool(existing.getCompanyUserId());
|
|
|
+ }
|
|
|
+ return rows;
|
|
|
}
|
|
|
|
|
|
@Override
|