夏文涛 2 lat temu
rodzic
commit
064e70e81d
51 zmienionych plików z 1192 dodań i 63 usunięć
  1. 8 0
      src/main/java/com/template/api/SmartAccessControllerAPI.java
  2. 5 0
      src/main/java/com/template/api/SmartAttendanceControllerAPI.java
  3. 5 0
      src/main/java/com/template/api/SmartClassControllerAPI.java
  4. 9 0
      src/main/java/com/template/api/SmartFaceDiscernControllerAPI.java
  5. 23 0
      src/main/java/com/template/api/SmartPushConfigControllerAPI.java
  6. 20 0
      src/main/java/com/template/api/SmartVisitorControllerAPI.java
  7. 92 16
      src/main/java/com/template/controller/HikvisionController.java
  8. 97 1
      src/main/java/com/template/controller/SmartAccessController.java
  9. 8 0
      src/main/java/com/template/controller/SmartAttendanceController.java
  10. 7 0
      src/main/java/com/template/controller/SmartClassController.java
  11. 148 26
      src/main/java/com/template/controller/SmartFaceDiscernController.java
  12. 1 2
      src/main/java/com/template/controller/SmartFaceDiscernTestController.java
  13. 51 0
      src/main/java/com/template/controller/SmartPushConfigController.java
  14. 169 2
      src/main/java/com/template/controller/SmartVisitorController.java
  15. 6 1
      src/main/java/com/template/mapper/SmartAccessMapper.java
  16. 3 0
      src/main/java/com/template/mapper/SmartAttendanceMapper.java
  17. 3 0
      src/main/java/com/template/mapper/SmartClassMapper.java
  18. 10 0
      src/main/java/com/template/mapper/SmartFaceDiscernMapper.java
  19. 18 0
      src/main/java/com/template/mapper/SmartPushConfigMapper.java
  20. 2 1
      src/main/java/com/template/mapper/SmartVisitorMapper.java
  21. 31 0
      src/main/java/com/template/model/dto/ParentsScreenDto.java
  22. 0 6
      src/main/java/com/template/model/pojo/SmartFaceDiscern.java
  23. 0 6
      src/main/java/com/template/model/pojo/SmartFaceDiscernTest.java
  24. 64 0
      src/main/java/com/template/model/pojo/SmartPushConfig.java
  25. 3 0
      src/main/java/com/template/model/pojo/SmartVisitor.java
  26. 1 0
      src/main/java/com/template/model/request/otherAppointmentRequest.java
  27. 5 0
      src/main/java/com/template/model/request/parentsAppointmentRequest.java
  28. 35 0
      src/main/java/com/template/model/vo/AskForLeaveScreenVo.java
  29. 24 0
      src/main/java/com/template/model/vo/FaceManagementVo.java
  30. 11 0
      src/main/java/com/template/model/vo/SchoolClassVo.java
  31. 33 0
      src/main/java/com/template/model/vo/SmartVisitorScreenVo.java
  32. 3 0
      src/main/java/com/template/services/SmartAccessService.java
  33. 4 0
      src/main/java/com/template/services/SmartAttendanceService.java
  34. 4 0
      src/main/java/com/template/services/SmartClassService.java
  35. 6 0
      src/main/java/com/template/services/SmartFaceDiscernService.java
  36. 16 0
      src/main/java/com/template/services/SmartPushConfigService.java
  37. 2 0
      src/main/java/com/template/services/SmartUserService.java
  38. 2 0
      src/main/java/com/template/services/SmartVisitorService.java
  39. 6 0
      src/main/java/com/template/services/impl/SmartAccessServiceImpl.java
  40. 8 0
      src/main/java/com/template/services/impl/SmartAttendanceServiceImpl.java
  41. 7 0
      src/main/java/com/template/services/impl/SmartClassServiceImpl.java
  42. 21 0
      src/main/java/com/template/services/impl/SmartFaceDiscernServiceImpl.java
  43. 20 0
      src/main/java/com/template/services/impl/SmartPushConfigServiceImpl.java
  44. 12 2
      src/main/java/com/template/services/impl/SmartUserServiceImpl.java
  45. 10 0
      src/main/java/com/template/services/impl/SmartVisitorServiceImpl.java
  46. 45 0
      src/main/resources/mapper/template/SmartAccessMapper.xml
  47. 26 0
      src/main/resources/mapper/template/SmartAttendanceMapper.xml
  48. 9 0
      src/main/resources/mapper/template/SmartClassMapper.xml
  49. 69 0
      src/main/resources/mapper/template/SmartFaceDiscernMapper.xml
  50. 5 0
      src/main/resources/mapper/template/SmartPushConfigMapper.xml
  51. 25 0
      src/main/resources/mapper/template/SmartVisitorMapper.xml

+ 8 - 0
src/main/java/com/template/api/SmartAccessControllerAPI.java

@@ -6,10 +6,18 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 
+import javax.servlet.http.HttpServletResponse;
+
 @RequestMapping("/api/smartAccess")
 public interface SmartAccessControllerAPI {
 
     @GetMapping("/getPage")
     @ApiOperation(value = "门禁通行记录", notes = "门禁通行记录", httpMethod = "GET")
     CommonResult getPage(@RequestParam Integer currentPage, @RequestParam Integer pageCount,String keyWord,Integer gradeId,Integer classId,Integer departmentId,Integer openType,Integer resultStatus,String startTime,String endTime);
+
+    @GetMapping("/getPageExport")
+    @ApiOperation(value = "门禁通行记录导出", notes = "门禁通行记录导出", httpMethod = "GET")
+    void getPageExport(HttpServletResponse response, String keyWord, Integer gradeId, Integer classId, Integer departmentId, Integer openType, Integer resultStatus, String startTime, String endTime);
+
+
 }

+ 5 - 0
src/main/java/com/template/api/SmartAttendanceControllerAPI.java

@@ -98,4 +98,9 @@ public interface SmartAttendanceControllerAPI {
     @ApiOperation(value = "学生考勤记录导出", notes = "学生考勤记录导出", httpMethod = "GET")
     void queryPageExport(HttpServletResponse response, Integer gradeId, Integer classId, String status, String studentNo , String name, @RequestParam String startTime, @RequestParam String endTime);
 
+
+    @GetMapping(value = "/askForLeaveScreenPage")
+    @ApiOperation(value = "大屏——请假数据展示", notes = "大屏——请假数据展示", httpMethod = "GET")
+    CommonResult askForLeaveScreenPage(@RequestParam int currentPage, @RequestParam int pageCount,String cardNo,String ifVerification);
+
 }

+ 5 - 0
src/main/java/com/template/api/SmartClassControllerAPI.java

@@ -53,4 +53,9 @@ public interface SmartClassControllerAPI {
     @ApiOperation(value = "获取班级", notes = "获取班级", httpMethod = "GET")
     CommonResult getSchoolClasses(@RequestParam int schoolClass,String className);
 
+    @GetMapping(value = "/getClassId")
+    @ApiOperation(value = "获取班级", notes = "获取班级", httpMethod = "GET")
+    CommonResult getClassId(@RequestParam int schoolClass);
+
+
 }

+ 9 - 0
src/main/java/com/template/api/SmartFaceDiscernControllerAPI.java

@@ -1,6 +1,7 @@
 package com.template.api;
 
 import com.template.model.result.CommonResult;
+import com.tencentcloudapi.tci.v20190318.models.Face;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -35,4 +36,12 @@ public interface SmartFaceDiscernControllerAPI {
     @ApiOperation(value = "轨迹查询", notes = "轨迹查询", httpMethod = "GET")
     CommonResult selectTrack(@RequestParam Integer userId, @RequestParam String startTime,@RequestParam String endTime);
 
+    @GetMapping(value = "/faceManagement")
+    @ApiOperation(value = "人脸管理记录", notes = "人脸管理记录", httpMethod = "GET")
+    CommonResult faceManagement(@RequestParam int currentPage, @RequestParam int pageCount,String keyWord,String gradeId,String classId,String startTime,String endTime);
+
+    @GetMapping(value = "/faceManagementExport")
+    @ApiOperation(value = "人脸管理记录", notes = "人脸管理记录", httpMethod = "GET")
+    void faceManagementExport(HttpServletResponse response,String keyWord,String gradeId,String classId,String startTime,String endTime);
+
 }

+ 23 - 0
src/main/java/com/template/api/SmartPushConfigControllerAPI.java

@@ -0,0 +1,23 @@
+package com.template.api;
+
+import com.template.model.pojo.SmartPushConfig;
+import com.template.model.pojo.SmartVisitorRestsConfig;
+import com.template.model.result.CommonResult;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@RequestMapping("/api/smartPushConfig")
+public interface SmartPushConfigControllerAPI {
+
+    @GetMapping(value = "/list")
+    @ApiOperation(value = "展示推送配置", notes = "展示推送配置", httpMethod = "GET")
+    CommonResult list();
+
+    @PostMapping(value = "/update")
+    @ApiOperation(value = "推送配置修改", notes = "推送配置修改", httpMethod = "POST")
+    CommonResult update(@RequestBody SmartPushConfig smartPushConfig);
+
+}

+ 20 - 0
src/main/java/com/template/api/SmartVisitorControllerAPI.java

@@ -1,6 +1,7 @@
 package com.template.api;
 
 import com.fasterxml.jackson.core.JsonProcessingException;
+import com.template.model.dto.ParentsScreenDto;
 import com.template.model.pojo.SmartVisitor;
 import com.template.model.request.otherAppointmentRequest;
 import com.template.model.request.parentsAppointmentRequest;
@@ -139,4 +140,23 @@ public interface SmartVisitorControllerAPI {
     @ApiOperation(value = "其他访问预约审核", notes = "其他访客预约审核", httpMethod = "GET")
     CommonResult restsAudit(@RequestParam int id,@RequestParam int type);
 
+    @PostMapping(value = "/parentsScreen")
+    @ApiOperation(value = "大屏——学生家长预约", notes = "大屏——学生家长预约", httpMethod = "POST")
+    CommonResult parentsScreen(@Validated @RequestBody ParentsScreenDto par,BindingResult bindingResult);
+
+    @GetMapping(value = "/getScreenPage")
+    @ApiOperation(value = "大屏——家长访客预约数据", notes = "大屏——家长访客预约数据", httpMethod = "GET")
+    CommonResult getScreenPage(@RequestParam int currentPage, @RequestParam int pageCount,String phone,String status);
+
+    @GetMapping(value = "/cancel")
+    @ApiOperation(value = "大屏——学生家长预约取消", notes = "大屏——学生家长预约取消", httpMethod = "GET")
+    CommonResult cancel(@RequestParam int id);
+
+    @GetMapping(value = "/verification")
+    @ApiOperation(value = "大屏——学生家长预约核销", notes = "大屏——学生家长预约核销", httpMethod = "GET")
+    CommonResult verification(@RequestParam int id);
+
+
+
+
 }

+ 92 - 16
src/main/java/com/template/controller/HikvisionController.java

@@ -2,20 +2,15 @@ package com.template.controller;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.template.annotation.DESRespondSecret;
 import com.template.api.HikvisionAPI;
 import com.template.api.SmartNotificationControllerAPI;
 import com.template.common.utils.GetCameraPreviewURL;
 import com.template.common.utils.Message2;
