use of com.qlangtech.tis.manage.biz.dal.pojo.ApplicationCriteria in project tis by qlangtech.
the class NormalUserApplicationFetcher method createCriteria.
private ApplicationCriteria createCriteria(CriteriaSetter setter) {
ApplicationCriteria criteria = new ApplicationCriteria();
setter.set(process(criteria.createCriteria()));
return criteria;
}
use of com.qlangtech.tis.manage.biz.dal.pojo.ApplicationCriteria in project tis by qlangtech.
the class TSearcherClusterInfoCollect method getBuAppMap.
/**
*/
public // Map<String, List<App>>
BuAppMap getBuAppMap() {
BuAppMap buAppMap = new BuAppMap();
ApplicationCriteria query = new ApplicationCriteria();
List<Application> apps = getApplicationDAO().selectByExample(query);
List<App> applist = null;
for (Application ap : apps) {
App pp = new App();
pp.setAppid(ap.getAppId());
pp.setDpt(ap.getDptName());
pp.setServiceName(ap.getProjectName());
if ((applist = buAppMap.get(pp.getBu())) == null) {
applist = new ArrayList<App>();
buAppMap.put(pp.getBu(), applist);
}
applist.add(pp);
}
return buAppMap;
}
use of com.qlangtech.tis.manage.biz.dal.pojo.ApplicationCriteria in project tis by qlangtech.
the class OfflineManager method deleteWorkflow.
// public WorkflowPojo getWorkflowConfig(String name, boolean isMaster) {
// return
// }
// public WorkflowPojo getWorkflowConfig(String name, String sha) {
// return GitUtils.$().getWorkflowSha(GitUtils.WORKFLOW_GIT_PROJECT_ID, sha,
// name);
// }
public void deleteWorkflow(int id, BasicModule action, Context context) {
WorkFlow workFlow = workflowDAOFacade.getWorkFlowDAO().selectByPrimaryKey(id);
if (workFlow == null) {
action.addErrorMessage(context, "数据库没有这条记录");
return;
}
if (workFlow.getInChange().intValue() != 0) {
action.addErrorMessage(context, "该工作流在变更中,无法删除");
return;
}
ApplicationCriteria applicationCriteria = new ApplicationCriteria();
applicationCriteria.createCriteria().andWorkFlowIdEqualTo(id);
List<Application> applications = action.getApplicationDAO().selectByExample(applicationCriteria);
if (!CollectionUtils.isEmpty(applications)) {
StringBuilder stringBuilder = new StringBuilder();
for (Application application : applications) {
stringBuilder.append(application.getProjectName()).append(", ");
}
action.addErrorMessage(context, "请先删除与该工作流相关的索引,相关索引为" + stringBuilder.toString());
return;
}
try {
GitUser user = GitUser.dft();
// delete git
GitUtils.$().deleteWorkflow(workFlow.getName(), user);
// delete db
workflowDAOFacade.getWorkFlowDAO().deleteByPrimaryKey(id);
// TODO 删除线上db的数据,发送一个http请求
action.addActionMessage(context, "工作流删除成功");
} catch (Exception e) {
action.addErrorMessage(context, "工作流删除失败");
action.addErrorMessage(context, e.getMessage());
}
}
use of com.qlangtech.tis.manage.biz.dal.pojo.ApplicationCriteria in project tis by qlangtech.
the class ApplicationDAOImpl method updateLastProcessTime.
@Override
public int updateLastProcessTime(String appname) {
if (StringUtils.isBlank(appname)) {
throw new IllegalArgumentException("param appId can not be null");
}
ApplicationCriteria criteria = new ApplicationCriteria();
criteria.createCriteria().andProjectNameEqualTo(appname);
return this.updateRecords("application.ibatorgenerated_updateLastProcessTime", criteria);
}
use of com.qlangtech.tis.manage.biz.dal.pojo.ApplicationCriteria in project tis by qlangtech.
the class CheckAppDomainExistValve method queryApplication.
public static AppDomainInfo queryApplication(HttpServletRequest request, RunContext context, final String appname, RunEnvironment runtime) {
if (true) {
ApplicationCriteria query = new ApplicationCriteria();
query.createCriteria().andProjectNameEqualTo(appname);
AppDomainInfo appDomain = null;
for (Application app : context.getApplicationDAO().selectByExample(query)) {
// Integer bizid, Integer appid, RunEnvironment runEnvironment, Application app
appDomain = new // getRuntime(match),
AppDomainInfo(// getRuntime(match),
app.getDptId(), // getRuntime(match),
app.getAppId(), runtime, app);
// appDomain.setAppName(appname);
break;
}
return appDomain;
}
return null;
// // ApplicationCriteria criteria = new ApplicationCriteria();
// // criteria.createCriteria().andProjectNameEqualTo(
// // // match.group(1)
// // appname);// .andNotDelete();
// AppDomainInfo appDomain = null;
// IAppsFetcher appFetcher = UserUtils.getAppsFetcher(request, context);
//
// List<Application> applist = appFetcher.getApps(new CriteriaSetter() {
// @Override
// public void set(Criteria criteria) {
// criteria.andProjectNameEqualTo(appname);
// }
// });
//
// // List<Application> applist = applicationDAO.selectByExample(criteria,
// // 1,
// // 100);
//
// // AppsFetcher.create();
//
// for (Application app : applist) {
// // appDomain = new AppDomainInfo(app, Integer
// // .parseInt(match.group(2)), applicationDAO);
//
// // 如果应用的部门为空则说明不是一个合法的部门
// if (app.getDptId() == null || app.getDptId() < 1) {
// return CheckAppDomainExistValve.createNull();
// }
//
// appDomain = new AppDomainInfo(app.getDptId(), app.getAppId(), runtime,
// // getRuntime(match),
// context);
//
// appDomain.setAutoDeploy(app.getIsAutoDeploy());
// break;
// }
// return appDomain;
}
Aggregations