Browse Source

Merge branch '84-integrate' into 'develop'

develop-20230223



See merge request !37

linwenhua 2 năm trước cách đây
mục cha
commit
1391432a23

+ 2 - 1
smsb-customer-manager-adapter/src/main/java/com/inspur/customer/web/controller/keyclaok/KeycloakController.java

@@ -63,8 +63,9 @@ public class KeycloakController {
         return Response.buildSuccess();
     }
 
-    @Scheduled(cron = "0/10 * * * * ?")
+    @Scheduled(cron = "0 0/10 * * * ?")
     public void askUserOppenId() {
+        log.info("update wechat openId");
         for (String userId : keycloakService.getUsersMap().keySet()) {
             String oppenId = iWeChatService.askUser(userId);
             if (!StringUtils.isEmpty(oppenId)) {

+ 1 - 6
smsb-customer-manager-app/src/main/java/com/inspur/customer/service/keycloak/KeycloakServiceImpl.java

@@ -54,12 +54,6 @@ public class KeycloakServiceImpl implements KeycloakService {
         log.info("users map cache clear:{}",LocalDateTime.now() );
     }
 
-    @Scheduled(cron = "* 0/10 * * * ?")
-    public void expiredCache(){
-        // 每隔10小时,清除缓存数据初始化一次
-        this.clearUserMapCache();
-    }
-
     /**
      * get users in role (xuzhou environment)
      * @param role role
@@ -459,6 +453,7 @@ public class KeycloakServiceImpl implements KeycloakService {
     }
 
     @Override
+    @Cacheable(value = "msr:user:openIds", key = "#role")
     public List<String> queryWechatByRole(String role) {
         List<String> openIds = Lists.newArrayList();
          realmResource.roles().get(role).getRoleUserMembers().forEach(user->{

+ 1 - 1
smsb-customer-manager-app/src/main/java/com/inspur/customer/service/tenant/TenantCommonAttributeServiceImpl.java

@@ -33,7 +33,7 @@ public class TenantCommonAttributeServiceImpl extends ServiceImpl<TenantCommonAt
     private SmsbDeviceService smsbDeviceService;
 
     @Override
-    @CacheEvict(value = "msr:customer:tenantCommonAttribute")
+    @CacheEvict(value = "msr:customer:tenantCommonAttribute", allEntries=true)
     public Response saveOrUpdate(TenantAttributeCO attributeCO) {
         TenantCommonAttributeDO tenantAttribute = queryOne(attributeCO.getTenant() ,attributeCO.getAttributeKey());
         if(Objects.nonNull(tenantAttribute)){