use of com.ibeiliao.deployment.admin.po.deploy.ServerDeployHistoryPO in project Corgi by kevinYin.
the class DeployHistoryServiceImpl method getByServerDeployHistoryId.
@Override
public DeployHistory getByServerDeployHistoryId(int serverDeployHistoryId) {
ServerDeployHistoryPO po = serverDeployHistoryDao.get(serverDeployHistoryId);
DeployHistory history = null;
if (po != null) {
DeployHistoryPO deployPo = deployHistoryDao.get(po.getHistoryId());
history = new DeployHistory();
VOUtil.copy(deployPo, history);
}
return history;
}
use of com.ibeiliao.deployment.admin.po.deploy.ServerDeployHistoryPO in project Corgi by kevinYin.
the class DeployHistoryServiceImpl method createAndSaveRestart.
private DeployHistoryPO createAndSaveRestart(long accountId, String title, int serverId) {
Server server = serverService.getById(serverId);
AdminAccount account = adminAccountService.getById(accountId);
Assert.notNull(server, "服务器不存在");
Assert.notNull(account, "管理员不存在");
ServerGroup serverGroup = serverGroupService.getById(server.getGroupId());
ProjectModule module = projectModuleService.getByModuleId(serverGroup.getModuleId());
DeployHistoryPO po = new DeployHistoryPO();
po.setTagName("");
po.setAccountId(accountId);
po.setAuditorId(0);
po.setTitle(title);
po.setCreateTime(new Date());
po.setDeployStatus(DeployStatus.WAITING_FOR_DEPLOYMENT.getValue());
po.setAuditTime(po.getCreateTime());
po.setDeployServers(1);
po.setProjectId(module.getProjectId());
po.setModuleId(module.getModuleId());
po.setModuleName(module.getModuleName());
po.setVersionNo("");
po.setIsRestart(Constants.TRUE);
po.setEnvId(serverGroup.getEnvId());
po.setRealName(account.getRealname());
deployHistoryDao.insert(po);
ServerDeployHistoryPO serverDeployHistoryPO = new ServerDeployHistoryPO();
serverDeployHistoryPO.setHistoryId(po.getHistoryId());
serverDeployHistoryPO.setServerId(serverId);
serverDeployHistoryPO.setServerName(server.getServerName());
serverDeployHistoryPO.setServerIp(server.getIp());
serverDeployHistoryPO.setDeployStatus(ServerDeployResult.WAITING_FOR_DEPLOYMENT.getValue());
serverDeployHistoryDao.insert(serverDeployHistoryPO);
return deployHistoryDao.get(po.getHistoryId());
}
Aggregations