Commit 4436aff5 by zhangxingmin

push

parent 22e39b42
...@@ -242,11 +242,12 @@ public class ApiCsfCommonServiceImpl implements ApiCsfCommonService { ...@@ -242,11 +242,12 @@ public class ApiCsfCommonServiceImpl implements ApiCsfCommonService {
public static void main(String[] args) { public static void main(String[] args) {
ApiCsfCommonServiceImpl commonService = new ApiCsfCommonServiceImpl(); ApiCsfCommonServiceImpl commonService = new ApiCsfCommonServiceImpl();
ApiCsfCalculateRequest request = new ApiCsfCalculateRequest(); System.out.println(commonService.convertChineseToPinyin("吕姐"));
request.setRequestValue("310111202603191111"); // ApiCsfCalculateRequest request = new ApiCsfCalculateRequest();
request.setCalculateType(6); // request.setRequestValue("310111202603191111");
Result<List<ApiCsfCalculateResponse>> result = commonService.calculate(request); // request.setCalculateType(6);
System.out.println(result); // Result<List<ApiCsfCalculateResponse>> result = commonService.calculate(request);
// System.out.println(result);
} }
/** /**
...@@ -343,8 +344,8 @@ public class ApiCsfCommonServiceImpl implements ApiCsfCommonService { ...@@ -343,8 +344,8 @@ public class ApiCsfCommonServiceImpl implements ApiCsfCommonService {
if (pinyinArray != null && pinyinArray.length > 0) { if (pinyinArray != null && pinyinArray.length > 0) {
String py = pinyinArray[0]; String py = pinyinArray[0];
// 将 ü / Ü 替换为 v / V // 将 ü / Ü 替换为 v / V
py = py.replace("ü", "v").replace("Ü", "V"); py = py.replace("U:","V").replace("u:","v").replace("ü", "v").replace("Ü", "V");
// 移除可能出现的冒号或其他非字母字符(仅保留字母和空格 // 移除所有非字母字符(如冒号
py = py.replaceAll("[^A-Z]", ""); py = py.replaceAll("[^A-Z]", "");
if (StringUtils.isBlank(py)) { if (StringUtils.isBlank(py)) {
py = String.valueOf(c); py = String.valueOf(c);
...@@ -370,5 +371,4 @@ public class ApiCsfCommonServiceImpl implements ApiCsfCommonService { ...@@ -370,5 +371,4 @@ public class ApiCsfCommonServiceImpl implements ApiCsfCommonService {
return pinyin.toString(); return pinyin.toString();
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment