use of com.ibeiliao.deployment.admin.vo.global.ProjectEnv in project Corgi by kevinYin.
the class ProjectModuleServiceImpl method buildModuleJvms.
private List<ModuleJvm> buildModuleJvms(int moduleId) {
List<ModuleJvm> moduleJvmArgs = moduleJvmService.queryByModuleId(moduleId);
List<ProjectEnv> allEnv = projectEnvService.findAllEnv();
HashMap<Integer, ModuleJvm> envId2ModuleJvmMap = Maps.newHashMap();
for (ModuleJvm moduleJvm : moduleJvmArgs) {
envId2ModuleJvmMap.put(moduleJvm.getEnvId(), moduleJvm);
}
for (ProjectEnv env : allEnv) {
if (envId2ModuleJvmMap.get(env.getEnvId()) == null) {
ModuleJvm newModuleJvm = new ModuleJvm();
newModuleJvm.setEnvId(env.getEnvId());
newModuleJvm.setEnvName(env.getEnvName());
envId2ModuleJvmMap.put(env.getEnvId(), newModuleJvm);
}
}
return Lists.newArrayList(envId2ModuleJvmMap.values());
}
use of com.ibeiliao.deployment.admin.vo.global.ProjectEnv in project Corgi by kevinYin.
the class ViewModuleController method buildModuleJvms.
private List<ModuleJvm> buildModuleJvms(List<ProjectEnv> allEnv) {
List<ModuleJvm> moduleJvmArgses = Lists.newArrayList();
if (CollectionUtils.isNotEmpty(allEnv)) {
for (ProjectEnv env : allEnv) {
ModuleJvm moduleJvm = new ModuleJvm();
moduleJvm.setEnvId(env.getEnvId());
moduleJvm.setEnvName(env.getEnvName());
moduleJvmArgses.add(moduleJvm);
}
}
return moduleJvmArgses;
}
use of com.ibeiliao.deployment.admin.vo.global.ProjectEnv in project Corgi by kevinYin.
the class ViewProjectController method projectDetail.
/**
* 查看项目详情
*/
@RequestMapping("projectDetail")
@ResponseBody
@MenuResource("项目详情")
public RestResult projectDetail(int projectId) {
Project project = projectService.getProject(projectId);
GlobalSetting globalSetting = globalSettingService.getGlobalSetting();
ProjectDetailInfo projectDetailInfo = new ProjectDetailInfo();
projectDetailInfo.setProject(project);
projectDetailInfo.setGlobalSetting(globalSetting);
List<ProjectEnv> allEnv = projectEnvService.findAllEnv();
projectDetailInfo.setProjectEnvs(allEnv);
List<ProjectModule> modules = projectModuleService.getByProjectId(projectId);
fillServerGroupIntoModule(modules);
fillJvmArgsIntoModule(modules);
projectDetailInfo.setModules(modules);
return new RestResult<>(projectDetailInfo);
}
use of com.ibeiliao.deployment.admin.vo.global.ProjectEnv 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;
}
use of com.ibeiliao.deployment.admin.vo.global.ProjectEnv in project Corgi by kevinYin.
the class DeployHistoryServiceImpl method checkIfDeployingModuleWithEnv.
private void checkIfDeployingModuleWithEnv(DeploymentOrder order) {
// 如果 module 正在 env 发布,不能再创建发布
if (moduleStatusManagementService.isModuleDeploying(order.getModuleId(), order.getEnvId())) {
ProjectModule module = projectModuleService.getByModuleId(order.getModuleId());
ProjectEnv env = projectEnvService.getById(order.getEnvId());
throw new IllegalStateException("模块 [" + module.getModuleName() + "] 正在 [" + env.getEnvName() + "] 环境发布,必须等待当前的发布结束才可以发布");
}
}
Aggregations