Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @POST
- @Path("/calculate/{revId}/{projId}")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public Response processTasksCalculate(@Context HttpServletRequest request,
- TaskListWrapper taskListWrapper,
- @PathParam("revId") long revId,
- @PathParam("projId") long projId) {
- Response response = processTasks(request, taskListWrapper.getTaskDTOList());
- if (response.getStatus() == Response.Status.OK.getStatusCode()) {
- DateTime lastRecalcDate = null;
- try {
- lastRecalcDate = ObjectHelper.parseEditableGanttDate(taskListWrapper.getLastRecalcDate());
- } catch (Exception exception) {
- LOGGER.error("", exception);
- }
- Object[] result = new DataBuilder().calculateSchedule(revId, projId, lastRecalcDate);
- boolean success = (Boolean) result[0];
- String message = (String) result[1];
- if (success) {
- projectService.updateLastRecalcDate(revId, projId, lastRecalcDate);
- UserActionLogService.createUserLog(request, "Расчет расписания проекта "+revId+":"+projId);
- }
- return Response.status(success ? Response.Status.OK : Response.Status.INTERNAL_SERVER_ERROR).entity(message).build();
- } else {
- return response;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement