Jelajahi Sumber

学校健康公示墙添加访客数据

Administrator 5 tahun lalu
induk
melakukan
efe88a6eda

+ 15 - 2
web/src/main/java/com/jpsoft/smart/modules/mobile/controller/HealthShowApiController.java

@@ -334,6 +334,13 @@ public class HealthShowApiController {
                 Integer teacherNum = Math.toIntExact(personInfoService.countByCompanyListAndPopedom("teacher", list));
                 //应测学生数
                 Integer studentNum = Math.toIntExact(personInfoService.countByCompanyListAndPopedom("student", list));
+                //访客人次
+                Integer visitorNum = 0;
+                if (deviceNoList.size() > 0) {
+                    visitorNum = personDeviceLogService.getDayCheckedVistorNumByDeviceNoList(DateUtil.beginOfDay(new Date()), DateUtil.endOfDay(new Date()), deviceNoList);
+                }
+
+
                 //已测教职工数
                 Integer checkedTeacherNum = personDeviceFilterLogService.getDayCheckedPersonNumByCompanyList(DateUtil.beginOfDay(new Date()), DateUtil.endOfDay(new Date()), list, "%2%");
                 Integer checkedTeacherAndStudentNum = personDeviceFilterLogService.getDayCheckedPersonNumByCompanyList(DateUtil.beginOfDay(new Date()), DateUtil.endOfDay(new Date()), list, "%1%");
@@ -362,6 +369,7 @@ public class HealthShowApiController {
                 //   HashMap<String, Object> mapData = new HashMap<>();
                 mapData.put("teacherNum", teacherNum);
                 mapData.put("studentNum", studentNum);
+                mapData.put("visitorNum",visitorNum);
                 mapData.put("checkedTeacherNum", checkedTeacherNum);
                 mapData.put("checkedStudentNum", checkedStudentNum);
                 mapData.put("dayAbnormalNum", dayAbnormalNum);
@@ -394,7 +402,7 @@ public class HealthShowApiController {
     @ApiImplicitParams({
             @ApiImplicitParam(name = "token", value = "令牌", paramType = "query", dataType = "form"),
             @ApiImplicitParam(name = "subject", value = "目标(不传)", paramType = "form"),
-            @ApiImplicitParam(name = "type", value = "老师/学生(teacher/student)", required = true, paramType = "form", dataType = "String"),
+            @ApiImplicitParam(name = "type", value = "老师/学生/访客(teacher/student/visitor)", required = true, paramType = "form", dataType = "String"),
 
     })
     public MessageResult<Map> picDataForSchool(
@@ -452,13 +460,18 @@ public class HealthShowApiController {
                 }
                 Page<PersonDeviceLog> personDeviceLogList = new Page<>();
                 if ("all".equals(type)) {
-                    personDeviceLogList = personDeviceLogService.findLastPersonLogByCompanyList(DateUtil.beginOfDay(new Date()), DateUtil.endOfDay(new Date()), list, pageIndex, pageSize);
+                    personDeviceLogList = personDeviceLogService.findAllPersonLogByCompanyListAndDeviceNoList(DateUtil.beginOfDay(new Date()), DateUtil.endOfDay(new Date()), list,deviceNoList, pageIndex, pageSize);
                 } else if ("teacher".equals(type)) {
                     personDeviceLogList = personDeviceLogService.findLastTeacherLogByCompanyList(DateUtil.beginOfDay(new Date()), DateUtil.endOfDay(new Date()), list, pageIndex, pageSize);
                 } else if ("student".equals(type)) {
                     personDeviceLogList = personDeviceLogService.findLastStudentLogByCompanyList(DateUtil.beginOfDay(new Date()), DateUtil.endOfDay(new Date()), list, pageIndex, pageSize);
 
                 }
+                else if ("visitor".equals(type)) {
+                    if (deviceNoList.size() > 0) {
+                        personDeviceLogList = personDeviceLogService.findVisitorLogByDeviceNoList(DateUtil.beginOfDay(new Date()), DateUtil.endOfDay(new Date()), deviceNoList, pageIndex, pageSize);
+                    }
+                }
                 msgResult.setData(PojoUtils.pageWrapper(personDeviceLogList));
 
             } else {