refactor(bpm): 用 StringUtils 替代 Strings 进行字符串操作

- 在 BpmOAPaymentController 和 BpmOAProcureController 中,将 Strings.isNotEmpty()
This commit is contained in:
furongxin 2024-12-27 11:56:59 +08:00
parent 2f869ded4c
commit 708775f6dc
3 changed files with 7 additions and 4 deletions

View File

@ -17,6 +17,7 @@ import cn.iocoder.yudao.module.system.api.project.dto.ProjectDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.util.Strings;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -88,7 +89,7 @@ public class BpmOAPaymentController {
item.setFactoryName(dtoMap.get(item.getDeptId()).getName());
});
if (Strings.isNotEmpty(payment.getProjectNo())) {
if (StringUtils.isNotEmpty(payment.getProjectNo())) {
// 获取项目信息
ProjectDTO project = projectApi.getProject(payment.getProjectNo()).getCheckedData();
// 设置项目名称

View File

@ -12,6 +12,7 @@ import cn.iocoder.yudao.module.system.api.project.dto.ProjectDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.util.Strings;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -64,7 +65,7 @@ public class BpmOAProcureController {
public CommonResult<BpmOAProcureRespVO> getOaProcure(@RequestParam("id") Long id) {
BpmOAProcureDO oaProcure = bpmOaProcureService.getOaProcure(id);
BpmOAProcureRespVO respVO = BpmOAProcureConvert.INSTANCE.convert(oaProcure);
if (respVO != null && Strings.isNotEmpty(respVO.getProjectNo())) {
if (respVO != null && StringUtils.isNotEmpty(respVO.getProjectNo())) {
ProjectDTO projectDTO = projectApi.getProject(respVO.getProjectNo()).getCheckedData();
respVO.setProjectName(projectDTO.getName());
}
@ -87,7 +88,7 @@ public class BpmOAProcureController {
BpmOAProcureDO oaProcure = bpmOaProcureService.getByProcessInstanceId(processInstanceId);
BpmOAProcureRespVO respVO = BpmOAProcureConvert.INSTANCE.convert(oaProcure);
if (respVO != null && Strings.isNotEmpty(respVO.getProjectNo())) {
if (respVO != null && StringUtils.isNotEmpty(respVO.getProjectNo())) {
ProjectDTO projectDTO = projectApi.getProject(respVO.getProjectNo()).getCheckedData();
respVO.setProjectName(projectDTO.getName());
}

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.smartfactory.framework.util;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.util.Strings;
import java.util.regex.Matcher;
@ -17,7 +18,7 @@ public class StringUtil {
*/
public static Integer sizeNameAnalysis(String sizeName) {
if (Strings.isEmpty(sizeName)) {
if (StringUtils.isEmpty(sizeName)) {
return 1;
}