use of com.ngtesting.platform.entity.TestPlan in project ngtesting-platform by aaronchen2k.
the class PlanAction method delete.
@AuthPassport(validate = true)
@RequestMapping(value = "delete", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> delete(HttpServletRequest request, @RequestBody JSONObject json) {
Map<String, Object> ret = new HashMap<String, Object>();
Long id = json.getLong("id");
UserVo userVo = (UserVo) request.getSession().getAttribute(Constant.HTTP_SESSION_USER_KEY);
TestPlan po = planService.delete(id, userVo.getId());
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.entity.TestPlan in project ngtesting-platform by aaronchen2k.
the class PlanServiceImpl method list.
@Override
public List<TestPlan> list(Long projectId, String projectType) {
DetachedCriteria dc = DetachedCriteria.forClass(TestPlan.class);
dc.add(Restrictions.eq("deleted", Boolean.FALSE));
dc.add(Restrictions.eq("disabled", Boolean.FALSE));
if (projectType.equals(TestProject.ProjectType.project.toString())) {
dc.add(Restrictions.eq("projectId", projectId));
} else {
dc.createAlias("project", "project");
dc.add(Restrictions.eq("project.parentId", projectId));
}
dc.addOrder(Order.asc("createTime"));
List<TestPlan> ls = findAllByCriteria(dc);
return ls;
}
use of com.ngtesting.platform.entity.TestPlan in project ngtesting-platform by aaronchen2k.
the class PlanServiceImpl method getById.
@Override
public TestPlanVo getById(Long caseId) {
TestPlan po = (TestPlan) get(TestPlan.class, caseId);
TestPlanVo vo = genVo(po);
return vo;
}
use of com.ngtesting.platform.entity.TestPlan in project ngtesting-platform by aaronchen2k.
the class PlanServiceImpl method updatePo.
@Override
public TestPlan updatePo(TestPlanVo vo) {
TestPlan po = new TestPlan();
po.setName(vo.getName());
po.setName(vo.getName());
po.setEstimate(vo.getEstimate());
po.setStartTime(vo.getStartTime());
po.setEndTime(vo.getEndTime());
po.setDescr(vo.getDescr());
po.setProjectId(vo.getProjectId());
return po;
}
use of com.ngtesting.platform.entity.TestPlan in project ngtesting-platform by aaronchen2k.
the class AlertServiceImpl method saveAlert.
@Override
public void saveAlert(TestRun run) {
for (TestUser user : run.getAssignees()) {
TestAlert po = getByRun(run.getId());
;
if (po == null) {
po = new TestAlert();
}
po.setType("run");
po.setDescr(run.getDescr());
po.setEntityId(run.getId());
po.setEntityName(run.getName());
po.setStatus(run.getStatus().toString());
po.setRead(false);
po.setUserId(run.getUserId());
po.setAssigneeId(user.getId());
TestPlan plan = run.getPlan();
if (plan == null || plan.getId() == null) {
plan = (TestPlan) get(TestPlan.class, run.getPlanId());
}
po.setStartTime(plan.getStartTime());
po.setEndTime(plan.getEndTime());
saveOrUpdate(po);
}
}
Aggregations