use of com.dtstack.taier.dao.domain.BatchFunction in project Taier by DTStack.
the class BatchFunctionService method init.
/**
* 启动服务时,就初始化系统函数到缓存中
*/
@PostConstruct
public void init() {
Map<String, BatchFunction> batchFunctionMap = systemFunctions.getIfPresent(SYSTEM_FUNCTIONS);
if (batchFunctionMap == null || batchFunctionMap.size() == 0) {
List<BatchFunction> listSystemFunction = developFunctionDao.listSystemFunction(null);
batchFunctionMap = Maps.newConcurrentMap();
for (BatchFunction systemFunction : listSystemFunction) {
batchFunctionMap.put(systemFunction.getName(), systemFunction);
}
systemFunctions.put(SYSTEM_FUNCTIONS, batchFunctionMap);
}
systemFunctions.put(SYSTEM_FUNCTIONS, batchFunctionMap);
}
use of com.dtstack.taier.dao.domain.BatchFunction in project Taier by DTStack.
the class BatchFunctionService method getFunction.
/**
* 根据id获取函数
* @param functionId
* @return
*/
public BatchFunctionVO getFunction(Long functionId) {
BatchFunction batchFunction = developFunctionDao.getOne(functionId);
if (Objects.isNull(batchFunction)) {
return new BatchFunctionVO();
}
BatchFunctionVO vo = BatchFunctionVO.toVO(batchFunction);
// 如果函数有资源,则设置函数的资源
BatchFunctionResource resourceFunctionByFunctionId = batchFunctionResourceService.getResourceFunctionByFunctionId(batchFunction.getId());
if (Objects.nonNull(resourceFunctionByFunctionId)) {
vo.setResources(resourceFunctionByFunctionId.getResourceId());
}
vo.setCreateUser(userService.getById(batchFunction.getCreateUserId()));
vo.setModifyUser(userService.getById(batchFunction.getModifyUserId()));
return vo;
}
Aggregations