mirror of
https://github.com/getrebuild/rebuild.git
synced 2025-03-13 15:44:26 +08:00
fix approval form
This commit is contained in:
parent
29cdfc52eb
commit
7e72b52b0f
2 changed files with 12 additions and 8 deletions
|
@ -22,9 +22,8 @@ import com.rebuild.core.service.general.EntityService;
|
|||
import com.rebuild.core.support.SetUser;
|
||||
import com.rebuild.core.support.i18n.Language;
|
||||
import com.rebuild.utils.JSONUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.*;
|
||||
|
@ -35,10 +34,9 @@ import java.util.*;
|
|||
* @author devezhao zhaofang123@gmail.com
|
||||
* @since 2019/06/24
|
||||
*/
|
||||
@Slf4j
|
||||
public class ApprovalProcessor extends SetUser {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ApprovalProcessor.class);
|
||||
|
||||
// 最大撤销次数
|
||||
private static final int MAX_REVOKED = 3;
|
||||
|
||||
|
@ -80,13 +78,13 @@ public class ApprovalProcessor extends SetUser {
|
|||
|
||||
FlowNodeGroup nextNodes = getNextNodes(FlowNode.NODE_ROOT);
|
||||
if (!nextNodes.isValid()) {
|
||||
LOG.warn("No next-node be found");
|
||||
log.warn("No next-node be found");
|
||||
return false;
|
||||
}
|
||||
|
||||
Set<ID> nextApprovers = nextNodes.getApproveUsers(this.getUser(), this.record, selectNextUsers);
|
||||
if (nextApprovers.isEmpty()) {
|
||||
LOG.warn("No any approvers special");
|
||||
log.warn("No any approvers special");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -444,6 +442,12 @@ public class ApprovalProcessor extends SetUser {
|
|||
}
|
||||
|
||||
private void shareIfNeed(ID recordId, Set<ID> shareTo) {
|
||||
// 当前用户无共享权限
|
||||
if (!Application.getPrivilegesManager().allowShare(getUser(), recordId)) {
|
||||
log.warn("Current userm no share privileges to auto-share : {} >> {}", getUser(), recordId);
|
||||
return;
|
||||
}
|
||||
|
||||
final EntityService es = Application.getEntityService(recordId.getEntityCode());
|
||||
for (ID user : shareTo) {
|
||||
if (!Application.getPrivilegesManager().allowRead(user, recordId)) {
|
||||
|
|
|
@ -417,7 +417,7 @@ class ApprovalApproveForm extends ApprovalUsersForm {
|
|||
return (
|
||||
<div className="form-group">
|
||||
<label>{$L('信息完善 (驳回时无需填写)')}</label>
|
||||
<EditableForm $$$parent={fake} entity={this.props.entity} ref={(c) => (this._rbform = c)}>
|
||||
<EditableForm entity={this.props.entity} id={this.props.id} rawModel={{}} $$$parent={fake} ref={(c) => (this._rbform = c)}>
|
||||
{this.state.aform.map((item) => {
|
||||
item.isFull = true
|
||||
// eslint-disable-next-line no-undef
|
||||
|
@ -478,7 +478,7 @@ class ApprovalApproveForm extends ApprovalUsersForm {
|
|||
// eslint-disable-next-line no-undef
|
||||
class EditableForm extends RbForm {
|
||||
constructor(props) {
|
||||
super({ ...props, rawModel: {} })
|
||||
super(props)
|
||||
}
|
||||
|
||||
renderFormAction() {
|
||||
|
|
Loading…
Reference in a new issue