Ejemplo n.º 1
0
 @RequestMapping(
     value = "/source",
     method = {RequestMethod.GET})
 @ResponseBody
 public String getSourceCode(@RequestParam("relativePath") String relativePath) {
   return testCaseService.getSourceCode(projectService.getActiveProject(), relativePath);
 }
Ejemplo n.º 2
0
 @RequestMapping(
     value = "/execute",
     method = {RequestMethod.POST})
 @ResponseBody
 public TestResult execute(@RequestBody Test test) {
   return testExecutionService.execute(projectService.getActiveProject(), test);
 }
Ejemplo n.º 3
0
 @RequestMapping(
     value = "/detail",
     method = {RequestMethod.POST})
 @ResponseBody
 public TestDetail getTestDetail(@RequestBody Test test) {
   return testCaseService.getTestDetail(projectService.getActiveProject(), test);
 }
Ejemplo n.º 4
0
 @RequestMapping(
     value = "/count",
     method = {RequestMethod.GET})
 @ResponseBody
 public long getTestCount() {
   return testCaseService.getTestCount(projectService.getActiveProject());
 }
Ejemplo n.º 5
0
 @RequestMapping(
     value = "/latest",
     method = {RequestMethod.GET})
 @ResponseBody
 public List<TestGroup> getLatest() {
   return testCaseService.getLatest(projectService.getActiveProject(), 8);
 }
Ejemplo n.º 6
0
 @RequestMapping(
     value = "/source",
     method = {RequestMethod.PUT})
 @ResponseBody
 public void updateSourceCode(
     @RequestParam("relativePath") String relativePath, @RequestBody String newSourceCode) {
   testCaseService.updateSourceCode(
       projectService.getActiveProject(), relativePath, newSourceCode);
 }
Ejemplo n.º 7
0
  /*
   * Возвращает HashMap со значениями для заполнения списков сотрудников,
   * проектов, пресейлов, проектных задач, типов и категорий активности на
   * форме приложения.
   */
  private Map<String, Object> getListsToMAV() {
    Map<String, Object> result = new HashMap<String, Object>();

    List<DictionaryItem> typesOfActivity = dictionaryItemService.getTypesOfActivity();
    result.put("actTypeList", typesOfActivity);

    String typesOfActivityJson = getDictionaryItemsInJson(typesOfActivity);
    result.put("actTypeJson", typesOfActivityJson);

    String workplacesJson = getDictionaryItemsInJson(dictionaryItemService.getWorkplaces());
    result.put("workplaceJson", workplacesJson);

    result.put(
        "overtimeCauseJson", getDictionaryItemsInJson(dictionaryItemService.getOvertimeCauses()));
    result.put(
        "unfinishedDayCauseJson",
        getDictionaryItemsInJson(dictionaryItemService.getUnfinishedDayCauses()));
    result.put("overtimeThreshold", propertyProvider.getOvertimeThreshold());

    List<Division> divisions = divisionService.getDivisions();
    result.put("divisionList", divisions);

    result.put(
        "employeeListJson",
        employeeHelper.getEmployeeListJson(divisions, employeeService.isShowAll(request)));

    List<DictionaryItem> categoryOfActivity = dictionaryItemService.getCategoryOfActivity();
    result.put("actCategoryList", categoryOfActivity);

    String actCategoryListJson = getDictionaryItemsInJson(categoryOfActivity);
    result.put("actCategoryListJson", actCategoryListJson);

    result.put("availableActCategoriesJson", getAvailableActCategoriesJson());

    result.put("projectListJson", projectService.getProjectListJson(divisions));
    result.put("projectTaskListJson", getProjectTaskListJson(projectService.getProjectsWithCq()));

    List<ProjectRole> projectRoleList = projectRoleService.getProjectRoles();

    for (int i = 0; i < projectRoleList.size(); i++) {
      if (projectRoleList
          .get(i)
          .getCode()
          .equals("ND")) { // Убираем из списка роль "Не определена" APLANATS-270
        projectRoleList.remove(i);
        break;
      }
    }

    result.put("projectRoleList", projectRoleList);
    StringBuilder projectRoleListJson = new StringBuilder();
    projectRoleListJson.append("[");
    for (ProjectRole item : projectRoleList) {
      projectRoleListJson.append("{id:'");
      projectRoleListJson.append(item.getId().toString());
      projectRoleListJson.append("', value:'");
      projectRoleListJson.append(item.getName());
      projectRoleListJson.append("'},");
    }
    result.put(
        "projectRoleListJson",
        projectRoleListJson.toString().substring(0, (projectRoleListJson.toString().length() - 1))
            + "]");

    return result;
  }
Ejemplo n.º 8
0
 @RequestMapping(method = {RequestMethod.GET})
 @ResponseBody
 public List<TestGroup> list() {
   return testCaseService.getTestPackages(projectService.getActiveProject());
 }