Commit bc7eee70 authored by Vijay Akula's avatar Vijay Akula

Resolved the errors in Resourcescontroller

parent 236ee698
...@@ -61,7 +61,7 @@ public class ResourceAllocationController { ...@@ -61,7 +61,7 @@ public class ResourceAllocationController {
} }
} }
ResponseDetails responseDetails = new ResponseDetails(new Date(), resourceAllocService.respMap.get("statusCode").toString(), resourceAllocService.respMap.get("message").toString(), ResponseDetails responseDetails = new ResponseDetails(new Date(), Integer.parseInt(resourceAllocService.respMap.get("statusCode").toString()), resourceAllocService.respMap.get("message").toString(),
"Error message desc", null, request.getRequestURI(), "Resource details", resourceAllocationReq); "Error message desc", null, request.getRequestURI(), "Resource details", resourceAllocationReq);
return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK); return new ResponseEntity<ResponseDetails>(responseDetails, HttpStatus.OK);
...@@ -85,7 +85,7 @@ public class ResourceAllocationController { ...@@ -85,7 +85,7 @@ public class ResourceAllocationController {
resourceAllocService.updateResource(resourceAllocationReq, loginEmpId); resourceAllocService.updateResource(resourceAllocationReq, loginEmpId);
} }
ResponseDetails createResponseDetails = new ResponseDetails(new Date(), resourceAllocService.respMap.get("statusCode").toString(), resourceAllocService.respMap.get("message").toString(), ResponseDetails createResponseDetails = new ResponseDetails(new Date(), Integer.parseInt(resourceAllocService.respMap.get("statusCode").toString()), resourceAllocService.respMap.get("message").toString(),
"Resource description", null, request.getContextPath(), "Resource details", resourceAllocationReq); "Resource description", null, request.getContextPath(), "Resource details", resourceAllocationReq);
return new ResponseEntity<ResponseDetails>(createResponseDetails, HttpStatus.OK); return new ResponseEntity<ResponseDetails>(createResponseDetails, HttpStatus.OK);
} }
......
...@@ -2,7 +2,6 @@ package com.nisum.myteam.service; ...@@ -2,7 +2,6 @@ package com.nisum.myteam.service;
import com.nisum.myteam.exception.handler.MyTeamException; import com.nisum.myteam.exception.handler.MyTeamException;
import com.nisum.myteam.model.dao.Employee; import com.nisum.myteam.model.dao.Employee;
import com.nisum.myteam.model.dao.Resource;
import com.nisum.myteam.model.dao.ResourceAllocation; import com.nisum.myteam.model.dao.ResourceAllocation;
import com.nisum.myteam.model.vo.MyProjectAllocationVO; import com.nisum.myteam.model.vo.MyProjectAllocationVO;
import com.nisum.myteam.model.vo.ResourceVO; import com.nisum.myteam.model.vo.ResourceVO;
...@@ -62,5 +61,7 @@ public interface IResourceAllocationService { ...@@ -62,5 +61,7 @@ public interface IResourceAllocationService {
public List<ResourceAllocation> getAllResources(); public List<ResourceAllocation> getAllResources();
public void deleteResourcesUnderProject(String projectId);
} }
...@@ -175,7 +175,7 @@ public class ResourceAllocationService implements IResourceAllocationService { ...@@ -175,7 +175,7 @@ public class ResourceAllocationService implements IResourceAllocationService {
public void updateResource(ResourceAllocation resourceAllocReq, String loginEmpId) throws MyTeamException { public void updateResource(ResourceAllocation resourceAllocReq, String loginEmpId) throws MyTeamException {
ResourceAllocation resourceAllocationPers = resourceAllocationRepo.save(resourceAllocReq); ResourceAllocation resourceAllocationPers = resourceAllocationRepo.save(resourceAllocReq);
respMap.put("statusCode", 801; respMap.put("statusCode", 801);
respMap.put("message", "Resource updated successfully"); respMap.put("message", "Resource updated successfully");
respMap.put("resourceObj", resourceAllocationPers); respMap.put("resourceObj", resourceAllocationPers);
...@@ -390,4 +390,13 @@ public class ResourceAllocationService implements IResourceAllocationService { ...@@ -390,4 +390,13 @@ public class ResourceAllocationService implements IResourceAllocationService {
} }
public void deleteResourcesUnderProject(String projectId) {
Query query = new Query(Criteria.where("projectId").is(projectId));
List<ResourceAllocation> list = mongoTemplate.find(query, ResourceAllocation.class);
resourceAllocationRepo.delete(list);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment