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; private RequirementType type;
@OneToMany(cascade = CascadeType.ALL) @OneToMany(cascade = CascadeType.ALL)
@LazyCollection(LazyCollectionOption.TRUE) @LazyCollection(LazyCollectionOption.TRUE)
@OrderBy("WORDER") @OrderBy("CENTRE, WORDER")
private List<Workflow> workflow; private List<Workflow> workflow;
@Column(name = "NUMSER", unique = true) @Column(name = "NUMSER", unique = true)
private String numser; private String numser;

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

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

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

@ -13,7 +13,9 @@ import java.util.List;
import org.springframework.security.access.AccessDeniedException; import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils; import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.GlobalCommand;
import org.zkoss.bind.annotation.Init; import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.select.annotation.WireVariable; import org.zkoss.zk.ui.select.annotation.WireVariable;
public class ReqListMyAll extends RequirementSubpage<Requirement> public class ReqListMyAll extends RequirementSubpage<Requirement>
@ -56,4 +58,10 @@ public class ReqListMyAll extends RequirementSubpage<Requirement>
return new ArrayList<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.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils; import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.GlobalCommand;
import org.zkoss.bind.annotation.Init; import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.select.annotation.WireVariable; import org.zkoss.zk.ui.select.annotation.WireVariable;
public class ReqListMyCenters extends RequirementSubpage<Requirement> public class ReqListMyCenters extends RequirementSubpage<Requirement>
@ -56,4 +58,10 @@ public class ReqListMyCenters extends RequirementSubpage<Requirement>
return new ArrayList<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.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils; import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.GlobalCommand;
import org.zkoss.bind.annotation.Init; import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.select.annotation.WireVariable; import org.zkoss.zk.ui.select.annotation.WireVariable;
public class ReqListMyWorkgroups extends RequirementSubpage<Requirement> public class ReqListMyWorkgroups extends RequirementSubpage<Requirement>
@ -56,4 +58,10 @@ public class ReqListMyWorkgroups extends RequirementSubpage<Requirement>
return new ArrayList<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(); this.bigDecimalConverter = new BigDecimalConverter();
} }
@SuppressWarnings("unchecked")
private RequirementBaseService<T> getReqService() private RequirementBaseService<T> getReqService()
{ {
return (RequirementBaseService<T>) service; return (RequirementBaseService<T>) service;

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

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

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

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

Loading…
Cancel
Save