|
@@ -19,6 +19,8 @@ import com.ym.mec.biz.dal.wrapper.StatGroupWrapper;
|
|
|
import com.ym.mec.biz.service.*;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
|
|
|
+import com.ym.mec.thirdparty.user.realname.RealnameAuthenticationPluginContext;
|
|
|
+import com.ym.mec.thirdparty.user.realname.provider.LinkfaceRealnameAuthenticationPlugin;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -64,6 +66,8 @@ public class SchoolStaffServiceImpl extends ServiceImpl<SchoolStaffMapper, Schoo
|
|
|
private ImUserFriendDao imUserFriendDao;
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private RealnameAuthenticationPluginContext realnameAuthenticationPluginContext;
|
|
|
|
|
|
@Value("${message.debugMode:false}")
|
|
|
private boolean debugMode;
|
|
@@ -535,5 +539,48 @@ public class SchoolStaffServiceImpl extends ServiceImpl<SchoolStaffMapper, Schoo
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 实名认证
|
|
|
+ *
|
|
|
+ * @param realName 姓名
|
|
|
+ * @param idcardNo 身份证号
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void realNameAuthentication(Integer userId,String realName, String idcardNo) {
|
|
|
+
|
|
|
+
|
|
|
+ SchoolStaff schoolStaff = schoolStaffService.getByUserId(userId);
|
|
|
+ if (schoolStaff == null) {
|
|
|
+ throw new BizException("用户信息不存在");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 验证数据合法
|
|
|
+ if (!debugMode) {
|
|
|
+ realnameAuthenticationPluginContext.getRealnameAuthenticationPlugin(LinkfaceRealnameAuthenticationPlugin.getName()).verify(realName, idcardNo);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 保存到sys_user表中
|
|
|
+ SysUser user = new SysUser();
|
|
|
+ user.setRealName(realName);
|
|
|
+ user.setIdCardNo(idcardNo);
|
|
|
+ user.setUpdateTime(new Date());
|
|
|
+ teacherDao.updateUser(user);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询学校员工信息
|
|
|
+ *
|
|
|
+ * @param userId 用户ID
|
|
|
+ * @return SchoolStaff
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public SchoolStaff getByUserId(Integer userId) {
|
|
|
+ return this.lambdaQuery()
|
|
|
+ .eq(SchoolStaff::getUserId, userId)
|
|
|
+ .ne(SchoolStaff::getStatus, -1)
|
|
|
+ .last("limit 1")
|
|
|
+ .one();
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|