From e51955f86acf258b2e33b2883d91e16b9c5e17f0 Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Sun, 18 Jan 2015 15:53:03 +0100 Subject: [PATCH] =?UTF-8?q?Ji=C5=BE=20se=20nezkr=C3=BDvaj=C3=AD=20schv?= =?UTF-8?q?=C3=A1len=C3=A9=20po=C5=BEadavky=20na=20z=C3=A1lo=C5=BEk=C3=A1c?= =?UTF-8?q?h=20Moje/st=C5=99ediska/komise.=20closes=20#181?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../services/requirement/ReqMaterialServiceImpl.java | 9 +++------ .../services/requirement/ReqServicesServiceImpl.java | 9 +++------ .../services/requirement/RequirementBaseServiceImpl.java | 9 +++------ 3 files changed, 9 insertions(+), 18 deletions(-) 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(); }