Author | SHA1 | Message | Date |
---|---|---|---|
唐周平 | 7d1841454b |
Merge pull request '添加定时任务刷新缓存 因为该项目部署了两个服务 导致缓存不同步' (#12) from dev into master
Reviewed-on: http://47.92.149.153:3000/tangzp/mztb-parent/pulls/12 |
8 months ago |
yulin | 61905638f3 | 添加定时任务刷新缓存 因为该项目部署了两个服务 导致缓存不同步 | 8 months ago |
@@ -203,12 +203,18 @@ public class MztbController { | |||||
+ " SET srg_party_id = CONCAT(srg_party_id,',' ,'" + String.join(",", ptIdList) + "') where srg_id = ? ", 927515588790587392L); // 角色组填报员 | + " SET srg_party_id = CONCAT(srg_party_id,',' ,'" + String.join(",", ptIdList) + "') where srg_id = ? ", 927515588790587392L); // 角色组填报员 | ||||
} | } | ||||
// 将机构、用户信息放入缓存,或者刷新缓存 | // 将机构、用户信息放入缓存,或者刷新缓存 | ||||
PartyCache.getInstance().putList(sysPartyList); | |||||
UserCache.getInstance().putList(userList); | |||||
UserPartyCache.getInstance().putList(userPartyList); | |||||
DeptCache.getInstance().putList(deptList); | |||||
UserRoleCache.getInstance().putList(userRoleList); | |||||
UserStatuCache.getInstance().putList(userStatuList); | |||||
// PartyCache.getInstance().putList(sysPartyList); | |||||
PartyCache.getInstance().refresh(); | |||||
// UserCache.getInstance().putList(userList); | |||||
UserCache.getInstance().refresh(); | |||||
// UserPartyCache.getInstance().putList(userPartyList); | |||||
UserPartyCache.getInstance().refresh(); | |||||
// DeptCache.getInstance().putList(deptList); | |||||
DeptCache.getInstance().refresh(); | |||||
// UserRoleCache.getInstance().putList(userRoleList); | |||||
UserRoleCache.getInstance().refresh(); | |||||
// UserStatuCache.getInstance().putList(userStatuList); | |||||
UserStatuCache.getInstance().refresh(); | |||||
RoleGroupCache.getInstance().refresh(); | RoleGroupCache.getInstance().refresh(); | ||||
log.debug("机构缓存刷新完成!"); | log.debug("机构缓存刷新完成!"); | ||||
}); | }); | ||||
@@ -0,0 +1,26 @@ | |||||
package cc.smtweb.biz.mztb.web.task; | |||||
import cc.smtweb.system.bpm.util.UtilLogger; | |||||
import cc.smtweb.system.bpm.web.sys.base.job.BaseJob; | |||||
import cc.smtweb.system.bpm.web.sys.user.dept.DeptCache; | |||||
import cc.smtweb.system.bpm.web.sys.user.party.PartyCache; | |||||
import cc.smtweb.system.bpm.web.sys.user.role.group.RoleGroupCache; | |||||
import cc.smtweb.system.bpm.web.sys.user.user.UserCache; | |||||
import cc.smtweb.system.bpm.web.sys.user.user.UserPartyCache; | |||||
import cc.smtweb.system.bpm.web.sys.user.user.UserRoleCache; | |||||
import cc.smtweb.system.bpm.web.sys.user.user.UserStatuCache; | |||||
public class FlushRedisTask extends BaseJob { | |||||
@Override | |||||
protected String work() { | |||||
PartyCache.getInstance().refresh(); | |||||
UserCache.getInstance().refresh(); | |||||
UserPartyCache.getInstance().refresh(); | |||||
DeptCache.getInstance().refresh(); | |||||
UserRoleCache.getInstance().refresh(); | |||||
UserStatuCache.getInstance().refresh(); | |||||
RoleGroupCache.getInstance().refresh(); | |||||
UtilLogger.info("定时任务刷新缓存完成。。"); | |||||
return null; | |||||
} | |||||
} |