-import com.template.model.pojo.SmartFaceDiscern;
-import com.template.model.pojo.SmartNotification;
-import com.template.model.pojo.SmartUser;
-import com.template.model.pojo.SmartWarning;
-import com.template.services.SmartFaceDiscernService;
-import com.template.services.SmartNotificationService;
-import com.template.services.SmartUserService;
-import com.template.services.SmartWarningService;
+import com.template.model.pojo.*;
+import com.template.services.*;
 import org.aspectj.weaver.ast.Var;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -47,7 +42,8 @@ public class HikvisionController implements HikvisionAPI {
     @Autowired
     SmartNotificationService smartNotificationService;
 
-
+    @Autowired
+    SmartPushConfigService smartPushConfigService;
 
     /**
      * 事件订阅
@@ -237,18 +233,98 @@ public class HikvisionController implements HikvisionAPI {
                     JSONObject reserve_field = jsonObject5.getJSONObject("reserve_field");
 //                    证件号
                     String certificateNumber = reserve_field.getString("certificateNumber");
-                    logger.info("证件号 = " + certificateNumber);
-//                    名字
+//                    logger.info("证件号 = " + certificateNumber);
+//                    名字是学号
                     String name = reserve_field.getString("name");
                     logger.info("名字 = " + name);
 
-                    smartFaceDiscern.setName(name);
 
 //                   通过身份证,学号查询是谁
-//                    SmartUser one = smartUserService.getCard(certificateNumber);
-//                    if (ObjectUtils.isNotEmpty(one)) {
-//                        smartFaceDiscern.setUserId(one.getId());
-//                    }
+                    SmartUser smartUser = smartUserService.getCard(name);
+                    if (ObjectUtils.isNotEmpty(smartUser)) {
+                        smartFaceDiscern.setUserId(smartUser.getId());
+                        smartFaceDiscern.setName(smartUser.getName());
+                        Integer identityId = smartUser.getIdentityId();
+                        //                        时间格式是 yyyy-MM-dd HH:mm:ss,当前时间格式有问题
+                        DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+//                    判断是否是学生
+                        if (2 == identityId) {
+                            //                    获取推送配置
+                            List<SmartPushConfig> pushConfigs = smartPushConfigService.list(new LambdaQueryWrapper<>());
+                            SmartPushConfig smartPushConfig = pushConfigs.get(0);
+                            Integer parentsPush = smartPushConfig.getParentsPush();
+                            Integer chargeTeacherPush = smartPushConfig.getChargeTeacherPush();
+
+                            if (parentsPush == 1) {
+//                        通过学生id找到关联的家长affiliate,并找到公众号,如果openid为空则不传
+                                List<SmartUser> userList = smartUserService.getAffiliateList(smartUser.getId());
+                                if (ObjectUtils.isNotEmpty(userList) && userList.size() > 0) {
+
+                                    for (SmartUser user : userList) {
+                                        String gzhOpenId = user.getGzhOpenId();
+                                        if (ObjectUtils.isNotEmpty(gzhOpenId)) {
+                                            String pushType = "人脸比对";
+
+                                            LocalDateTime date = LocalDateTime.now();
+                                            String format = date.format(dateTimeFormatter1);
+                                            //                    公众号信息推送
+                                            Message2.send(gzhOpenId, pushType, channelName, format);
+
+                                            SmartNotification smartNotification = new SmartNotification();
+                                            smartNotification.setUserId(smartUser.getId());
+                                            smartNotification.setUserName(smartUser.getName());
+                                            smartNotification.setTypeName(pushType);
+                                            smartNotification.setLocation(channelName);
+                                            smartNotification.setImage(bkgUrl);
+                                            smartNotification.setDateTime(happenTime);
+                                            smartNotification.setType(2);
+
+                                            smartNotificationService.save(smartNotification);
+
+                                        }
+
+                                    }
+                                }
+                            }
+
+                            if (1 == chargeTeacherPush) {
+                                Integer schoolClass = smartUser.getSchoolClass();
+//                        通过班级找到对应的班主任
+                                List<SmartUser> userLists = smartUserService.getChargeTeacher(schoolClass);
+                                if (ObjectUtils.isNotEmpty(userLists) && userLists.size() > 0) {
+
+                                    for (SmartUser user : userLists) {
+                                        String gzhOpenId = user.getGzhOpenId();
+                                        if (ObjectUtils.isNotEmpty(gzhOpenId)) {
+                                            String pushType = "人脸比对";
+
+                                            LocalDateTime date = LocalDateTime.now();
+                                            String format = date.format(dateTimeFormatter1);
+                                            //                    公众号信息推送
+                                            Message2.send(gzhOpenId, pushType, channelName, format);
+
+                                            SmartNotification smartNotification = new SmartNotification();
+                                            smartNotification.setUserId(smartUser.getId());
+                                            smartNotification.setUserName(smartUser.getName());
+                                            smartNotification.setTypeName(pushType);
+                                            smartNotification.setLocation(channelName);
+                                            smartNotification.setImage(bkgUrl);
+                                            smartNotification.setDateTime(happenTime);
+                                            smartNotification.setType(2);
+                                            smartNotificationService.save(smartNotification);
+                                        }
+
+                                    }
+                                }
+
+
+                            }
+
+                        }
+                    } else {
+                        smartFaceDiscern.setName(name);
+                        smartFaceDiscern.setUserId(0);
+                    }
                     logger.info("smartFaceDiscern = " + smartFaceDiscern);
 //                    smartFaceDiscernService.save(smartFaceDiscern);
 

+ 97 - 1
src/main/java/com/template/controller/SmartAccessController.java

@@ -1,18 +1,30 @@
 package com.template.controller;
 
 
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.template.annotation.DESRespondSecret;
 import com.template.api.SmartAccessControllerAPI;
+import com.template.common.utils.ExcelUtils;
 import com.template.model.pojo.SmartAccess;
 import com.template.model.result.CommonResult;
 import com.template.model.result.PageUtils;
 import com.template.model.vo.SmartAccessVo;
+import com.template.model.vo.SmartAttendanceVo;
 import com.template.services.SmartAccessService;
+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.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpServletResponse;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+
 /**
  * <p>
  *  前端控制器
@@ -29,10 +41,94 @@ public class SmartAccessController implements SmartAccessControllerAPI {
     SmartAccessService smartAccessService;
 
     @Override
-    @DESRespondSecret(validated = false)
+    @DESRespondSecret(validated = true)
     public CommonResult getPage(Integer currentPage, Integer pageCount, String keyWord,Integer gradeId, Integer classId, Integer departmentId, Integer openType, Integer resultStatus,String startTime,String endTime) {
         PageUtils<SmartAccessVo> pageUtils=smartAccessService.getPage(currentPage,pageCount,keyWord,gradeId,classId,departmentId,openType,resultStatus,startTime,endTime);
         return CommonResult.ok(pageUtils);
     }
+
+    @Override
+    public void getPageExport(HttpServletResponse response, String keyWord, Integer gradeId, Integer classId, Integer departmentId, Integer openType, Integer resultStatus, String startTime, String endTime) {
+
+        //导出
+        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("人员编号");
+        headerRow.createCell(7).setCellValue("图像");
+        headerRow.createCell(8).setCellValue("识别分组");
+        headerRow.createCell(9).setCellValue("记录时间");
+        headerRow.createCell(10).setCellValue("出口类型");
+        headerRow.createCell(11).setCellValue("通行状态");
+
+
+        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        //        默认前一天的
+        if (ObjectUtils.isEmpty(startTime)||ObjectUtils.isEmpty(endTime)) {
+            LocalDateTime now = LocalDateTime.now().withHour(0).withMinute(0).withSecond(0);
+            LocalDateTime end = now.plusDays(1);
+            startTime=now.format(dateTimeFormatter);
+            endTime=end.format(dateTimeFormatter);
+        }
+
+        List<SmartAccessVo> vos=smartAccessService.getPageExport(keyWord,gradeId,classId,departmentId,openType,resultStatus,startTime,endTime);
+
+        for (int i = 0; i < vos.size(); i++) {
+            SmartAccessVo vo = vos.get(i);
+            Row dataRow = sheet.createRow(i + 1);
+            dataRow.createCell(0).setCellValue(i + 1);
+            dataRow.createCell(1).setCellValue(vo.getSn());
+            dataRow.createCell(2).setCellValue(vo.getType());
+            dataRow.createCell(3).setCellValue(vo.getDepartmentName());
+            dataRow.createCell(4).setCellValue(vo.getClassName());
+            dataRow.createCell(5).setCellValue(vo.getName());
+            dataRow.createCell(6).setCellValue(vo.getCardNo());
+            dataRow.createCell(7).setCellValue(vo.getImage());
+
+            Integer openType1 = vo.getOpenType();
+            String type="";
+            if (0==openType1) {
+                type="白名单比对";
+            }else if (1==openType1){
+                type="人证比对";
+            }else if (2==openType1){
+                type="IC卡比对";
+            }else if (5==openType1){
+                type="职工二维码比对";
+            }
+            dataRow.createCell(8).setCellValue(type);
+            dataRow.createCell(9).setCellValue(vo.getDateTime());
+            Integer access = vo.getAccess();
+            String accessSting="";
+            if (1==access) {
+                accessSting="入口";
+            }else if (0==openType1){
+                accessSting="出口";
+            }
+            dataRow.createCell(10).setCellValue(accessSting);
+
+            Integer resultStatus1 = vo.getResultStatus();
+            String result="";
+            if (1==resultStatus1) {
+                result="正常通行";
+            }else if (0==resultStatus1){
+                result="禁止通行";
+            }
+
+            dataRow.createCell(11).setCellValue(result);
+
+        }
+
+        // 将工作簿写入文件
+        ExcelUtils.excelDownload(workbook, "通行记录.xlsx", response);
+
+
+    }
 }
 

+ 8 - 0
src/main/java/com/template/controller/SmartAttendanceController.java

@@ -464,6 +464,14 @@ public class SmartAttendanceController implements SmartAttendanceControllerAPI {
         ExcelUtils.excelDownload(workbook, "学生考勤.xlsx", response);
     }
 
+    @Override
+    @DESRespondSecret(validated = true)
+    public CommonResult askForLeaveScreenPage(int currentPage, int pageCount, String cardNo, String ifVerification) {
+        PageUtils<AskForLeaveScreenVo> result= smartAttendanceService.askForLeaveScreenPage(currentPage,pageCount,cardNo,ifVerification);
+
+        return CommonResult.ok(result);
+    }
+
     public PersonalLeaveListSchoolPeriodRecordsResult getXwAttendance(String startDate, String endDate, Integer currentPage, Integer pageSize) {
         //初始化客户端
         SeewoClient seewoClient = new DefaultSeewoClient(new Account(seewoConfig.getAppId(), seewoConfig.getAppSecret()));

+ 7 - 0
src/main/java/com/template/controller/SmartClassController.java

@@ -474,5 +474,12 @@ public class SmartClassController implements SmartClassControllerAPI {
         SmartClassVo vo = smartClassService.getSchoolClassId(schoolClass,className);
         return CommonResult.ok(vo);
     }
+
+    @Override
+    @DESRespondSecret(validated = true)
+    public CommonResult getClassId(int schoolClass) {
+        SchoolClassVo vo = smartClassService.getClassId(schoolClass);
+        return CommonResult.ok(vo);
+    }
 }
 

+ 148 - 26
src/main/java/com/template/controller/SmartFaceDiscernController.java

@@ -14,8 +14,16 @@ import com.template.common.utils.*;
 import com.template.config.ControlConfig;
 import com.template.model.pojo.*;
 import com.template.model.result.CommonResult;
+import com.template.model.result.PageUtils;
+import com.template.model.vo.AskForLeaveScreenVo;
+import com.template.model.vo.FaceManagementVo;
 import com.template.model.vo.LastSevenDaysTrackVo;
+import com.template.model.vo.SmartAccessVo;
 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;
@@ -84,6 +92,9 @@ public class SmartFaceDiscernController implements SmartFaceDiscernControllerAPI
     @Autowired
     SmartAccessService smartAccessService;
 
+    @Autowired
+    SmartPushConfigService smartPushConfigService;
+
     @Override
     @DESRespondSecret(validated = true)
     public CommonResult track(Integer id, int dateTime) {
@@ -337,39 +348,100 @@ public class SmartFaceDiscernController implements SmartFaceDiscernControllerAPI
                     smartFaceDiscern.setImage(image);
                     smartAccessService.save(smartFaceDiscern);
 
+                    Integer identityId = smartUser.getIdentityId();
+//                    判断是否是学生
+                    if (2==identityId) {
+                        //                    获取推送配置
+                        List<SmartPushConfig> pushConfigs = smartPushConfigService.list(new LambdaQueryWrapper<>());
+                        SmartPushConfig smartPushConfig = pushConfigs.get(0);
+                        Integer parentsPush = smartPushConfig.getParentsPush();
+                        Integer chargeTeacherPush = smartPushConfig.getChargeTeacherPush();
+
+                        if (parentsPush == 1) {
 //                        通过学生id找到关联的家长affiliate,并找到公众号,如果openid为空则不传
-                    List<SmartUser> userList = smartUserService.getAffiliateList(userId);
-                    if (ObjectUtils.isNotEmpty(userList) && userList.size() > 0) {
-
-                        for (SmartUser user : userList) {
-                            String gzhOpenId = user.getGzhOpenId();
-                            if (ObjectUtils.isNotEmpty(gzhOpenId)) {
-                                String pushType = "";
-                                if (type.contains("进校")) {
-                                    pushType = "进入大门";
-                                } else if (type.contains("出校")) {
-                                    pushType = "离开大门";
+                            List<SmartUser> userList = smartUserService.getAffiliateList(userId);
+                            if (ObjectUtils.isNotEmpty(userList) && userList.size() > 0) {
+
+                                for (SmartUser user : userList) {
+                                    String gzhOpenId = user.getGzhOpenId();
+                                    if (ObjectUtils.isNotEmpty(gzhOpenId)) {
+                                        String pushType = "";
+                                        if (type.contains("进校")) {
+                                            pushType = "进入大门";
+                                        } else if (type.contains("出校")) {
+                                            pushType = "离开大门";
+                                        }else if (type.contains("进地下室")){
+                                            pushType = "进入地下室";
+                                        }else if (type.contains("出地下室")){
+                                            pushType = "离开地下室";
+                                        }
+                                        LocalDateTime date = LocalDateTime.now();
+                                        String format = date.format(dateTimeFormatter1);
+                                        //                    公众号信息推送
+                                        Message2.send(gzhOpenId, pushType, address, format);
+
+                                        SmartNotification smartNotification = new SmartNotification();
+                                        smartNotification.setUserId(smartUser.getId());
+                                        smartNotification.setUserName(smartUser.getName());
+                                        smartNotification.setTypeName(pushType);
+                                        smartNotification.setLocation(address);
+                                        smartNotification.setImage(image);
+                                        smartNotification.setDateTime(time);
+                                        smartNotification.setType(2);
+
+                                        smartNotificationService.save(smartNotification);
+
+                                    }
+
                                 }
-                                LocalDateTime date = LocalDateTime.now();
-                                String format = date.format(dateTimeFormatter1);
-                                //                    公众号信息推送
-                                Message2.send(gzhOpenId, pushType, address, format);
-
-                                SmartNotification smartNotification = new SmartNotification();
-                                smartNotification.setUserId(smartUser.getId());
-                                smartNotification.setUserName(smartUser.getName());
-                                smartNotification.setTypeName(pushType);
-                                smartNotification.setLocation(address);
-                                smartNotification.setImage(image);
-                                smartNotification.setDateTime(time);
-                                smartNotification.setType(2);
-
-                                smartNotificationService.save(smartNotification);
+                            }
+                        }
+
+                        if (1==chargeTeacherPush) {
+                            Integer schoolClass = smartUser.getSchoolClass();
+//                        通过班级找到对应的班主任
+                            List<SmartUser> userLists = smartUserService.getChargeTeacher(schoolClass);
+                            if (ObjectUtils.isNotEmpty(userLists) && userLists.size() > 0) {
+
+                                for (SmartUser user : userLists) {
+                                    String gzhOpenId = user.getGzhOpenId();
+                                    if (ObjectUtils.isNotEmpty(gzhOpenId)) {
+                                        String pushType = "";
+                                        if (type.contains("进校")) {
+                                            pushType = "进入大门";
+                                        } else if (type.contains("出校")) {
+                                            pushType = "离开大门";
+                                        }else if (type.contains("进地下室")){
+                                            pushType = "进入地下室";
+                                        }else if (type.contains("出地下室")){
+                                            pushType = "离开地下室";
+                                        }
+                                        LocalDateTime date = LocalDateTime.now();
+                                        String format = date.format(dateTimeFormatter1);
+                                        //                    公众号信息推送
+                                        Message2.send(gzhOpenId, pushType, address, format);
+
+                                        SmartNotification smartNotification = new SmartNotification();
+                                        smartNotification.setUserId(smartUser.getId());
+                                        smartNotification.setUserName(smartUser.getName());
+                                        smartNotification.setTypeName(pushType);
+                                        smartNotification.setLocation(address);
+                                        smartNotification.setImage(image);
+                                        smartNotification.setDateTime(time);
+                                        smartNotification.setType(2);
+
+                                        smartNotificationService.save(smartNotification);
+
+                                    }
 
+                                }
                             }
 
+
                         }
+
                     }
+
                 }
             } else {
 
@@ -471,6 +543,56 @@ public class SmartFaceDiscernController implements SmartFaceDiscernControllerAPI
         return CommonResult.ok(vos);
     }
 
+    @Override
+    @DESRespondSecret(validated = true)
+    public CommonResult faceManagement(int currentPage, int pageCount, String keyWord,String gradeId,String classId,String startTime,String endTime) {
+        PageUtils<FaceManagementVo> result= smartFaceDiscernService.faceManagement(currentPage,pageCount,keyWord,gradeId,classId,startTime,endTime);
+
+        return CommonResult.ok(result);
+    }
+
+    @Override
+    public void faceManagementExport(HttpServletResponse response, String keyWord, String gradeId, String classId, String startTime, String endTime) {
+        //导出
+        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("创建时间");
+
+        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        //        默认前一天的
+        if (ObjectUtils.isEmpty(startTime)||ObjectUtils.isEmpty(endTime)) {
+            LocalDateTime now = LocalDateTime.now().withHour(0).withMinute(0).withSecond(0);
+            LocalDateTime end = now.plusDays(1);
+            startTime=now.format(dateTimeFormatter);
+            endTime=end.format(dateTimeFormatter);
+        }
+
+        List<FaceManagementVo> vos= smartFaceDiscernService.faceManagementExport(keyWord,gradeId,classId,startTime,endTime);
+
+        for (int i = 0; i < vos.size(); i++) {
+            FaceManagementVo vo = vos.get(i);
+            Row dataRow = sheet.createRow(i + 1);
+            dataRow.createCell(0).setCellValue(i + 1);
+            dataRow.createCell(1).setCellValue(vo.getName());
+            dataRow.createCell(2).setCellValue(vo.getClassName());
+            dataRow.createCell(3).setCellValue(vo.getGradeName());
+            dataRow.createCell(4).setCellValue(vo.getLocation());
+            dataRow.createCell(5).setCellValue(vo.getImage());
+            dataRow.createCell(6).setCellValue(vo.getDateTime());
+
+        }
+
+        // 将工作簿写入文件
+        ExcelUtils.excelDownload(workbook, "人脸记录.xlsx", response);
+    }
+
 
     public static JSONObject getDate(Integer date) {
         JSONObject jsonObject = new JSONObject();

+ 1 - 2
src/main/java/com/template/controller/SmartFaceDiscernTestController.java

@@ -114,8 +114,7 @@ public class SmartFaceDiscernTestController implements SmartFaceDiscernTestContr
                 smartFaceDiscernTest.setType(type);
                 smartFaceDiscernTest.setUserId(userId);
                 smartFaceDiscernTest.setDateTime(time);
-                smartFaceDiscernTest.setIdNum(idNum);
-                smartFaceDiscernTest.setSn(sn);
+
 
 
                 if (userId != 0) {

+ 51 - 0
src/main/java/com/template/controller/SmartPushConfigController.java

@@ -0,0 +1,51 @@
+package com.template.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.template.annotation.DESRespondSecret;
+import com.template.api.SmartPushConfigControllerAPI;
+import com.template.model.pojo.SmartPushConfig;
+import com.template.model.pojo.SmartVisitorRestsConfig;
+import com.template.model.result.CommonResult;
+import com.template.services.SmartPushConfigService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-06-05
+ */
+@RestController
+@DESRespondSecret
+public class SmartPushConfigController implements SmartPushConfigControllerAPI {
+
+    @Autowired
+    SmartPushConfigService smartPushConfigService;
+
+    @Override
+    @DESRespondSecret(validated = false)
+    public CommonResult list() {
+        List<SmartPushConfig> list = smartPushConfigService.list(new LambdaQueryWrapper<>());
+        SmartPushConfig s = list.get(0);
+        return CommonResult.ok(s);
+    }
+
+    @Override
+    @DESRespondSecret(validated = false)
+    public CommonResult update(SmartPushConfig smartPushConfig) {
+        boolean update = smartPushConfigService.updateById(smartPushConfig);
+        if (update) {
+            return CommonResult.ok();
+        }
+        return CommonResult.fail();
+    }
+}
+

+ 169 - 2
src/main/java/com/template/controller/SmartVisitorController.java

@@ -16,6 +16,7 @@ import com.template.common.utils.*;
 import com.template.config.ControlConfig;
 import com.template.config.ParkConfig;
 import com.template.config.SeewoConfig;
+import com.template.model.dto.ParentsScreenDto;
 import com.template.model.enumModel.*;
 import com.template.model.pojo.*;
 import com.template.model.request.otherAppointmentRequest;
@@ -40,6 +41,8 @@ import org.springframework.web.bind.annotation.RestController;
 import javax.annotation.Resource;
 import java.net.URLDecoder;
 import java.net.URLEncoder;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -224,6 +227,8 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
             //将第一个受访学生的部门ID带过去
             sv.setDepartmentId(student.getDepartmentId());
             sv.setVisitorType(eVisitorType.Parent.getValue());
+//            图片
+            sv.setImage(par.getImage());
 
             //        获取受访者id
             Integer respondent = sv.getRespondent();
@@ -317,7 +322,7 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
 
         boolean result = smartVisitorService.insertVisitorBatch(svs);
 
-        return result ? CommonResult.ok("预约成功,等待审批通过") : CommonResult.fail("预约失败");
+        return result ? CommonResult.ok("预约成功") : CommonResult.fail("预约失败");
     }
 
 
