V agendě Procesy schválení lze u jednotlivých schvalovacích rolí nastavit, jestli bude vyžadován při schválení elektronický podpis.
closes #242
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
package info.bukova.isspst.data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.hibernate.annotations.LazyCollection;
|
||||
import org.hibernate.annotations.LazyCollectionOption;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.hibernate.annotations.LazyCollection;
|
||||
import org.hibernate.annotations.LazyCollectionOption;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Entity
|
||||
@Table(name = "WORKFLOW")
|
||||
@@ -25,6 +24,8 @@ public class Workflow extends BaseData {
|
||||
private Integer wOrder;
|
||||
@Column(name = "WLIMIT", precision=15, scale=4)
|
||||
private BigDecimal limit;
|
||||
@Column(name = "SIGNATURE")
|
||||
private Boolean signature;
|
||||
|
||||
public Boolean getCentre() {
|
||||
return centre;
|
||||
@@ -68,4 +69,11 @@ public class Workflow extends BaseData {
|
||||
this.limit = limit;
|
||||
}
|
||||
|
||||
public Boolean getSignature() {
|
||||
return signature;
|
||||
}
|
||||
|
||||
public void setSignature(Boolean signature) {
|
||||
this.signature = signature;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package info.bukova.isspst.services.requirement;
|
||||
|
||||
import info.bukova.isspst.data.RequirementBase;
|
||||
import info.bukova.isspst.data.User;
|
||||
import info.bukova.isspst.data.Workflow;
|
||||
import info.bukova.isspst.services.Service;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -26,6 +27,7 @@ public interface RequirementBaseService<T extends RequirementBase> extends Servi
|
||||
public boolean canApprove(T entity);
|
||||
public List<User> getNextApprover(T entity);
|
||||
public boolean prepareSignData(T entity, Date approveDate);
|
||||
public Workflow getNextWorkflow(T entity);
|
||||
|
||||
public List<T> getMy();
|
||||
|
||||
|
||||
+12
-6
@@ -150,6 +150,7 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
|
||||
workflow.setLimit(w.getLimit());
|
||||
workflow.setOrder(w.getOrder());
|
||||
workflow.setRole(w.getRole());
|
||||
workflow.setSignature(w.getSignature());
|
||||
entity.getWorkflow().add(workflow);
|
||||
}
|
||||
}
|
||||
@@ -277,6 +278,12 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
|
||||
|
||||
super.update(e);
|
||||
|
||||
if (signedPdf != null) {
|
||||
saveSignedDoc(e, signedPdf);
|
||||
} else if (wf.getSignature() != null && wf.getSignature()) {
|
||||
throw new ApproveException("ErrApproveMustBeSigned");
|
||||
}
|
||||
|
||||
if (!autoApprove(e, approveDate)) {
|
||||
this.sendToApprovers(e);
|
||||
|
||||
@@ -300,11 +307,6 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
|
||||
}
|
||||
}
|
||||
|
||||
if (signedPdf != null)
|
||||
{
|
||||
saveSignedDoc(e, signedPdf);
|
||||
}
|
||||
|
||||
postApprove(e);
|
||||
}
|
||||
|
||||
@@ -381,7 +383,11 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
|
||||
return false;
|
||||
}
|
||||
|
||||
protected Workflow getNextWorkflow(T e) {
|
||||
@Override
|
||||
@Transactional
|
||||
public Workflow getNextWorkflow(T entity) {
|
||||
T e = dao.getById(entity.getId());
|
||||
|
||||
AuthItem authItem = null;
|
||||
if (e.getWorkflow() == null) {
|
||||
return null;
|
||||
|
||||
@@ -33,6 +33,7 @@ public class ApproveDialogVM {
|
||||
@WireVariable
|
||||
private SessionData sessionData;
|
||||
private boolean signed;
|
||||
private boolean signRequired;
|
||||
private boolean timer;
|
||||
private byte[] signedPdf;
|
||||
|
||||
@@ -53,7 +54,14 @@ public class ApproveDialogVM {
|
||||
this.grid = grid;
|
||||
this.approveDate = new Date();
|
||||
|
||||
if (service.getNextWorkflow(requirement).getSignature() != null
|
||||
&& service.getNextWorkflow(requirement).getSignature()) {
|
||||
this.signed = false;
|
||||
this.signRequired = true;
|
||||
} else {
|
||||
this.signRequired = false;
|
||||
}
|
||||
|
||||
this.timer = false;
|
||||
}
|
||||
|
||||
@@ -103,4 +111,7 @@ public class ApproveDialogVM {
|
||||
return timer;
|
||||
}
|
||||
|
||||
public boolean isSignRequired() {
|
||||
return signRequired;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,13 +6,6 @@ import info.bukova.isspst.data.Role;
|
||||
import info.bukova.isspst.data.Workflow;
|
||||
import info.bukova.isspst.services.requirement.RequirementTypeService;
|
||||
import info.bukova.isspst.services.users.RoleService;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.zkoss.bind.annotation.BindingParam;
|
||||
import org.zkoss.bind.annotation.Command;
|
||||
import org.zkoss.bind.annotation.GlobalCommand;
|
||||
@@ -24,6 +17,12 @@ import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||
import org.zkoss.zul.Listitem;
|
||||
import org.zkoss.zul.Window;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class RequirementTypesVM {
|
||||
|
||||
@WireVariable
|
||||
@@ -237,6 +236,18 @@ public class RequirementTypesVM {
|
||||
win.doModal();
|
||||
}
|
||||
|
||||
@Command
|
||||
@NotifyChange({"selected", "centreSelWorkflow", "wgSelWorkflow"})
|
||||
public void toggleSignature(@BindingParam("workflow") Workflow workflow) {
|
||||
if (workflow.getSignature() != null && workflow.getSignature()) {
|
||||
workflow.setSignature(false);
|
||||
} else {
|
||||
workflow.setSignature(true);
|
||||
}
|
||||
|
||||
reqTypeService.update(selected);
|
||||
}
|
||||
|
||||
@GlobalCommand
|
||||
@NotifyChange("selected")
|
||||
public void refresh() {
|
||||
|
||||
@@ -412,3 +412,7 @@ ForeignPersons = Cizí osoby
|
||||
TripBillResultMessageText = Zpráva z pracovní cesty
|
||||
ErrFillTripBillResultMessageText = Vyplňte zprávu z pracovní cesty.
|
||||
ErrFillTripBillResultTimes = Zadejte časy odjezdu a příjezdu.
|
||||
|
||||
ErrApproveMustBeSigned = Schválení musí být digitálně podepsané.
|
||||
DigitalSignature = Elektronický podpis
|
||||
ContextMenu = Volby v kontextovém menu
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 790 B |
@@ -17,12 +17,12 @@
|
||||
<label value="${labels.RequirementApproveDate}"/>
|
||||
<datebox
|
||||
value="@bind(vm.approveDate)"
|
||||
format="${labels.DateFormat}" disabled="@load(vm.signed)"/>
|
||||
format="${labels.DateFormat}" disabled="@load(vm.signed and vm.signRequired)"/>
|
||||
</hbox>
|
||||
<separator bar="true" hflex="1"/>
|
||||
<hbox>
|
||||
<button label="Podepsat" onClick="@command('signPdf')" sclass="nicebutton" disabled="@load(vm.signed)"/>
|
||||
<button image="/img/approve-016.png" label="${labels.Confirm}" onClick="@command('approve', window=approveWin)" sclass="nicebutton" disabled="@load(not vm.signed)"/>
|
||||
<button label="Podepsat" onClick="@command('signPdf')" sclass="nicebutton" disabled="@load(vm.signed or not vm.signRequired)"/>
|
||||
<button image="/img/approve-016.png" label="${labels.Confirm}" onClick="@command('approve', window=approveWin)" sclass="nicebutton" disabled="@load(not vm.signed and vm.signRequired)"/>
|
||||
<button image="~./zul/img/misc/drag-disallow.png" label="${labels.ButtonStorno}" onClick="approveWin.detach()" sclass="nicebutton"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?page title="${labels.AgendaWorkflow}" contentType="text/html;charset=UTF-8"?>
|
||||
<zk>
|
||||
<zk xmlns="http://www.zkoss.org/2005/zul"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">
|
||||
<window border="normal" apply="org.zkoss.bind.BindComposer"
|
||||
viewModel="@id('vm') @init('info.bukova.isspst.ui.requirement.RequirementTypesVM')"
|
||||
vflex="1">
|
||||
@@ -63,32 +65,46 @@
|
||||
<groupbox mold="3d" visible="@load(not empty vm.selected)">
|
||||
<caption label="${labels.Workflow}"/>
|
||||
<vbox>
|
||||
<label value="${labels.ContextMenu}"/>
|
||||
<listbox id="wgWorkflow" model="@load(vm.selected.workflow)" droppable="workgroup"
|
||||
onDrop="@command('addRoleWg', event=event)"
|
||||
selectedItem="@bind(vm.wgSelWorkflow)">
|
||||
<listhead>
|
||||
<listheader width="50px"/>
|
||||
<listheader label="${labels.WorkgroupWorkflow}"/>
|
||||
</listhead>
|
||||
<template name="model">
|
||||
<listitem label="@load(each.role.description)" visible="@load(not each.centre)"
|
||||
<listitem visible="@load(not each.centre)"
|
||||
onDrop="@command('reorderWg', event=event)" draggable="workgroup" droppable="workgroup"
|
||||
context="limitPopUpWg"
|
||||
style="@load(empty each.limit ? '' : 'background-color: #e1fdd5')"
|
||||
tooltiptext="@load(empty each.limit ? '' : labels.Limit.concat(' ').concat(each.limit))"/>
|
||||
tooltiptext="@load(empty each.limit ? '' : labels.Limit.concat(' ').concat(each.limit))">
|
||||
<listcell>
|
||||
<image src="/img/money-small.png" visible="@load(not empty each.limit)"/>
|
||||
<image src="/img/sign-small.png" visible="@load(each.signature)"/>
|
||||
</listcell>
|
||||
<listcell label="@load(each.role.description)"/>
|
||||
</listitem>
|
||||
</template>
|
||||
</listbox>
|
||||
<listbox id="centreWorkflow" model="@load(vm.selected.workflow)" droppable="centre"
|
||||
onDrop="@command('addRoleCentre', event=event)"
|
||||
selectedItem="@bind(vm.centreSelWorkflow)">
|
||||
<listhead>
|
||||
<listheader width="50px"/>
|
||||
<listheader label="${labels.CentreWorkflow}"/>
|
||||
</listhead>
|
||||
<template name="model">
|
||||
<listitem label="@load(each.role.description)" visible="@load(each.centre)"
|
||||
<listitem visible="@load(each.centre)"
|
||||
onDrop="@command('reorderCentre', event=event)" draggable="centre" droppable="centre"
|
||||
context="limitPopUp"
|
||||
style="@load(empty each.limit ? '' : 'background-color: #e1fdd5')"
|
||||
tooltiptext="@load(empty each.limit ? '' : labels.Limit.concat(' ').concat(each.limit))"/>
|
||||
tooltiptext="@load(empty each.limit ? '' : labels.Limit.concat(' ').concat(each.limit))">
|
||||
<listcell>
|
||||
<image src="/img/money-small.png" visible="@load(not empty each.limit)"/>
|
||||
<image src="/img/sign-small.png" visible="@load(each.signature)"/>
|
||||
</listcell>
|
||||
<listcell label="@load(each.role.description)"/>
|
||||
</listitem>
|
||||
</template>
|
||||
</listbox>
|
||||
</vbox>
|
||||
@@ -97,11 +113,17 @@
|
||||
<menuitem label="${labels.OverLimit}" checkmark="true"
|
||||
checked="@load(not empty vm.centreSelWorkflow.limit)"
|
||||
onClick="@command('overLimit', workflow=centreWorkflow.selectedItem.value)"/>
|
||||
<menuitem label="${labels.DigitalSignature}" checkmark="true"
|
||||
checked="@load(vm.centreSelWorkflow.signature)"
|
||||
onClick="@command('toggleSignature', workflow=centreWorkflow.selectedItem.value)"/>
|
||||
</menupopup>
|
||||
<menupopup id="limitPopUpWg">
|
||||
<menuitem label="${labels.OverLimit}" checkmark="true"
|
||||
checked="@load(not empty vm.wgSelWorkflow.limit)"
|
||||
onClick="@command('overLimit', workflow=wgWorkflow.selectedItem.value)"/>
|
||||
<menuitem label="${labels.DigitalSignature}" checkmark="true"
|
||||
checked="@load(vm.wgSelWorkflow.signature)"
|
||||
onClick="@command('toggleSignature', workflow=wgWorkflow.selectedItem.value)"/>
|
||||
</menupopup>
|
||||
</div>
|
||||
</hbox>
|
||||
|
||||
Reference in New Issue
Block a user