|
|
|
@ -1,5 +1,7 @@
|
|
|
|
|
package com.docus.server.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.docus.core.util.ListUtils;
|
|
|
|
|
import com.docus.core.util.property.Setters;
|
|
|
|
|
import com.docus.infrastructure.web.request.SearchDTO;
|
|
|
|
|
import com.docus.infrastructure.web.response.PageResult;
|
|
|
|
|
import com.docus.server.convert.SchCollectorVersionLogConvert;
|
|
|
|
@ -7,12 +9,17 @@ import com.docus.server.dto.scheduling.management.schcollectorversionlog.AddSchC
|
|
|
|
|
import com.docus.server.dto.scheduling.management.schcollectorversionlog.DeleteSchCollectorVersionLogDTO;
|
|
|
|
|
import com.docus.server.dto.scheduling.management.schcollectorversionlog.EditSchCollectorVersionLogDTO;
|
|
|
|
|
import com.docus.server.entity.scheduling.management.SchCollectorVersionLog;
|
|
|
|
|
import com.docus.server.entity.scheduling.management.SchSystemParams;
|
|
|
|
|
import com.docus.server.infrastructure.dao.ISchCollectorVersionLogDao;
|
|
|
|
|
import com.docus.server.infrastructure.dao.ISchSystemParamsDao;
|
|
|
|
|
import com.docus.server.service.ISchCollectorVersionLogService;
|
|
|
|
|
import com.docus.server.vo.scheduling.management.schcollectorversionlog.SchCollectorVersionLogVO;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 采集器版本更新日志管理 服务实现类
|
|
|
|
@ -24,6 +31,8 @@ import javax.annotation.Resource;
|
|
|
|
|
public class SchCollectorVersionLogServiceImpl implements ISchCollectorVersionLogService {
|
|
|
|
|
@Resource
|
|
|
|
|
private ISchCollectorVersionLogDao iSchCollectorVersionLogDao;
|
|
|
|
|
@Resource
|
|
|
|
|
private ISchSystemParamsDao iSchSystemParamsDao;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 按主键查询
|
|
|
|
@ -44,7 +53,23 @@ public class SchCollectorVersionLogServiceImpl implements ISchCollectorVersionLo
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public PageResult<SchCollectorVersionLogVO> search(SearchDTO searchDTO) {
|
|
|
|
|
return SchCollectorVersionLogConvert.INSTANCE.convertVO(iSchCollectorVersionLogDao.search(searchDTO));
|
|
|
|
|
PageResult<SchCollectorVersionLogVO> result = SchCollectorVersionLogConvert.INSTANCE.convertVO(iSchCollectorVersionLogDao.search(searchDTO));
|
|
|
|
|
|
|
|
|
|
if (CollectionUtils.isEmpty(result.getList())) {
|
|
|
|
|
return new PageResult<>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<SchSystemParams> schSystemParams = iSchSystemParamsDao.findBy("paramValue", ListUtils.distinctSelect(result.getList(), SchCollectorVersionLogVO::getCollectorId));
|
|
|
|
|
Map<String, SchSystemParams> taskConfigRetryLogMap = ListUtils.toMap(schSystemParams, SchSystemParams::getParamValue);
|
|
|
|
|
|
|
|
|
|
Setters.<SchCollectorVersionLogVO>instance().list(result.getList()).cycleSetProperties(p -> {
|
|
|
|
|
String collectorId = String.valueOf(p.getCollectorId());
|
|
|
|
|
if (taskConfigRetryLogMap.containsKey(collectorId)) {
|
|
|
|
|
p.setCollectorName(taskConfigRetryLogMap.get(collectorId).getParamName());
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|