Již se nezkrývají schválené požadavky na záložkách

Moje/střediska/komise.
closes #181
Verze_1.0
Josef Rokos 10 years ago
parent 26699fd3a9
commit e51955f86a

@ -38,9 +38,8 @@ public class ReqMaterialServiceImpl extends RequirementServiceImpl implements Re
@PreAuthorize("hasPermission(this, 'PERM_READ')")
public List<Requirement> 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<Requirement> getCentreReq()
{
List<Workgroup> 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<Workgroup> 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();
}

@ -38,9 +38,8 @@ public class ReqServicesServiceImpl extends RequirementServiceImpl implements Re
@PreAuthorize("hasPermission(this, 'PERM_READ')")
public List<Requirement> 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<Requirement> getCentreReq()
{
List<Workgroup> 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<Workgroup> 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();
}

@ -334,9 +334,8 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
@PreAuthorize("hasPermission(this, 'PERM_READ')")
public List<T> 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<T extends RequirementBase> exte
public List<T> getCentreReq()
{
List<Workgroup> 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<T extends RequirementBase> exte
public List<T> getWorkgroupReq()
{
List<Workgroup> 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();
}

Loading…
Cancel
Save