feat:删除缓存
This commit is contained in:
1 parent
934ec7168e
commit
17dd0fc6e9
3 files changed
+6
-1
No files matched your search
+2
@@ -239,4 +239,6 @@ public interface SysUserService extends IService<SysUser> {
|
||||
* @return
|
||||
*/
|
||||
List<SimpleUserListVO> listUserIdByDeptId(Long deptId, String name);
|
||||
|
||||
void deleteDiscountsCacheByUserId(Long userId);
|
||||
}
|
||||
+3
-1
@@ -61,6 +61,7 @@ import com.bsd.pjcloud.common.core.util.MsgUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.data.resolver.ParamResolver;
|
||||
import com.bsd.pjcloud.common.data.tenant.TenantContextHolder;
|
||||
import com.bsd.pjcloud.common.excel.vo.ErrorMessage;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
@@ -1069,9 +1070,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
return count > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDiscountsCacheByUserId(Long userId) {
|
||||
if (ObjectUtil.isEmpty(userId)) return;
|
||||
String pattern = CacheConstants.WALLET_USER_DISCOUNTS_LIST + "::" + userId + ":*";
|
||||
String pattern = TenantContextHolder.getTenantId() + ":" + CacheConstants.WALLET_USER_DISCOUNTS_LIST + "::" + userId + ":*";
|
||||
Set<String> keys = new HashSet<>();
|
||||
stringRedisTemplate.execute((RedisCallback<Void>) connection -> {
|
||||
Cursor<byte[]> cursor = connection.scan(
|
||||
|
||||
+1
@@ -230,6 +230,7 @@ public class SysUserTransactionServiceImpl extends ServiceImpl<SysUserTransactio
|
||||
RequestContextHolder.setRequestAttributes(requestAttributes);
|
||||
remoteWalletService.userChange(detail.getUserId(), Boolean.FALSE);
|
||||
});
|
||||
sysUserService.deleteDiscountsCacheByUserId(detail.getUserId());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
Reference in new issue
Block a user