@@ -601,7 +606,7 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
     }
 
     @Override
-    @DESRespondSecret(validated = false)
+    @DESRespondSecret(validated = true)
     public CommonResult getPage(int currentPage, int pageCount, Integer type, String keyWord, Integer status, String startTime, String endTime, String visitorStartTime, String visitorEndTime) {
         PageUtils<SmartVisitor> page = smartVisitorService.getPage(currentPage, pageCount, type, keyWord, status, startTime, endTime, visitorStartTime, visitorEndTime);
 
@@ -823,6 +828,168 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
         return CommonResult.ok("审核成功");
     }
 
+    @Override
+    public CommonResult parentsScreen(ParentsScreenDto par, BindingResult bindingResult) {
+        if (bindingResult.hasErrors()) {
+            String st = paramUtils.getParamError(bindingResult);
+            return CommonResult.fail(st);
+        }
+
+        //参数判断 判断受访学生信息是否为空
+        if (par.getStudents() == null) {
+            return CommonResult.fail("请选择受访学生");
+        }
+
+        if (par.getStudents().size() <= 0) {
+            return CommonResult.fail("请选择受访学生");
+        }
+
+        //根据用户ID查询相关信息
+        SmartUser su = smartUserService.getSmartById(par.getUserId());
+        if (su == null) {
+            return CommonResult.fail("当前用户信息不合法,无法进行预约!");
+        }
+        DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        LocalDateTime date = LocalDateTime.now();
+        String startTime = date.format(dateTimeFormatter1);
+
+        String endTime = TimeExchange.getEndOfDayStr(TimeExchange.StringToDate(startTime, "yyyy-MM-dd HH:mm:ss"));
+
+        //要进行家长数据重复判断
+        //那是不是第二次预约的时间不能在那个可访问的时间段内
+        //例如:比如,第一次约了7:00-10:00;那第二次:6:00-7:30 或 8:11-13:00都不行
+        Integer count = smartVisitorService.queryVisitorCount(su.getIdCard(), startTime, endTime);
+        if (count > 0) {
+            return CommonResult.fail("该时间段已预约,请勿重复预约!");
+        }
+
+        List<SmartVisitor> svs = new ArrayList<>();
+        for (AffiliateUserVo student : par.getStudents()) {
+            SmartVisitor sv = new SmartVisitor();
+            sv.setUserId(par.getUserId());
+            sv.setUserName(su.getName());
+            sv.setUserPhone(su.getPhone());
+            sv.setUserNumber(su.getIdCard());
+            sv.setPeerNum(0);
+            sv.setVisitReason(par.getVisitReason());
+//            sv.setStatu(eApproveStatu.Audit.getValue());
+            sv.setVisitorTime(TimeExchange.StringToDate(startTime, "yyyy-MM-dd HH:mm:ss"));
+            sv.setVisitorDeadline(TimeExchange.StringToDate(TimeExchange.AddTimeDesH(sv.getVisitorTime(), 4), "yyyy-MM-dd HH:mm:ss"));
+            sv.setRespondent(student.getId());
+            sv.setResponcode(student.getCardNo());
+            sv.setRespondentName(student.getName());
+            //将第一个受访学生的部门ID带过去
+            sv.setDepartmentId(student.getDepartmentId());
+            sv.setVisitorType(eVisitorType.Parent.getValue());
+
+            //        获取受访者id
+            Integer respondent = sv.getRespondent();
+            SmartUser smartUser = smartUserService.getById(respondent);
+            Integer schoolClass = smartUser.getSchoolClass();
+            SmartVisitorParentsConfig svpc = smartVisitorParentsConfigService.getById(schoolClass);
+            Integer screenAuditConfig = svpc.getScreenAuditConfig();
+            if (1 == screenAuditConfig) {//需要审核
+                sv.setStatu(1);
+            } else {//不需要审核
+                Integer screenPushConfig = svpc.getScreenPushConfig();
+//                判断是否需要推送
+                if (5 == screenPushConfig) {//需要推送
+                    String content = sv.getRespondentName() + "你的家长将于" + TimeExchange.chineseDateTime(sv.getVisitorTime()) + "到校!";
+                    //将预约信息推送到希沃班牌
+                    CommonResult seewo = pushInfo(sv.getUserPhone(), sv.getResponcode(), content);
+                }
+//                核销
+                Integer screenCancelConfig = svpc.getScreenCancelConfig();
+                if (6 == screenCancelConfig) {//需要核销
+                    sv.setStatu(7);
+                } else {//不需要核销
+                    sv.setStatu(9);
+                }
+//                门禁配置
+                Integer accessConfig = svpc.getAccessConfig();
+                if (0 == accessConfig) {
+                    try {
+                        List<SmartDevice> devices = smartDeviceService.queryOnLineDevice();
+                        String visitorNo = getUUIDBits(16);
+                        //region 将访客数据下发到设备
+                        for (SmartDevice device : devices) {
+                            CommonResult<String> insertVisitor = bsInsertVisitor(su, TimeExchange.DateToString(sv.getVisitorTime()), TimeExchange.DateToString(sv.getVisitorDeadline()), device.getNum(), visitorNo);
+                            if (!insertVisitor.isSuccess()) {
+                                throw new Exception(insertVisitor.getMessage());
+                            }
+                            sv.setVisitorsync(sv.getVisitorsync() == null ? insertVisitor.getData() : (sv.getVisitorsync() + "," + insertVisitor.getData()));
+                            sv.setDeviceNum(sv.getDeviceNum() == null ? device.getNum() : (sv.getDeviceNum() + "," + device.getNum()));
+                        }
+                        String code = GetVertifyCode.getRandomNumCode(6);
+                        sv.setVisitorCode(code);
+
+                    } catch (Exception e) {
+                        throw new RuntimeException(e);
+                    }
+                }
+            }
+
+            svs.add(sv);
+        }
+
+
+        boolean result = smartVisitorService.insertVisitorBatch(svs);
+
+        return result ? CommonResult.ok("预约成功") : CommonResult.fail("预约失败");
+
+
+    }
+
+    @Override
+    @DESRespondSecret(validated = true)
+    public CommonResult getScreenPage(int currentPage, int pageCount, String phone,String status) {
+        PageUtils<SmartVisitorScreenVo> page = smartVisitorService.getScreenPage(currentPage, pageCount,phone,status);
+
+        return CommonResult.ok(page);
+    }
+
+    @Override
+    public CommonResult cancel(int id) {
+        boolean b = smartVisitorService.removeById(id);
+        if (b) {
+            return CommonResult.ok();
+        }
+        return CommonResult.fail();
+    }
+
+    @Override
+    public CommonResult verification(int id) {
+        SmartVisitor sv = smartVisitorService.getSmartById(id);
+        if (sv == null) {
+            return CommonResult.fail("访客记录已失效,审核失败!");
+        }
+        Integer statu = sv.getStatu();
+        if (9==statu) {
+            return CommonResult.fail("该记录已完成,请勿重复操作");
+        }
+        if (2==statu) {
+            return CommonResult.fail("该记录未同意");
+        }
+        if (1==statu) {
+            return CommonResult.fail("该记录还未通过审核");
+        }
+        if (7==statu) {
+            sv.setStatu(8);
+            int result = smartVisitorService.updateSmartVisitor(sv);
+            if (result > 0) {
+                return CommonResult.ok("进校核销成功");
+            }
+        }else if(8==statu){
+            sv.setStatu(9);
+            int result = smartVisitorService.updateSmartVisitor(sv);
+            if (result > 0) {
+                return CommonResult.ok("出校核销成功");
+            }
+        }
+
+        return CommonResult.fail();
+    }
+
     /**
      * 1、学生请假:
      * 我们这边调用请假接口之后,把请假数据写到了百胜系统的"学生请假登记"页面中,那到时候学生是通过任意设备都能进出吗?

+ 6 - 1
src/main/java/com/template/mapper/SmartAccessMapper.java

@@ -9,6 +9,8 @@ import com.template.model.vo.VisitorPageVo;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
+import java.util.List;
+
 /**
  * <p>
  *  Mapper 接口
@@ -20,5 +22,8 @@ import org.springframework.stereotype.Repository;
 @Repository
 public interface SmartAccessMapper extends BaseMapper<SmartAccess> {
 
-    IPage<SmartAccessVo> getPage(Page<SmartAccessVo> page,@Param("keyWord") String keyWord,@Param("gradeId") Integer gradeId, @Param("classId") Integer classId,@Param("departmentId") Integer departmentId,@Param("openType") Integer openType,@Param("resultStatus") Integer resultStatus,@Param("startTime")String startTime,@Param("endTime")String endTime);
+    IPage<SmartAccessVo> getPage(Page<SmartAccessVo> page, @Param("keyWord") String keyWord, @Param("gradeId") Integer gradeId, @Param("classId") Integer classId, @Param("departmentId") Integer departmentId, @Param("openType") Integer openType, @Param("resultStatus") Integer resultStatus, @Param("startTime") String startTime, @Param("endTime") String endTime);
+
+    List<SmartAccessVo> getPageExport(@Param("keyWord") String keyWord, @Param("gradeId") Integer gradeId, @Param("classId") Integer classId, @Param("departmentId") Integer departmentId, @Param("openType") Integer openType, @Param("resultStatus") Integer resultStatus, @Param("startTime") String startTime, @Param("endTime") String endTime);
+
 }

+ 3 - 0
src/main/java/com/template/mapper/SmartAttendanceMapper.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.template.model.pojo.SmartAttendance;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.template.model.vo.AskForLeaveScreenVo;
 import com.template.model.vo.AskForLeaveVo;
 import com.template.model.vo.SmartAttendanceVo;
 import org.apache.ibatis.annotations.Param;
@@ -30,5 +31,7 @@ public interface SmartAttendanceMapper extends BaseMapper<SmartAttendance> {
 
     List<SmartAttendanceVo> queryExpor(@Param("gradeId") Integer gradeId, @Param("classId") Integer classId, @Param("status") String status, @Param("studentNo") String studentNo, @Param("name") String name, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
+    IPage<AskForLeaveScreenVo> askForLeaveScreenPage(Page<AskForLeaveScreenVo> page, @Param("cardNo") String cardNo, @Param("ifVerification") String ifVerification);
+
 }
 

+ 3 - 0
src/main/java/com/template/mapper/SmartClassMapper.java

@@ -2,6 +2,7 @@ package com.template.mapper;
 
 import com.template.model.pojo.SmartClass;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.template.model.vo.SchoolClassVo;
 import com.template.model.vo.SmartClassVo;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
@@ -23,4 +24,6 @@ public interface SmartClassMapper extends BaseMapper<SmartClass> {
     List<SmartClassVo> getSchoolClassIdList(@Param("className") String className);
 
     SmartClassVo getSchoolClassId(@Param("schoolClass") int schoolClass,@Param("className") String className);
+
+    SchoolClassVo getClassId(@Param("schoolClass") int schoolClass);
 }

+ 10 - 0
src/main/java/com/template/mapper/SmartFaceDiscernMapper.java

@@ -1,10 +1,16 @@
 package com.template.mapper;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.template.model.pojo.SmartFaceDiscern;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.template.model.vo.FaceManagementVo;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
+import java.util.List;
+
 /**
  * <p>
  *  Mapper 接口
@@ -16,4 +22,8 @@ import org.springframework.stereotype.Repository;
 @Repository
 public interface SmartFaceDiscernMapper extends BaseMapper<SmartFaceDiscern> {
 
+    IPage<FaceManagementVo> faceManagement(Page<FaceManagementVo> page, @Param("keyWord") String keyWord, @Param("gradeId") String gradeId, @Param("classId") String classId, @Param("startTime") String startTime, @Param("endTime") String endTime);
+
+    List<FaceManagementVo> faceManagementExport(@Param("keyWord") String keyWord, @Param("gradeId") String gradeId, @Param("classId") String classId, @Param("startTime") String startTime, @Param("endTime") String endTime);
+
 }

+ 18 - 0
src/main/java/com/template/mapper/SmartPushConfigMapper.java

@@ -0,0 +1,18 @@
+package com.template.mapper;
+
+import com.template.model.pojo.SmartPushConfig;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-06-05
+ */
+@Repository
+public interface SmartPushConfigMapper extends BaseMapper<SmartPushConfig> {
+
+}

