1、修改组信息不能修改的问题
2、组下拉列表显示中文名
This commit is contained in:
parent
f9fa6f0c91
commit
06a35caa92
@ -71,6 +71,7 @@ public class GroupConfigServiceImpl implements GroupConfigService {
|
|||||||
private final JobMapper jobMapper;
|
private final JobMapper jobMapper;
|
||||||
private final WorkflowMapper workflowMapper;
|
private final WorkflowMapper workflowMapper;
|
||||||
private final SystemUserPermissionMapper systemUserPermissionMapper;
|
private final SystemUserPermissionMapper systemUserPermissionMapper;
|
||||||
|
private final GroupConfigMapper groupConfigMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
@ -92,12 +93,6 @@ public class GroupConfigServiceImpl implements GroupConfigService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public Boolean updateGroup(GroupConfigRequestVO groupConfigRequestVO) {
|
public Boolean updateGroup(GroupConfigRequestVO groupConfigRequestVO) {
|
||||||
|
|
||||||
List<Integer> tablePartitionList = getTablePartitionList();
|
|
||||||
if (CollUtil.isEmpty(tablePartitionList)) {
|
|
||||||
return Boolean.FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
String groupName = groupConfigRequestVO.getGroupName();
|
String groupName = groupConfigRequestVO.getGroupName();
|
||||||
String namespaceId = UserSessionUtils.currentUserSession().getNamespaceId();
|
String namespaceId = UserSessionUtils.currentUserSession().getNamespaceId();
|
||||||
|
|
||||||
@ -111,16 +106,12 @@ public class GroupConfigServiceImpl implements GroupConfigService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
GroupConfig groupConfig = GroupConfigConverter.INSTANCE.toGroupConfig(groupConfigRequestVO);
|
GroupConfig groupConfig = GroupConfigConverter.INSTANCE.toGroupConfig(groupConfigRequestVO);
|
||||||
|
//描述
|
||||||
groupConfig.setDescription(Optional.ofNullable(groupConfigRequestVO.getDescription()).orElse(StrUtil.EMPTY));
|
groupConfig.setDescription(Optional.ofNullable(groupConfigRequestVO.getDescription()).orElse(StrUtil.EMPTY));
|
||||||
// 使用@TableField(value = "version", update= "%s+1") 进行更新version, 这里必须初始化一个值
|
// 使用@TableField(value = "version", update= "%s+1") 进行更新version, 这里必须初始化一个值
|
||||||
groupConfig.setVersion(1);
|
groupConfig.setVersion(1);
|
||||||
// 不允许更新token
|
// 不允许更新token
|
||||||
groupConfig.setToken(null);
|
groupConfig.setToken(null);
|
||||||
Assert.isTrue(tablePartitionList.contains(groupConfigRequestVO.getGroupPartition()),
|
|
||||||
() -> new SnailJobServerException("Partition does not exist. [{}]", tablePartitionList));
|
|
||||||
Assert.isTrue(groupConfigRequestVO.getGroupPartition() >= 0,
|
|
||||||
() -> new SnailJobServerException("Partition cannot be negative."));
|
|
||||||
|
|
||||||
// 不允许更新组
|
// 不允许更新组
|
||||||
groupConfig.setGroupName(null);
|
groupConfig.setGroupName(null);
|
||||||
Assert.isTrue(1 == groupConfigAccess.update(groupConfig,
|
Assert.isTrue(1 == groupConfigAccess.update(groupConfig,
|
||||||
@ -267,15 +258,24 @@ public class GroupConfigServiceImpl implements GroupConfigService {
|
|||||||
|
|
||||||
UserSessionVO userSessionVO = UserSessionUtils.currentUserSession();
|
UserSessionVO userSessionVO = UserSessionUtils.currentUserSession();
|
||||||
if (userSessionVO.isUser()) {
|
if (userSessionVO.isUser()) {
|
||||||
return userSessionVO.getGroupNames();
|
List<String> groupNames = userSessionVO.getGroupNames();
|
||||||
|
ConfigAccess<GroupConfig> groupConfigAccess = accessTemplate.getGroupConfigAccess();
|
||||||
|
if (CollUtil.isEmpty(groupNames)) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
List<GroupConfig> groupConfigs = groupConfigAccess.list(
|
||||||
|
new LambdaQueryWrapper<GroupConfig>()
|
||||||
|
.in(CollUtil.isNotEmpty(groupNames), GroupConfig::getGroupName, groupNames)
|
||||||
|
.eq(GroupConfig::getNamespaceId, userSessionVO.getNamespaceId()));
|
||||||
|
return StreamUtils.toList(groupConfigs, GroupConfig::getGroupNameCn);
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigAccess<GroupConfig> groupConfigAccess = accessTemplate.getGroupConfigAccess();
|
ConfigAccess<GroupConfig> groupConfigAccess = accessTemplate.getGroupConfigAccess();
|
||||||
List<GroupConfig> groupConfigs = groupConfigAccess.list(new LambdaQueryWrapper<GroupConfig>()
|
List<GroupConfig> groupConfigs = groupConfigAccess.list(new LambdaQueryWrapper<GroupConfig>()
|
||||||
.eq(GroupConfig::getNamespaceId, userSessionVO.getNamespaceId())
|
.eq(GroupConfig::getNamespaceId, userSessionVO.getNamespaceId())
|
||||||
.select(GroupConfig::getGroupName));
|
.select(GroupConfig::getGroupNameCn));
|
||||||
//TODO ?
|
//TODO ?
|
||||||
return StreamUtils.toList(groupConfigs, GroupConfig::getGroupName);
|
return StreamUtils.toList(groupConfigs, GroupConfig::getGroupNameCn);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user