use of com.orion.ops.entity.domain.ApplicationMachineDO in project orion-ops by lijiahangmax.
the class ReleaseMachineProcessor method updateAppMachineVersion.
/**
* 更新应用机器版本
*/
private void updateAppMachineVersion() {
ApplicationMachineDO update = new ApplicationMachineDO();
update.setAppId(release.getAppId());
update.setProfileId(release.getProfileId());
update.setMachineId(machine.getMachineId());
update.setReleaseId(release.getId());
update.setBuildId(release.getBuildId());
update.setBuildSeq(release.getBuildSeq());
applicationMachineDAO.updateAppVersion(update);
}
use of com.orion.ops.entity.domain.ApplicationMachineDO in project orion-ops by lijiahangmax.
the class ApplicationMachineServiceImpl method syncAppProfileMachine.
@Override
@Transactional(rollbackFor = Exception.class)
public void syncAppProfileMachine(Long appId, Long profileId, Long targetProfileId) {
// 删除
LambdaQueryWrapper<ApplicationMachineDO> deleteWrapper = new LambdaQueryWrapper<ApplicationMachineDO>().eq(ApplicationMachineDO::getAppId, appId).eq(ApplicationMachineDO::getProfileId, targetProfileId);
applicationMachineDAO.delete(deleteWrapper);
// 查询
LambdaQueryWrapper<ApplicationMachineDO> queryWrapper = new LambdaQueryWrapper<ApplicationMachineDO>().eq(ApplicationMachineDO::getAppId, appId).eq(ApplicationMachineDO::getProfileId, profileId);
List<ApplicationMachineDO> machines = applicationMachineDAO.selectList(queryWrapper);
// 新增
for (ApplicationMachineDO machine : machines) {
machine.setId(null);
machine.setProfileId(targetProfileId);
machine.setCreateTime(null);
machine.setUpdateTime(null);
applicationMachineDAO.insert(machine);
}
}
use of com.orion.ops.entity.domain.ApplicationMachineDO in project orion-ops by lijiahangmax.
the class ApplicationMachineServiceImpl method updateAppMachineReleaseId.
@Override
public void updateAppMachineReleaseId(Long appId, Long profileId, Long releaseId, List<Long> machineIdList) {
ApplicationMachineDO update = new ApplicationMachineDO();
update.setReleaseId(releaseId);
LambdaQueryWrapper<ApplicationMachineDO> wrapper = new LambdaQueryWrapper<ApplicationMachineDO>().eq(ApplicationMachineDO::getAppId, appId).eq(ApplicationMachineDO::getProfileId, profileId).in(ApplicationMachineDO::getMachineId, machineIdList);
applicationMachineDAO.update(update, wrapper);
}
use of com.orion.ops.entity.domain.ApplicationMachineDO in project orion-ops by lijiahangmax.
the class ApplicationMachineServiceImpl method copyAppMachine.
@Override
@Transactional(rollbackFor = Exception.class)
public void copyAppMachine(Long appId, Long targetAppId) {
// 查询
LambdaQueryWrapper<ApplicationMachineDO> wrapper = new LambdaQueryWrapper<ApplicationMachineDO>().eq(ApplicationMachineDO::getAppId, appId);
List<ApplicationMachineDO> machines = applicationMachineDAO.selectList(wrapper);
// 新增
for (ApplicationMachineDO machine : machines) {
machine.setId(null);
machine.setAppId(targetAppId);
machine.setCreateTime(null);
machine.setUpdateTime(null);
applicationMachineDAO.insert(machine);
}
}
use of com.orion.ops.entity.domain.ApplicationMachineDO in project orion-ops by lijiahangmax.
the class ApplicationMachineServiceImpl method configAppMachines.
@Override
@Transactional(rollbackFor = Exception.class)
public void configAppMachines(ApplicationConfigRequest request) {
Long appId = request.getAppId();
Long profileId = request.getProfileId();
List<Long> machineIdList = request.getMachineIdList();
// 检查
for (Long machineId : machineIdList) {
MachineInfoDO machine = machineInfoDAO.selectById(machineId);
Valid.notNull(machine, MessageConst.INVALID_MACHINE);
}
// 删除
SpringHolder.getBean(ApplicationMachineService.class).deleteAppMachineByAppProfileId(appId, profileId);
// 添加
for (Long machineId : machineIdList) {
ApplicationMachineDO machine = new ApplicationMachineDO();
machine.setAppId(appId);
machine.setProfileId(profileId);
machine.setMachineId(machineId);
applicationMachineDAO.insert(machine);
}
}
Aggregations