Pārlūkot izejas kodu

家长手机号

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

+ 11 - 2
src/main/java/com/template/api/SmartUserControllerAPI.java

@@ -78,7 +78,7 @@ public interface SmartUserControllerAPI {
      */
     @PostMapping(value = "importExcelUpdateUsers")
     @ApiOperation(value = "批量更新学生信息", notes = "批量更新学生信息", httpMethod = "POST")
-    CommonResult importExcelUpdateUsers(@RequestParam("file") MultipartFile excelFile, @RequestParam String headImage) throws Exception;
+    CommonResult importExcelUpdateUsers(@RequestParam("file") MultipartFile excelFile, String headImage) throws Exception;
 
     /**
      * 批量导入压缩包
@@ -99,6 +99,13 @@ public interface SmartUserControllerAPI {
     @ApiOperation(value = "添加用户", notes = "添加用户数据", httpMethod = "POST")
     CommonResult insertSmartUser(@Validated @RequestBody insertSmartUserRequest isur, BindingResult bindingResult) throws Exception;
 
+    /**
+     * 时间组数据集合
+     */
+    @GetMapping(value = "/updateTest")
+    @ApiOperation(value = "更新", notes = "更新", httpMethod = "GET")
+    CommonResult updateTest(int departmentId) throws Exception;
+
     @PostMapping(value = "/updateSmartUserById")
     @ApiOperation(value = "编辑用户数据", notes = "编辑用户数据", httpMethod = "POST")
     CommonResult updateSmartUserById(@Validated @RequestBody updateSmartUserRequest ra, BindingResult bindingResult) throws Exception;
@@ -282,5 +289,7 @@ public interface SmartUserControllerAPI {
     @ApiOperation(value = "管理端——统计报表导出", notes = "管理端——在校统计导出", httpMethod = "GET")
     void statisticsStatementManagExport(HttpServletResponse response,@RequestParam String dateTime);
 
-
+    @GetMapping(value = "/lostBan")
+    @ApiOperation(value = "退班", notes = "退班", httpMethod = "GET")
+    CommonResult lostBan(@RequestParam String teacherUid,@RequestParam String classUid);
 }

+ 552 - 10
src/main/java/com/template/controller/SmartUserController.java

@@ -216,7 +216,7 @@ public class SmartUserController implements SmartUserControllerAPI {
             }
 
             if (users != null && users.size() > 0) {
-                boolean insertData = smartUserService.updateUserBatchById(users);
+                boolean insertData = smartUserService.updateBatchById(users);
                 if (!insertData) {
                     return CommonResult.fail("导入失败");
                 }
@@ -536,7 +536,7 @@ public class SmartUserController implements SmartUserControllerAPI {
             user.setDepartmentId(cdr.getDepartmentId());
 
         }
-        boolean result = smartUserService.updateUserBatchById(users);
+        boolean result = smartUserService.updateBatchById(users);
 
         return result ? CommonResult.ok("移动成功") : CommonResult.fail("移动失败");
     }
@@ -2107,7 +2107,7 @@ public class SmartUserController implements SmartUserControllerAPI {
         List<SmartUser> insertStudent = new ArrayList<>();
         List<SmartUser> updateStudent = new ArrayList<>();
 
-        List<SmartUser> updateStudents = result.stream().filter(e -> e.getId() != null).collect(Collectors.toList());
+        List<SmartUser> updateStudents = result.stream().filter(e -> e.getId() != null && e.getIdentityId().intValue() == eIdentityStatu.Student.getValue()).collect(Collectors.toList());
 
         for (SmartUser studentData : updateStudents) {
             studentData.setName(studentData.getName());//姓名
@@ -2128,7 +2128,7 @@ public class SmartUserController implements SmartUserControllerAPI {
                         if (!studentData.getOldClassUid().equals(oClass.get().getClassUid())) {
                             CommonResult changeClass = SeewoChangeClass(seewoClient, seewoConfig.getSchoolId(), studentData.getXwStudentUid(), studentData.getOldClassUid(), oClass.get().getClassUid());
                             if (!changeClass.isSuccess()) {
-                                return CommonResult.fail("希沃平台:" + changeClass.getMessage());
+                                //return CommonResult.fail("希沃平台:" + changeClass.getMessage());
                             }
                         }
                     }
@@ -2153,8 +2153,149 @@ public class SmartUserController implements SmartUserControllerAPI {
                 return CommonResult.fail("学号为:" + studentData.getCardNo() + "的" + studentData.getName() + "的年级数据无效,无法进行更新操作");
             }
         }
+
+        //更新家长
+        List<SmartUser> updateParents = result.stream().filter(e -> e.getId() != null && e.getIdentityId().intValue() == eIdentityStatu.Parent.getValue()).collect(Collectors.toList());
+        if(updateParents != null && updateParents.size() > 0){
+            boolean updateBatch = smartUserService.updateBatchById(updateParents);
+            if (!updateBatch) {
+                return CommonResult.fail("系统批量更新家长出错,导入失败");
+            }
+        }
+
+        //新增家长
+        List<SmartUser> insertParentDatas = new ArrayList<>();
+        List<SmartUser> insertParents = result.stream().filter(e -> e.getId() == null && e.getIdentityId().intValue() == eIdentityStatu.Parent.getValue()).collect(Collectors.toList());
+        if(insertParents != null && insertParents.size() > 0){
+            List<String> familyCardNos = updateStudents.stream().map(SmartUser::getCardNo).distinct().collect(Collectors.toList());
+            List<SmartFamilyIndex> indexs = smartFamilyIndexService.querySmartFamilyByCardNo(familyCardNos);
+            List<SmartFamilyIndex> familyIndexs = new ArrayList<>();
+            //region 希沃新增编辑学生家长信息
+            if (useXw == 1) {
+                int num = (int) Math.ceil((double) updateStudents.size() / 100);
+                for (int count = 1; count <= num; count++) {
+                    int startIndex = (count - 1) * 100;
+                    int endIndex = count * 100;
+                    if (count == num) {
+                        endIndex = startIndex + (updateStudents.size() % 100);
+                    }
+
+                    List<SmartUser> currentStudentDatas = updateStudents.subList(startIndex, endIndex);//结尾不包含下标100
+                    //学生与家长列表,最大100条
+                    List<ParentServiceBatchSaveOrUpdateParentsParam.StudentParentsItem> studentParents = new ArrayList<>();
+                    for (SmartUser student : currentStudentDatas) {
+                        ParentServiceBatchSaveOrUpdateParentsParam.StudentParentsItem students = ParentServiceBatchSaveOrUpdateParentsParam.StudentParentsItem.builder()
+                                .studentCode(student.getCardNo())
+                                .build();
+
+
+                        List<SmartUser> parentDatas = insertParents.stream().filter(e -> e.getIdentityId().intValue() == eIdentityStatu.Parent.getValue() && e.getAffiliate().equals(student.getCardNo())).collect(Collectors.toList());
+                        List<ParentServiceBatchSaveOrUpdateParentsParam.ParentsItem> parents = new ArrayList<>();
+
+                        long indexCount = indexs.stream().filter(e -> e.getStudentNo().equals(student.getCardNo())).count();
+                        int i = (indexCount<= 0 ? 0 : (int)indexCount);
+
+                        for (SmartUser parent : parentDatas) {
+                            insertParentDatas.add(parent);
+                            SmartFamilyIndex familyIndex = new SmartFamilyIndex();
+                            familyIndex.setParentPhone(parent.getPhone());
+                            familyIndex.setStudentNo(student.getCardNo());
+                            familyIndex.setIndexData(i);
+                            familyIndexs.add(familyIndex);
+                            ParentServiceBatchSaveOrUpdateParentsParam.ParentsItem data = ParentServiceBatchSaveOrUpdateParentsParam.ParentsItem.builder()
+                                    .name(parent.getShip())
+                                    .phone(parent.getPhone())
+                                    .index(i)
+                                    .build();
+                            parents.add(data);
+                            ++i;
+                        }
+
+                        if (parents != null && parents.size() > 0) {
+                            studentParents.add(students);
+                            //家长列表,最多4个
+                            students.setParents(parents);
+                        }
+                    }
+
+                    //初始化客户端
+                    SeewoClient seewoClient = new DefaultSeewoClient(new Account(seewoConfig.getAppId(), seewoConfig.getAppSecret()));
+                    ParentServiceBatchSaveOrUpdateParentsParam param = new ParentServiceBatchSaveOrUpdateParentsParam();
+                    //响应体,MimeType为 application/json
+                    ParentServiceBatchSaveOrUpdateParentsParam.RequestBody requestBody = ParentServiceBatchSaveOrUpdateParentsParam.RequestBody.builder()
+                            .build();
+                    param.setRequestBody(requestBody);
+                    //query
+                    ParentServiceBatchSaveOrUpdateParentsParam.Query query = ParentServiceBatchSaveOrUpdateParentsParam.Query.builder()
+                            .appId(seewoConfig.getAppId())
+                            .schoolUid(seewoConfig.getSchoolId())
+                            .build();
+                    requestBody.setQuery(query);
+                    query.setStudentParents(studentParents);
+                    param.setRequestBody(requestBody);
+                    ParentServiceBatchSaveOrUpdateParentsRequest request = new ParentServiceBatchSaveOrUpdateParentsRequest(param);
+                    String jsonString = JSON.toJSONString(request);
+                    logger.info("入参:" + request);
+                    //如果想要调用沙箱环境,请通过设置 request 对象的 serverUrl 属性,如:
+                    //request.setServerUrl("https://openapi.test.seewo.com")
+                    //执行请求,如果想获取到com.seewo.open.sdk.HttpResponse对象,请调用 seewoClient.execute 方法
+                    ParentServiceBatchSaveOrUpdateParentsResult parentResult = seewoClient.invoke(request);
+                    logger.info("出参:" + parentResult);
+
+
+                    if (parentResult == null) {
+                        return CommonResult.fail("希沃学生家长数据添加失败!");
+                    }
+
+                    if (!parentResult.getResponseBody().getCode().equals("000000")) {
+                        return CommonResult.fail("希沃平台:" + parentResult.getResponseBody().getMessage());
+                    }
+                }
+
+            }
+            //endregion
+            if (familyIndexs != null && familyIndexs.size() > 0) {
+
+                boolean insertBatch = smartFamilyIndexService.saveBatch(familyIndexs);
+                if (!insertBatch) {
+                    return CommonResult.fail("导入失败!");
+                }
+            }
+
+            List<SmartUser> newParents = new ArrayList<>();
+            if(insertParentDatas != null && insertParentDatas.size() > 0){
+                for (SmartUser parent : insertParentDatas) {
+                    Optional<SmartUser> student = updateStudents.stream().filter(e -> e.getCardNo().equals(parent.getAffiliate())).findFirst();
+                    if (student != null && student.isPresent()) {
+                        //先查找是否存在
+                        Optional<SmartUser> newData = newParents.stream().filter(e -> e.getName().equals(parent.getName()) && e.getPhone().equals(parent.getPhone()) && e.getShip().equals(parent.getShip())).findFirst();
+                        if (newData != null && newData.isPresent()) {
+                            String affiliate = newData.get().getAffiliate() + "," + student.get().getId();
+                            newData.get().setAffiliate(affiliate);
+                        } else {
+                            SmartUser newParent = new SmartUser();
+                            newParent.setName(parent.getName());
+                            newParent.setDepartmentId(parent.getDepartmentId());
+                            newParent.setPhone(parent.getPhone());
+                            newParent.setIdentityId(parent.getIdentityId());
+                            newParent.setSexId(parent.getSexId());
+                            newParent.setIsCancel(parent.getIsCancel());
+                            newParent.setAffiliate(String.valueOf(student.get().getId()));
+                            newParent.setShip(parent.getShip());
+                            newParents.add(newParent);
+                        }
+                    }
+
+                }
+                boolean insertBatch = smartUserService.saveBatch(newParents);
+                if (!insertBatch) {
+                    return CommonResult.fail("批量新增家长失败!");
+                }
+            }
+        }
+
         if (updateStudent != null && updateStudent.size() > 0) {
-            boolean updateBatch = smartUserService.updateUserBatchById(updateStudent);
+            boolean updateBatch = smartUserService.updateBatchById(updateStudent);
             if (!updateBatch) {
                 return CommonResult.fail("系统批量更新出错,导入失败");
             } else {
@@ -2176,7 +2317,11 @@ public class SmartUserController implements SmartUserControllerAPI {
 
 
         List<SmartUser> insertStudents = result.stream().filter(e -> e.getId() == null).collect(Collectors.toList());
+
         if (insertStudents != null && insertStudents.size() > 0) {
+            if(headImage == null){
+                return CommonResult.fail("更新数据文档中存在新增数据,头像不能为空");
+            }
             List<String> uploadImages = Arrays.asList(headImage.split(","));
             for (SmartUser user : insertStudents) {
                 Optional<String> image = uploadImages == null ? null : uploadImages.stream().filter(e -> e.equals("https://wanzai-1306339220.cos.ap-shanghai.myqcloud.com/" + user.getHeadImage())).findFirst();
@@ -2192,7 +2337,10 @@ public class SmartUserController implements SmartUserControllerAPI {
 
             //region 将数据加入第三方
             List<SmartUser> studentDatas = insertStudents.stream().filter(e -> e.getIdentityId().intValue() == eIdentityStatu.Student.getValue()).collect(Collectors.toList());
-
+            List<String> newCardNos = studentDatas.stream().map(SmartUser::getCardNo).collect(Collectors.toList());
+            if (newCardNos == null) {
+                return CommonResult.fail("文档内容为空,批量更新失败");
+            }
             if (studentDatas != null && studentDatas.size() > 0) {
                 //判断是否存在重复数据
                 List<String> cardNoDatas = studentDatas.stream().map(SmartUser::getCardNo).collect(Collectors.toList());
@@ -2423,8 +2571,8 @@ public class SmartUserController implements SmartUserControllerAPI {
                 //双胞胎家长
                 List<SmartUser> newParents = new ArrayList<>();
 
-                if (cardNos != null && cardNos.size() > 0) {
-                    List<SmartUser> students = smartUserService.querySmartUserByCardNos(cardNos);
+                if (newCardNos != null && newCardNos.size() > 0) {
+                    List<SmartUser> students = smartUserService.querySmartUserByCardNos(newCardNos);
                     for (SmartUser parent : parents) {
                         Optional<SmartUser> student = students.stream().filter(e -> e.getCardNo().equals(parent.getAffiliate())).findFirst();
                         if (student != null && student.isPresent()) {
@@ -2516,6 +2664,7 @@ public class SmartUserController implements SmartUserControllerAPI {
         HSSFSheet sheetAt = sheets.getSheetAt(0);
         DataFormatter dataFormatter = new DataFormatter();
         List<SmartUser> users = smartUserService.queryStudentDatas(eIdentityStatu.Student.getValue(), ids);
+        List<SmartUser> parents = smartUserService.getSmartUserByIdentity(eIdentityStatu.Parent.getValue());
 
         try {
             for (int rowNum = 0; rowNum < sheetAt.getLastRowNum() + 1; rowNum++) {
@@ -2677,6 +2826,8 @@ public class SmartUserController implements SmartUserControllerAPI {
                             user.setCardNo(cardNo == null ? "" : cardNo);
                             user.setName(name == null ? "" : name);
                             user.setIdentityId(eIdentityStatu.Student.getValue());
+                            String cardId = dataFormatter.formatCellValue(row.getCell(7));//身份证
+                            user.setIdCard(cardId == null ? user.getIdCard() : cardId);
 
                             Optional<SmartClass> oClass = classs.stream().filter(e -> e.getName().equals(schoolClass)).findFirst();
                             if (oClass != null && oClass.isPresent()) {
@@ -2691,6 +2842,72 @@ public class SmartUserController implements SmartUserControllerAPI {
                                 user.setTimeGroupId(oGroup.get().getId());
                             }
                             result.add(user);
+
+                            //不判断重复性 因为会出现双胞胎
+                            String phone = dataFormatter.formatCellValue(row.getCell(11));
+                            //部门是否为空判断
+                            String familyDepartment = dataFormatter.formatCellValue(row.getCell(1)).replace("年级", "") + "家长";
+
+                            Integer familyDepartmentId = null;
+                            Optional<SmartDepartment> familyDepartModel = departments.stream().filter(e -> e.getName().equals(familyDepartment)).findFirst();
+                            if (familyDepartModel != null && familyDepartModel.isPresent()) {
+                                familyDepartmentId = familyDepartModel.get().getId();
+                            } else {
+                                familyDepartmentId = 16;
+                            }
+
+                            //region 家属
+
+                            if (!ObjectUtils.isEmpty(phone)) {
+                                if (phone.length() != 11) {
+                                    return CommonResult.fail(name + "的学生家长手机号长度不符合标准");
+                                }
+
+                                SmartUser familyOne = new SmartUser();
+                                Optional<SmartUser> oneParent = parents.stream().filter(e -> e.getPhone().equals(phone)).findFirst();
+                                if(oneParent != null && oneParent.isPresent()){
+                                    familyOne = oneParent.get();
+                                }else{
+                                    familyOne.setAffiliate(user.getCardNo());
+                                }
+                                String family = dataFormatter.formatCellValue(row.getCell(12));//家属
+                                familyOne.setName(!ObjectUtils.isEmpty(family) ? family : "家长");
+                                familyOne.setDepartmentId(familyDepartmentId);
+                                familyOne.setPhone(phone);
+                                familyOne.setIdentityId(eIdentityStatu.Parent.getValue());
+                                familyOne.setSexId(eSexStatu.Man.getValue());
+                                familyOne.setIsCancel(eLogOff.Unlogout.getValue());
+                                familyOne.setAffiliate(user.getCardNo());
+                                String familyShip = dataFormatter.formatCellValue(row.getCell(13));//家属与本人关系
+                                familyOne.setShip(familyShip == null ? "其他" : familyShip);
+                                result.add(familyOne);
+                            }
+
+                            String phoneTwo = dataFormatter.formatCellValue(row.getCell(14));//联系电话2
+                            if (!ObjectUtils.isEmpty(phoneTwo)) {
+                                if (phoneTwo.length() != 11) {
+                                    return CommonResult.fail(name + "的学生家长手机号长度不符合标准");
+                                }
+                                SmartUser familyTwo = new SmartUser();
+                                Optional<SmartUser> oneParent = parents.stream().filter(e -> e.getPhone().equals(phoneTwo)).findFirst();
+                                if(oneParent != null && oneParent.isPresent()){
+                                    familyTwo = oneParent.get();
+                                }else{
+                                    familyTwo.setAffiliate(user.getCardNo());
+                                }
+                                String familyNameTwo = dataFormatter.formatCellValue(row.getCell(15));//家属2
+                                familyTwo.setName(!ObjectUtils.isEmpty(familyNameTwo) ? familyNameTwo : "家长");
+                                familyTwo.setDepartmentId(familyDepartmentId);
+                                familyTwo.setPhone(phoneTwo == null ? "" : phoneTwo);
+                                familyTwo.setIdentityId(eIdentityStatu.Parent.getValue());
+                                familyTwo.setSexId(eSexStatu.Man.getValue());
+                                familyTwo.setIsCancel(eLogOff.Unlogout.getValue());
+                                familyTwo.setAffiliate(user.getCardNo());
+                                String familyShipTwo = dataFormatter.formatCellValue(row.getCell(16));//家属与本人关系2
+                                familyTwo.setShip(familyShipTwo == null ? "其他" : familyShipTwo);
+                                result.add(familyTwo);
+                            }
+                            //endregion
                         } else {
                             String name = dataFormatter.formatCellValue(row.getCell(4));
                             //                        if (ObjectUtils.isEmpty(name)) {
@@ -2930,6 +3147,7 @@ public class SmartUserController implements SmartUserControllerAPI {
         XSSFSheet sheetAt = sheets.getSheetAt(0);
         DataFormatter dataFormatter = new DataFormatter();
         List<SmartUser> users = smartUserService.queryStudentDatas(eIdentityStatu.Student.getValue(), ids);
+        List<SmartUser> parents = smartUserService.getSmartUserByIdentity(eIdentityStatu.Parent.getValue());
         try {
             for (int rowNum = 0; rowNum < sheetAt.getLastRowNum() + 1; rowNum++) {
                 XSSFRow row = sheetAt.getRow(rowNum);
@@ -3091,6 +3309,11 @@ public class SmartUserController implements SmartUserControllerAPI {
                             user.setName(name == null ? "" : name);
                             user.setIdentityId(eIdentityStatu.Student.getValue());
 
+                            String cardId = dataFormatter.formatCellValue(row.getCell(7));//身份证
+                            user.setIdCard(cardId == null ? user.getIdCard() : cardId);
+                            String address = dataFormatter.formatCellValue(row.getCell(10));//住址
+                            user.setAddress(address == null ? user.getAddress() : address);
+
                             Optional<SmartClass> oClass = classs.stream().filter(e -> e.getName().equals(schoolClass)).findFirst();
                             if (oClass != null && oClass.isPresent()) {
                                 user.setSchoolClass(oClass.get().getId());
@@ -3104,6 +3327,75 @@ public class SmartUserController implements SmartUserControllerAPI {
                                 user.setTimeGroupId(oGroup.get().getId());
                             }
                             result.add(user);
+
+                            //不判断重复性 因为会出现双胞胎
+                            String phone = dataFormatter.formatCellValue(row.getCell(11));
+                            //部门是否为空判断
+                            String familyDepartment = dataFormatter.formatCellValue(row.getCell(1)).replace("年级", "") + "家长";
+
+                            Integer familyDepartmentId = null;
+                            Optional<SmartDepartment> familyDepartModel = departments.stream().filter(e -> e.getName().equals(familyDepartment)).findFirst();
+                            if (familyDepartModel != null && familyDepartModel.isPresent()) {
+                                familyDepartmentId = familyDepartModel.get().getId();
+                            } else {
+                                familyDepartmentId = 16;
+                            }
+
+                            //region 家属
+
+                            if(user.getName().equals("张宇霏")){
+                                String sdsd ="";
+                            }
+
+                            if (!ObjectUtils.isEmpty(phone)) {
+                                if (phone.length() != 11) {
+                                    return CommonResult.fail(name + "的学生家长手机号长度不符合标准");
+                                }
+
+                                SmartUser familyOne = new SmartUser();
+                                Optional<SmartUser> oneParent = parents.stream().filter(e -> e.getPhone().equals(phone)).findFirst();
+                                if(oneParent != null && oneParent.isPresent()){
+                                    familyOne = oneParent.get();
+                                }else{
+                                    familyOne.setAffiliate(user.getCardNo());
+                                }
+                                String family = dataFormatter.formatCellValue(row.getCell(12));//家属
+                                familyOne.setName(!ObjectUtils.isEmpty(family) ? family : "家长");
+                                familyOne.setDepartmentId(familyDepartmentId);
+                                familyOne.setPhone(phone);
+                                familyOne.setIdentityId(eIdentityStatu.Parent.getValue());
+                                familyOne.setSexId(eSexStatu.Man.getValue());
+                                familyOne.setIsCancel(eLogOff.Unlogout.getValue());
+                                String familyShip = dataFormatter.formatCellValue(row.getCell(13));//家属与本人关系
+                                familyOne.setShip(familyShip == null ? "其他" : familyShip);
+                                result.add(familyOne);
+                            }
+
+                            String phoneTwo = dataFormatter.formatCellValue(row.getCell(14));//联系电话2
+                            if (!ObjectUtils.isEmpty(phoneTwo)) {
+                                if (phoneTwo.length() != 11) {
+                                    return CommonResult.fail(name + "的学生家长手机号长度不符合标准");
+                                }
+                                SmartUser familyTwo = new SmartUser();
+                                Optional<SmartUser> oneParent = parents.stream().filter(e -> e.getPhone().equals(phoneTwo)).findFirst();
+                                if(oneParent != null && oneParent.isPresent()){
+                                    familyTwo = oneParent.get();
+                                }else{
+                                    familyTwo.setAffiliate(user.getCardNo());
+                                }
+                                String familyNameTwo = dataFormatter.formatCellValue(row.getCell(15));//家属2
+                                familyTwo.setName(!ObjectUtils.isEmpty(familyNameTwo) ? familyNameTwo : "家长");
+                                familyTwo.setDepartmentId(familyDepartmentId);
+                                familyTwo.setPhone(phoneTwo == null ? "" : phoneTwo);
+                                familyTwo.setIdentityId(eIdentityStatu.Parent.getValue());
+                                familyTwo.setSexId(eSexStatu.Man.getValue());
+                                familyTwo.setIsCancel(eLogOff.Unlogout.getValue());
+                                String familyShipTwo = dataFormatter.formatCellValue(row.getCell(16));//家属与本人关系2
+                                familyTwo.setShip(familyShipTwo == null ? "其他" : familyShipTwo);
+                                result.add(familyTwo);
+                            }
+                            //endregion
+
                         } else {
                             String name = dataFormatter.formatCellValue(row.getCell(4));
                             //                        if (ObjectUtils.isEmpty(name)) {
@@ -3739,6 +4031,197 @@ public class SmartUserController implements SmartUserControllerAPI {
     }
     //endregion
 
+    @Override
+    @DESRespondSecret(validated = true)
+    @PassToken
+    public CommonResult updateTest(int departmentId) throws Exception {
+        List<Integer> departmentIds = new ArrayList<>();
+        departmentIds.add(81);
+        departmentIds.add(82);
+        departmentIds.add(83);
+        departmentIds.add(84);
+        departmentIds.add(85);
+        departmentIds.add(86);
+        departmentIds.add(87);
+        departmentIds.add(88);
+        departmentIds.add(89);
+        departmentIds.add(90);
+        departmentIds.add(91);
+        departmentIds.add(92);
+        departmentIds.add(93);
+        departmentIds.add(94);
+        departmentIds.add(95);
+        departmentIds.add(96);
+        departmentIds.add(97);
+        departmentIds.add(98);
+        List<SmartUser> users = smartUserService.queryDatasByDepartments(departmentIds);
+
+        for (SmartUser usur:users) {
+
+            if(usur.getName().equals("张玉玲")){
+                String sdsd = "";
+            }
+            int useXw = 1;
+            int useBs = 1;
+
+            //更新的同时将百胜用户信息同步过去或者同步过来?
+            SmartUser su = smartUserService.getSmartById(usur.getId());
+            if (su == null) {
+                return CommonResult.fail("用户数据已失效,修改失败!");
+            }
+
+            //是否转换身份
+            boolean changeIdentity = false;
+            Integer oldIdentity = null;
+            String oldAffiliate = su.getAffiliate();
+            Integer oldSchoolClass = su.getSchoolClass();
+            String oldStaffNo = su.getBsStaffCode();
+            String oldCardNo = su.getCardNo();
+            if (usur.getIdentityId().intValue() != su.getIdentityId().intValue()) {
+                changeIdentity = true;
+                oldIdentity = su.getIdentityId().intValue();
+            }
+            SeewoClient seewoClient = new DefaultSeewoClient(new Account(seewoConfig.getAppId(), seewoConfig.getAppSecret()));
+
+            su.setTimeGroupId(usur.getTimeGroupId());
+            su.setCardNo(usur.getCardNo());
+            su.setName(usur.getName());
+            su.setIdentityId(usur.getIdentityId());
+            su.setIdCard(usur.getIdCard());
+            su.setSexId(usur.getSexId());
+            su.setDepartmentId(usur.getDepartmentId());
+            su.setHeadImage(usur.getHeadImage());
+            su.setGrade(usur.getGrade());
+            su.setCollege(usur.getCollege());
+            su.setSpeciality(usur.getSpeciality());
+            su.setSchoolClass(usur.getSchoolClass());
+            su.setCampus(usur.getCampus());
+            su.setDormitoryNumber(usur.getDormitoryNumber());
+            su.setPhone(usur.getPhone());
+            su.setAffiliate(StringUtils.join(usur.getAffiliate(), ","));
+            su.setTitle(usur.getTitle());
+            su.setAddress(usur.getAddress());
+            su.setNation(usur.getNation());
+            su.setOfStudent(usur.getOfStudent());
+            su.setGraduate(usur.getGraduate());
+            su.setDuties(usur.getDuties());
+            su.setIsCancel(eLogOff.Unlogout.getValue());
+
+            if (usur.getIdentityId().intValue() == eIdentityStatu.Parent.getValue()) {//家长
+                //拿到被关联学生的信息去获取对应的卡号
+                //有多个学生就循环学生
+                if (usur.getAffiliate() == null) {
+                    return CommonResult.fail("被关联人不能为空");
+                }
+
+                List<String> affiliates = Arrays.asList(usur.getAffiliate().split(","));
+                if (affiliates.size() <= 0) {
+                    return CommonResult.fail("被关联人不能为空");
+                }
+
+                SmartUser oldUser = smartUserService.queryParentByPhone(usur.getPhone());
+                if (oldUser != null && oldUser.getId().intValue() != usur.getId().intValue()) {
+                    //return CommonResult.fail("当前手机号已被其他家长使用");
+                }
+
+                List<SmartUser> studentDatas = smartUserService.getSmartUserIds(affiliates);
+
+                if(studentDatas.size() <= 0){
+                    smartUserService.deleteSmartUserById(usur.getId());
+                    continue;
+                }
+                if (!changeIdentity) {
+                    //region 希沃新增编辑学生家长信息
+                    if (useXw == 1) {
+                        //学生与家长列表,最大100条
+                        CommonResult insertOrUpdateResult = insertOrUpdateStudentParent(seewoClient, studentDatas, "其他", usur.getPhone(), false);
+                        if (!insertOrUpdateResult.isSuccess()) {
+                            return CommonResult.fail("希沃平台:" + insertOrUpdateResult.getMessage());
+                        }
+                    }
+                    //endregion
+                } else {
+                    if (oldIdentity.intValue() == eIdentityStatu.Student.getValue()) {
+                        //region 希沃删除学生
+                        //获取班级Uid
+                        SmartClass classData = smartClassService.getSmartClassById(oldSchoolClass);
+                        if (classData == null) {
+                            return CommonResult.fail("班级数据无效,更新失败");
+                        }
+
+                        if (useXw == 1) {
+                            CommonResult deleteStudent = SeewoDeleteStudent(seewoClient, classData.getClassUid(), oldCardNo);
+                            if (!deleteStudent.isSuccess()) {
+                                return CommonResult.fail("希沃平台:" + deleteStudent.getMessage());
+                            }
+                        }
+                        //endregion
+
+                        //region 百胜删除学生
+                        if (useBs == 1) {
+                            CommonResult deleteBsStudent = bsDeleteStudent(su);
+                            if (!deleteBsStudent.isSuccess()) {
+                                return CommonResult.fail("百胜平台:" + deleteBsStudent.getMessage());
+                            }
+                        }
+                        //endregion
+
+                    } else if (oldIdentity.intValue() == eIdentityStatu.Teacher.getValue()) {
+                        //获取班级Uid
+                        SmartClass classData = smartClassService.getSmartClassById(oldSchoolClass);
+                        if (classData == null) {
+                            return CommonResult.fail("班级数据无效,更新失败");
+                        }
+
+                        //region 希沃删除教师
+                        if (useXw == 1) {
+                            CommonResult deleteTeacher = SeewoDeleteTeacher(seewoClient, su.getPhone());
+                            if (!deleteTeacher.isSuccess()) {
+                                return CommonResult.fail("希沃平台:" + deleteTeacher.getMessage());
+                            }
+                        }
+                        //endregion
+
+                        //region 希沃删除班主任
+                        if (useXw == 1) {
+                            CommonResult deleteTeacherMaster = SeewoDeleteTeacherMaster(seewoClient, classData.getClassUid(), su.getPhone());
+                            if (deleteTeacherMaster.isSuccess()) {
+                                return CommonResult.fail("希沃平台:" + deleteTeacherMaster.getMessage());
+                            }
+                        }
+                        //endregion
+
+                        //region 百胜删除教师
+                        if (useBs == 1) {
+                            CommonResult bsDeleteTeacher = bsDeleteTeacher(oldStaffNo);
+                            if (!bsDeleteTeacher.isSuccess()) {
+                                return CommonResult.fail("百胜平台:" + bsDeleteTeacher.getMessage());
+                            }
+                        }
+                        //endregion
+                    }
+
+                    //region 希沃新增编辑学生家长信息
+                    if (useXw == 1) {
+                        List<SmartFamilyIndex> indexs = smartFamilyIndexService.querySmartFamilyByCardNo(su.getCardNo());
+                        if (indexs != null && indexs.size() >= 4) {
+                            return CommonResult.fail("绑定失败,希沃学生家长最多绑定四个家长");
+                        }
+
+                        CommonResult insertOrUpdate = insertOrUpdateStudentParent(seewoClient, studentDatas, su.getShip(), su.getPhone(), true);
+                        if (!insertOrUpdate.isSuccess()) {
+                            return CommonResult.fail("希沃平台:" + insertOrUpdate.getMessage());
+                        }
+                    }
+                    //endregion
+                }
+
+            }
+        }
+
+        return CommonResult.ok();
+    }
+
     //region 更新用户
 
     /**
@@ -4131,6 +4614,18 @@ public class SmartUserController implements SmartUserControllerAPI {
                         return CommonResult.fail("班级数据无效,新增失败");
                     }
 
+                    if (useXw == 1) {
+                        //获取班级Uid
+                        SmartClass oldClassData = smartClassService.getSmartClassById(oldSchoolClass);
+                        if (oldClassData == null) {
+                            return CommonResult.fail("班级数据无效,更新失败");
+                        }
+                        CommonResult deleteMaster = SeewoDeleteTeacherMaster(seewoClient, oldClassData.getClassUid(), su.getPhone());
+                        if (!deleteMaster.isSuccess()) {
+                            return CommonResult.fail("希沃平台:" + deleteMaster.getMessage());
+                        }
+                    }
+
                     //region 将班主任推送到希沃
                     if (useXw == 1) {
                         CommonResult pushMaster = SeewoPushMaster(seewoClient, su.getPhone(), classData.getClassUid());
@@ -4414,7 +4909,7 @@ public class SmartUserController implements SmartUserControllerAPI {
         ObjectMapper objectMapper = new ObjectMapper();
         XwBodyVo xwResult = objectMapper.readValue(result.getBody(), XwBodyVo.class);
         if (!xwResult.getCode().equals("000000")) {
-            return CommonResult.fail("希沃平台:" + result.getMessage());
+            return CommonResult.fail("希沃平台:" + xwResult.getMessage());
         }
 
         return CommonResult.ok("换班成功");
@@ -6375,6 +6870,53 @@ public class SmartUserController implements SmartUserControllerAPI {
         ExcelUtils.excelDownload(workbook, s1 + ":统计报表.xlsx", response);
     }
 
+    @Override
+    @PassToken
+    public CommonResult lostBan(String teacherUid, String classUid) {
+        SeewoClient seewoClient = new DefaultSeewoClient(new Account(seewoConfig.getAppId(), seewoConfig.getAppSecret()));
+        CommonResult deleteTeacherMaster = SeewoDeleteTeacherMaster(seewoClient, classUid, teacherUid);
+        if (deleteTeacherMaster.isSuccess()) {
+            return CommonResult.fail("希沃平台:" + deleteTeacherMaster.getMessage());
+        }
+//        CommonResult pushMaster = SeewoPushMaster(seewoClient, teacherUid, classUid);
+//        if (!pushMaster.isSuccess()) {
+//            return CommonResult.fail("希沃平台:" + pushMaster.getMessage());
+//        }
+        return CommonResult.ok();
+    }
+
+
+    public CommonResult seeWoLostBan(SeewoClient seewoClient,String schoolUid, String classUid, String teacherUid){
+        MdmTeacherClassApiTeacherLeaveClassParam requestParam = new MdmTeacherClassApiTeacherLeaveClassParam();
+        //请求体,MimeType为 application/json
+        MdmTeacherClassApiTeacherLeaveClassParam.JSONRequestBody requestBody = MdmTeacherClassApiTeacherLeaveClassParam.JSONRequestBody.builder()
+                .build();
+        requestParam.setRequestBody(requestBody);
+        //
+        List<String> teacherIds = new ArrayList<>();
+        teacherIds.add(teacherUid);
+        MdmTeacherClassApiTeacherLeaveClassParam.TeacherLeaveClassReqDto reqDto = MdmTeacherClassApiTeacherLeaveClassParam.TeacherLeaveClassReqDto.builder()
+                .orgUid(schoolUid)
+                .classUid(classUid)
+                .teacherUids(teacherIds)
+                .positionCode("CLASS_MASTER")
+                .build();
+        requestBody.setReqDto(reqDto);
+        MdmTeacherClassApiTeacherLeaveClassRequest request = new MdmTeacherClassApiTeacherLeaveClassRequest(requestParam);
+        System.out.println("入参:" +request);
+        //执行请求,如果想获取到com.seewo.open.sdk.HttpResponse对象,请调用 seewoClient.execute 方法
+        MdmTeacherClassApiTeacherLeaveClassResult result = seewoClient.invoke(request);
+        System.out.println("出参:" +result);
+        if (result == null) {
+            return CommonResult.fail("希沃教师数据删除失败!");
+        }
+
+        if (!result.getResponseBody().getCode().equals("000000")) {
+            return CommonResult.fail("希沃平台:" + result.getResponseBody().getMessage());
+        }
+
+        return CommonResult.ok("删除成功");
+    }
 
     //endregion
 
@@ -7513,7 +8055,7 @@ public class SmartUserController implements SmartUserControllerAPI {
 
         logger.info("循环结束:" + TimeExchange.getDateMillS());
         //region 批量更新学生数据
-        boolean updateBatch = smartUserService.updateUserBatchById(users);
+        boolean updateBatch = smartUserService.updateBatchById(users);
 
         logger.info("存储结束:" + TimeExchange.getDateMillS());
 

+ 2 - 1
src/main/java/com/template/model/evaluate/student/SmartTemplateRule.java

@@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 
 import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
 import java.io.Serializable;
 
 /**
@@ -31,7 +32,7 @@ public class SmartTemplateRule implements Serializable {
     private Integer id;
 
     @ApiModelProperty(value = "模板ID")
-    @NotBlank(message = "模板ID不能为空")
+    @NotNull(message = "模板ID不能为空")
     private Integer templateId;
 
     @ApiModelProperty(value = "等级")

+ 176 - 0
src/main/java/com/template/model/seewo/MdmTeacherClassApiTeacherLeaveClassParam.java

@@ -0,0 +1,176 @@
+package com.template.model.seewo;
+
+import java.util.*;
+import com.seewo.open.sdk.OpenApiParam;
+import com.seewo.open.sdk.ParameterPosition;
+
+/**
+ * seewo-open API: 教师退班
+ * 教师退班
+ *
+ * @author auto create
+ * @since 2.0.1 2024-9-5
+ */
+public class MdmTeacherClassApiTeacherLeaveClassParam extends OpenApiParam {
+
+
+    /**
+     * 请求体,MimeType为 application/json
+     */
+
+    private JSONRequestBody requestBody;
+
+
+    public JSONRequestBody getRequestBody() {
+        return this.requestBody;
+    }
+
+    public void setRequestBody(JSONRequestBody requestBody) {
+        this.requestBody = requestBody;
+    }
+
+    public static MdmTeacherClassApiTeacherLeaveClassParamBuilder builder(){
+        return new MdmTeacherClassApiTeacherLeaveClassParamBuilder();
+    }
+
+    public static class MdmTeacherClassApiTeacherLeaveClassParamBuilder{
+        private JSONRequestBody requestBody;
+
+        public MdmTeacherClassApiTeacherLeaveClassParamBuilder requestBody(JSONRequestBody requestBody){
+            this.requestBody = requestBody;
+            return this;
+        }
+
+        public MdmTeacherClassApiTeacherLeaveClassParam build(){
+            MdmTeacherClassApiTeacherLeaveClassParam result = new MdmTeacherClassApiTeacherLeaveClassParam();
+            result.setRequestBody(requestBody);
+            return result;
+        }
+    }
+
+    public static class JSONRequestBody {
+        /**
+         *
+         */
+        private TeacherLeaveClassReqDto reqDto;
+
+        public TeacherLeaveClassReqDto getReqDto() {
+            return this.reqDto;
+        }
+
+        public void setReqDto(TeacherLeaveClassReqDto reqDto) {
+            this.reqDto = reqDto;
+        }
+
+
+        public static JSONRequestBodyBuilder builder(){
+            return new JSONRequestBodyBuilder();
+        }
+
+        public static class JSONRequestBodyBuilder{
+            private TeacherLeaveClassReqDto reqDto;
+
+            public JSONRequestBodyBuilder reqDto(TeacherLeaveClassReqDto reqDto){
+                this.reqDto = reqDto;
+                return this;
+            }
+
+            public JSONRequestBody build(){
+                JSONRequestBody result = new JSONRequestBody();
+                result.setReqDto(reqDto);
+                return result;
+            }
+        }
+    }
+
+    public static class TeacherLeaveClassReqDto {
+        /**
+         * 组织id
+         */
+        private String orgUid;
+        /**
+         * 教师ids
+         */
+        private List<String> teacherUids;
+        /**
+         * 班级id
+         */
+        private String classUid;
+        /**
+         * 职务编码 班主任 CLASS_MASTER/任课老师 COURSE_TEACHER
+         */
+        private String positionCode;
+
+        public String getOrgUid() {
+            return this.orgUid;
+        }
+
+        public void setOrgUid(String orgUid) {
+            this.orgUid = orgUid;
+        }
+
+        public List<String> getTeacherUids() {
+            return this.teacherUids;
+        }
+
+        public void setTeacherUids(List<String> teacherUids) {
+            this.teacherUids = teacherUids;
+        }
+
+        public String getClassUid() {
+            return this.classUid;
+        }
+
+        public void setClassUid(String classUid) {
+            this.classUid = classUid;
+        }
+
+        public String getPositionCode() {
+            return this.positionCode;
+        }
+
+        public void setPositionCode(String positionCode) {
+            this.positionCode = positionCode;
+        }
+
+
+        public static TeacherLeaveClassReqDtoBuilder builder(){
+            return new TeacherLeaveClassReqDtoBuilder();
+        }
+
+        public static class TeacherLeaveClassReqDtoBuilder{
+            private String orgUid;
+            private List<String> teacherUids;
+            private String classUid;
+            private String positionCode;
+
+            public TeacherLeaveClassReqDtoBuilder orgUid(String orgUid){
+                this.orgUid = orgUid;
+                return this;
+            }
+            public TeacherLeaveClassReqDtoBuilder teacherUids(List<String> teacherUids){
+                this.teacherUids = teacherUids;
+                return this;
+            }
+            public TeacherLeaveClassReqDtoBuilder classUid(String classUid){
+                this.classUid = classUid;
+                return this;
+            }
+            public TeacherLeaveClassReqDtoBuilder positionCode(String positionCode){
+                this.positionCode = positionCode;
+                return this;
+            }
+
+            public TeacherLeaveClassReqDto build(){
+                TeacherLeaveClassReqDto result = new TeacherLeaveClassReqDto();
+                result.setOrgUid(orgUid);
+                result.setTeacherUids(teacherUids);
+                result.setClassUid(classUid);
+                result.setPositionCode(positionCode);
+                return result;
+            }
+        }
+    }
+
+
+}

+ 37 - 0
src/main/java/com/template/model/seewo/MdmTeacherClassApiTeacherLeaveClassRequest.java

@@ -0,0 +1,37 @@
+package com.template.model.seewo;
+
+import java.util.*;
+import com.seewo.open.sdk.OpenApiParam;
+import com.seewo.open.sdk.OpenApiRequest;
+
+/**
+ * seewo-open API: 教师退班
+ * 教师退班
+ *
+ * @author auto create
+ * @since 2.0.1 2024-9-5
+ */
+public class MdmTeacherClassApiTeacherLeaveClassRequest extends OpenApiRequest<MdmTeacherClassApiTeacherLeaveClassParam, MdmTeacherClassApiTeacherLeaveClassResult> {
+
+    public MdmTeacherClassApiTeacherLeaveClassRequest(MdmTeacherClassApiTeacherLeaveClassParam param) {
+        this();
+        setBizModel(param);
+    }
+
+    public MdmTeacherClassApiTeacherLeaveClassRequest() {
+        setServerUrl("https://openapi.seewo.com");
+        setPath("/mdm-basis/mdm-teacher-class-api/teacher-leave-class");
+        setHttpMethod("POST");
+        // replace with your permissionId
+        setPermissionId("");
+    }
+
+    public Class<MdmTeacherClassApiTeacherLeaveClassResult> getResponseClass() {
+        return  MdmTeacherClassApiTeacherLeaveClassResult.class;
+    }
+
+    public Class<MdmTeacherClassApiTeacherLeaveClassParam> getDomainClass() {
+        return MdmTeacherClassApiTeacherLeaveClassParam.class;
+    }
+}
+

+ 82 - 0
src/main/java/com/template/model/seewo/MdmTeacherClassApiTeacherLeaveClassResult.java

@@ -0,0 +1,82 @@
+package com.template.model.seewo;
+
+import java.util.*;
+import com.seewo.open.sdk.OpenApiResult;
+import com.seewo.open.sdk.HttpResponse;
+
+/**
+ * seewo-open API: 教师退班
+ * 教师退班
+ *
+ * @author auto create
+ * @since 2.0.1 2024-9-5
+ */
+public class MdmTeacherClassApiTeacherLeaveClassResult extends OpenApiResult {
+
+    public MdmTeacherClassApiTeacherLeaveClassResult(HttpResponse response) {
+        super(response);
+    }
+
+
+    /**
+     * 响应体,MimeType为 application/json
+     */
+
+    private JSONResponseBody responseBody;
+
+
+    public JSONResponseBody getResponseBody() {
+        return this.responseBody;
+    }
+
+    public void setResponseBody(JSONResponseBody responseBody) {
+        this.responseBody = responseBody;
+    }
+
+    public static class JSONResponseBody {
+        /**
+         * 响应码
+         */
+        private String code;
+        /**
+         * 异常信息
+         */
+        private String message;
+        /**
+         * 业务内容
+         */
+        private T data;
+
+        public String getCode() {
+            return this.code;
+        }
+
+        public void setCode(String code) {
+            this.code = code;
+        }
+
+        public String getMessage() {
+            return this.message;
+        }
+
+        public void setMessage(String message) {
+            this.message = message;
+        }
+
+        public T getData() {
+            return this.data;
+        }
+
+        public void setData(T data) {
+            this.data = data;
+        }
+
+    }
+
+    public static class T {
+
+    }
+
+
+}
+

+ 2 - 0
src/main/java/com/template/services/SmartFamilyIndexService.java

@@ -20,6 +20,8 @@ public interface SmartFamilyIndexService extends IService<SmartFamilyIndex> {
 
     List<SmartFamilyIndex> querySmartFamilyByCardNo(String cardNo);
 
+    List<SmartFamilyIndex> querySmartFamilyByCardNo(List<String> cardNo);
+
     int deleteSmartFamilyByPhone(String phone);
 
     int deleteSmartFamilyByCardNo(String cardNo);

+ 2 - 0
src/main/java/com/template/services/SmartUserService.java

@@ -28,6 +28,8 @@ public interface SmartUserService extends IService<SmartUser> {
 
     List<SmartUser> getSmartUserByIds(List<Integer> ids);
 
+    List<SmartUser> getSmartUserByIdentity(Integer identityId);
+
     List<SmartUser> getSmartUserIds(List<String> ids);
 
     int getSmartUserCountByIds(List<Integer> ids);

+ 9 - 0
src/main/java/com/template/services/impl/SmartFamilyIndexServiceImpl.java

@@ -45,6 +45,15 @@ public class SmartFamilyIndexServiceImpl extends ServiceImpl<SmartFamilyIndexMap
     }
 
     @Override
+    public List<SmartFamilyIndex> querySmartFamilyByCardNo(List<String> cardNo) {
+        QueryWrapper<SmartFamilyIndex> queryWrapper = new QueryWrapper();
+        queryWrapper.in(cardNo != null && cardNo.size() > 0, "student_no", cardNo);
+        queryWrapper.orderByAsc("index_data");
+        List<SmartFamilyIndex> indexs = smartFamilyIndexMapper.selectList(queryWrapper);
+        return indexs;
+    }
+
+    @Override
     public int deleteSmartFamilyByPhone(String phone) {
         QueryWrapper<SmartFamilyIndex> queryWrapper = new QueryWrapper();
         queryWrapper.eq(StringUtils.hasText(phone), "parent_phone", phone);

+ 16 - 2
src/main/java/com/template/services/impl/SmartUserServiceImpl.java

@@ -91,6 +91,15 @@ public class SmartUserServiceImpl extends ServiceImpl<SmartUserMapper, SmartUser
     }
 
     @Override
+    public List<SmartUser> getSmartUserByIdentity(Integer identityId) {
+        QueryWrapper<SmartUser> queryWrapper = new QueryWrapper();
+        queryWrapper.eq("identity_id", identityId);
+        queryWrapper.eq("is_cancel", 0);
+        List<SmartUser> result = smartUserMapper.selectList(queryWrapper);
+        return result;
+    }
+
+    @Override
     public List<SmartUser> getSmartUserIds(List<String> ids) {
         QueryWrapper<SmartUser> queryWrapper = new QueryWrapper();
         queryWrapper.in("id", ids);
@@ -211,7 +220,7 @@ public class SmartUserServiceImpl extends ServiceImpl<SmartUserMapper, SmartUser
         QueryWrapper<SmartUser> queryWrapper = new QueryWrapper();
         queryWrapper.eq("is_cancel", 0);
         queryWrapper.eq("identity_id", eIdentityStatu.Student.getValue());
-        queryWrapper.in(gradeIds != null && gradeIds.size() > 0 ,"grade",gradeIds);
+        queryWrapper.in(gradeIds != null && gradeIds.size() > 0, "grade", gradeIds);
         List<SmartUser> result = smartUserMapper.selectList(queryWrapper);
         return result;
     }
@@ -477,7 +486,12 @@ public class SmartUserServiceImpl extends ServiceImpl<SmartUserMapper, SmartUser
         QueryWrapper<SmartUser> queryWrapper = new QueryWrapper();
         queryWrapper.eq("identity_id", eIdentityStatu.Parent.getValue());
         queryWrapper.eq("phone", phone);
-        SmartUser result = smartUserMapper.selectOne(queryWrapper);
+        List<SmartUser> datas = smartUserMapper.selectList(queryWrapper);
+        if (datas != null && datas.size() > 1) {
+            String sdsd = "";
+        }
+        SmartUser result = datas != null && datas.size() > 0 ? datas.get(0) : null;
+
         return result;
     }