+ 2 - 1
src/main/java/com/template/mapper/SmartVisitorMapper.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.template.model.pojo.SmartVisitor;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.template.model.vo.SmartVisitorScreenVo;
 import com.template.model.vo.VisitorPageVo;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
@@ -29,5 +30,5 @@ public interface SmartVisitorMapper extends BaseMapper<SmartVisitor> {
     IPage<VisitorPageVo> getPage(Page<SmartVisitor> page,@Param("type")Integer type,@Param("keyWord") String keyWord,@Param("status") Integer status,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("visitorStartTime") String visitorStartTime,@Param("visitorEndTime") String visitorEndTime);
 
 
-
+    IPage<SmartVisitorScreenVo> getScreenPage(Page<SmartVisitorScreenVo> page,@Param("phone") String phone,@Param("status")  String status);
 }

+ 31 - 0
src/main/java/com/template/model/dto/ParentsScreenDto.java

@@ -0,0 +1,31 @@
+package com.template.model.dto;
+
+import com.template.model.vo.AffiliateUserVo;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+@Data
+public class ParentsScreenDto {
+    /**
+     * 用户ID
+     * 根据用户ID把访客姓名、访客手机号、证件号带过来
+     */
+    @NotNull(message = "用户ID不能为空")
+    private Integer userId;
+
+
+    /**
+     * 访问事由
+     */
+    @NotBlank(message = "访问事由不能为空")
+    private String visitReason;
+
+
+    /**
+     * 受访学生信息
+     */
+    private List<AffiliateUserVo> students;
+}

