Compare commits

..

No commits in common. "b0b4e573f6a28395b19c89a98f2b9320b2638bc5" and "b815b8e5741b70dc4e7c27de8bd7a6e509bba4fd" have entirely different histories.

6 changed files with 6 additions and 65 deletions

View File

@ -21,8 +21,6 @@ import org.dromara.common.core.domain.model.SocialLoginBody;
import org.dromara.common.core.utils.*;
import org.dromara.common.encrypt.annotation.ApiEncrypt;
import org.dromara.common.json.utils.JsonUtils;
import org.dromara.common.ratelimiter.annotation.RateLimiter;
import org.dromara.common.ratelimiter.enums.LimitType;
import org.dromara.common.satoken.utils.LoginHelper;
import org.dromara.common.social.config.properties.SocialLoginConfigProperties;
import org.dromara.common.social.config.properties.SocialProperties;
@ -200,7 +198,6 @@ public class AuthController {
*
* @return 租户列表
*/
@RateLimiter(time = 60, count = 20, limitType = LimitType.IP)
@GetMapping("/tenant/list")
public R<LoginTenantVo> tenantList(HttpServletRequest request) throws Exception {
// 返回对象

View File

@ -2,8 +2,6 @@ package org.dromara.system.mapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.dromara.common.core.constant.SystemConstants;
import org.dromara.common.core.utils.StreamUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.system.domain.SysMenu;
import org.dromara.system.domain.vo.SysMenuVo;
@ -80,13 +78,13 @@ public interface SysMenuMapper extends BaseMapperPlus<SysMenu, SysMenuVo> {
* @return 权限列表
*/
default Set<String> selectMenuPermsByUserId(Long userId) {
List<String> list = this.selectObjs(
return new HashSet<>(this.selectObjs(
new LambdaQueryWrapper<SysMenu>()
.select(SysMenu::getPerms)
.inSql(SysMenu::getMenuId, this.buildMenuByUserSql(userId))
.isNotNull(SysMenu::getPerms)
);
return new HashSet<>(StreamUtils.filter(list, StringUtils::isNotBlank));
.ne(SysMenu::getPerms, "")
));
}
/**
@ -96,13 +94,13 @@ public interface SysMenuMapper extends BaseMapperPlus<SysMenu, SysMenuVo> {
* @return 权限列表
*/
default Set<String> selectMenuPermsByRoleId(Long roleId) {
List<String> list = this.selectObjs(
return new HashSet<>(this.selectObjs(
new LambdaQueryWrapper<SysMenu>()
.select(SysMenu::getPerms)
.inSql(SysMenu::getMenuId, this.buildMenuByRoleSql(roleId))
.isNotNull(SysMenu::getPerms)
);
return new HashSet<>(StreamUtils.filter(list, StringUtils::isNotBlank));
.ne(SysMenu::getPerms, "")
));
}
/**

View File

@ -82,17 +82,6 @@ public class TestLeaveController extends BaseController {
return R.ok(testLeaveService.insertByBo(bo));
}
/**
* 提交请假并提交流程
*/
@SaCheckPermission("workflow:leave:add")
@Log(title = "请假", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping("/submitAndFlowStart")
public R<TestLeaveVo> submitAndFlowStart(@Validated(AddGroup.class) @RequestBody TestLeaveBo bo) {
return R.ok(testLeaveService.submitAndFlowStart(bo));
}
/**
* 修改请假
*/

View File

@ -31,11 +31,6 @@ public class TestLeaveBo extends BaseEntity {
@NotNull(message = "主键不能为空", groups = {EditGroup.class})
private Long id;
/**
* 流程code
*/
private String flowCode;
/**
* 请假类型
*/

View File

@ -35,11 +35,6 @@ public interface ITestLeaveService {
*/
TestLeaveVo insertByBo(TestLeaveBo bo);
/**
* 提交请假并发起流程
*/
TestLeaveVo submitAndFlowStart(TestLeaveBo bo);
/**
* 修改请假
*/

View File

@ -9,14 +9,10 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.core.domain.dto.CompleteTaskDTO;
import org.dromara.common.core.domain.dto.StartProcessDTO;
import org.dromara.common.core.domain.dto.StartProcessReturnDTO;
import org.dromara.common.core.domain.event.ProcessTaskEvent;
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
import org.dromara.common.core.domain.event.ProcessEvent;
import org.dromara.common.core.enums.BusinessStatusEnum;
import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.core.service.WorkflowService;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
@ -119,35 +115,6 @@ public class TestLeaveServiceImpl implements ITestLeaveService {
return MapstructUtils.convert(add, TestLeaveVo.class);
}
@Transactional(rollbackFor = Exception.class)
@Override
public TestLeaveVo submitAndFlowStart(TestLeaveBo bo) {
long day = DateUtil.betweenDay(bo.getStartDate(), bo.getEndDate(), true);
// 截止日期也算一天
bo.setLeaveDays((int) day + 1);
TestLeave leave = MapstructUtils.convert(bo, TestLeave.class);
boolean flag = baseMapper.insertOrUpdate(leave);
if (flag) {
bo.setId(leave.getId());
// 后端发起需要忽略权限
bo.getParams().put("ignore", true);
StartProcessReturnDTO result = workflowService.startWorkFlow(new StartProcessDTO() {{
setBusinessId(leave.getId().toString());
setFlowCode(StringUtils.isEmpty(bo.getFlowCode()) ? "leave1" : bo.getFlowCode());
setVariables(bo.getParams());
}});
boolean flag1 = workflowService.completeTask(new CompleteTaskDTO() {{
setTaskId(result.getTaskId());
setMessageType(List.of("1"));
setVariables(bo.getParams());
}});
if (!flag1) {
throw new ServiceException("流程发起异常");
}
}
return MapstructUtils.convert(leave, TestLeaveVo.class);
}
/**
* 修改请假
*/