Просмотр исходного кода

家长手机号重复性判断

夏文涛 2 лет назад
Родитель
Сommit
8c5d5716ad

+ 16 - 8
src/main/java/com/template/api/SmartEvaluateStudentControllerAPI.java

@@ -2,48 +2,56 @@ package com.template.api;
 
 import com.alibaba.fastjson.JSONObject;
 import com.template.model.evaluate.student.SmartEvaluateStudent;
+import com.template.model.evaluate.teacher.SmartEvaluateTeacher;
 import com.template.model.result.CommonResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.springframework.validation.BindingResult;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 
+import javax.servlet.http.HttpServletResponse;
+
 @RequestMapping("/api/smartEvaluateStudent")
 @Api(tags = {"SmartEvaluateStudentControllerAPI"}, value = "学生评测")
 public interface SmartEvaluateStudentControllerAPI {
 
     @RequestMapping(value = "/operateSmartSubjectManage")
     @ApiOperation(value = "学科管理", httpMethod = "POST")
-    public CommonResult operateSmartSubjectManage(@Validated @RequestBody JSONObject jsonObject);
+    CommonResult operateSmartSubjectManage(@Validated @RequestBody JSONObject jsonObject);
 
     @RequestMapping(value = "/querySubjectManage")
     @ApiOperation(value = "查看学科", httpMethod = "POST")
-    public CommonResult querySubjectManage(String term);
+    CommonResult querySubjectManage(String term);
 
     @RequestMapping(value = "/operateSmartSubjectRule")
     @ApiOperation(value = "操作评分标准", httpMethod = "POST")
-    public CommonResult operateSmartSubjectRule(@Validated @RequestBody JSONObject jsonObject);
+    CommonResult operateSmartSubjectRule(@Validated @RequestBody JSONObject jsonObject);
 
     @RequestMapping(value = "/querySubjectRule")
     @ApiOperation(value = "查看评分标准", httpMethod = "POST")
-    public CommonResult querySubjectRule(String term);
+    CommonResult querySubjectRule(String term);
 
     @RequestMapping(value = "/queryEvaluateStudent")
     @ApiOperation(value = "查看评分标准", httpMethod = "POST")
-    public CommonResult queryEvaluateStudent(@Validated @RequestBody SmartEvaluateStudent smartEvaluateStudent,Integer currentPage, Integer pageCount);
+    CommonResult queryEvaluateStudent(@Validated @RequestBody SmartEvaluateStudent smartEvaluateStudent,Integer currentPage, Integer pageCount);
 
     @RequestMapping(value = "/evaluateScore")
     @ApiOperation(value = "学生评分", httpMethod = "POST")
-    public CommonResult evaluateScore(@Validated @RequestBody JSONObject jsonObject);
+    CommonResult evaluateScore(@Validated @RequestBody JSONObject jsonObject);
 
     @RequestMapping(value = "/queryDetailScore")
     @ApiOperation(value = "查看学生评分详情", httpMethod = "POST")
-    public CommonResult queryDetailScore(Integer id);
+    CommonResult queryDetailScore(Integer id);
 
     @GetMapping(value = "/historicalEvaluation")
     @ApiOperation(value = "历史考评",notes = "历史考评", httpMethod = "GET")
-    public CommonResult historicalEvaluation(@RequestParam String cardNo);
+    CommonResult historicalEvaluation(@RequestParam String cardNo);
+
+    @RequestMapping(value = "/getSEvaluationExcel")
+    @ApiOperation(value = "导出学生素质评价", httpMethod = "POST")
+    CommonResult getSEvaluationExcel(@Validated @RequestBody SmartEvaluateStudent smartEvaluateStudent, HttpServletResponse response, BindingResult bindingResult);
 }

+ 92 - 0
src/main/java/com/template/controller/SmartEvaluateStudentController.java

@@ -7,7 +7,9 @@ import com.template.annotation.PassToken;
 import com.template.api.SmartEvaluateStudentControllerAPI;
 import com.template.common.jh.ReqRespResearchProductQuestionnaireItem;
 import com.template.common.jh.SectionUtil;
+import com.template.common.utils.ExcelUtils;
 import com.template.common.utils.UUIDUtil;
