Advertisement
deflorator1980

Untitled

Jan 19th, 2017
331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.51 KB | None | 0 0
  1.     @POST
  2.     @Path("/calculate/{revId}/{projId}")
  3.     @Consumes(MediaType.APPLICATION_JSON)
  4.     @Produces(MediaType.APPLICATION_JSON)
  5.     public Response processTasksCalculate(@Context HttpServletRequest request,
  6.                                           TaskListWrapper taskListWrapper,
  7.                                           @PathParam("revId") long revId,
  8.                                           @PathParam("projId") long projId) {
  9.         Response response = processTasks(request, taskListWrapper.getTaskDTOList());
  10.         if (response.getStatus() == Response.Status.OK.getStatusCode()) {
  11.             DateTime lastRecalcDate = null;
  12.             try {
  13.                 lastRecalcDate = ObjectHelper.parseEditableGanttDate(taskListWrapper.getLastRecalcDate());
  14.             } catch (Exception exception) {
  15.                 LOGGER.error("", exception);
  16.             }
  17.             Object[] result = new DataBuilder().calculateSchedule(revId, projId, lastRecalcDate);
  18.             boolean success = (Boolean) result[0];
  19.             String message = (String) result[1];
  20.             if (success) {
  21.                 projectService.updateLastRecalcDate(revId, projId, lastRecalcDate);
  22.                 UserActionLogService.createUserLog(request, "Расчет расписания проекта "+revId+":"+projId);
  23.             }
  24.             return Response.status(success ? Response.Status.OK : Response.Status.INTERNAL_SERVER_ERROR).entity(message).build();
  25.         } else {
  26.             return response;
  27.         }
  28.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement