同步最新的表结构

This commit is contained in:
YunaiV 2022-01-15 13:07:19 +08:00
parent 1781e76e19
commit e01b33bc78
9 changed files with 4907 additions and 550 deletions

3017
sql/activiti.sql Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -139,7 +139,7 @@ public class BpmUserTaskActivitiBehavior extends UserTaskActivityBehavior {
} }
private Set<Long> calculateTaskCandidateUsersByDeptMember(TaskEntity task, BpmTaskAssignRuleDO rule) { private Set<Long> calculateTaskCandidateUsersByDeptMember(TaskEntity task, BpmTaskAssignRuleDO rule) {
List<SysUserDO> users = userService.getUsersByPostIds(rule.getOptions()); List<SysUserDO> users = userService.getUsersByDeptIds(rule.getOptions());
return convertSet(users, SysUserDO::getId); return convertSet(users, SysUserDO::getId);
} }

View File

@ -158,7 +158,7 @@ public class BpmTaskAssignRuleServiceImpl implements BpmTaskAssignRuleService {
private void validTaskAssignRuleOptions(Integer type, Set<Long> options) { private void validTaskAssignRuleOptions(Integer type, Set<Long> options) {
if (Objects.equals(type, BpmTaskAssignRuleTypeEnum.ROLE.getType())) { if (Objects.equals(type, BpmTaskAssignRuleTypeEnum.ROLE.getType())) {
roleService.validRoles(options); roleService.validRoles(options);
} else if (ObjectUtils.equalsAny(BpmTaskAssignRuleTypeEnum.DEPT_MEMBER.getType(), } else if (ObjectUtils.equalsAny(type, BpmTaskAssignRuleTypeEnum.DEPT_MEMBER.getType(),
BpmTaskAssignRuleTypeEnum.DEPT_LEADER.getType())) { BpmTaskAssignRuleTypeEnum.DEPT_LEADER.getType())) {
deptService.validDepts(options); deptService.validDepts(options);
} else if (Objects.equals(type, BpmTaskAssignRuleTypeEnum.POST.getType())) { } else if (Objects.equals(type, BpmTaskAssignRuleTypeEnum.POST.getType())) {

View File

@ -68,7 +68,7 @@ public interface SysUserMapper extends BaseMapperX<SysUserDO> {
return selectList("status", status); return selectList("status", status);
} }
default List<SysUserDO> selectListByDeptIds(Collection<Integer> deptIds) { default List<SysUserDO> selectListByDeptIds(Collection<Long> deptIds) {
return selectList("dept_id", deptIds); return selectList("dept_id", deptIds);
} }

View File

@ -188,7 +188,7 @@ public interface SysUserService {
* @param deptIds 部门数组 * @param deptIds 部门数组
* @return 用户数组 * @return 用户数组
*/ */
List<SysUserDO> getUsersByDeptIds(Collection<Integer> deptIds); List<SysUserDO> getUsersByDeptIds(Collection<Long> deptIds);
/** /**
* 校验用户们是否有效如下情况视为无效 * 校验用户们是否有效如下情况视为无效

View File

@ -402,7 +402,7 @@ public class SysUserServiceImpl implements SysUserService {
} }
@Override @Override
public List<SysUserDO> getUsersByDeptIds(Collection<Integer> deptIds) { public List<SysUserDO> getUsersByDeptIds(Collection<Long> deptIds) {
if (CollUtil.isEmpty(deptIds)) { if (CollUtil.isEmpty(deptIds)) {
return Collections.emptyList(); return Collections.emptyList();
} }

View File

@ -20,6 +20,7 @@ import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import cn.iocoder.yudao.framework.common.util.collection.SetUtils;
import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import cn.iocoder.yudao.framework.common.util.object.ObjectUtils;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.mockito.stubbing.Answer; import org.mockito.stubbing.Answer;
@ -29,17 +30,19 @@ import org.springframework.security.crypto.password.PasswordEncoder;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.util.List; import java.util.*;
import java.util.Set;
import java.util.function.Consumer; import java.util.function.Consumer;
import static cn.hutool.core.util.RandomUtil.randomBytes; import static cn.hutool.core.util.RandomUtil.randomBytes;
import static cn.hutool.core.util.RandomUtil.randomEle; import static cn.hutool.core.util.RandomUtil.randomEle;
import static cn.iocoder.yudao.adminserver.modules.system.enums.SysErrorCodeConstants.*; import static cn.iocoder.yudao.adminserver.modules.system.enums.SysErrorCodeConstants.*;
import static cn.iocoder.yudao.framework.common.util.collection.SetUtils.asSet;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime;
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals;
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException;
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*;
import static java.util.Collections.singleton;
import static java.util.Collections.singletonList;
import static org.assertj.core.util.Lists.newArrayList; import static org.assertj.core.util.Lists.newArrayList;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertNull;
@ -577,6 +580,23 @@ public class SysUserServiceImplTest extends BaseDbUnitTest {
verify(passwordEncoder, times(1)).matches(eq(oldPassword), eq(user.getPassword())); verify(passwordEncoder, times(1)).matches(eq(oldPassword), eq(user.getPassword()));
} }
@Test
public void testUsersByPostIds() {
// 准备参数
Collection<Long> postIds = asSet(10L, 20L);
// mock 方法
SysUserDO user1 = randomSysUserDO(o -> o.setPostIds(asSet(10L, 30L)));
userMapper.insert(user1);
SysUserDO user2 = randomSysUserDO(o -> o.setPostIds(singleton(100L)));
userMapper.insert(user2);
// 调用
List<SysUserDO> result = userService.getUsersByPostIds(postIds);
// 断言
assertEquals(1, result.size());
assertEquals(user1, result.get(0));
}
// ========== 随机对象 ========== // ========== 随机对象 ==========
@SafeVarargs @SafeVarargs

View File

@ -129,6 +129,11 @@
<el-form-item label="流程名称" prop="name"> <el-form-item label="流程名称" prop="name">
<el-input v-model="form.name" placeholder="请输入流程名称" :disabled="form.id" clearable /> <el-input v-model="form.name" placeholder="请输入流程名称" :disabled="form.id" clearable />
</el-form-item> </el-form-item>
<el-form-item v-if="form.id" label="流程分类" prop="category">
<el-select v-model="form.category" placeholder="请选择流程分类" clearable style="width: 100%">
<el-option v-for="dict in categoryDictDatas" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item label="流程描述" prop="description"> <el-form-item label="流程描述" prop="description">
<el-input type="textarea" v-model="form.description" clearable /> <el-input type="textarea" v-model="form.description" clearable />
</el-form-item> </el-form-item>
@ -270,6 +275,7 @@ export default {
name: [{ required: true, message: "流程名称不能为空", trigger: "blur" }], name: [{ required: true, message: "流程名称不能为空", trigger: "blur" }],
formType: [{ required: true, message: "流程名称不能为空", trigger: "blur" }], formType: [{ required: true, message: "流程名称不能为空", trigger: "blur" }],
formId: [{ required: true, message: "业务表单不能为空", trigger: "blur" }], formId: [{ required: true, message: "业务表单不能为空", trigger: "blur" }],
category: [{ required: true, message: "流程分类不能为空", trigger: "blur" }],
formCustomCreatePath: [{ required: true, message: "表单提交路由不能为空", trigger: "blur" }], formCustomCreatePath: [{ required: true, message: "表单提交路由不能为空", trigger: "blur" }],
formCustomViewPath: [{ required: true, message: "表单查看路由不能为空", trigger: "blur" }], formCustomViewPath: [{ required: true, message: "表单查看路由不能为空", trigger: "blur" }],
}, },
@ -331,6 +337,7 @@ export default {
key: undefined, key: undefined,
name: undefined, name: undefined,
description: undefined, description: undefined,
category: undefined,
formType: undefined, formType: undefined,
formId: undefined, formId: undefined,
formCustomCreatePath: undefined, formCustomCreatePath: undefined,