refactor(bpm): 优化报销控制器中的项目编号判断逻辑

- 将 Strings.isNotEmpty() 替换为 StringUtil.isNotEmpty()
- 引入 jodd.util.StringUtil 替换 org.mapstruct.ap.internal.util.Strings- 提高代码可读性和维护性
This commit is contained in:
furongxin 2024-12-04 11:51:30 +08:00
parent 1d80ee957e
commit 973f7e4bcf

View File

@ -10,7 +10,9 @@ import cn.iocoder.yudao.module.system.api.project.dto.ProjectDTO;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jodd.util.StringUtil;
import org.mapstruct.ap.internal.util.Strings; import org.mapstruct.ap.internal.util.Strings;
import org.springframework.util.StringUtils;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -52,7 +54,7 @@ public class BpmOAReimbursementController {
BpmOAReimbursementDO reimbursement = service.getReimbursement(id); BpmOAReimbursementDO reimbursement = service.getReimbursement(id);
BpmOAReimbursementRespVO respVO = service.convert(reimbursement); BpmOAReimbursementRespVO respVO = service.convert(reimbursement);
if (respVO != null && Strings.isNotEmpty(respVO.getProjectNo())) { if (respVO != null && StringUtil.isNotEmpty(respVO.getProjectNo())) {
// 设置项目名称 // 设置项目名称
ProjectDTO projectDTO = projectApi.getProject(respVO.getProjectNo()).getCheckedData(); ProjectDTO projectDTO = projectApi.getProject(respVO.getProjectNo()).getCheckedData();
respVO.setProjectName(projectDTO.getName()); respVO.setProjectName(projectDTO.getName());
@ -75,7 +77,7 @@ public class BpmOAReimbursementController {
BpmOAReimbursementDO reimbursement = service.getByProcessInstanceId(processInstanceId); BpmOAReimbursementDO reimbursement = service.getByProcessInstanceId(processInstanceId);
BpmOAReimbursementRespVO respVO = service.convert(reimbursement); BpmOAReimbursementRespVO respVO = service.convert(reimbursement);
if (respVO != null && Strings.isNotEmpty(respVO.getProjectNo())) { if (respVO != null && StringUtil.isNotEmpty(respVO.getProjectNo())) {
// 设置项目名称 // 设置项目名称
ProjectDTO projectDTO = projectApi.getProject(respVO.getProjectNo()).getCheckedData(); ProjectDTO projectDTO = projectApi.getProject(respVO.getProjectNo()).getCheckedData();
respVO.setProjectName(projectDTO.getName()); respVO.setProjectName(projectDTO.getName());