use of com.ibeiliao.deployment.admin.vo.stat.LowQualityRank in project Corgi by kevinYin.
the class DeployHistoryDaoTest method testStatLowQualityModule.
/**
* 仅测试语法,不测试逻辑
*/
@Test
public void testStatLowQualityModule() {
Date startTime = DateUtil.currentStartDate();
Date endTime = DateUtil.currentEndDate();
int[] envId = { 1 };
String envStr = StringUtils.join(envId, ",");
List<LowQualityRank> ranks = deployHistoryDao.statLowQualityModule(startTime, endTime, envStr, DeployStatus.DEPLOYED.getValue(), DeployResult.SUCCESS.getValue(), Constants.LOW_QUALITY_DEPLOY_TIMES);
assertNotNull(ranks);
}
use of com.ibeiliao.deployment.admin.vo.stat.LowQualityRank in project Corgi by kevinYin.
the class StatServiceImpl method statLowQualityModule.
private void statLowQualityModule(Date startTime, Date endTime) {
List<LowQualityRank> lowQualityRanks = deployHistoryService.statLowQualityModule(startTime, endTime);
if (lowQualityRanks.isEmpty()) {
logger.warn("没有发布数据");
return;
}
List<LowQualityRankPO> list = new ArrayList<>(lowQualityRanks.size());
for (LowQualityRank rank : lowQualityRanks) {
LowQualityRankPO po = new LowQualityRankPO();
po.setModuleId(rank.getModuleId());
po.setDeployTimes(rank.getDeployTimes());
po.setStatDate(startTime);
}
lowQualityRankDao.deleteByDate(startTime);
lowQualityRankDao.batchInsertOrUpdate(list);
}
use of com.ibeiliao.deployment.admin.vo.stat.LowQualityRank in project Corgi by kevinYin.
the class DeployHistoryServiceImpl method statLowQualityModule.
@Override
public List<LowQualityRank> statLowQualityModule(@Param("startTime") Date startTime, @Param("endTime") Date endTime) {
List<ProjectEnv> envs = projectEnvService.findAllEnv();
List<Integer> onlineEnvs = new ArrayList<>(envs.size());
for (ProjectEnv env : envs) {
if (env.getOnlineFlag() == Constants.TRUE) {
onlineEnvs.add(env.getEnvId());
}
}
if (onlineEnvs.isEmpty()) {
return Collections.emptyList();
}
String env = StringUtils.join(onlineEnvs, ",");
List<LowQualityRank> ranks = deployHistoryDao.statLowQualityModule(startTime, endTime, env, DeployStatus.DEPLOYED.getValue(), DeployResult.SUCCESS.getValue(), Constants.LOW_QUALITY_DEPLOY_TIMES);
return ranks;
}
Aggregations