+import com.template.common.utils.paramUtils;
 import com.template.model.evaluate.student.*;
 import com.template.model.evaluate.teacher.SimpleScore;
 import com.template.model.evaluate.teacher.SmartEvaluateTdetail;
@@ -17,11 +19,17 @@ import com.template.model.result.PageUtils;
 import com.template.model.vo.HistoricalEvaluationVo;
 import com.template.model.vo.TemplateRuleVo;
 import com.template.services.*;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpServletResponse;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -317,4 +325,88 @@ public class SmartEvaluateStudentController implements SmartEvaluateStudentContr
         List<HistoricalEvaluationVo> vos = smartEvaluateStudentService.getHistoricalEvaluation(cardNo);
         return CommonResult.ok(vos);
     }
+
+    @Override
+    public CommonResult getSEvaluationExcel(SmartEvaluateStudent smartEvaluateStudent, HttpServletResponse response, BindingResult bindingResult) {
+        if (bindingResult.hasErrors()) {
+            String st = paramUtils.getParamError(bindingResult);
+            return CommonResult.fail(st);
+        }
+        //导出
+        Workbook workbook = new XSSFWorkbook();
+        Sheet sheet = workbook.createSheet("学生综评管理");
+        Row headerRow = sheet.createRow(0);
+        headerRow.createCell(0).setCellValue("序号");
+        headerRow.createCell(1).setCellValue("学期");
+        headerRow.createCell(2).setCellValue("年级");
+        headerRow.createCell(3).setCellValue("班级");
+        headerRow.createCell(4).setCellValue("姓名");
+        headerRow.createCell(5).setCellValue("测评等级");
+        headerRow.createCell(6).setCellValue("教师寄语");
+
+        QueryWrapper<SmartEvaluateStudent> queryWrapper1 = new QueryWrapper<>();
+        queryWrapper1.eq("deleted", 0);
+        if (smartEvaluateStudent.getName() != null && !smartEvaluateStudent.getName().trim().equals("")) {
+            queryWrapper1.and(qw -> qw.like("name", smartEvaluateStudent.getName()).or().like("card_no", smartEvaluateStudent.getName()));
+        }
+        if (smartEvaluateStudent.getTerm() != null && !smartEvaluateStudent.getTerm().trim().equals("")) {
+            queryWrapper1.like("term", smartEvaluateStudent.getTerm());
+        }
+        if (smartEvaluateStudent.getGradeName() != null && !smartEvaluateStudent.getGradeName().trim().equals("")) {
+            queryWrapper1.eq("grade_name", smartEvaluateStudent.getGradeName());
+        }
+        if (smartEvaluateStudent.getClassName() != null && !smartEvaluateStudent.getClassName().trim().equals("")) {
+            queryWrapper1.eq("class_name", smartEvaluateStudent.getClassName());
+        }
+        if (smartEvaluateStudent.getScoreLevel() != null && !smartEvaluateStudent.getScoreLevel().trim().equals("")) {
+            queryWrapper1.eq("score_level", smartEvaluateStudent.getClassName());
+        }
+        queryWrapper1.orderByDesc("id");
+        List<SmartEvaluateStudent> list = smartEvaluateStudentService.queryPageSmartEvaluateStudent(queryWrapper1);
+        if (list != null && list.size() > 0) {
+            List<Integer> gradeIds = list.stream().map(SmartEvaluateStudent::getGradeId).distinct().collect(Collectors.toList());
+            List<Integer> termIds = list.stream().map(SmartEvaluateStudent::getTermId).distinct().collect(Collectors.toList());
+            List<TemplateRuleVo> templateRules = smartTemplateRuleService.queryTemplateRuleByIds(gradeIds, termIds);
+            int i = 0;
+            for (SmartEvaluateStudent student : list) {
+                List<TemplateRuleVo> ownerRules = templateRules.stream().filter(e -> e.getGradeId().equals(student.getGradeId())
+                        && e.getTermId().equals(student.getTermId())).collect(Collectors.toList());
+                if (ownerRules != null && ownerRules.size() > 0) {
+                    for (TemplateRuleVo ownerRule : ownerRules) {
+                        Integer minValue = 0;
+                        Integer maxValue = 0;
+                        String[] levels = ownerRule.getScoreRange().split("-");
+                        if (Integer.valueOf(levels[0]).intValue() > Integer.valueOf(levels[1]).intValue()) {
+                            minValue = Integer.valueOf(levels[1]).intValue();
+                            maxValue = Integer.valueOf(levels[0]).intValue();
+                        }else{
+                            minValue = Integer.valueOf(levels[0]).intValue();
+                            maxValue = Integer.valueOf(levels[1]).intValue();
+                        }
+
+                        Double scoreNum = (double) student.getScoreNum() / student.getSubjectNum();
+                        if(scoreNum >= minValue && scoreNum <= maxValue){
+                            student.setScoreLevel(ownerRule.getLevel());
+                        }
+                    }
+                }
+
+                Row dataRow = sheet.createRow(i + 1);
+                dataRow.createCell(0).setCellValue(i + 1);
+                dataRow.createCell(1).setCellValue(student.getTerm());
+                dataRow.createCell(2).setCellValue(student.getGradeName());
+                dataRow.createCell(3).setCellValue(student.getClassName());
+                dataRow.createCell(4).setCellValue(student.getName());
+                dataRow.createCell(5).setCellValue(student.getScoreLevel());
+                dataRow.createCell(6).setCellValue(student.getScoreComment());
+                i++;
+            }
+        }
+
+        // 将工作簿写入文件
+        ExcelUtils.excelDownload(workbook, "学生综评管理.xlsx", response);
+
+
+        return CommonResult.ok("导出成功");
+    }
 }