+ 0 - 6
src/main/java/com/template/model/pojo/SmartFaceDiscern.java

@@ -50,12 +50,6 @@ public class SmartFaceDiscern implements Serializable {
     @ApiModelProperty(value = "图片")
     private String image;
 
-    @ApiModelProperty(value = "百胜门禁编号")
-    private String idNum;
-
-    @ApiModelProperty(value = "设备sn号")
-    private String sn;
-
     @ApiModelProperty(value = "备注")
     private String remark;
 

+ 0 - 6
src/main/java/com/template/model/pojo/SmartFaceDiscernTest.java

@@ -45,12 +45,6 @@ public class SmartFaceDiscernTest implements Serializable {
     @ApiModelProperty(value = "地点")
     private String location;
 
-    @ApiModelProperty(value = "百胜门禁编号")
-    private String idNum;
-
-    @ApiModelProperty(value = "设备sn号")
-    private String sn;
-
     @ApiModelProperty(value = "图片")
     private String image;
 

+ 64 - 0
src/main/java/com/template/model/pojo/SmartPushConfig.java

@@ -0,0 +1,64 @@
+package com.template.model.pojo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.Version;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-06-05
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="SmartPushConfig对象", description="")
+public class SmartPushConfig implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.UUID)
+    private Integer id;
+
+    @ApiModelProperty(value = "家长 1:推送,2:不推送")
+    private Integer parentsPush;
+
+    @ApiModelProperty(value = "班主任 1:推送,2:不推送")
+    private Integer chargeTeacherPush;
+
+    @ApiModelProperty(value = "创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
+
+    @ApiModelProperty(value = "更新时间")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Date updateTime;
+
+    @ApiModelProperty(value = "创建人员")
+    @TableField(fill = FieldFill.INSERT)
+    private String createUser;
+
+    @ApiModelProperty(value = "更新人员")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private String updateUser;
+
+    @ApiModelProperty(value = "逻辑删除 未删除:0;删除:1")
+    @TableField(fill = FieldFill.INSERT)
+    @TableLogic
+    private Integer deleted;
+
+
+}

+ 3 - 0
src/main/java/com/template/model/pojo/SmartVisitor.java

@@ -113,6 +113,9 @@ public class SmartVisitor implements Serializable {
     @ApiModelProperty(value = "访客验证码")
     private String visitorCode;
 
+    @ApiModelProperty(value = "图片")
+    private String image;
+
     @ApiModelProperty(value = "创建时间")
     @TableField(fill = FieldFill.INSERT)
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")

+ 1 - 0
src/main/java/com/template/model/request/otherAppointmentRequest.java

@@ -73,4 +73,5 @@ public class otherAppointmentRequest {
      */
     @NotBlank(message = "受访者电话不能为空")
     private String respondentPhone;
+
 }

+ 5 - 0
src/main/java/com/template/model/request/parentsAppointmentRequest.java

@@ -49,4 +49,9 @@ public class parentsAppointmentRequest {
      */
     private List<AffiliateUserVo> students;
 
+    /**
+     * 图片
+     */
+    private String image;
+
 }

+ 35 - 0
src/main/java/com/template/model/vo/AskForLeaveScreenVo.java

@@ -0,0 +1,35 @@
+package com.template.model.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class AskForLeaveScreenVo {
+    private Integer id;
+
+    @ApiModelProperty(value = "头像")
+    private String headImage;
+
+    @ApiModelProperty(value = "希沃用户名称")
+    private String name;
+
+    @ApiModelProperty(value = "班级名称")
+    private String className;
+
+    @ApiModelProperty(value = "学号")
+    private String cardNo;
+
+    @ApiModelProperty(value = "请假原因")
+    private String reason;
+
+    @ApiModelProperty(value = "开始时间")
+    private Date startTime;
+
+    @ApiModelProperty(value = "结束时间")
+    private Date endTime;
+
+    @ApiModelProperty(value = "请假核销(0:未核销,1:已核销)")
+    private Integer ifVerification;
+}

+ 24 - 0
src/main/java/com/template/model/vo/FaceManagementVo.java

@@ -0,0 +1,24 @@
+package com.template.model.vo;
+
+import lombok.Data;
+
+@Data
+public class FaceManagementVo {
+    private Integer id;
+
+    private String name;
+
+    private String className;
+
+    private String gradeName;
+
+    private String type;
+
+    private String location;
+
+    private String image;
+
+    private String dateTime;
+
+
+}

+ 11 - 0
src/main/java/com/template/model/vo/SchoolClassVo.java

@@ -0,0 +1,11 @@
+package com.template.model.vo;
+
+import lombok.Data;
+
+@Data
+public class SchoolClassVo {
+    private String classId;
+    private String className;
+    private String gradeId;
+    private String gradeName;
+}

+ 33 - 0
src/main/java/com/template/model/vo/SmartVisitorScreenVo.java

@@ -0,0 +1,33 @@
+package com.template.model.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class SmartVisitorScreenVo {
+
+    private int id;
+
+    @ApiModelProperty(value = "访问事由")
+    private String visitReason;
+
+    @ApiModelProperty(value = "图片")
+    private String image;
+
+    @ApiModelProperty(value = "来访时间")
+    private Date visitorTime;
+
+    @ApiModelProperty(value = "学生姓名")
+    private String studentName;
+
+    @ApiModelProperty(value = "班级名称")
+    private String className;
+
+    @ApiModelProperty(value = "学号")
+    private String cardNo;
+
+    private int statu;
+
+}

+ 3 - 0
src/main/java/com/template/services/SmartAccessService.java

@@ -21,4 +21,7 @@ public interface SmartAccessService extends IService<SmartAccess> {
     List<SmartAccess> track(String stateTime, String endTime, Integer id);
 
     PageUtils<SmartAccessVo> getPage(Integer currentPage, Integer pageCount,String keyWord,Integer gradeId, Integer classId, Integer departmentId, Integer openType, Integer resultStatus,String startTime,String endTime);
+
+    List<SmartAccessVo> getPageExport(String keyWord, Integer gradeId, Integer classId, Integer departmentId, Integer openType, Integer resultStatus, String startTime, String endTime);
+
 }

+ 4 - 0
src/main/java/com/template/services/SmartAttendanceService.java

@@ -4,6 +4,7 @@ import com.template.model.pojo.SmartAttendance;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.template.model.pojo.SmartVisitor;
 import com.template.model.result.PageUtils;
+import com.template.model.vo.AskForLeaveScreenVo;
 import com.template.model.vo.AskForLeaveVo;
 import com.template.model.vo.SmartAttendanceVo;
 
@@ -40,4 +41,7 @@ public interface SmartAttendanceService extends IService<SmartAttendance> {
     List<SmartAttendance> duplicatesList(Date startTime, Date endTime, Date initiateTime);
 
     List<SmartAttendanceVo> queryExpor(Integer gradeId, Integer classId, String status, String studentNo, String name, String startTime, String endTime);
+
+    PageUtils<AskForLeaveScreenVo> askForLeaveScreenPage(int currentPage, int pageCount, String cardNo, String ifVerification);
+
 }

+ 4 - 0
src/main/java/com/template/services/SmartClassService.java

@@ -4,6 +4,7 @@ import com.template.model.pojo.SmartBuild;
 import com.template.model.pojo.SmartClass;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.template.model.result.PageUtils;
+import com.template.model.vo.SchoolClassVo;
 import com.template.model.vo.SmartClassVo;
 
 import java.util.List;
@@ -38,4 +39,7 @@ public interface SmartClassService extends IService<SmartClass> {
     List<SmartClassVo> getSchoolClassIdList(String className);
 
     SmartClassVo getSchoolClassId(int schoolClass,String className);
+
+    SchoolClassVo getClassId(int schoolClass);
+
 }

+ 6 - 0
src/main/java/com/template/services/SmartFaceDiscernService.java

@@ -11,6 +11,8 @@ import com.template.common.utils.TimeExchange;
 import com.template.model.pojo.SmartFaceDiscern;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.template.model.pojo.SmartUser;
+import com.template.model.result.PageUtils;
+import com.template.model.vo.FaceManagementVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
@@ -36,4 +38,8 @@ public interface SmartFaceDiscernService extends IService<SmartFaceDiscern> {
 
 
     List<SmartFaceDiscern> track(String stateTime, String endTime, Integer id);
+
+    PageUtils<FaceManagementVo> faceManagement(int currentPage, int pageCount, String keyWord,String gradeId,String classId,String startTime,String endTime);
+
+    List<FaceManagementVo> faceManagementExport(String keyWord, String gradeId, String classId, String startTime, String endTime);
 }

+ 16 - 0
src/main/java/com/template/services/SmartPushConfigService.java

@@ -0,0 +1,16 @@
+package com.template.services;
+
+import com.template.model.pojo.SmartPushConfig;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-06-05
+ */
+public interface SmartPushConfigService extends IService<SmartPushConfig> {
+
+}

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

@@ -134,4 +134,6 @@ public interface SmartUserService extends IService<SmartUser> {
      * @return
      */
     SmartUser getBsStudentNo(String idNum);
+
+    List<SmartUser> getChargeTeacher(Integer schoolClass);
 }

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

@@ -4,6 +4,7 @@ import com.template.model.pojo.SmartVisitor;
 import com.template.model.pojo.SmartVisitor;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.template.model.result.PageUtils;
+import com.template.model.vo.SmartVisitorScreenVo;
 import com.template.model.vo.VisitorPageVo;
 import org.apache.ibatis.annotations.Param;
 
@@ -42,4 +43,5 @@ public interface SmartVisitorService extends IService<SmartVisitor> {
 
     PageUtils<SmartVisitor> getPage(int currentPage, int pageCount,Integer type, String keyWord, Integer status, String startTime, String endTime, String visitorStartTime, String visitorEndTime);
 
+    PageUtils<SmartVisitorScreenVo> getScreenPage(int currentPage, int pageCount, String phone, String status);
 }

+ 6 - 0
src/main/java/com/template/services/impl/SmartAccessServiceImpl.java

@@ -48,4 +48,10 @@ public class SmartAccessServiceImpl extends ServiceImpl<SmartAccessMapper, Smart
         IPage<SmartAccessVo> datas = smartAccessMapper.getPage(page,keyWord,gradeId,classId,departmentId,openType,resultStatus,startTime,endTime);
         return new PageUtils(datas);
     }
+
+    @Override
+    public List<SmartAccessVo> getPageExport(String keyWord, Integer gradeId, Integer classId, Integer departmentId, Integer openType, Integer resultStatus, String startTime, String endTime) {
+        List<SmartAccessVo> vos = smartAccessMapper.getPageExport(keyWord,gradeId,classId,departmentId,openType,resultStatus,startTime,endTime);
+        return vos;
+    }
 }

+ 8 - 0
src/main/java/com/template/services/impl/SmartAttendanceServiceImpl.java

@@ -9,6 +9,7 @@ import com.template.model.pojo.SmartAttendance;
 import com.template.mapper.SmartAttendanceMapper;
 import com.template.model.pojo.SmartVisitor;
 import com.template.model.result.PageUtils;
+import com.template.model.vo.AskForLeaveScreenVo;
 import com.template.model.vo.AskForLeaveVo;
 import com.template.model.vo.SmartAttendanceVo;
 import com.template.services.SmartAttendanceService;
@@ -131,4 +132,11 @@ public class SmartAttendanceServiceImpl extends ServiceImpl<SmartAttendanceMappe
         List<SmartAttendanceVo> vos =smartAttendanceMapper.queryExpor(gradeId,classId,status,studentNo,name,startTime,endTime);
         return vos;
     }
+
+    @Override
+    public PageUtils<AskForLeaveScreenVo> askForLeaveScreenPage(int currentPage, int pageCount, String cardNo, String ifVerification) {
+        Page<AskForLeaveScreenVo> page = new Page<>(currentPage,pageCount);
+        IPage<AskForLeaveScreenVo> datas = smartAttendanceMapper.askForLeaveScreenPage(page,cardNo,ifVerification);
+        return new PageUtils(datas);
+    }
 }

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

@@ -10,6 +10,7 @@ import com.template.model.pojo.SmartClass;
 import com.template.model.pojo.SmartGrade;
 import com.template.model.pojo.SmartSchool;
 import com.template.model.result.PageUtils;
+import com.template.model.vo.SchoolClassVo;
 import com.template.model.vo.SmartClassVo;
 import com.template.services.SmartClassService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -110,4 +111,10 @@ public class SmartClassServiceImpl extends ServiceImpl<SmartClassMapper, SmartCl
         SmartClassVo vo = smartClassMapper.getSchoolClassId(schoolClass,className);
         return vo;
     }
+
+    @Override
+    public SchoolClassVo getClassId(int schoolClass) {
+        SchoolClassVo vo = smartClassMapper.getClassId(schoolClass);
+        return vo;
+    }
 }

+ 21 - 0
src/main/java/com/template/services/impl/SmartFaceDiscernServiceImpl.java

@@ -3,13 +3,18 @@ package com.template.services.impl;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.template.common.utils.*;
 import com.template.config.ScheduleConfig;
 import com.template.model.pojo.SmartFaceDiscern;
 import com.template.mapper.SmartFaceDiscernMapper;
 import com.template.model.pojo.SmartNotification;
 import com.template.model.pojo.SmartUser;
+import com.template.model.result.PageUtils;
+import com.template.model.vo.AskForLeaveScreenVo;
+import com.template.model.vo.FaceManagementVo;
 import com.template.services.SmartFaceDiscernService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.template.services.SmartNotificationService;
@@ -50,6 +55,9 @@ public class SmartFaceDiscernServiceImpl extends ServiceImpl<SmartFaceDiscernMap
     @Resource
     private ScheduleConfig scheduleConfig;
 
+    @Autowired
+    SmartFaceDiscernMapper smartFaceDiscernMapper;
+
 
     //    static String appid = "sc5efc60f2bd373df9";
     static String appid = "sc1eb792c1ea3237e9";
@@ -289,4 +297,17 @@ public class SmartFaceDiscernServiceImpl extends ServiceImpl<SmartFaceDiscernMap
 
         return list;
     }
+
+    @Override
+    public PageUtils<FaceManagementVo> faceManagement(int currentPage, int pageCount, String keyWord,String gradeId,String classId,String startTime,String endTime) {
+        Page<FaceManagementVo> page = new Page<>(currentPage,pageCount);
+        IPage<FaceManagementVo> datas = smartFaceDiscernMapper.faceManagement(page,keyWord,gradeId,classId,startTime,endTime);
+        return new PageUtils(datas);
+    }
+
+    @Override
+    public List<FaceManagementVo> faceManagementExport(String keyWord, String gradeId, String classId, String startTime, String endTime) {
+        List<FaceManagementVo> vos = smartFaceDiscernMapper.faceManagementExport(keyWord,gradeId,classId,startTime,endTime);
+        return vos;
+    }
 }

+ 20 - 0
src/main/java/com/template/services/impl/SmartPushConfigServiceImpl.java

@@ -0,0 +1,20 @@
+package com.template.services.impl;
+
+import com.template.model.pojo.SmartPushConfig;
+import com.template.mapper.SmartPushConfigMapper;
+import com.template.services.SmartPushConfigService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-06-05
+ */
+@Service
+public class SmartPushConfigServiceImpl extends ServiceImpl<SmartPushConfigMapper, SmartPushConfig> implements SmartPushConfigService {
+
+}

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

@@ -326,8 +326,8 @@ public class SmartUserServiceImpl extends ServiceImpl<SmartUserMapper, SmartUser
     @Override
     public SmartUser getCard(String certificateNumber) {
         LambdaQueryWrapper<SmartUser> wrapper=new LambdaQueryWrapper<>();
-        wrapper.eq(SmartUser::getIdCard,certificateNumber)
-                .or()
+        wrapper/*.eq(SmartUser::getIdCard,certificateNumber)
+                .or()*/
                 .eq(SmartUser::getCardNo,certificateNumber);
         SmartUser one = this.getOne(wrapper);
 
@@ -346,5 +346,15 @@ public class SmartUserServiceImpl extends ServiceImpl<SmartUserMapper, SmartUser
         return one;
     }
 
+    @Override
+    public List<SmartUser> getChargeTeacher(Integer schoolClass) {
+        LambdaQueryWrapper<SmartUser> wrapper=new LambdaQueryWrapper<>();
+        wrapper.eq(SmartUser::getSchoolClass,schoolClass)
+                .eq(SmartUser::getDepartmentId,137);
+        List<SmartUser> list = this.list(wrapper);
+
+        return list;
+    }
+
 
 }

+ 10 - 0
src/main/java/com/template/services/impl/SmartVisitorServiceImpl.java

@@ -9,6 +9,7 @@ import com.template.model.pojo.SmartVisitor;
 import com.template.model.pojo.SmartVisitor;
 import com.template.mapper.SmartVisitorMapper;
 import com.template.model.result.PageUtils;
+import com.template.model.vo.SmartVisitorScreenVo;
 import com.template.model.vo.VisitorPageVo;
 import com.template.services.SmartVisitorService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -126,4 +127,13 @@ public class SmartVisitorServiceImpl extends ServiceImpl<SmartVisitorMapper, Sma
         IPage<VisitorPageVo> datas = smartVisitorMapper.getPage(page,type,keyWord,status,startTime,endTime,visitorStartTime,visitorEndTime);
         return new PageUtils(datas);
     }
+
+    @Override
+    public PageUtils<SmartVisitorScreenVo> getScreenPage(int currentPage, int pageCount, String phone, String status) {
+        Page<SmartVisitorScreenVo> page = new Page<>();
+        page.setCurrent(currentPage);
+        page.setSize(pageCount);
+        IPage<SmartVisitorScreenVo> datas = smartVisitorMapper.getScreenPage(page,phone,status);
+        return new PageUtils(datas);
+    }
 }

+ 45 - 0
src/main/resources/mapper/template/SmartAccessMapper.xml

@@ -47,4 +47,49 @@
 
         ORDER BY sa.date_time DESC
     </select>
+
+    <select id="getPageExport" resultType="com.template.model.vo.SmartAccessVo">
+        SELECT
+        sa.id,
+        sa.name,
+        sa.sn,
+        sa.type,
+        sd.`name` as departmentName,
+        sc.`name` as className,
+        su.card_no as cardNo,
+        sa.image,
+        sa.open_type as openType,
+        sa.date_time as dateTime,
+        sa.in_out as access,
+        sa.result_status as resultStatus
+        FROM
+        `smart_access` sa
+        LEFT JOIN smart_user su on sa.user_id=su.id
+        LEFT JOIN smart_department sd on su.department_id=sd.id
+        LEFT JOIN smart_class sc on su.school_class=sc.id
+        LEFT JOIN smart_grade sg on sc.grade_id=sg.id
+        WHERE sa.deleted = 0
+        <if test="keyWord != null and keyWord != ''">
+            and (sa.name like '%' #{keyWord} '%' or su.card_no like '%' #{keyWord} '%')
+        </if>
+        <if test="gradeId != null and gradeId != ''">
+            and sc.grade_id= #{gradeId}
+        </if>
+        <if test="classId != null and classId != ''">
+            and su.school_class= #{classId}
+        </if>
+        <if test="departmentId != null and departmentId != ''">
+            and su.department_id= #{departmentId}
+        </if>
+        <if test="openType != null and openType != ''">
+            and sa.open_type= #{openType}
+        </if>
+        <if test="resultStatus != null and  resultStatus != ''">
+            and sa.result_status= #{resultStatus}
+        </if>
+        <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+            and sa.date_time &gt;= #{startTime} and sa.date_time &lt;= #{endTime}
+        </if>
+        ORDER BY sa.date_time DESC
+    </select>
 </mapper>

+ 26 - 0
src/main/resources/mapper/template/SmartAttendanceMapper.xml

@@ -120,4 +120,30 @@
         </if>
         ORDER BY sa.create_time desc
     </select>
+    <select id="askForLeaveScreenPage" resultType="com.template.model.vo.AskForLeaveScreenVo">
+        SELECT
+            sa.id,
+            su.head_image as headImage,
+            su.`name` as name,
+            sc.`name` as className,
+            su.card_no as cardNo,
+            sa.start_time as startTime,
+            sa.end_time as endTime,
+            sa.reason,
+            sa.if_verification as ifVerification
+        FROM
+            `smart_attendance` sa
+                LEFT JOIN smart_user su ON sa.user_id = su.id
+                LEFT JOIN smart_class sc ON sa.class_id = sc.id
+        WHERE
+            sa.deleted = 0
+          AND sa.`status` =6
+        <if test="cardNo != null and cardNo != ''">
+            and su.card_no like '%' #{cardNo} '%'
+        </if>
+        <if test="ifVerification != null and ifVerification != ''">
+            and sa.if_verification = #{ifVerification}
+        </if>
+        ORDER BY sa.initiate_time desc
+    </select>
 </mapper>

+ 9 - 0
src/main/resources/mapper/template/SmartClassMapper.xml

@@ -25,5 +25,14 @@
             AND sc.`name` like '%' #{className} '%'
         </if>
     </select>
+    <select id="getClassId" resultType="com.template.model.vo.SchoolClassVo">
+        SELECT sc.id     as classId,
+               sc.name   as className,
+               sg.id   as gradeId,
+               sg.`name` as gradeName
+        FROM `smart_class` sc
+                 LEFT JOIN smart_grade sg ON sc.grade_id = sg.id
+        WHERE sc.id = #{schoolClass} and sc.deleted=0
+    </select>
 
 </mapper>

+ 69 - 0
src/main/resources/mapper/template/SmartFaceDiscernMapper.xml

@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.template.mapper.SmartFaceDiscernMapper">
+
+    <select id="faceManagement" resultType="com.template.model.vo.FaceManagementVo">
+        SELECT
+            sfd.id,
+            sfd.`name`,
+            sc.`name` as className,
+            sg.`name` as gradeName,
+            sfd.type,
+            sfd.location,
+            sfd.image,
+            sfd.date_time AS dateTime
+        FROM
+            `smart_face_discern` sfd
+                LEFT JOIN smart_user su ON sfd.user_id = su.id
+                LEFT JOIN smart_class sc ON su.school_class = sc.id
+                LEFT JOIN smart_grade sg ON sc.grade_id = sg.id
+        WHERE
+            sfd.deleted =0
+        <if test="keyWord != null and keyWord != ''">
+            and (sfd.`name` like '%' #{keyWord} '%'  or sfd.location like '%' #{keyWord} '%')
+        </if>
+        <if test="gradeId != null and gradeId != ''">
+            and sc.grade_id= #{gradeId}
+        </if>
+        <if test="classId != null and classId != ''">
+            and su.school_class= #{classId}
+        </if>
+        <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+            and sfd.date_time &gt;= #{startTime} and sfd.date_time &lt;= #{endTime}
+        </if>
+        ORDER BY sfd.date_time desc
+    </select>
+
+    <select id="faceManagementExport" resultType="com.template.model.vo.FaceManagementVo">
+        SELECT
+        sfd.id,
+        sfd.`name`,
+        sc.`name` as className,
+        sg.`name` as gradeName,
+        sfd.type,
+        sfd.location,
+        sfd.image,
+        sfd.date_time AS dateTime
+        FROM
+        `smart_face_discern` sfd
+        LEFT JOIN smart_user su ON sfd.user_id = su.id
+        LEFT JOIN smart_class sc ON su.school_class = sc.id
+        LEFT JOIN smart_grade sg ON sc.grade_id = sg.id
+        WHERE
+        sfd.deleted =0
+        <if test="keyWord != null and keyWord != ''">
+            and (sfd.`name` like '%' #{keyWord} '%'  or sfd.location like '%' #{keyWord} '%')
+        </if>
+        <if test="gradeId != null and gradeId != ''">
+            and sc.grade_id= #{gradeId}
+        </if>
+        <if test="classId != null and classId != ''">
+            and su.school_class= #{classId}
+        </if>
+        <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+            and sfd.date_time &gt;= #{startTime} and sfd.date_time &lt;= #{endTime}
+        </if>
+        ORDER BY sfd.date_time desc
+    </select>
+
+</mapper>

+ 5 - 0
src/main/resources/mapper/template/SmartPushConfigMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.template.mapper.SmartPushConfigMapper">
+
+</mapper>

+ 25 - 0
src/main/resources/mapper/template/SmartVisitorMapper.xml

@@ -134,5 +134,30 @@
         </if>
         order by sv.create_time desc
     </select>
+    <select id="getScreenPage" resultType="com.template.model.vo.SmartVisitorScreenVo">
+        SELECT
+            sv.id,
+            sv.visit_reason as visitReason,
+            sv.image as image,
+            sv.visitor_time as visitorTime,
+            su.`name` as studentName,
+            su.card_no as cardNo,
+            sc.`name` as className,
+            sv.statu as statu
+        FROM
+            `smart_visitor` sv
+                LEFT JOIN smart_user su ON sv.respondent = su.id
+                LEFT JOIN smart_class sc ON su.school_class = sc.id
+        WHERE
+            sv.deleted = 0
+          AND sv.visitor_type =1
+        <if test="status != null and status != ''">
+            and sv.statu = #{status}
+        </if>
+        <if test="phone != null and phone != ''">
+            and sv.user_phone = #{phone}
+        </if>
+        order by sv.visitor_time desc
+    </select>
 
 </mapper>