From c678894e37d15cca116d962eba5c107c99176945 Mon Sep 17 00:00:00 2001
From: lisy <linlangsur163@163.com>
Date: 星期四, 20 七月 2023 17:39:05 +0800
Subject: [PATCH] 开始上课的主页中课包列表展示;bmi工具类匹配对应的身体状态

---
 cloud-server-account/src/main/java/com/dsh/account/service/impl/TStudentServiceImpl.java |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/cloud-server-account/src/main/java/com/dsh/account/service/impl/TStudentServiceImpl.java b/cloud-server-account/src/main/java/com/dsh/account/service/impl/TStudentServiceImpl.java
index c47fba0..d420ca5 100644
--- a/cloud-server-account/src/main/java/com/dsh/account/service/impl/TStudentServiceImpl.java
+++ b/cloud-server-account/src/main/java/com/dsh/account/service/impl/TStudentServiceImpl.java
@@ -107,15 +107,22 @@
 
 
     @Override
-    public void addStuOfAppUser(StuDetailsReq stu,Integer appUserId) {
+    public ResultUtil addStuOfAppUser(StuDetailsReq stu,Integer appUserId) throws Exception {
         TStudent student = new TStudent();
+        if(ToolUtil.isNotEmpty(stu.getName()) && ToolUtil.isNotEmpty(stu.getIdCard())){
+            Boolean aBoolean = JuHeUtil.idcardAuthentication(stu.getIdCard(), stu.getName());
+            if(!aBoolean){
+                return ResultUtil.error("身份证和姓名不匹配");
+            }
+        }
         student.setAppUserId(appUserId);
         student.setName(stu.getName());
         student.setHeadImg(stu.getHeadImg());
         student.setPhone(ToolUtil.isNotEmpty(stu.getPhone()) ? stu.getPhone() : "");
         student.setSex(stu.getSex());
         student.setIdCard(ToolUtil.isNotEmpty(stu.getIdCard())?stu.getIdCard() : "");
-        student.setBirthday(new Date(stu.getBirthday()));
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        student.setBirthday(sdf.parse(stu.getBirthday()));
         student.setHeight(stu.getHeight());
         student.setWeight(stu.getWeight());
         BigDecimal bigDecimal = BigDecimal.valueOf(stu.getWeight());
@@ -137,6 +144,7 @@
         saveParticipant.setPhone(student.getPhone());
         saveParticipant.setIdcard(student.getIdCard());
         participantClient.saveParticipant(saveParticipant);
+        return ResultUtil.success();
     }
 
     @Override
@@ -481,7 +489,7 @@
     }
 
     public ResultUtil AlipayPayment(String code,BigDecimal amount){
-        ResultUtil alipay = payMoneyUtil.alipay("课包续费", "", "", code, amount.toString(),
+        ResultUtil alipay = payMoneyUtil.alipay("课包续费", "课包续费", "", code, amount.toString(),
                 "/base/coursePackage/alipayPaymentCallback");
         if(alipay.getCode() == 200){
             new Thread(new Runnable() {

--
Gitblit v1.7.1