mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-23 23:09:47 +08:00
update 全局替换为 Convert.toStr,优化 null 字符串处理
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package org.dromara.workflow.handler;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.domain.dto.UserDTO;
|
||||
@ -59,6 +60,6 @@ public class WorkflowPermissionHandler implements PermissionHandler {
|
||||
}
|
||||
String storageIds = CollUtil.join(permissions, StringUtils.SEPARATOR);
|
||||
List<UserDTO> users = flwTaskAssigneeService.fetchUsersByStorageIds(storageIds);
|
||||
return StreamUtils.toList(users, userDTO -> String.valueOf(userDTO.getUserId()));
|
||||
return StreamUtils.toList(users, userDTO -> Convert.toStr(userDTO.getUserId()));
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package org.dromara.workflow.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@ -97,11 +98,11 @@ public class FlwCategoryServiceImpl implements IFlwCategoryService {
|
||||
}
|
||||
return TreeBuildUtils.buildMultiRoot(
|
||||
categoryList,
|
||||
node -> String.valueOf(node.getCategoryId()),
|
||||
node -> String.valueOf(node.getParentId()),
|
||||
node -> Convert.toStr(node.getCategoryId()),
|
||||
node -> Convert.toStr(node.getParentId()),
|
||||
(node, treeNode) -> treeNode
|
||||
.setId(String.valueOf(node.getCategoryId()))
|
||||
.setParentId(String.valueOf(node.getParentId()))
|
||||
.setId(Convert.toStr(node.getCategoryId()))
|
||||
.setParentId(Convert.toStr(node.getParentId()))
|
||||
.setName(node.getCategoryName())
|
||||
.setWeight(node.getOrderNum())
|
||||
);
|
||||
|
@ -231,7 +231,7 @@ public class FlwDefinitionServiceImpl implements IFlwDefinitionService {
|
||||
flowDefinition.setId(null);
|
||||
flowDefinition.setTenantId(tenantId);
|
||||
flowDefinition.setIsPublish(0);
|
||||
flowDefinition.setCategory(String.valueOf(flowCategory.getCategoryId()));
|
||||
flowDefinition.setCategory(Convert.toStr(flowCategory.getCategoryId()));
|
||||
int insert = flowDefinitionMapper.insert(flowDefinition);
|
||||
if (insert <= 0) {
|
||||
log.info("同步流程定义【{}】失败!", definition.getFlowCode());
|
||||
|
@ -110,7 +110,7 @@ public class FlwInstanceServiceImpl implements IFlwInstanceService {
|
||||
*/
|
||||
@Override
|
||||
public FlowInstanceVo queryByBusinessId(Long businessId) {
|
||||
FlowInstance instance = this.selectInstByBusinessId(String.valueOf(businessId));
|
||||
FlowInstance instance = this.selectInstByBusinessId(Convert.toStr(businessId));
|
||||
FlowInstanceVo instanceVo = BeanUtil.toBean(instance, FlowInstanceVo.class);
|
||||
Definition definition = defService.getById(instanceVo.getDefinitionId());
|
||||
instanceVo.setFlowName(definition.getFlowName());
|
||||
|
@ -149,9 +149,9 @@ public class FlwTaskAssigneeServiceImpl implements IFlwTaskAssigneeService, Hand
|
||||
*/
|
||||
private TreeFunDto<DeptDTO> buildDeptTree(List<DeptDTO> depts) {
|
||||
return new TreeFunDto<>(depts)
|
||||
.setId(dept -> String.valueOf(dept.getDeptId()))
|
||||
.setId(dept -> Convert.toStr(dept.getDeptId()))
|
||||
.setName(DeptDTO::getDeptName)
|
||||
.setParentId(dept -> String.valueOf(dept.getParentId()));
|
||||
.setParentId(dept -> Convert.toStr(dept.getParentId()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -303,7 +303,7 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
||||
List<User> userList = StreamUtils.toList(flowCopyList, x ->
|
||||
new FlowUser()
|
||||
.setType(TaskAssigneeType.COPY.getCode())
|
||||
.setProcessedBy(String.valueOf(x.getUserId()))
|
||||
.setProcessedBy(Convert.toStr(x.getUserId()))
|
||||
.setAssociated(taskId));
|
||||
// 批量保存抄送人员
|
||||
FlowEngine.userService().saveBatch(userList);
|
||||
@ -589,7 +589,7 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
||||
if (ObjectUtil.isNotNull(first) && CollUtil.isNotEmpty(first.getPermissionList())) {
|
||||
List<UserDTO> users = flwTaskAssigneeService.fetchUsersByStorageIds(String.join(StringUtils.SEPARATOR, first.getPermissionList()));
|
||||
if (CollUtil.isNotEmpty(users)) {
|
||||
flowNode.setPermissionFlag(StreamUtils.join(users, e -> String.valueOf(e.getUserId())));
|
||||
flowNode.setPermissionFlag(StreamUtils.join(users, e -> Convert.toStr(e.getUserId())));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user