| | |
| | | |
| | | @Override |
| | | public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) { |
| | | if (contextRefreshedEvent.getApplicationContext().getParent() == null) { |
| | | Thread thread = new Thread(this::run); |
| | | thread.setUncaughtExceptionHandler(handler); |
| | | thread.start(); |
| | | } |
| | | // if (contextRefreshedEvent.getApplicationContext().getParent() == null) { |
| | | // Thread thread = new Thread(this::run); |
| | | // thread.setUncaughtExceptionHandler(handler); |
| | | // thread.start(); |
| | | // } |
| | | } |
| | | |
| | | @Autowired |
| | |
| | | @Autowired |
| | | private UmsAdminRoleRelationService umsAdminRoleRelationService; |
| | | |
| | | // @Scheduled(cron = "0 0 00 * * ?") |
| | | //@Scheduled(cron = "0 50 15 * * ?") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void run() { |
| | | log.info("开始同步任务"); |
| | | //获取全部部门code |
| | | JSONObject topObj = dingCommon.getBookAuthority(); |
| | | //顶级部门id |
| | | JSONArray deptTopArr = topObj.getJSONArray("deptVisibleScopes"); |
| | | List<UmsDepart> dingOrgList = dingCommon.getOrgInfo(deptTopArr); |
| | | |
| | | //查询数据库中的部门 |
| | | List<UmsDepart> dataOrgList = umsDepartService.list(); |
| | | Iterator<UmsDepart> removeIterOrg = dingOrgList.iterator(); |
| | |
| | | |
| | | @Override |
| | | public void run(ApplicationArguments args) throws Exception { |
| | | run(); |
| | | // run(); |
| | | } |
| | | } |