Opravená chyba v generování pořadí schvalovatelů. Opraveno refreshování

gridů v požadavcích na nákup.
multitenant
Josef Rokos 10 years ago
parent 957213e54b
commit 954682fb5f

@ -26,7 +26,7 @@ public class RequirementBase extends BaseData {
private RequirementType type;
@OneToMany(cascade = CascadeType.ALL)
@LazyCollection(LazyCollectionOption.TRUE)
@OrderBy("WORDER")
@OrderBy("CENTRE, WORDER")
private List<Workflow> workflow;
@Column(name = "NUMSER", unique = true)
private String numser;

@ -23,7 +23,7 @@ public class RequirementType extends BaseData {
private String description;
@OneToMany(cascade = CascadeType.ALL, orphanRemoval=true)
@LazyCollection(LazyCollectionOption.FALSE)
@OrderBy("WORDER")
@OrderBy("CENTRE, WORDER")
private List<Workflow> workflow;
public RequirementType() {

@ -56,6 +56,7 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
entity.setWorkgroup(reqWorkgroup);
entity.setNumser(this.getNumberSerie());
this.addWorkflow(entity);
super.add(entity);
@ -79,12 +80,14 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
}
for (Workflow w : entity.getType().getWorkflow()) {
Workflow workflow = new Workflow();
workflow.setCentre(w.getCentre());
workflow.setLimit(w.getLimit());
workflow.setOrder(w.getOrder());
workflow.setRole(w.getRole());
entity.getWorkflow().add(workflow);
if ((entity.getWorkgroup() != null && !w.getCentre()) || w.getCentre()) {
Workflow workflow = new Workflow();
workflow.setCentre(w.getCentre());
workflow.setLimit(w.getLimit());
workflow.setOrder(w.getOrder());
workflow.setRole(w.getRole());
entity.getWorkflow().add(workflow);
}
}
}
@ -93,7 +96,6 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
public List<User> getNextApprover(T entity) {
T e = (T) dao.getById(entity.getId());
List<User> users = new ArrayList<User>();
Workgroup wg;
Workflow wf = getNextWorkflow(e);

@ -7,8 +7,6 @@ import info.bukova.isspst.data.RequirementState;
import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
public class RequirementServiceImpl extends
RequirementBaseServiceImpl<Requirement> implements RequirementService,
@ -24,15 +22,8 @@ public class RequirementServiceImpl extends
entity.setReqDate(new Date());
entity.setType(reqTypeService.getTypeById(Constants.REQTYPE_ORDER));
entity.setState(RequirementState.NEW);
this.addWorkflow(entity);
return entity;
}
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_ADD')")
public void add(Requirement entity) {
super.add(entity);
}
}

@ -31,15 +31,8 @@ public class TripRequirementServiceImpl extends RequirementBaseServiceImpl<TripR
tr.setReqDate(new Date());
tr.setType(reqTypeService.getTypeById(Constants.REQTYPE_BUSINESSTRIP));
tr.setState(RequirementState.NEW);
addWorkflow(tr);
return tr;
}
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_ADD')")
public void add(TripRequirement entity) {
super.add(entity);
return tr;
}
@Override

@ -13,7 +13,9 @@ import java.util.List;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.GlobalCommand;
import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.select.annotation.WireVariable;
public class ReqListMyAll extends RequirementSubpage<Requirement>
@ -56,4 +58,10 @@ public class ReqListMyAll extends RequirementSubpage<Requirement>
return new ArrayList<Requirement>();
}
}
@GlobalCommand
@NotifyChange({ "dataList", "dataBean", "fullFill" })
public void reloadRelated() {
this.reload();
}
}

@ -13,7 +13,9 @@ import java.util.List;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.GlobalCommand;
import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.select.annotation.WireVariable;
public class ReqListMyCenters extends RequirementSubpage<Requirement>
@ -56,4 +58,10 @@ public class ReqListMyCenters extends RequirementSubpage<Requirement>
return new ArrayList<Requirement>();
}
}
@GlobalCommand
@NotifyChange({ "dataList", "dataBean", "fullFill" })
public void reloadRelated() {
this.reload();
}
}

