feat(项目管理产品需求重构): 完善产品中的需求规格功能开发

生成需规标识时去掉标题中特殊字符

Signed-off-by: OTTO <731554297@qq.com>
This commit is contained in:
OTTO 2024-12-09 14:58:20 +08:00
parent e1b377ceef
commit 96c5a2b687
1 changed files with 5 additions and 1 deletions

View File

@ -38,6 +38,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.regex.Pattern;
import static com.microservices.common.core.utils.PageUtils.startPage;
@ -424,7 +425,10 @@ public class PmsProductRequirementServiceImpl implements IPmsProductRequirementS
}
private String genReqSpecsIdentifier(String productIdentifier, String reqTitle, String oldIdentifier) {
String reqTitleIdentifier = PinYinStringUtils.toFirstChar(reqTitle).replaceAll("[^a-z^A-Z]", "").toUpperCase();
// 去掉标题中特殊字符
String regEx = "\\pP|\\pS|\\s+";
reqTitle = Pattern.compile(regEx).matcher(reqTitle).replaceAll("").trim();
String reqTitleIdentifier = PinYinStringUtils.toFirstChar(reqTitle).toUpperCase();
String identifier = productIdentifier + "-" + reqTitleIdentifier;
if (!identifier.equals(oldIdentifier)) {
Integer count = pmsProductRequirementMapper.selectReqSpecsCountByIdentifier(identifier);