Merge branch 'master-jdk17' of https://gitee.com/zhijiantianya/ruoyi-vue-pro
# Conflicts: # yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/util/BpmHttpRequestUtils.java # yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmProcessInstanceServiceImpl.java # yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApiImpl.java
This commit is contained in:
commit
7609c74c8b
|
@ -92,10 +92,36 @@ public interface BaseMapperX<T> extends MPJBaseMapper<T> {
|
|||
|
||||
default T selectOne(SFunction<T, ?> field1, Object value1, SFunction<T, ?> field2, Object value2,
|
||||
SFunction<T, ?> field3, Object value3) {
|
||||
return selectOne(new LambdaQueryWrapper<T>().eq(field1, value1).eq(field2, value2)
|
||||
.eq(field3, value3));
|
||||
return selectOne(new LambdaQueryWrapper<T>().eq(field1, value1).eq(field2, value2).eq(field3, value3));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取满足条件的第 1 条记录
|
||||
*
|
||||
* 目的:解决并发场景下,插入多条记录后,使用 selectOne 会报错的问题
|
||||
*
|
||||
* @param field 字段名
|
||||
* @param value 字段值
|
||||
* @return 实体
|
||||
*/
|
||||
default T selectFirstOne(SFunction<T, ?> field, Object value) {
|
||||
// 如果明确使用 MySQL 等场景,可以考虑使用 LIMIT 1 进行优化
|
||||
List<T> list = selectList(new LambdaQueryWrapper<T>().eq(field, value));
|
||||
return CollUtil.getFirst(list);
|
||||
}
|
||||
|
||||
default T selectFirstOne(SFunction<T, ?> field1, Object value1, SFunction<T, ?> field2, Object value2) {
|
||||
List<T> list = selectList(new LambdaQueryWrapper<T>().eq(field1, value1).eq(field2, value2));
|
||||
return CollUtil.getFirst(list);
|
||||
}
|
||||
|
||||
default T selectFirstOne(SFunction<T,?> field1, Object value1, SFunction<T,?> field2, Object value2,
|
||||
SFunction<T,?> field3, Object value3) {
|
||||
List<T> list = selectList(new LambdaQueryWrapper<T>().eq(field1, value1).eq(field2, value2).eq(field3, value3));
|
||||
return CollUtil.getFirst(list);
|
||||
}
|
||||
|
||||
|
||||
default Long selectCount() {
|
||||
return selectCount(new QueryWrapper<>());
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package cn.iocoder.yudao.framework.web.core.handler;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.exceptions.ExceptionUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
|
@ -22,6 +23,7 @@ import org.springframework.security.access.AccessDeniedException;
|
|||
import org.springframework.util.Assert;
|
||||
import org.springframework.validation.BindException;
|
||||
import org.springframework.validation.FieldError;
|
||||
import org.springframework.validation.ObjectError;
|
||||
import org.springframework.web.HttpRequestMethodNotSupportedException;
|
||||
import org.springframework.web.bind.MethodArgumentNotValidException;
|
||||
import org.springframework.web.bind.MissingServletRequestParameterException;
|
||||
|
@ -35,6 +37,7 @@ import javax.validation.ConstraintViolation;
|
|||
import javax.validation.ConstraintViolationException;
|
||||
import javax.validation.ValidationException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -133,9 +136,23 @@ public class GlobalExceptionHandler {
|
|||
@ExceptionHandler(MethodArgumentNotValidException.class)
|
||||
public CommonResult<?> methodArgumentNotValidExceptionExceptionHandler(MethodArgumentNotValidException ex) {
|
||||
log.warn("[methodArgumentNotValidExceptionExceptionHandler]", ex);
|
||||
// 获取 errorMessage
|
||||
String errorMessage = null;
|
||||
FieldError fieldError = ex.getBindingResult().getFieldError();
|
||||
assert fieldError != null; // 断言,避免告警
|
||||
return CommonResult.error(BAD_REQUEST.getCode(), String.format("请求参数不正确:%s", fieldError.getDefaultMessage()));
|
||||
if (fieldError == null) {
|
||||
// 组合校验,参考自 https://t.zsxq.com/3HVTx
|
||||
List<ObjectError> allErrors = ex.getBindingResult().getAllErrors();
|
||||
if (CollUtil.isNotEmpty(allErrors)) {
|
||||
errorMessage = allErrors.get(0).getDefaultMessage();
|
||||
}
|
||||
} else {
|
||||
errorMessage = fieldError.getDefaultMessage();
|
||||
}
|
||||
// 转换 CommonResult
|
||||
if (StrUtil.isEmpty(errorMessage)) {
|
||||
return CommonResult.error(BAD_REQUEST);
|
||||
}
|
||||
return CommonResult.error(BAD_REQUEST.getCode(), String.format("请求参数不正确:%s", errorMessage));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package cn.iocoder.yudao.framework.ai.core.util;
|
||||
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.framework.ai.core.enums.AiPlatformEnum;
|
||||
import com.alibaba.cloud.ai.dashscope.chat.DashScopeChatOptions;
|
||||
|
@ -13,6 +14,7 @@ import org.springframework.ai.openai.OpenAiChatOptions;
|
|||
import org.springframework.ai.qianfan.QianFanChatOptions;
|
||||
import org.springframework.ai.zhipuai.ZhiPuAiChatOptions;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
|
@ -28,6 +30,7 @@ public class AiUtils {
|
|||
|
||||
public static ChatOptions buildChatOptions(AiPlatformEnum platform, String model, Double temperature, Integer maxTokens,
|
||||
Set<String> toolNames) {
|
||||
toolNames = ObjUtil.defaultIfNull(toolNames, Collections.emptySet());
|
||||
// noinspection EnhancedSwitchMigration
|
||||
switch (platform) {
|
||||
case TONG_YI:
|
||||
|
|
|
@ -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,8 +54,9 @@ public class BpmHttpRequestUtils {
|
|||
ResponseEntity<String> responseEntity = sendHttpRequest(url, headers, body, restTemplate);
|
||||
|
||||
// 3. 处理返回
|
||||
// TODO @lesan:可以用 if return,让括号小点
|
||||
if (Boolean.TRUE.equals(handleResponse)) {
|
||||
if (Boolean.FALSE.equals(handleResponse)) {
|
||||
return;
|
||||
}
|
||||
// 3.1 判断是否需要解析返回值
|
||||
if (responseEntity == null
|
||||
|| StrUtil.isEmpty(responseEntity.getBody())
|
||||
|
@ -66,7 +66,7 @@ public class BpmHttpRequestUtils {
|
|||
}
|
||||
// 3.2 解析返回值, 返回值必须符合 CommonResult 规范。
|
||||
CommonResult<Map<String, Object>> respResult = JsonUtils.parseObjectQuietly(responseEntity.getBody(),
|
||||
new TypeReference<CommonResult<Map<String, Object>>>() {});
|
||||
new TypeReference<>() {});
|
||||
if (respResult == null || !respResult.isSuccess()) {
|
||||
return;
|
||||
}
|
||||
|
@ -77,7 +77,6 @@ public class BpmHttpRequestUtils {
|
|||
processInstanceService.updateProcessInstanceVariables(processInstance.getId(), updateVariables);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static ResponseEntity<String> sendHttpRequest(String url,
|
||||
MultiValueMap<String, String> headers,
|
||||
|
|
|
@ -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()));
|
||||
|
|
|
@ -253,16 +253,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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -44,6 +44,8 @@ import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
|||
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.bpmn.constants.BpmnXMLConstants;
|
||||
import org.flowable.bpmn.model.*;
|
||||
|
@ -63,8 +65,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.*;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
@ -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();
|
||||
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(),
|
||||
restTemplate,
|
||||
this);
|
||||
}
|
||||
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);
|
||||
|
@ -966,7 +971,7 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
|||
BpmnModel bpmnModel = modelService.getBpmnModelByDefinitionId(taskList.get(0).getProcessDefinitionId());
|
||||
List<String> activityIds = CollUtil.newArrayList(convertSet(taskList, Task::getTaskDefinitionKey));
|
||||
EndEvent endEvent = BpmnModelUtils.getEndEvent(bpmnModel);
|
||||
Assert.notNull(endEvent, "结束节点不能未空");
|
||||
Assert.notNull(endEvent, "结束节点不能为空");
|
||||
runtimeService.createChangeActivityStateBuilder()
|
||||
.processInstanceId(processInstanceId)
|
||||
.moveActivityIdsToSingleActivityId(activityIds, endEvent.getId())
|
||||
|
@ -1251,6 +1256,7 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
|||
}
|
||||
|
||||
@Override
|
||||
@DataPermission(enable = false) // 忽略数据权限,避免因为过滤,导致找不到候选人
|
||||
public void processTaskAssigned(Task task) {
|
||||
// 发送通知。在事务提交时,批量执行操作,所以直接查询会无法查询到 ProcessInstance,所以这里是通过监听事务的提交来实现。
|
||||
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
|
||||
|
|
|
@ -34,9 +34,6 @@ public class BpmUserTaskListener implements TaskListener {
|
|||
@Resource
|
||||
private BpmProcessInstanceService processInstanceService;
|
||||
|
||||
@Resource
|
||||
private RestTemplate restTemplate;
|
||||
|
||||
@Setter
|
||||
private FixedValue listenerConfig;
|
||||
|
||||
|
@ -60,9 +57,7 @@ public class BpmUserTaskListener implements TaskListener {
|
|||
listenerHandler.getPath(),
|
||||
listenerHandler.getHeader(),
|
||||
listenerHandler.getBody(),
|
||||
false, null,
|
||||
restTemplate,
|
||||
processInstanceService);
|
||||
false, null);
|
||||
|
||||
// 3. 是否需要后续操作?TODO 芋艿:待定!
|
||||
}
|
||||
|
|
|
@ -22,9 +22,6 @@ import javax.annotation.Resource;
|
|||
@Slf4j
|
||||
public class BpmHttpCallbackTrigger extends BpmAbstractHttpRequestTrigger {
|
||||
|
||||
@Resource
|
||||
private RestTemplate restTemplate;
|
||||
|
||||
@Resource
|
||||
private BpmProcessInstanceService processInstanceService;
|
||||
|
||||
|
@ -52,9 +49,7 @@ public class BpmHttpCallbackTrigger extends BpmAbstractHttpRequestTrigger {
|
|||
setting.getUrl(),
|
||||
setting.getHeader(),
|
||||
setting.getBody(),
|
||||
false, null,
|
||||
restTemplate,
|
||||
processInstanceService);
|
||||
false, null);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,9 +21,6 @@ import javax.annotation.Resource;
|
|||
@Slf4j
|
||||
public class BpmSyncHttpRequestTrigger extends BpmAbstractHttpRequestTrigger {
|
||||
|
||||
@Resource
|
||||
private RestTemplate restTemplate;
|
||||
|
||||
@Resource
|
||||
private BpmProcessInstanceService processInstanceService;
|
||||
|
||||
|
@ -47,9 +44,7 @@ public class BpmSyncHttpRequestTrigger extends BpmAbstractHttpRequestTrigger {
|
|||
setting.getUrl(),
|
||||
setting.getHeader(),
|
||||
setting.getBody(),
|
||||
true, setting.getResponse(),
|
||||
restTemplate,
|
||||
processInstanceService);
|
||||
true, setting.getResponse());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,9 +21,8 @@ import java.util.Collection;
|
|||
public interface ProductBrowseHistoryMapper extends BaseMapperX<ProductBrowseHistoryDO> {
|
||||
|
||||
default ProductBrowseHistoryDO selectByUserIdAndSpuId(Long userId, Long spuId) {
|
||||
return selectOne(new LambdaQueryWrapperX<ProductBrowseHistoryDO>()
|
||||
.eq(ProductBrowseHistoryDO::getUserId, userId)
|
||||
.eq(ProductBrowseHistoryDO::getSpuId, spuId));
|
||||
return selectFirstOne(ProductBrowseHistoryDO::getUserId, userId,
|
||||
ProductBrowseHistoryDO::getSpuId, spuId);
|
||||
}
|
||||
|
||||
default PageResult<ProductBrowseHistoryDO> selectPage(ProductBrowseHistoryPageReqVO reqVO) {
|
||||
|
|
|
@ -47,7 +47,7 @@ public interface CouponTemplateMapper extends BaseMapperX<CouponTemplateDO> {
|
|||
}
|
||||
|
||||
default List<CouponTemplateDO> selectListByTakeType(Integer takeType) {
|
||||
return selectList(CouponTemplateDO::getTakeType, takeType);
|
||||
return selectList(CouponTemplateDO::getTakeType, takeType, CouponTemplateDO::getStatus, CommonStatusEnum.ENABLE.getStatus());
|
||||
}
|
||||
|
||||
default List<CouponTemplateDO> selectList(List<Integer> canTakeTypes, Integer productScope, Long productScopeValue, Integer count) {
|
||||
|
|
|
@ -56,6 +56,15 @@ public class TradeExpressProperties {
|
|||
@NotEmpty(message = "快递鸟 Api Key 配置项不能为空")
|
||||
private String apiKey;
|
||||
|
||||
/**
|
||||
* 接口指令
|
||||
*
|
||||
* 1. 1002:免费版(只能查询申通、圆通快递)
|
||||
* 2. 8001:付费版
|
||||
*/
|
||||
@NotEmpty(message = "RequestType 配置项不能为空")
|
||||
private String requestType = "1002";
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -39,11 +39,6 @@ public class KdNiaoExpressClient implements ExpressClient {
|
|||
|
||||
private static final String REAL_TIME_QUERY_URL = "https://api.kdniao.com/Ebusiness/EbusinessOrderHandle.aspx";
|
||||
|
||||
/**
|
||||
* 快递鸟即时查询免费版 RequestType
|
||||
*/
|
||||
private static final String REAL_TIME_FREE_REQ_TYPE = "1002";
|
||||
|
||||
private final RestTemplate restTemplate;
|
||||
private final TradeExpressProperties.KdNiaoConfig config;
|
||||
|
||||
|
@ -67,7 +62,7 @@ public class KdNiaoExpressClient implements ExpressClient {
|
|||
&& StrUtil.length(reqDTO.getPhone()) >= 4) {
|
||||
requestDTO.setCustomerName(StrUtil.subSufByLength(reqDTO.getPhone(), 4));
|
||||
}
|
||||
KdNiaoExpressQueryRespDTO respDTO = httpRequest(REAL_TIME_QUERY_URL, REAL_TIME_FREE_REQ_TYPE,
|
||||
KdNiaoExpressQueryRespDTO respDTO = httpRequest(REAL_TIME_QUERY_URL, config.getRequestType(),
|
||||
requestDTO, KdNiaoExpressQueryRespDTO.class);
|
||||
|
||||
// 处理结果
|
||||
|
|
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.trade.service.price.calculator;
|
|||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.module.member.api.level.MemberLevelApi;
|
||||
import cn.iocoder.yudao.module.member.api.level.dto.MemberLevelRespDTO;
|
||||
import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
|
||||
|
@ -141,7 +142,9 @@ public class TradeDiscountActivityPriceCalculator implements TradePriceCalculato
|
|||
*/
|
||||
public Integer calculateVipPrice(MemberLevelRespDTO level,
|
||||
TradePriceCalculateRespBO.OrderItem orderItem) {
|
||||
if (level == null || level.getDiscountPercent() == null) {
|
||||
if (level == null
|
||||
|| CommonStatusEnum.isDisable(level.getStatus())
|
||||
|| level.getDiscountPercent() == null) {
|
||||
return 0;
|
||||
}
|
||||
Integer newPrice = calculateRatePrice(orderItem.getPayPrice(), level.getDiscountPercent().doubleValue());
|
||||
|
|
|
@ -4,7 +4,7 @@ import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderRespDTO;
|
|||
import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedReqDTO;
|
||||
import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum;
|
||||
import cn.iocoder.yudao.framework.pay.core.enums.order.PayOrderDisplayModeEnum;
|
||||
import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult;
|
||||
import com.github.binarywang.wxpay.bean.order.WxPayAppOrderResult;
|
||||
import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest;
|
||||
import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderV3Request;
|
||||
import com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderV3Result;
|
||||
|
@ -41,7 +41,7 @@ public class WxAppPayClient extends AbstractWxPayClient {
|
|||
// 构建 WxPayUnifiedOrderRequest 对象
|
||||
WxPayUnifiedOrderRequest request = buildPayUnifiedOrderRequestV2(reqDTO);
|
||||
// 执行请求
|
||||
WxPayMpOrderResult response = client.createOrder(request);
|
||||
WxPayAppOrderResult response = client.createOrder(request);
|
||||
|
||||
// 转换结果
|
||||
return PayOrderRespDTO.waitingOf(PayOrderDisplayModeEnum.APP.getMode(), toJsonString(response),
|
||||
|
|
|
@ -24,6 +24,7 @@ public interface ErrorCodeConstants {
|
|||
ErrorCode MENU_NOT_EXISTS = new ErrorCode(1_002_001_003, "菜单不存在");
|
||||
ErrorCode MENU_EXISTS_CHILDREN = new ErrorCode(1_002_001_004, "存在子菜单,无法删除");
|
||||
ErrorCode MENU_PARENT_NOT_DIR_OR_MENU = new ErrorCode(1_002_001_005, "父菜单的类型必须是目录或者菜单");
|
||||
ErrorCode MENU_COMPONENT_NAME_DUPLICATE = new ErrorCode(1_002_001_006, "已经存在该组件名的菜单");
|
||||
|
||||
// ========== 角色模块 1-002-002-000 ==========
|
||||
ErrorCode ROLE_NOT_EXISTS = new ErrorCode(1_002_002_000, "角色不存在");
|
||||
|
|
|
@ -3,15 +3,15 @@ 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;
|
||||
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
@ -59,10 +59,11 @@ public class AdminUserApiImpl implements AdminUserApi {
|
|||
}
|
||||
|
||||
@Override
|
||||
@DataPermission(enable = false) // 禁用数据权限。原因是,一般基于指定 id 的 API 查询,都是数据拼接为主
|
||||
public List<AdminUserRespDTO> getUserList(Collection<Long> ids) {
|
||||
return DataPermissionUtils.executeIgnore(() -> { // 禁用数据权限。原因是,一般基于指定 id 的 API 查询,都是数据拼接为主
|
||||
List<AdminUserDO> users = userService.getUserList(ids);
|
||||
return BeanUtils.toBean(users, AdminUserRespDTO.class);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -28,4 +28,9 @@ public interface MenuMapper extends BaseMapperX<MenuDO> {
|
|||
default List<MenuDO> selectListByPermission(String permission) {
|
||||
return selectList(MenuDO::getPermission, permission);
|
||||
}
|
||||
|
||||
default MenuDO selectByComponentName(String componentName) {
|
||||
return selectOne(MenuDO::getComponentName, componentName);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,23 +5,20 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
|||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.socail.vo.user.SocialUserPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface SocialUserMapper extends BaseMapperX<SocialUserDO> {
|
||||
|
||||
default SocialUserDO selectByTypeAndCodeAnState(Integer type, String code, String state) {
|
||||
return selectOne(new LambdaQueryWrapper<SocialUserDO>()
|
||||
.eq(SocialUserDO::getType, type)
|
||||
.eq(SocialUserDO::getCode, code)
|
||||
.eq(SocialUserDO::getState, state));
|
||||
return selectOne(SocialUserDO::getType, type,
|
||||
SocialUserDO::getCode, code,
|
||||
SocialUserDO::getState, state);
|
||||
}
|
||||
|
||||
default SocialUserDO selectByTypeAndOpenid(Integer type, String openid) {
|
||||
return selectOne(new LambdaQueryWrapper<SocialUserDO>()
|
||||
.eq(SocialUserDO::getType, type)
|
||||
.eq(SocialUserDO::getOpenid, openid));
|
||||
return selectFirstOne(SocialUserDO::getType, type,
|
||||
SocialUserDO::getOpenid, openid);
|
||||
}
|
||||
|
||||
default PageResult<SocialUserDO> selectPage(SocialUserPageReqVO reqVO) {
|
||||
|
|
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.system.service.permission;
|
|||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu.MenuListReqVO;
|
||||
|
@ -53,7 +54,8 @@ public class MenuServiceImpl implements MenuService {
|
|||
// 校验父菜单存在
|
||||
validateParentMenu(createReqVO.getParentId(), null);
|
||||
// 校验菜单(自己)
|
||||
validateMenu(createReqVO.getParentId(), createReqVO.getName(), null);
|
||||
validateMenuName(createReqVO.getParentId(), createReqVO.getName(), null);
|
||||
validateMenuComponentName(createReqVO.getComponentName(), null);
|
||||
|
||||
// 插入数据库
|
||||
MenuDO menu = BeanUtils.toBean(createReqVO, MenuDO.class);
|
||||
|
@ -74,7 +76,8 @@ public class MenuServiceImpl implements MenuService {
|
|||
// 校验父菜单存在
|
||||
validateParentMenu(updateReqVO.getParentId(), updateReqVO.getId());
|
||||
// 校验菜单(自己)
|
||||
validateMenu(updateReqVO.getParentId(), updateReqVO.getName(), updateReqVO.getId());
|
||||
validateMenuName(updateReqVO.getParentId(), updateReqVO.getName(), updateReqVO.getId());
|
||||
validateMenuComponentName(updateReqVO.getComponentName(), updateReqVO.getId());
|
||||
|
||||
// 更新到数据库
|
||||
MenuDO updateObj = BeanUtils.toBean(updateReqVO, MenuDO.class);
|
||||
|
@ -228,7 +231,7 @@ public class MenuServiceImpl implements MenuService {
|
|||
* @param id 菜单编号
|
||||
*/
|
||||
@VisibleForTesting
|
||||
void validateMenu(Long parentId, String name, Long id) {
|
||||
void validateMenuName(Long parentId, String name, Long id) {
|
||||
MenuDO menu = menuMapper.selectByParentIdAndName(parentId, name);
|
||||
if (menu == null) {
|
||||
return;
|
||||
|
@ -242,6 +245,30 @@ public class MenuServiceImpl implements MenuService {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验菜单组件名是否合法
|
||||
*
|
||||
* @param componentName 组件名
|
||||
* @param id 菜单编号
|
||||
*/
|
||||
@VisibleForTesting
|
||||
void validateMenuComponentName(String componentName, Long id) {
|
||||
if (StrUtil.isBlank(componentName)) {
|
||||
return;
|
||||
}
|
||||
MenuDO menu = menuMapper.selectByComponentName(componentName);
|
||||
if (menu == null) {
|
||||
return;
|
||||
}
|
||||
// 如果 id 为空,说明不用比较是否为相同 id 的菜单
|
||||
if (id == null) {
|
||||
return;
|
||||
}
|
||||
if (!menu.getId().equals(id)) {
|
||||
throw exception(MENU_COMPONENT_NAME_DUPLICATE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化菜单的通用属性。
|
||||
* <p>
|
||||
|
|
|
@ -275,7 +275,7 @@ public class MenuServiceImplTest extends BaseDbUnitTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testValidateMenu_success() {
|
||||
public void testValidateMenu_Name_success() {
|
||||
// mock 父子菜单
|
||||
MenuDO sonMenu = createParentAndSonMenu();
|
||||
// 准备参数
|
||||
|
@ -284,11 +284,11 @@ public class MenuServiceImplTest extends BaseDbUnitTest {
|
|||
String otherSonMenuName = randomString();
|
||||
|
||||
// 调用,无需断言
|
||||
menuService.validateMenu(parentId, otherSonMenuName, otherSonMenuId);
|
||||
menuService.validateMenuName(parentId, otherSonMenuName, otherSonMenuId);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidateMenu_sonMenuNameDuplicate() {
|
||||
public void testValidateMenu_sonMenuNameNameDuplicate() {
|
||||
// mock 父子菜单
|
||||
MenuDO sonMenu = createParentAndSonMenu();
|
||||
// 准备参数
|
||||
|
@ -297,7 +297,7 @@ public class MenuServiceImplTest extends BaseDbUnitTest {
|
|||
String otherSonMenuName = sonMenu.getName(); //相同名称
|
||||
|
||||
// 调用,并断言异常
|
||||
assertServiceException(() -> menuService.validateMenu(parentId, otherSonMenuName, otherSonMenuId),
|
||||
assertServiceException(() -> menuService.validateMenuName(parentId, otherSonMenuName, otherSonMenuId),
|
||||
MENU_NAME_DUPLICATE);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ server:
|
|||
|
||||
--- #################### 数据库相关配置 ####################
|
||||
|
||||
spring:
|
||||
spring:
|
||||
autoconfigure:
|
||||
exclude:
|
||||
|
|
|
@ -340,10 +340,11 @@ yudao:
|
|||
receive-expire-time: 14d # 收货的过期时间
|
||||
comment-expire-time: 7d # 评论的过期时间
|
||||
express:
|
||||
client: kd_niao
|
||||
client: KD_NIAO
|
||||
kd-niao:
|
||||
api-key: cb022f1e-48f1-4c4a-a723-9001ac9676b8
|
||||
business-id: 1809751
|
||||
request-type: 1002 # 免费版 1002;付费版 8001
|
||||
kd100:
|
||||
key: pLXUGAwK5305
|
||||
customer: E77DF18BE109F454A5CD319E44BF5177
|
||||
|
|
Loading…
Reference in New Issue