@ -13,7 +13,9 @@ import java.util.List;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.GlobalCommand;
import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.select.annotation.WireVariable;
public class ReqListMyWorkgroups extends RequirementSubpage<Requirement>
@ -56,4 +58,10 @@ public class ReqListMyWorkgroups extends RequirementSubpage<Requirement>
return new ArrayList<Requirement>();
}
}
@GlobalCommand
@NotifyChange({ "dataList", "dataBean", "fullFill" })
public void reloadRelated() {
this.reload();
}
}

@ -30,7 +30,6 @@ public class RequirementSubpage<T extends RequirementBase> extends ListViewModel
this.bigDecimalConverter = new BigDecimalConverter();
}
@SuppressWarnings("unchecked")
private RequirementBaseService<T> getReqService()
{
return (RequirementBaseService<T>) service;

@ -9,7 +9,9 @@
<listbox
vflex="1"
selectedItem="@bind(vm.dataBean)"
model="@load(vm.dataList)">
model="@load(vm.dataList)"
onAfterRender="@command('afterRender')"
selectedIndex="@bind(vm.selIndex)">
<listhead menupopup="auto">
<listheader
label="${labels.RequirementsGridNumberSerie}"
@ -133,7 +135,7 @@
<listitem>
<listcell label="@load(each.numser)" />
<listcell label="@load(each.reqDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.workgroup.fullName)" />
<listcell label="@load(each.centre.fullName)" />
<listcell label="@load(each.deliveryDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.sumTotal) @converter(vm.bigDecimalConverter)" />
<listcell label="@load(each.description)" />

@ -11,7 +11,9 @@
vflex="1"
hflex="7"
selectedItem="@bind(vm.dataBean)"
model="@load(vm.dataList)">
model="@load(vm.dataList)"
onAfterRender="@command('afterRender')"
selectedIndex="@bind(vm.selIndex)">
<listhead menupopup="auto">
<listheader
label="${labels.RequirementsGridNumberSerie}"
@ -135,7 +137,7 @@
<listitem>
<listcell label="@load(each.numser)" />
<listcell label="@load(each.reqDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.workgroup.fullName)" />
<listcell label="@load(each.centre.fullName)" />
<listcell label="@load(each.deliveryDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.sumTotal) @converter(vm.bigDecimalConverter)" />
<listcell label="@load(each.description)" />

@ -11,7 +11,9 @@
vflex="1"
hflex="7"
selectedItem="@bind(vm.dataBean)"
model="@load(vm.dataList)">
model="@load(vm.dataList)"
onAfterRender="@command('afterRender')"
selectedIndex="@bind(vm.selIndex)">
<listhead menupopup="auto">
<listheader
label="${labels.RequirementsGridNumberSerie}"
@ -135,7 +137,7 @@
<listitem>
<listcell label="@load(each.numser)" />
<listcell label="@load(each.reqDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.workgroup.fullName)" />
<listcell label="@load(each.centre.fullName)" />
<listcell label="@load(each.deliveryDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.sumTotal) @converter(vm.bigDecimalConverter)" />
<listcell label="@load(each.description)" />

@ -11,7 +11,9 @@
vflex="1"
hflex="7"
selectedItem="@bind(vm.dataBean)"
model="@load(vm.dataList)">
model="@load(vm.dataList)"
onAfterRender="@command('afterRender')"
selectedIndex="@bind(vm.selIndex)">
<listhead menupopup="auto">
<listheader
label="${labels.RequirementsGridNumberSerie}"
@ -135,7 +137,7 @@
<listitem>
<listcell label="@load(each.numser)" />
<listcell label="@load(each.reqDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.workgroup.fullName)" />
<listcell label="@load(each.centre.fullName)" />
<listcell label="@load(each.deliveryDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.sumTotal) @converter(vm.bigDecimalConverter)" />
<listcell label="@load(each.description)" />

Loading…
Cancel
Save