+ 59 - 43
src/main/java/com/template/controller/SmartUserController.java

@@ -134,7 +134,6 @@ public class SmartUserController implements SmartUserControllerAPI {
     private SmartOperationUserService smartOperationUserService;
 
 
-
     private static Logger logger = LoggerFactory.getLogger(SmartUserController.class);
 
     //region 开发自己导数据用的接口
@@ -2502,6 +2501,12 @@ public class SmartUserController implements SmartUserControllerAPI {
             }
             //endregion
 
+            //查找家长身份是否存在用了该手机号的用户
+            int existCount = smartUserService.queryParentByCount(isur.getPhone());
+            if(existCount > 0){
+                return CommonResult.fail("当前手机号已被其他家长使用");
+            }
+
             //拿到被关联学生的信息去获取对应的卡号
             //有多个学生就循环学生
 
@@ -2838,6 +2843,11 @@ public class SmartUserController implements SmartUserControllerAPI {
                 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(usur.getAffiliate());
 
             if (!changeIdentity) {
@@ -3359,16 +3369,16 @@ public class SmartUserController implements SmartUserControllerAPI {
                 }
             }
 
-            if(newTeachers != null && newTeachers.size() > 0){
+            if (newTeachers != null && newTeachers.size() > 0) {
                 boolean insertEteacher = smartEvaluateTeacherService.saveBatch(newTeachers);
-                if(!insertEteacher){
+                if (!insertEteacher) {
                     return CommonResult.fail("修改失败");
                 }
             }
 
-            if(updateTeachers != null && updateTeachers.size() > 0){
+            if (updateTeachers != null && updateTeachers.size() > 0) {
                 boolean updateEteacher = smartEvaluateTeacherService.updateBatchById(updateTeachers);
-                if(!updateEteacher){
+                if (!updateEteacher) {
                     return CommonResult.fail("修改失败");
                 }
             }
@@ -3893,11 +3903,17 @@ public class SmartUserController implements SmartUserControllerAPI {
             int index = 0;
             if (isInsert) {
                 List<SmartFamilyIndex> indexs = smartFamilyIndexService.querySmartFamilyByCardNo(student.getCardNo());
+
                 if (indexs != null && indexs.size() >= 4) {
                     return CommonResult.fail("绑定失败,希沃学生家长最多绑定四个家长");
                 }
 
                 if (indexs != null) {
+                    long existCount = indexs.stream().filter(e -> e.getParentPhone().equals(phone)).count();
+                    if(existCount > 0){
+                        return CommonResult.fail("当前家长手机号已绑定该学生,请勿重复绑定");
+                    }
+
                     for (SmartFamilyIndex data : indexs) {
                         if (data.getIndexData().intValue() == index && index < 3) {
                             index++;
@@ -4873,11 +4889,11 @@ public class SmartUserController implements SmartUserControllerAPI {
 
     @Override
     @DESRespondSecret(validated = true)
-    public CommonResult getPage(int currentPage, int pageCount, String keyWord,String schoolClass) {
+    public CommonResult getPage(int currentPage, int pageCount, String keyWord, String schoolClass) {
         LambdaQueryWrapper<SmartUser> wrapper = new LambdaQueryWrapper<>();
         wrapper.like(ObjectUtils.isNotEmpty(keyWord), SmartUser::getName, keyWord);
-        wrapper.eq(ObjectUtils.isNotEmpty(schoolClass),SmartUser::getSchoolClass,schoolClass);
-        wrapper.eq(SmartUser::getIdentityId,2);
+        wrapper.eq(ObjectUtils.isNotEmpty(schoolClass), SmartUser::getSchoolClass, schoolClass);
+        wrapper.eq(SmartUser::getIdentityId, 2);
         IPage<SmartUser> page = smartUserService.page(new Page<>(currentPage, pageCount), wrapper);
 
         return CommonResult.ok(page);
@@ -4906,29 +4922,29 @@ public class SmartUserController implements SmartUserControllerAPI {
         Set<StatisticsCampusVo> vos = new HashSet<>();
 
 //        查找门禁记录
-        List<StatisticsCampusVo> accessVos=smartUserService.getAccessStatisticsCampus(classId,startTime,endTime);
+        List<StatisticsCampusVo> accessVos = smartUserService.getAccessStatisticsCampus(classId, startTime, endTime);
         for (StatisticsCampusVo accessVo : accessVos) {
             vos.add(accessVo);
         }
 //        查找打卡记录
-        List<StatisticsCampusVo> attendanceVos=smartUserService.getAttendanceStatisticsCampus(classId,startTime,endTime);
+        List<StatisticsCampusVo> attendanceVos = smartUserService.getAttendanceStatisticsCampus(classId, startTime, endTime);
         for (StatisticsCampusVo attendanceVo : attendanceVos) {
             vos.add(attendanceVo);
         }
 //        查找人脸记录
-        List<StatisticsCampusVo> faceDiscernVos=smartUserService.getFaceDiscernStatisticsCampus(classId,startTime,endTime);
+        List<StatisticsCampusVo> faceDiscernVos = smartUserService.getFaceDiscernStatisticsCampus(classId, startTime, endTime);
         for (StatisticsCampusVo faceDiscernVo : faceDiscernVos) {
             vos.add(faceDiscernVo);
         }
 
 //        查找请假记录
-        List<StatisticsCampusVo> ackVos= smartUserService.getAckStatisticsCampus(classId,startTime,endTime);
+        List<StatisticsCampusVo> ackVos = smartUserService.getAckStatisticsCampus(classId, startTime, endTime);
         for (StatisticsCampusVo ackVo : ackVos) {
             vos.add(ackVo);
         }
 
 //        查找该班级下的所有人
-        List<StatisticsCampusVo> campusVos= smartUserService.getClassStudent(classId);
+        List<StatisticsCampusVo> campusVos = smartUserService.getClassStudent(classId);
 
 //        不在正常记录里面的就是异常记录
         ArrayList<StatisticsCampusVo> abnormalVos = new ArrayList<>();
@@ -4940,21 +4956,21 @@ public class SmartUserController implements SmartUserControllerAPI {
 
 
         HashMap<String, Object> normal = new HashMap<>();
-        normal.put("date",vos);
-        normal.put("count",vos.size());
+        normal.put("date", vos);
+        normal.put("count", vos.size());
 
         HashMap<String, Object> ack = new HashMap<>();
-        ack.put("date",ackVos);
-        ack.put("count",ackVos.size());
+        ack.put("date", ackVos);
+        ack.put("count", ackVos.size());
 
         HashMap<String, Object> abnormal = new HashMap<>();
-        abnormal.put("date",abnormalVos);
-        abnormal.put("count",abnormalVos.size());
+        abnormal.put("date", abnormalVos);
+        abnormal.put("count", abnormalVos.size());
 
         JSONObject jsonObject = new JSONObject();
-        jsonObject.put("normal",normal);
-        jsonObject.put("ack",ack);
-        jsonObject.put("abnormal",abnormal);
+        jsonObject.put("normal", normal);
+        jsonObject.put("ack", ack);
+        jsonObject.put("abnormal", abnormal);
 
         return CommonResult.ok(jsonObject);
     }
@@ -4965,31 +4981,31 @@ public class SmartUserController implements SmartUserControllerAPI {
 //        获取学生信息
         SmartUser smartById = smartUserService.getSmartById(userId);
 //        获取家长信息
-        List<SmartUser> list=smartUserService.getAddressBook(userId);
+        List<SmartUser> list = smartUserService.getAddressBook(userId);
 
         HashMap<String, Object> map = new HashMap<>();
-        map.put("student",smartById);
+        map.put("student", smartById);
 
-        map.put("patriarch",list);
+        map.put("patriarch", list);
 
         return CommonResult.ok(map);
     }
 
     @Override
     @DESRespondSecret(validated = true)
-    public CommonResult statisticsCampusManage(Integer gradeId,Integer classId, String dateTime,Integer type,String keyWord) {
+    public CommonResult statisticsCampusManage(Integer gradeId, Integer classId, String dateTime, Integer type, String keyWord) {
         DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         LocalDateTime startTime = LocalDateTime.parse(dateTime, dateTimeFormatter1);
         LocalDateTime endTime = startTime.plusDays(1);
 
-        List<StatisticsCampusManageVo> ackVos=null;
+        List<StatisticsCampusManageVo> ackVos = null;
         JSONObject jsonObject = new JSONObject();
-        if (3==type) {
+        if (3 == type) {
 //            请假
             //        查找请假记录
-            ackVos= smartUserService.getAckStatisticsCampusManage(gradeId,classId,startTime,endTime,keyWord);
-            jsonObject.put("count",ackVos.size());
-            jsonObject.put("data",ackVos);
+            ackVos = smartUserService.getAckStatisticsCampusManage(gradeId, classId, startTime, endTime, keyWord);
+            jsonObject.put("count", ackVos.size());
+            jsonObject.put("data", ackVos);
 
             return CommonResult.ok(jsonObject);
         }
@@ -4998,37 +5014,37 @@ public class SmartUserController implements SmartUserControllerAPI {
         Set<StatisticsCampusManageVo> vos = new HashSet<>();
 
 //        查找门禁记录
-        List<StatisticsCampusManageVo> accessVos=smartUserService.getAccessStatisticsCampusManage(gradeId,classId,startTime,endTime,keyWord);
+        List<StatisticsCampusManageVo> accessVos = smartUserService.getAccessStatisticsCampusManage(gradeId, classId, startTime, endTime, keyWord);
         for (StatisticsCampusManageVo accessVo : accessVos) {
             vos.add(accessVo);
         }
 //        查找打卡记录
-        List<StatisticsCampusManageVo> attendanceVos=smartUserService.getAttendanceStatisticsCampusManage(gradeId,classId,startTime,endTime,keyWord);
+        List<StatisticsCampusManageVo> attendanceVos = smartUserService.getAttendanceStatisticsCampusManage(gradeId, classId, startTime, endTime, keyWord);
         for (StatisticsCampusManageVo attendanceVo : attendanceVos) {
             vos.add(attendanceVo);
         }
 //        查找人脸记录
-        List<StatisticsCampusManageVo> faceDiscernVos=smartUserService.getFaceDiscernStatisticsCampusManage(gradeId,classId,startTime,endTime,keyWord);
+        List<StatisticsCampusManageVo> faceDiscernVos = smartUserService.getFaceDiscernStatisticsCampusManage(gradeId, classId, startTime, endTime, keyWord);
         for (StatisticsCampusManageVo faceDiscernVo : faceDiscernVos) {
             vos.add(faceDiscernVo);
         }
-        if (ObjectUtils.isNotEmpty(ackVos)&&ackVos.size()>0) {
+        if (ObjectUtils.isNotEmpty(ackVos) && ackVos.size() > 0) {
             for (StatisticsCampusManageVo ackVo : ackVos) {
                 vos.add(ackVo);
             }
         }
 
 
-        if (2==type) {
+        if (2 == type) {
 //            正常
-            jsonObject.put("count",vos.size());
-            jsonObject.put("data",vos);
+            jsonObject.put("count", vos.size());
+            jsonObject.put("data", vos);
 
             return CommonResult.ok(jsonObject);
-        }else if (1==type){
+        } else if (1 == type) {
 //            异常
             //        查找该班级下的所有人
-            List<StatisticsCampusManageVo> campusVos= smartUserService.getClassStudentManage(gradeId,classId,keyWord);
+            List<StatisticsCampusManageVo> campusVos = smartUserService.getClassStudentManage(gradeId, classId, keyWord);
 
 //        不在正常记录里面的就是异常记录
             ArrayList<StatisticsCampusManageVo> abnormalVos = new ArrayList<>();
@@ -5037,11 +5053,11 @@ public class SmartUserController implements SmartUserControllerAPI {
                     abnormalVos.add(campusVo);
                 }
             }
-            jsonObject.put("count",abnormalVos.size());
-            jsonObject.put("data",abnormalVos);
+            jsonObject.put("count", abnormalVos.size());
+            jsonObject.put("data", abnormalVos);
             return CommonResult.ok(jsonObject);
 
-        }else {
+        } else {
             return CommonResult.fail("查询状态有误");
         }
 

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

@@ -24,6 +24,8 @@ public interface SmartEvaluateStudentService extends IService<SmartEvaluateStude
 
     PageUtils<SmartEvaluateStudent> queryPageSmartEvaluateStudent(int currentPage, int pageCount, QueryWrapper<SmartEvaluateStudent> queryWrapper);
 
+    List<SmartEvaluateStudent> queryPageSmartEvaluateStudent(QueryWrapper<SmartEvaluateStudent> queryWrapper);
+
     int deleteSmartEvaluateStudentById(int id);
 
     SmartEvaluateStudent getSmartEvaluateStudentById(int id);

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

@@ -170,4 +170,9 @@ public interface SmartUserService extends IService<SmartUser> {
 
     List<StatisticsCampusManageVo> getClassStudentManage(Integer gradeId,Integer classId,String keyWord);
 
+
+    int queryParentByCount(String phone);
+
+    SmartUser queryParentByPhone(String phone);
+
 }

+ 7 - 0
src/main/java/com/template/services/impl/SmartEvaluateStudentServiceImpl.java

@@ -50,6 +50,13 @@ public class SmartEvaluateStudentServiceImpl extends ServiceImpl<SmartEvaluateSt
     }
 
     @Override
+    public List<SmartEvaluateStudent> queryPageSmartEvaluateStudent(QueryWrapper<SmartEvaluateStudent> queryWrapper) {
+         List<SmartEvaluateStudent> result = smartEvaluateStudentMapper.selectList(queryWrapper);
+
+        return result;
+    }
+
+    @Override
     public int deleteSmartEvaluateStudentById(int id) {
         int result = smartEvaluateStudentMapper.deleteById(id);
         return result;

+ 18 - 0
src/main/java/com/template/services/impl/SmartUserServiceImpl.java

@@ -443,5 +443,23 @@ public class SmartUserServiceImpl extends ServiceImpl<SmartUserMapper, SmartUser
         return smartUserMapper.getClassStudentManage(gradeId,classId,keyWord);
     }
 
+    @Override
+    public int queryParentByCount(String phone) {
+        QueryWrapper<SmartUser> queryWrapper = new QueryWrapper();
+        queryWrapper.eq("identity_id", eIdentityStatu.Parent.getValue());
+        queryWrapper.eq("phone", phone);
+        int result = smartUserMapper.selectCount(queryWrapper);
+        return result;
+    }
+
+    @Override
+    public SmartUser queryParentByPhone(String phone) {
+        QueryWrapper<SmartUser> queryWrapper = new QueryWrapper();
+        queryWrapper.eq("identity_id", eIdentityStatu.Parent.getValue());
+        queryWrapper.eq("phone", phone);
+        SmartUser result = smartUserMapper.selectOne(queryWrapper);
+        return result;
+    }
+
 
 }