zoujiajian 1 년 전
부모
커밋
186554fcd9

+ 15 - 1
netflix-common/src/main/java/com/cyksj/common/util/StringUtil.java

@@ -531,7 +531,7 @@ public final class StringUtil {
 	/**
 	 * 身份证号返回
 	 */
-	public static String deIndent(String ident) {
+	public static String enIndent(String ident) {
 		String front = ident.substring(0, 4);
 		String back = ident.substring(ident.length() - 4);
 		StringBuilder sb = new StringBuilder();
@@ -615,4 +615,18 @@ public final class StringUtil {
 		}
 		return "unknown";
 	}
+
+	/**
+	 * 姓名返回
+	 */
+	public static String enName(String name) {
+		String first = name.substring(0, 1);
+		if (name.length() <= 2) {
+			return first + "*";
+		}
+		String end = name.substring(name.length() - 1);
+		StringBuilder sb = new StringBuilder();
+		sb.append(first).append("*").append(end);
+		return sb.toString();
+	}
 }

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/user/impl/UserIdentCertServiceImpl.java

@@ -93,7 +93,7 @@ public class UserIdentCertServiceImpl implements UserIdentCertService {
 		if (record == null) {
 			return null;
 		}
-		record.setIdent(StringUtil.deIndent(record.getIdent()));
+		record.setIdent(StringUtil.enIndent(record.getIdent()));
 		return record;
 	}
 

+ 6 - 0
netflix-service/src/main/java/com/cyksj/service/user/impl/UserServiceImpl.java

@@ -846,9 +846,15 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
 		List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
 		UserCertRecord record = userCertRecordMapper.selectOne(Wrappers.lambdaQuery(UserCertRecord.class)
 				.in(UserCertRecord::getUserId, userIdList)
+				.select(UserCertRecord::getName)
 				.last("limit 1"));
+		if (record != null) {
+			record.setIdent(StringUtil.enIndent(record.getIdent()));
+			record.setName(StringUtil.enName(record.getName()));
+		}
 		UserStudentCertRecord userStudentCertRecord = userStudentCertRecordMapper.selectOne(Wrappers.lambdaQuery(UserStudentCertRecord.class)
 				.in(UserStudentCertRecord::getUserId, userIdList)
+				.select(UserStudentCertRecord::getSchool)
 				.last("limit 1"));
 		UserCertInfoView userCertInfoView = new UserCertInfoView();
 		userCertInfoView.setIndent(record);