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")
|
||||
@@ -24,7 +23,9 @@ public class Workflow extends BaseData {
|
||||
@Column(name = "WORDER")
|
||||
private Integer wOrder;
|
||||
@Column(name = "WLIMIT", precision=15, scale=4)
|
||||
private BigDecimal limit;
|
||||
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();
|
||||
|
||||
|
||||
+13
-7
@@ -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);
|
||||
}
|
||||
|
||||
@@ -380,8 +382,12 @@ 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();
|
||||
|
||||
this.signed = false;
|
||||
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
|
||||
@@ -236,6 +235,18 @@ public class RequirementTypesVM {
|
||||
Window win = (Window) Executions.createComponents("/settings/workflow/limit.zul", null, params);
|
||||
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")
|
||||
|
||||
Reference in New Issue
Block a user