Merge branch 'feature/bpm' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into master-jdk17
This commit is contained in:
commit
36165e72fc
|
@ -44,6 +44,7 @@ public class RateLimiterRedisDAO {
|
|||
RateLimiterConfig config = rateLimiter.getConfig();
|
||||
if (config == null) {
|
||||
rateLimiter.trySetRate(RateType.OVERALL, count, rateInterval, RateIntervalUnit.SECONDS);
|
||||
rateLimiter.expire(rateInterval, TimeUnit.SECONDS); // 原因参见 https://t.zsxq.com/lcR0W
|
||||
return rateLimiter;
|
||||
}
|
||||
// 2. 如果存在,并且配置相同,则直接返回
|
||||
|
@ -54,6 +55,7 @@ public class RateLimiterRedisDAO {
|
|||
}
|
||||
// 3. 如果存在,并且配置不同,则进行新建
|
||||
rateLimiter.setRate(RateType.OVERALL, count, rateInterval, RateIntervalUnit.SECONDS);
|
||||
rateLimiter.expire(rateInterval, TimeUnit.SECONDS); // 原因参见 https://t.zsxq.com/lcR0W
|
||||
return rateLimiter;
|
||||
}
|
||||
|
||||
|
|
|
@ -82,13 +82,11 @@ public class BpmModelMetaInfoVO {
|
|||
@Schema(description = "摘要设置", example = "{}")
|
||||
private SummarySetting summarySetting;
|
||||
|
||||
// TODO @lesan:processBeforeTriggerSetting;要不叫这个?主要考虑,notify 留给后续的站内信、短信、邮件这种 notify 通知哈。
|
||||
@Schema(description = "流程前置通知设置", example = "{}")
|
||||
private HttpRequestSetting PreProcessNotifySetting;
|
||||
private HttpRequestSetting processBeforeTriggerSetting;
|
||||
|
||||
// TODO @lesan:processAfterTriggerSetting
|
||||
@Schema(description = "流程后置通知设置", example = "{}")
|
||||
private HttpRequestSetting PostProcessNotifySetting;
|
||||
private HttpRequestSetting processAfterTriggerSetting;
|
||||
|
||||
@Schema(description = "流程 ID 规则")
|
||||
@Data
|
||||
|
|
|
@ -188,16 +188,15 @@ public class BpmProcessDefinitionInfoDO extends BaseDO {
|
|||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private BpmModelMetaInfoVO.SummarySetting summarySetting;
|
||||
|
||||
// TODO @lesan:processBeforeTriggerSetting;要不叫这个?主要考虑,notify 留给后续的站内信、短信、邮件这种 notify 通知哈。
|
||||
/**
|
||||
* 流程前置通知设置
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class, exist = false) // TODO @芋艿:临时注释 exist,因为要合并 master-jdk17
|
||||
private BpmModelMetaInfoVO.HttpRequestSetting PreProcessNotifySetting;
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private BpmModelMetaInfoVO.HttpRequestSetting processBeforeTriggerSetting;
|
||||
/**
|
||||
* 流程后置通知设置
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class, exist = false) // TODO @芋艿:临时注释 exist,因为要合并 master-jdk17
|
||||
private BpmModelMetaInfoVO.HttpRequestSetting PostProcessNotifySetting;
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private BpmModelMetaInfoVO.HttpRequestSetting processAfterTriggerSetting;
|
||||
|
||||
}
|
||||
|
|
|
@ -10,7 +10,10 @@ import org.flowable.common.engine.impl.el.ExpressionManager;
|
|||
import org.flowable.engine.delegate.DelegateExecution;
|
||||
import org.flowable.engine.impl.bpmn.behavior.UserTaskActivityBehavior;
|
||||
import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
|
||||
import org.flowable.engine.impl.persistence.entity.ProcessDefinitionEntity;
|
||||
import org.flowable.engine.impl.util.CommandContextUtil;
|
||||
import org.flowable.engine.impl.util.TaskHelper;
|
||||
import org.flowable.engine.interceptor.CreateUserTaskBeforeContext;
|
||||
import org.flowable.task.service.TaskService;
|
||||
import org.flowable.task.service.impl.persistence.entity.TaskEntity;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
@ -69,4 +72,15 @@ public class BpmUserTaskActivityBehavior extends UserTaskActivityBehavior {
|
|||
return CollUtil.get(candidateUserIds, index);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleCategory(CreateUserTaskBeforeContext beforeContext, ExpressionManager expressionManager,
|
||||
TaskEntity task, DelegateExecution execution) {
|
||||
ProcessDefinitionEntity processDefinitionEntity = CommandContextUtil.getProcessDefinitionEntityManager().findById(execution.getProcessDefinitionId());
|
||||
if (processDefinitionEntity == null) {
|
||||
log.warn("[handleCategory][任务编号({}) 找不到流程定义({})]", task.getId(), execution.getProcessDefinitionId());
|
||||
return;
|
||||
}
|
||||
task.setCategory(processDefinitionEntity.getCategory());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil;
|
|||
import cn.iocoder.yudao.framework.common.core.KeyValue;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.spring.SpringUtils;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.simple.BpmSimpleModelNodeVO;
|
||||
import cn.iocoder.yudao.module.bpm.enums.definition.BpmHttpRequestParamTypeEnum;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
||||
|
@ -40,11 +41,9 @@ public class BpmHttpRequestUtils {
|
|||
List<BpmSimpleModelNodeVO.HttpRequestParam> headerParams,
|
||||
List<BpmSimpleModelNodeVO.HttpRequestParam> bodyParams,
|
||||
Boolean handleResponse,
|
||||
List<KeyValue<String, String>> response,
|
||||
// TODO @lesan:RestTemplate 直接通过 springUtil 获取好咧;
|
||||
RestTemplate restTemplate,
|
||||
// TODO @lesan:processInstanceService 直接通过 springUtil 获取好咧;
|
||||
BpmProcessInstanceService processInstanceService) {
|
||||
List<KeyValue<String, String>> response) {
|
||||
RestTemplate restTemplate = SpringUtils.getBean(RestTemplate.class);
|
||||
BpmProcessInstanceService processInstanceService = SpringUtils.getBean(BpmProcessInstanceService.class);
|
||||
|
||||
// 1.1 设置请求头
|
||||
MultiValueMap<String, String> headers = buildHttpHeaders(processInstance, headerParams);
|
||||
|
@ -55,27 +54,27 @@ public class BpmHttpRequestUtils {
|
|||
ResponseEntity<String> responseEntity = sendHttpRequest(url, headers, body, restTemplate);
|
||||
|
||||
// 3. 处理返回
|
||||
// TODO @lesan:可以用 if return,让括号小点
|
||||
if (Boolean.TRUE.equals(handleResponse)) {
|
||||
// 3.1 判断是否需要解析返回值
|
||||
if (responseEntity == null
|
||||
|| StrUtil.isEmpty(responseEntity.getBody())
|
||||
|| !responseEntity.getStatusCode().is2xxSuccessful()
|
||||
|| CollUtil.isEmpty(response)) {
|
||||
return;
|
||||
}
|
||||
// 3.2 解析返回值, 返回值必须符合 CommonResult 规范。
|
||||
CommonResult<Map<String, Object>> respResult = JsonUtils.parseObjectQuietly(responseEntity.getBody(),
|
||||
new TypeReference<>() {});
|
||||
if (respResult == null || !respResult.isSuccess()) {
|
||||
return;
|
||||
}
|
||||
// 3.3 获取需要更新的流程变量
|
||||
Map<String, Object> updateVariables = getNeedUpdatedVariablesFromResponse(respResult.getData(), response);
|
||||
// 3.4 更新流程变量
|
||||
if (CollUtil.isNotEmpty(updateVariables)) {
|
||||
processInstanceService.updateProcessInstanceVariables(processInstance.getId(), updateVariables);
|
||||
}
|
||||
if (Boolean.FALSE.equals(handleResponse)) {
|
||||
return;
|
||||
}
|
||||
// 3.1 判断是否需要解析返回值
|
||||
if (responseEntity == null
|
||||
|| StrUtil.isEmpty(responseEntity.getBody())
|
||||
|| !responseEntity.getStatusCode().is2xxSuccessful()
|
||||
|| CollUtil.isEmpty(response)) {
|
||||
return;
|
||||
}
|
||||
// 3.2 解析返回值, 返回值必须符合 CommonResult 规范。
|
||||
CommonResult<Map<String, Object>> respResult = JsonUtils.parseObjectQuietly(responseEntity.getBody(),
|
||||
new TypeReference<>() {});
|
||||
if (respResult == null || !respResult.isSuccess()) {
|
||||
return;
|
||||
}
|
||||
// 3.3 获取需要更新的流程变量
|
||||
Map<String, Object> updateVariables = getNeedUpdatedVariablesFromResponse(respResult.getData(), response);
|
||||
// 3.4 更新流程变量
|
||||
if (CollUtil.isNotEmpty(updateVariables)) {
|
||||
processInstanceService.updateProcessInstanceVariables(processInstance.getId(), updateVariables);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -907,17 +907,9 @@ public class BpmnModelUtils {
|
|||
* @return 符合条件的路径
|
||||
*/
|
||||
private static SequenceFlow findMatchSequenceFlowByExclusiveGateway(Gateway gateway, Map<String, Object> variables) {
|
||||
// TODO 表单无可编辑字段时variables为空,流程走向会出现问题,比如流程审批过程中无需要修改的字段值,
|
||||
// TODO @小北:是不是还是保证,编辑的时候,如果计算下一个节点,还是 variables 是完整体?而不是空的!!!(可以微信讨论下)
|
||||
SequenceFlow matchSequenceFlow;
|
||||
if (CollUtil.isNotEmpty(variables)) {
|
||||
matchSequenceFlow = CollUtil.findOne(gateway.getOutgoingFlows(),
|
||||
SequenceFlow matchSequenceFlow = CollUtil.findOne(gateway.getOutgoingFlows(),
|
||||
flow -> ObjUtil.notEqual(gateway.getDefaultFlow(), flow.getId())
|
||||
&& (evalConditionExpress(variables, flow.getConditionExpression())));
|
||||
} else {
|
||||
matchSequenceFlow = CollUtil.findOne(gateway.getOutgoingFlows(),
|
||||
flow -> ObjUtil.notEqual(gateway.getDefaultFlow(), flow.getId()));
|
||||
}
|
||||
if (matchSequenceFlow == null) {
|
||||
matchSequenceFlow = CollUtil.findOne(gateway.getOutgoingFlows(),
|
||||
flow -> ObjUtil.equal(gateway.getDefaultFlow(), flow.getId()));
|
||||
|
|
|
@ -248,16 +248,14 @@ public class BpmModelServiceImpl implements BpmModelService {
|
|||
throw exception(MODEL_DEPLOY_FAIL_BPMN_USER_TASK_NAME_NOT_EXISTS, userTask.getId());
|
||||
}
|
||||
});
|
||||
// TODO @小北:是不是可以 UserTask firUserTask = CollUtil.get(userTasks, BpmModelTypeEnum.BPMN.getType().equals(type) ? 0 : 1);然后,最好判空。。。极端情况下,没 usertask ,哈哈哈哈。
|
||||
// 3. 校验第一个用户任务节点的规则类型是否为“审批人自选”
|
||||
Map<Integer, UserTask> userTaskMap = new HashMap<>();
|
||||
// BPMN 设计器,校验第一个用户任务节点
|
||||
userTaskMap.put(BpmModelTypeEnum.BPMN.getType(), userTasks.get(0));
|
||||
// SIMPLE 设计器,第一个节点固定为发起人所以校验第二个用户任务节点
|
||||
userTaskMap.put(BpmModelTypeEnum.SIMPLE.getType(), userTasks.get(1));
|
||||
Integer candidateStrategy = parseCandidateStrategy(userTaskMap.get(type));
|
||||
// 3. 校验第一个用户任务节点的规则类型是否为“审批人自选”,BPMN 设计器,校验第一个用户任务节点,SIMPLE 设计器,第一个节点固定为发起人所以校验第二个用户任务节点
|
||||
UserTask firUserTask = CollUtil.get(userTasks, BpmModelTypeEnum.BPMN.getType().equals(type) ? 0 : 1);
|
||||
if (firUserTask == null) {
|
||||
return;
|
||||
}
|
||||
Integer candidateStrategy = parseCandidateStrategy(firUserTask);
|
||||
if (Objects.equals(candidateStrategy, BpmTaskCandidateStrategyEnum.APPROVE_USER_SELECT.getStrategy())) {
|
||||
throw exception(MODEL_DEPLOY_FAIL_FIRST_USER_TASK_CANDIDATE_STRATEGY_ERROR, userTaskMap.get(type).getName());
|
||||
throw exception(MODEL_DEPLOY_FAIL_FIRST_USER_TASK_CANDIDATE_STRATEGY_ERROR, firUserTask.getName());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -122,9 +122,6 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService
|
|||
@Resource
|
||||
private BpmProcessIdRedisDAO processIdRedisDAO;
|
||||
|
||||
@Resource
|
||||
private RestTemplate restTemplate;
|
||||
|
||||
// ========== Query 查询相关方法 ==========
|
||||
|
||||
@Override
|
||||
|
@ -914,16 +911,14 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService
|
|||
BpmProcessDefinitionInfoDO processDefinitionInfo = processDefinitionService.
|
||||
getProcessDefinitionInfo(instance.getProcessDefinitionId());
|
||||
if (ObjUtil.isNotNull(processDefinitionInfo) &&
|
||||
ObjUtil.isNotNull(processDefinitionInfo.getPostProcessNotifySetting())) {
|
||||
BpmModelMetaInfoVO.HttpRequestSetting setting = processDefinitionInfo.getPostProcessNotifySetting();
|
||||
ObjUtil.isNotNull(processDefinitionInfo.getProcessAfterTriggerSetting())) {
|
||||
BpmModelMetaInfoVO.HttpRequestSetting setting = processDefinitionInfo.getProcessAfterTriggerSetting();
|
||||
|
||||
BpmHttpRequestUtils.executeBpmHttpRequest(instance,
|
||||
setting.getUrl(),
|
||||
setting.getHeader(),
|
||||
setting.getBody(),
|
||||
true, setting.getResponse(),
|
||||
restTemplate,
|
||||
this);
|
||||
true, setting.getResponse());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -936,18 +931,16 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService
|
|||
// 流程前置通知
|
||||
BpmProcessDefinitionInfoDO processDefinitionInfo = processDefinitionService.
|
||||
getProcessDefinitionInfo(instance.getProcessDefinitionId());
|
||||
// TODO @lesan:if return 哈。减少括号。
|
||||
if (ObjUtil.isNotNull(processDefinitionInfo) &&
|
||||
ObjUtil.isNotNull(processDefinitionInfo.getPreProcessNotifySetting())) {
|
||||
BpmModelMetaInfoVO.HttpRequestSetting setting = processDefinitionInfo.getPreProcessNotifySetting();
|
||||
BpmHttpRequestUtils.executeBpmHttpRequest(instance,
|
||||
setting.getUrl(),
|
||||
setting.getHeader(),
|
||||
setting.getBody(),
|
||||
true, setting.getResponse(),
|
||||
restTemplate,
|
||||
this);
|
||||
if (ObjUtil.isNull(processDefinitionInfo) ||
|
||||
ObjUtil.isNull(processDefinitionInfo.getProcessBeforeTriggerSetting())) {
|
||||
return;
|
||||
}
|
||||
BpmModelMetaInfoVO.HttpRequestSetting setting = processDefinitionInfo.getProcessBeforeTriggerSetting();
|
||||
BpmHttpRequestUtils.executeBpmHttpRequest(instance,
|
||||
setting.getUrl(),
|
||||
setting.getHeader(),
|
||||
setting.getBody(),
|
||||
true, setting.getResponse());
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
|||
import cn.iocoder.yudao.framework.common.util.number.NumberUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.object.ObjectUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.object.PageUtils;
|
||||
import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
|
||||
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.*;
|
||||
import cn.iocoder.yudao.module.bpm.convert.task.BpmTaskConvert;
|
||||
|
@ -557,18 +558,31 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
|||
// 2.2 添加评论
|
||||
taskService.addComment(task.getId(), task.getProcessInstanceId(), BpmCommentTypeEnum.APPROVE.getType(),
|
||||
BpmCommentTypeEnum.APPROVE.formatComment(reqVO.getReason()));
|
||||
// 2.3 校验并处理 APPROVE_USER_SELECT 当前审批人,选择下一节点审批人的逻辑
|
||||
Map<String, Object> variables = validateAndSetNextAssignees(task.getTaskDefinitionKey(), reqVO.getVariables(),
|
||||
|
||||
// 3. 设置流程变量。如果流程变量前端传空,需要从历史实例中获取,原因:前端表单如果在当前节点无可编辑的字段时 variables 一定会为空
|
||||
// 场景一:A 节点发起,B 节点表单无可编辑字段,审批通过时,C 节点需要流程变量获取下一个执行节点,但因为 B 节点无可编辑的字段,variables 为空,流程可能出现问题。
|
||||
// 场景二:A 节点发起,B 节点只有某一个字段可编辑(比如 day),但 C 节点需要多个节点。
|
||||
// (比如 work + day 变量,在发起时填写,因为 B 节点只有 day 的编辑权限,在审批后,variables 会缺少 work 的值)
|
||||
Map<String, Object> processVariables = new HashMap<>();
|
||||
if (CollUtil.isNotEmpty(instance.getProcessVariables())) { // 获取历史中流程变量
|
||||
processVariables.putAll(instance.getProcessVariables());
|
||||
}
|
||||
if (CollUtil.isNotEmpty(reqVO.getVariables())) { // 合并前端传递的流程变量,以前端为准
|
||||
processVariables.putAll(reqVO.getVariables());
|
||||
}
|
||||
|
||||
// 4. 校验并处理 APPROVE_USER_SELECT 当前审批人,选择下一节点审批人的逻辑
|
||||
Map<String, Object> variables = validateAndSetNextAssignees(task.getTaskDefinitionKey(), processVariables,
|
||||
bpmnModel, reqVO.getNextAssignees(), instance);
|
||||
runtimeService.setVariables(task.getProcessInstanceId(), variables);
|
||||
// 2.4 调用 BPM complete 去完成任务
|
||||
|
||||
// 5. 调用 BPM complete 去完成任务
|
||||
taskService.complete(task.getId(), variables, true);
|
||||
|
||||
// 【加签专属】处理加签任务
|
||||
handleParentTaskIfSign(task.getParentTaskId());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 校验选择的下一个节点的审批人,是否合法
|
||||
*
|
||||
|
@ -600,9 +614,7 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
|||
}
|
||||
processVariables = FlowableUtils.getStartUserSelectAssignees(processInstance.getProcessVariables());
|
||||
// 特殊:如果当前节点已经存在审批人,则不允许覆盖
|
||||
// TODO @小北:【不用改】通过 if return,让逻辑更简洁一点;虽然会多判断一次 processVariables,但是 if else 层级更少。
|
||||
if (processVariables != null
|
||||
&& CollUtil.isNotEmpty(processVariables.get(nextFlowNode.getId()))) {
|
||||
if (processVariables != null && CollUtil.isNotEmpty(processVariables.get(nextFlowNode.getId()))) {
|
||||
continue;
|
||||
}
|
||||
// 设置 PROCESS_INSTANCE_VARIABLE_START_USER_SELECT_ASSIGNEES
|
||||
|
@ -622,13 +634,6 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
|||
processVariables = FlowableUtils.getApproveUserSelectAssignees(processInstance.getProcessVariables());
|
||||
if (processVariables == null) {
|
||||
processVariables = new HashMap<>();
|
||||
} else {
|
||||
List<Long> approveUserSelectAssignee = processVariables.get(nextFlowNode.getId());
|
||||
// 特殊:如果当前节点已经存在审批人,则不允许覆盖
|
||||
// TODO @小北:这种,应该可以覆盖呢。
|
||||
if (CollUtil.isNotEmpty(approveUserSelectAssignee)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// 设置 PROCESS_INSTANCE_VARIABLE_APPROVE_USER_SELECT_ASSIGNEES
|
||||
processVariables.put(nextFlowNode.getId(), assignees);
|
||||
|
@ -1251,6 +1256,7 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
|||
}
|
||||
|
||||
@Override
|
||||
@DataPermission(enable = false) // 忽略数据权限,避免因为过滤,导致找不到候选人
|
||||
public void processTaskAssigned(Task task) {
|
||||
// 发送通知。在事务提交时,批量执行操作,所以直接查询会无法查询到 ProcessInstance,所以这里是通过监听事务的提交来实现。
|
||||
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
|
||||
|
|
|
@ -33,9 +33,6 @@ public class BpmUserTaskListener implements TaskListener {
|
|||
@Resource
|
||||
private BpmProcessInstanceService processInstanceService;
|
||||
|
||||
@Resource
|
||||
private RestTemplate restTemplate;
|
||||
|
||||
@Setter
|
||||
private FixedValue listenerConfig;
|
||||
|
||||
|
@ -59,9 +56,7 @@ public class BpmUserTaskListener implements TaskListener {
|
|||
listenerHandler.getPath(),
|
||||
listenerHandler.getHeader(),
|
||||
listenerHandler.getBody(),
|
||||
false, null,
|
||||
restTemplate,
|
||||
processInstanceService);
|
||||
false, null);
|
||||
|
||||
// 3. 是否需要后续操作?TODO 芋艿:待定!
|
||||
}
|
||||
|
|
|
@ -21,9 +21,6 @@ import org.springframework.web.client.RestTemplate;
|
|||
@Slf4j
|
||||
public class BpmHttpCallbackTrigger extends BpmAbstractHttpRequestTrigger {
|
||||
|
||||
@Resource
|
||||
private RestTemplate restTemplate;
|
||||
|
||||
@Resource
|
||||
private BpmProcessInstanceService processInstanceService;
|
||||
|
||||
|
@ -51,9 +48,7 @@ public class BpmHttpCallbackTrigger extends BpmAbstractHttpRequestTrigger {
|
|||
setting.getUrl(),
|
||||
setting.getHeader(),
|
||||
setting.getBody(),
|
||||
false, null,
|
||||
restTemplate,
|
||||
processInstanceService);
|
||||
false, null);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,9 +20,6 @@ import org.springframework.web.client.RestTemplate;
|
|||
@Slf4j
|
||||
public class BpmSyncHttpRequestTrigger extends BpmAbstractHttpRequestTrigger {
|
||||
|
||||
@Resource
|
||||
private RestTemplate restTemplate;
|
||||
|
||||
@Resource
|
||||
private BpmProcessInstanceService processInstanceService;
|
||||
|
||||
|
@ -46,9 +43,7 @@ public class BpmSyncHttpRequestTrigger extends BpmAbstractHttpRequestTrigger {
|
|||
setting.getUrl(),
|
||||
setting.getHeader(),
|
||||
setting.getBody(),
|
||||
true, setting.getResponse(),
|
||||
restTemplate,
|
||||
processInstanceService);
|
||||
true, setting.getResponse());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.system.api.user;
|
|||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
|
||||
import cn.iocoder.yudao.framework.datapermission.core.util.DataPermissionUtils;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||
|
@ -12,7 +12,10 @@ import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
|||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||
|
||||
|
@ -56,10 +59,11 @@ public class AdminUserApiImpl implements AdminUserApi {
|
|||
}
|
||||
|
||||
@Override
|
||||
@DataPermission(enable = false) // 禁用数据权限。原因是,一般基于指定 id 的 API 查询,都是数据拼接为主
|
||||
public List<AdminUserRespDTO> getUserList(Collection<Long> ids) {
|
||||
List<AdminUserDO> users = userService.getUserList(ids);
|
||||
return BeanUtils.toBean(users, AdminUserRespDTO.class);
|
||||
return DataPermissionUtils.executeIgnore(() -> { // 禁用数据权限。原因是,一般基于指定 id 的 API 查询,都是数据拼接为主
|
||||
List<AdminUserDO> users = userService.getUserList(ids);
|
||||
return BeanUtils.toBean(users, AdminUserRespDTO.class);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue