组织架构新增定时任务

This commit is contained in:
zhangchenbiao
2023-06-14 16:21:55 +08:00
parent 4596b69e68
commit a643859dc2
10 changed files with 132 additions and 5 deletions

View File

@@ -0,0 +1,32 @@
package com.cool.store.job;
import com.cool.store.service.EnterpriseSyncService;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* @author zhangchenbiao
* @FileName: JobHandler
* @Description:
* @date 2023-06-14 16:07
*/
@Slf4j
@Service
public class JobHandler {
@Resource
private EnterpriseSyncService enterpriseSyncService;
@XxlJob("syncOrganization")
public void syncOrganization(){
log.info("组织架构定时同步开始");
enterpriseSyncService.syncAll();
log.info("组织架构同步结束");
XxlJobHelper.handleSuccess();
}
}

View File

@@ -26,6 +26,7 @@ public class MenuServiceImpl implements MenuService {
@Override
public List<MenuTreeVO> getUserMenus(String userId, String roleId) {
List<SysMenuDO> menuList= sysMenuDAO.selectMenuAll(null, PlatFormTypeEnum.PC.getCode());
//根据角色获取菜单
return MenuTreeVO.dealMenuTree(CommonConstants.ZERO_LONG, menuList);
}
}