夏文涛 1 gadu atpakaļ
vecāks
revīzija
1108a989b4

+ 1 - 0
src/main/java/com/template/controller/LoginController.java

@@ -229,6 +229,7 @@ public class LoginController implements LoginControllerAPI {
         }
         //根据卡号查询repair_user表中的用户信息
         WelcomeStudent student = welcomeStudentService.getDataByIdcard(id_card);
+        System.out.println("微校授权获取用户信息"+JSON.toJSON(student));
         //取消授权的身份验证 谁都能进
         //if (identity_type != 4 && user == null) {
         //   return CommonResult.fail("非法权限,授权失败");

+ 16 - 13
src/main/java/com/template/controller/WelcomeStudentController.java

@@ -636,14 +636,16 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
                 if (!(StringUtils.hasText(fv.getName()) && StringUtils.hasText(fv.getPhone()) && StringUtils.hasText(fv.getWorkUnit()) && StringUtils.hasText(fv.getFamilyShip()))) {
                     return CommonResult.fail("家庭成员信息不能为空!");
                 }
+                if (fv.getId() != null && fv.getId().intValue() > 0) {
+                    WelcomeFamily wf = new WelcomeFamily();
+                    wf.setName(fv.getName());
+                    wf.setPhone(fv.getPhone());
+                    wf.setWorkUnit(fv.getWorkUnit());
+                    wf.setFamilyShip(fv.getFamilyShip());
+                    wf.setStudentCard(icr.getCardId());
+                    wfs.add(wf);
+                }
 
-                WelcomeFamily wf = new WelcomeFamily();
-                wf.setName(fv.getName());
-                wf.setPhone(fv.getPhone());
-                wf.setWorkUnit(fv.getWorkUnit());
-                wf.setFamilyShip(fv.getFamilyShip());
-                wf.setStudentCard(icr.getCardId());
-                wfs.add(wf);
             }
         }
 
@@ -654,12 +656,13 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
                 if (!(StringUtils.hasText(av.getName()) && StringUtils.hasText(av.getPhone()))) {
                     return CommonResult.fail("家庭成员信息不能为空!");
                 }
-
-                WelcomeAccompany wa = new WelcomeAccompany();
-                wa.setName(av.getName());
-                wa.setPhone(av.getPhone());
-                wa.setStudentCard(icr.getCardId());
-                was.add(wa);
+                if(av.getId()!= null && av.getId().intValue() > 0) {
+                    WelcomeAccompany wa = new WelcomeAccompany();
+                    wa.setName(av.getName());
+                    wa.setPhone(av.getPhone());
+                    wa.setStudentCard(icr.getCardId());
+                    was.add(wa);
+                }
             }
         }