diff --git a/src/main/java/info/bukova/isspst/services/requirement/ReqMaterialServiceImpl.java b/src/main/java/info/bukova/isspst/services/requirement/ReqMaterialServiceImpl.java index cf52e60d..e3096b84 100644 --- a/src/main/java/info/bukova/isspst/services/requirement/ReqMaterialServiceImpl.java +++ b/src/main/java/info/bukova/isspst/services/requirement/ReqMaterialServiceImpl.java @@ -38,9 +38,8 @@ public class ReqMaterialServiceImpl extends RequirementServiceImpl implements Re @PreAuthorize("hasPermission(this, 'PERM_READ')") public List getMy() { - Query q = dao.getQuery("from " + dao.getEntityName() + " where ownedBy = :owner and state != :state and kind = :kind"); + Query q = dao.getQuery("from " + dao.getEntityName() + " where ownedBy = :owner and kind = :kind"); q.setParameter("owner", getLoggedInUser()); - q.setParameter("state", RequirementState.APPROVED); q.setParameter("kind", Constants.REQ_TYPE_MATERIAL); return q.list(); } @@ -53,9 +52,8 @@ public class ReqMaterialServiceImpl extends RequirementServiceImpl implements Re public List getCentreReq() { List wgList = workgroupService.getUserCentres(getLoggedInUser()); - Query q = dao.getQuery("select tr from " + dao.getEntityName() + " tr join fetch tr.ownedBy join tr.centre c where tr.state != :state and c in (:wgList) and kind = :kind order by tr.numser"); + Query q = dao.getQuery("select tr from " + dao.getEntityName() + " tr join fetch tr.ownedBy join tr.centre c where c in (:wgList) and kind = :kind order by tr.numser"); q.setParameterList("wgList", wgList); - q.setParameter("state", RequirementState.APPROVED); q.setParameter("kind", Constants.REQ_TYPE_MATERIAL); return q.list(); } @@ -70,9 +68,8 @@ public class ReqMaterialServiceImpl extends RequirementServiceImpl implements Re List wgList = workgroupService.getUserWorkgroups(getLoggedInUser()); Query q = dao.getQuery("select tr from " + dao.getEntityName() - + " tr join fetch tr.ownedBy join tr.workgroup w where tr.state != :state and w in (:wgList) and kind = :kind order by tr.numser"); + + " tr join fetch tr.ownedBy join tr.workgroup w where w in (:wgList) and kind = :kind order by tr.numser"); q.setParameterList("wgList", wgList); - q.setParameter("state", RequirementState.APPROVED); q.setParameter("kind", Constants.REQ_TYPE_MATERIAL); return q.list(); } diff --git a/src/main/java/info/bukova/isspst/services/requirement/ReqServicesServiceImpl.java b/src/main/java/info/bukova/isspst/services/requirement/ReqServicesServiceImpl.java index 46d86338..bafd2fb5 100644 --- a/src/main/java/info/bukova/isspst/services/requirement/ReqServicesServiceImpl.java +++ b/src/main/java/info/bukova/isspst/services/requirement/ReqServicesServiceImpl.java @@ -38,9 +38,8 @@ public class ReqServicesServiceImpl extends RequirementServiceImpl implements Re @PreAuthorize("hasPermission(this, 'PERM_READ')") public List getMy() { - Query q = dao.getQuery("from " + dao.getEntityName() + " where ownedBy = :owner and state != :state and kind = :kind"); + Query q = dao.getQuery("from " + dao.getEntityName() + " where ownedBy = :owner and kind = :kind"); q.setParameter("owner", getLoggedInUser()); - q.setParameter("state", RequirementState.APPROVED); q.setParameter("kind", Constants.REQ_TYPE_SERVICES); return q.list(); } @@ -53,9 +52,8 @@ public class ReqServicesServiceImpl extends RequirementServiceImpl implements Re public List getCentreReq() { List wgList = workgroupService.getUserCentres(getLoggedInUser()); - Query q = dao.getQuery("select tr from " + dao.getEntityName() + " tr join fetch tr.ownedBy join tr.centre c where tr.state != :state and c in (:wgList) and kind = :kind order by tr.numser"); + Query q = dao.getQuery("select tr from " + dao.getEntityName() + " tr join fetch tr.ownedBy join tr.centre c where c in (:wgList) and kind = :kind order by tr.numser"); q.setParameterList("wgList", wgList); - q.setParameter("state", RequirementState.APPROVED); q.setParameter("kind", Constants.REQ_TYPE_SERVICES); return q.list(); } @@ -70,9 +68,8 @@ public class ReqServicesServiceImpl extends RequirementServiceImpl implements Re List wgList = workgroupService.getUserWorkgroups(getLoggedInUser()); Query q = dao.getQuery("select tr from " + dao.getEntityName() - + " tr join fetch tr.ownedBy join tr.workgroup w where tr.state != :state and w in (:wgList) and kind = :kind order by tr.numser"); + + " tr join fetch tr.ownedBy join tr.workgroup w where w in (:wgList) and kind = :kind order by tr.numser"); q.setParameterList("wgList", wgList); - q.setParameter("state", RequirementState.APPROVED); q.setParameter("kind", Constants.REQ_TYPE_SERVICES); return q.list(); } diff --git a/src/main/java/info/bukova/isspst/services/requirement/RequirementBaseServiceImpl.java b/src/main/java/info/bukova/isspst/services/requirement/RequirementBaseServiceImpl.java index 4587eab5..bc44a3f5 100644 --- a/src/main/java/info/bukova/isspst/services/requirement/RequirementBaseServiceImpl.java +++ b/src/main/java/info/bukova/isspst/services/requirement/RequirementBaseServiceImpl.java @@ -334,9 +334,8 @@ public abstract class RequirementBaseServiceImpl exte @PreAuthorize("hasPermission(this, 'PERM_READ')") public List getMy() { - Query q = dao.getQuery("from " + dao.getEntityName() + " where ownedBy = :owner and state != :state"); + Query q = dao.getQuery("from " + dao.getEntityName() + " where ownedBy = :owner"); q.setParameter("owner", getLoggedInUser()); - q.setParameter("state", RequirementState.APPROVED); return q.list(); } @@ -348,9 +347,8 @@ public abstract class RequirementBaseServiceImpl exte public List getCentreReq() { List wgList = workgroupService.getUserCentres(getLoggedInUser()); - Query q = dao.getQuery("select tr from " + dao.getEntityName() + " tr join fetch tr.ownedBy join tr.centre c where tr.state != :state and c in (:wgList) order by tr.numser"); + Query q = dao.getQuery("select tr from " + dao.getEntityName() + " tr join fetch tr.ownedBy join tr.centre c where c in (:wgList) order by tr.numser"); q.setParameterList("wgList", wgList); - q.setParameter("state", RequirementState.APPROVED); return q.list(); } @@ -362,9 +360,8 @@ public abstract class RequirementBaseServiceImpl exte public List getWorkgroupReq() { List wgList = workgroupService.getUserWorkgroups(getLoggedInUser()); - Query q = dao.getQuery("select tr from " + dao.getEntityName() + " tr join fetch tr.ownedBy join tr.workgroup w where tr.state != :state and w in (:wgList) order by tr.numser"); + Query q = dao.getQuery("select tr from " + dao.getEntityName() + " tr join fetch tr.ownedBy join tr.workgroup w where w in (:wgList) order by tr.numser"); q.setParameterList("wgList", wgList); - q.setParameter("state", RequirementState.APPROVED); return q.list(); }