|
|
@ -3,7 +3,6 @@ package info.bukova.isspst.services.requirement;
|
|
|
|
import info.bukova.isspst.Constants;
|
|
|
|
import info.bukova.isspst.Constants;
|
|
|
|
import info.bukova.isspst.data.RequirementState;
|
|
|
|
import info.bukova.isspst.data.RequirementState;
|
|
|
|
import info.bukova.isspst.data.TripRequirement;
|
|
|
|
import info.bukova.isspst.data.TripRequirement;
|
|
|
|
import info.bukova.isspst.data.Workgroup;
|
|
|
|
|
|
|
|
import info.bukova.isspst.services.LazyLoader;
|
|
|
|
import info.bukova.isspst.services.LazyLoader;
|
|
|
|
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
|
|
|
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
|
|
|
|
|
|
|
|
|
|
@ -36,14 +35,6 @@ public class TripRequirementServiceImpl extends RequirementBaseServiceImpl<TripR
|
|
|
|
@Transactional
|
|
|
|
@Transactional
|
|
|
|
@PreAuthorize("hasPermission(this, 'PERM_ADD')")
|
|
|
|
@PreAuthorize("hasPermission(this, 'PERM_ADD')")
|
|
|
|
public void add(TripRequirement entity) {
|
|
|
|
public void add(TripRequirement entity) {
|
|
|
|
Workgroup reqWorkgroup = null;
|
|
|
|
|
|
|
|
for (Workgroup w : workgroupService.getUserWorkgroups(getLoggedInUser())) {
|
|
|
|
|
|
|
|
if (workgroupService.getMembers(entity.getCentre()).contains(w)) {
|
|
|
|
|
|
|
|
reqWorkgroup = w;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
entity.setWorkgroup(reqWorkgroup);
|
|
|
|
|
|
|
|
entity.setNumser(getNumberSerie());
|
|
|
|
|
|
|
|
super.add(entity);
|
|
|
|
super.add(entity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|