ItEr37S06ValidacionEProbasFuncionaisItEr36S07: Fix with configuration unit criterion requirement combobox
This commit is contained in:
parent
ae9048e5fe
commit
a4cf5ec392
9 changed files with 65 additions and 2 deletions
|
|
@ -56,6 +56,13 @@ public class AssignedMachineCriterionsModel implements IAssignedMachineCriterion
|
|||
applicableResources.add(ResourceEnum.MACHINE);
|
||||
}
|
||||
|
||||
private static List<ResourceEnum> applicableWorkerResources = new ArrayList<ResourceEnum>();
|
||||
|
||||
static {
|
||||
applicableWorkerResources.add(ResourceEnum.RESOURCE);
|
||||
applicableWorkerResources.add(ResourceEnum.WORKER);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public void prepareForEdit(Resource resource) {
|
||||
|
|
@ -180,12 +187,31 @@ public class AssignedMachineCriterionsModel implements IAssignedMachineCriterion
|
|||
return criterionsWithItsTypes;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public List<CriterionWithItsType> getCriterionWorkersWithItsType() {
|
||||
criterionsWithItsTypes = new ArrayList<CriterionWithItsType>();
|
||||
List<CriterionType> listTypes = getCriterionWorkersTypes();
|
||||
for (CriterionType criterionType : listTypes) {
|
||||
Set<Criterion> listCriterion = getDirectCriterions(criterionType);
|
||||
getCriterionWithItsType(criterionType, listCriterion);
|
||||
}
|
||||
return criterionsWithItsTypes;
|
||||
}
|
||||
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
private List<CriterionType> getCriterionTypes() {
|
||||
return criterionTypeDAO
|
||||
.getCriterionTypesByResources(applicableResources);
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
private List<CriterionType> getCriterionWorkersTypes() {
|
||||
return criterionTypeDAO
|
||||
.getCriterionTypesByResources(applicableWorkerResources);
|
||||
}
|
||||
|
||||
private void getCriterionWithItsType(CriterionType type,
|
||||
Set<Criterion> children) {
|
||||
for (Criterion criterion : children) {
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@ public interface IAssignedMachineCriterionsModel {
|
|||
|
||||
List<CriterionWithItsType> getCriterionWithItsType();
|
||||
|
||||
List<CriterionWithItsType> getCriterionWorkersWithItsType();
|
||||
|
||||
Set<CriterionSatisfactionDTO> getFilterCriterionSatisfactions();
|
||||
|
||||
void prepareForEdit(Resource resource);
|
||||
|
|
@ -67,4 +69,5 @@ public interface IAssignedMachineCriterionsModel {
|
|||
void validate() throws ValidationException, IllegalStateException;
|
||||
|
||||
void confirm() throws ValidationException, IllegalStateException;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,22 +22,30 @@ package org.navalplanner.web.resources.machine;
|
|||
import static org.navalplanner.web.I18nHelper._;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.navalplanner.business.common.exceptions.InstanceNotFoundException;
|
||||
import org.navalplanner.business.resources.daos.ICriterionTypeDAO;
|
||||
import org.navalplanner.business.resources.entities.Criterion;
|
||||
import org.navalplanner.business.resources.entities.CriterionType;
|
||||
import org.navalplanner.business.resources.entities.CriterionWithItsType;
|
||||
import org.navalplanner.business.resources.entities.MachineWorkerAssignment;
|
||||
import org.navalplanner.business.resources.entities.MachineWorkersConfigurationUnit;
|
||||
import org.navalplanner.business.resources.entities.ResourceEnum;
|
||||
import org.navalplanner.business.resources.entities.Worker;
|
||||
import org.navalplanner.web.common.IMessagesForUser;
|
||||
import org.navalplanner.web.common.Level;
|
||||
import org.navalplanner.web.common.MessagesForUser;
|
||||
import org.navalplanner.web.common.Util;
|
||||
import org.navalplanner.web.common.components.Autocomplete;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.WrongValueException;
|
||||
import org.zkoss.zk.ui.util.GenericForwardComposer;
|
||||
|
|
|
|||
|
|
@ -164,6 +164,12 @@ public class AssignedCriterionsModel implements IAssignedCriterionsModel {
|
|||
return criterionsWithItsTypes;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public List<CriterionWithItsType> getCriterionWorkersWithItsType() {
|
||||
return getCriterionWithItsType();
|
||||
}
|
||||
|
||||
private List<CriterionType> getCriterionTypes() {
|
||||
return criterionTypeDAO
|
||||
.getCriterionTypesByResources(applicableResources);
|
||||
|
|
|
|||
|
|
@ -97,6 +97,10 @@ public class CriterionsController extends GenericForwardComposer {
|
|||
return assignedCriterionsModel.getCriterionWithItsType();
|
||||
}
|
||||
|
||||
public List<CriterionWithItsType> getCriterionWorkersWithItsTypes() {
|
||||
return assignedCriterionsModel.getCriterionWorkersWithItsType();
|
||||
}
|
||||
|
||||
public void reload() {
|
||||
Util.reloadBindings(listingCriterions);
|
||||
forceSortGridSatisfaction();
|
||||
|
|
|
|||
|
|
@ -91,6 +91,11 @@ public class CriterionsMachineController extends GenericForwardComposer {
|
|||
return assignedMachineCriterionsModel.getCriterionWithItsType();
|
||||
}
|
||||
|
||||
public List<CriterionWithItsType> getCriterionWorkersWithItsTypes() {
|
||||
// othermodel
|
||||
return assignedMachineCriterionsModel.getCriterionWorkersWithItsType();
|
||||
}
|
||||
|
||||
public void reload() {
|
||||
Util.reloadBindings(listingCriterions);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ package org.navalplanner.web.resources.worker;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.navalplanner.business.common.exceptions.ValidationException;
|
||||
import org.navalplanner.business.resources.entities.CriterionWithItsType;
|
||||
import org.navalplanner.business.resources.entities.Worker;
|
||||
|
|
@ -45,4 +46,6 @@ public interface IAssignedCriterionsModel {
|
|||
|
||||
public boolean checkNotAllowSimultaneousCriterionsPerResource(
|
||||
CriterionSatisfactionDTO satisfaction);
|
||||
|
||||
List<CriterionWithItsType> getCriterionWorkersWithItsType();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -945,3 +945,11 @@ tr.z-tree-row-seld, tr.z-list-item-seld,
|
|||
.earned-parameter-column {
|
||||
width: 70px;
|
||||
}
|
||||
|
||||
.z-panel-header {
|
||||
/* color: #0F3B82; */
|
||||
}
|
||||
.z-panel-body {
|
||||
padding: 10px;
|
||||
/* border-color: #0F3B82; */
|
||||
}
|
||||
|
|
@ -83,7 +83,7 @@
|
|||
<bandbox value = "@{criterionSatisfactionDTO.criterionAndType}" width="300px">
|
||||
<bandpopup>
|
||||
<listbox width="500px" height="150px" fixedLayout="true"
|
||||
model="@{assignedCriterionsController.criterionWithItsTypes}"
|
||||
model="@{assignedCriterionsController.criterionWorkersWithItsTypes}"
|
||||
onSelect="configurationController.selectCriterionRequirement(self.selectedItem,self.parent.parent)">
|
||||
<listhead>
|
||||
<listheader label="Type" />
|
||||
|
|
@ -134,4 +134,4 @@
|
|||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</vbox>
|
||||
</vbox>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue