Commit 38841d26587e26db1af3f96923126de6a646532c
1 parent
f1e0c386
Exists in
master
修改提交
Showing
14 changed files
with
259 additions
and
83 deletions
Show diff stats
cloud/dahua/src/main/java/com/example/dahua/control/UserOperateController.java
| ... | ... | @@ -91,15 +91,25 @@ public class UserOperateController { |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | @ApiOperation(value = "按班级指定下发") |
| 94 | - @RequestMapping(value = "sendFaceByClassId", method = RequestMethod.POST) | |
| 94 | + @RequestMapping(value = "sendFaceByClassId", method = RequestMethod.GET) | |
| 95 | 95 | public void exportFace(@RequestParam("schoolId") Integer schoolId, |
| 96 | 96 | @RequestParam(value = "classIds",required = false) String classIds, |
| 97 | 97 | @RequestParam(value = "deviceIds",required = false) String deviceIds){ |
| 98 | - userOperateService.sendFaceByClassId(schoolId,classIds,deviceIds); | |
| 98 | + userOperateService.sendFaceByClassId(schoolId,classIds,deviceIds,"",null); | |
| 99 | + } | |
| 100 | + | |
| 101 | + @ApiOperation(value = "按班级指定下发") | |
| 102 | + @RequestMapping(value = "sendFaceByClassId2", method = RequestMethod.GET) | |
| 103 | + public void sendFaceByClassId2(@RequestParam("schoolId") Integer schoolId, | |
| 104 | + @RequestParam(value = "classIds",required = false) String classIds, | |
| 105 | + @RequestParam(value = "studentType",required = false) Integer studentType, | |
| 106 | + @RequestParam(value = "sex",required = false) String sex, | |
| 107 | + @RequestParam(value = "deviceIds",required = false) String deviceIds){ | |
| 108 | + userOperateService.sendFaceByClassId(schoolId,classIds,deviceIds,sex,studentType); | |
| 99 | 109 | } |
| 100 | 110 | |
| 101 | 111 | @ApiOperation(value = "删除指定学校下无效人脸") |
| 102 | - @RequestMapping(value = "deleteFaceByClassId", method = RequestMethod.POST) | |
| 112 | + @RequestMapping(value = "deleteFaceByClassId", method = RequestMethod.GET) | |
| 103 | 113 | public void exportFace(@RequestParam("schoolId") Integer schoolId, |
| 104 | 114 | @RequestParam(value = "deviceIds",required = false) String deviceIds){ |
| 105 | 115 | userOperateService.deleteFaceByClassId(schoolId,deviceIds); |
| ... | ... | @@ -133,7 +143,7 @@ public class UserOperateController { |
| 133 | 143 | public void importExcel(@RequestParam("schoolId") Integer schoolId, |
| 134 | 144 | HttpServletRequest request, HttpServletResponse response){ |
| 135 | 145 | |
| 136 | - List<Map<String, Object>> sheetList = userOperateService.exportStudent(schoolId,"188368,188369,188370,188371"); | |
| 146 | + List<Map<String, Object>> sheetList = userOperateService.exportStudent(schoolId,"188368,188369,188370,188371",null,""); | |
| 137 | 147 | ExcelUtil2.exportExcelByEasyPoi(sheetList,"中意",request,response); |
| 138 | 148 | } |
| 139 | 149 | |
| ... | ... | @@ -144,18 +154,25 @@ public class UserOperateController { |
| 144 | 154 | } |
| 145 | 155 | |
| 146 | 156 | @ApiOperation(value = "下方指定卡号") |
| 147 | - @RequestMapping(value = "sendCard", method = RequestMethod.POST) | |
| 157 | + @RequestMapping(value = "sendCard", method = RequestMethod.GET) | |
| 148 | 158 | public void exportFace(@RequestParam("cardNum") String cardNum,@RequestParam("schoolId") Integer schoolId, |
| 149 | 159 | @RequestParam("deviceIds") String deviceIds){ |
| 150 | 160 | userOperateService.sendCard(cardNum,schoolId,deviceIds); |
| 151 | 161 | } |
| 152 | -// @ApiOperation(value = "按班级指定下发") | |
| 153 | -// @RequestMapping(value = "sendFaceByRoomId", method = RequestMethod.POST) | |
| 154 | -// public void exportFace(@RequestParam("schoolId") Integer schoolId, | |
| 155 | -// @RequestParam(value = "classIds",required = false) String classIds, | |
| 156 | -// @RequestParam(value = "deviceIds",required = false) String deviceIds){ | |
| 157 | -//// userOperateService.sendFaceByRoomId(schoolId,classIds,deviceIds); | |
| 158 | -// r | |
| 159 | -// } | |
| 160 | 162 | |
| 163 | + @ApiOperation(value = "按班级指定下发") | |
| 164 | + @RequestMapping(value = "sendFaceByRoomId", method = RequestMethod.GET) | |
| 165 | + public void exportFace(@RequestParam("schoolId") Integer schoolId, | |
| 166 | + @RequestParam("roomId") Integer roomId, | |
| 167 | + @RequestParam(value = "deviceIds",required = false) String deviceIds){ | |
| 168 | + userOperateService.sendFaceByRoomId(schoolId,roomId,deviceIds); | |
| 169 | + } | |
| 170 | + | |
| 171 | + @ApiOperation(value = "按关键字指定下发") | |
| 172 | + @RequestMapping(value = "sendFaceByKeyword", method = RequestMethod.GET) | |
| 173 | + public void sendFaceByKeyword(@RequestParam("schoolId") Integer schoolId, | |
| 174 | + @RequestParam("keyword") String keyword, | |
| 175 | + @RequestParam(value = "deviceIds",required = false) String deviceIds){ | |
| 176 | + userOperateService.sendFaceByKeyword(schoolId,keyword,deviceIds); | |
| 177 | + } | |
| 161 | 178 | } | ... | ... |
cloud/dahua/src/main/java/com/example/dahua/dao/UserDao.java
| ... | ... | @@ -282,10 +282,17 @@ public interface UserDao { |
| 282 | 282 | |
| 283 | 283 | List<String> queryStudentIdList(@Param("schoolId") Integer schoolId,@Param("roomId")Integer roomId); |
| 284 | 284 | |
| 285 | - List<StudentBean> getStudentByClassId(@Param("schoolId") int schoolId,@Param("classIds") List<Integer> classIds); | |
| 285 | + List<StudentBean> getStudentByClassId(@Param("schoolId") int schoolId,@Param("classIds") List<String> classIds, | |
| 286 | + @Param("studentType")Integer studentType,@Param("sexList") List<Integer> sexList); | |
| 287 | + | |
| 288 | + List<StudentBean> getStudentByKeyword(@Param("schoolId") int schoolId, @Param("keyword") String keyword); | |
| 286 | 289 | |
| 287 | 290 | List<Integer> getGroupByClassId(@Param("classId") Integer classId); |
| 288 | 291 | |
| 292 | + List<Integer> getRoomBySchoolId(@Param("schoolId") Integer schoolId,@Param("groupId") Integer groupId); | |
| 293 | + | |
| 294 | + List<StudentBean> getStudentByRoomIds(@Param("schoolId") Integer schoolId,@Param("pIdList") List<Integer> pIdList); | |
| 295 | + | |
| 289 | 296 | void insertStudent(ImportStudent studentBak); |
| 290 | 297 | |
| 291 | 298 | List<ImportStudent> selectYxStudentList(@Param("sceneName") String sceneName,@Param("schoolId") Integer schoolId); | ... | ... |
cloud/dahua/src/main/java/com/example/dahua/service/UserOperateService.java
| ... | ... | @@ -25,7 +25,11 @@ public interface UserOperateService { |
| 25 | 25 | * @param classIds |
| 26 | 26 | * @param deviceIds |
| 27 | 27 | */ |
| 28 | - void sendFaceByClassId(Integer schoolId,String classIds,String deviceIds); | |
| 28 | + void sendFaceByClassId(Integer schoolId,String classIds,String deviceIds,String sex,Integer studentType); | |
| 29 | + | |
| 30 | + void sendFaceByRoomId(Integer schoolId,Integer roomId,String deviceIds); | |
| 31 | + | |
| 32 | + void sendFaceByKeyword(Integer schoolId,String keyword,String deviceIds); | |
| 29 | 33 | |
| 30 | 34 | void deleteFaceByClassId(Integer schoolId,String deviceIds); |
| 31 | 35 | |
| ... | ... | @@ -42,5 +46,5 @@ public interface UserOperateService { |
| 42 | 46 | |
| 43 | 47 | void sendCard(String cardNum,Integer schoolId,String deviceIds); |
| 44 | 48 | |
| 45 | - List<Map<String, Object>> exportStudent(Integer schoolId, String deviceIds); | |
| 49 | + List<Map<String, Object>> exportStudent(Integer schoolId, String deviceIds,Integer studentType,String sex); | |
| 46 | 50 | } | ... | ... |
cloud/dahua/src/main/java/com/example/dahua/service/imp/BaseService.java
| ... | ... | @@ -9,6 +9,7 @@ import com.example.dahua.xiananDao.SendRecordDao; |
| 9 | 9 | import lombok.extern.slf4j.Slf4j; |
| 10 | 10 | import org.springframework.beans.factory.annotation.Autowired; |
| 11 | 11 | import org.springframework.stereotype.Service; |
| 12 | +import org.springframework.util.CollectionUtils; | |
| 12 | 13 | import org.springframework.util.StringUtils; |
| 13 | 14 | |
| 14 | 15 | import java.text.SimpleDateFormat; |
| ... | ... | @@ -132,15 +133,17 @@ public class BaseService { |
| 132 | 133 | } |
| 133 | 134 | } |
| 134 | 135 | |
| 135 | - public List<StudentBean> getStudentByClassId(Integer schoolId,String classIds) { | |
| 136 | - List<Integer> list = new ArrayList<>(); | |
| 136 | + public List<StudentBean> getStudentByClassId(Integer schoolId,String classIds,Integer studentType,String sex) { | |
| 137 | + List<String> classList = null; | |
| 137 | 138 | if(!StringUtils.isEmpty(classIds)){ |
| 138 | - String[] msg = classIds.split(","); | |
| 139 | - for(String s : msg){ | |
| 140 | - list.add(Integer.valueOf(s)); | |
| 141 | - } | |
| 139 | + classList = Arrays.asList(classIds.split(",")); | |
| 140 | + } | |
| 141 | + List<Integer> sexList = null; | |
| 142 | + if(org.apache.commons.lang3.StringUtils.isNotBlank(sex)){ | |
| 143 | + sexList = Arrays.asList(sex.split(",")) | |
| 144 | + .stream().map(Integer::parseInt).collect(Collectors.toList()); | |
| 142 | 145 | } |
| 143 | - List<StudentBean> students = userDao.getStudentByClassId(schoolId,list); | |
| 146 | + List<StudentBean> students = userDao.getStudentByClassId(schoolId,classList,studentType,sexList); | |
| 144 | 147 | //去重重复数据 |
| 145 | 148 | List<StudentBean> studentList = students.stream().collect(Collectors.collectingAndThen( |
| 146 | 149 | Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(StudentBean::getStudent_num))), ArrayList::new)); |
| ... | ... | @@ -176,4 +179,37 @@ public class BaseService { |
| 176 | 179 | Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(ImportStudent::getCardNum))), ArrayList::new)); |
| 177 | 180 | return teacherist; |
| 178 | 181 | } |
| 182 | + | |
| 183 | + /** | |
| 184 | + * 获取宿舍分组管理学生 | |
| 185 | + * @param schoolId | |
| 186 | + * @param roomId | |
| 187 | + * @return | |
| 188 | + */ | |
| 189 | + public List<StudentBean> getStudentListByRoomId(Integer schoolId,Integer roomId) { | |
| 190 | + List<Integer> rooms = userDao.getRoomBySchoolId(schoolId,roomId); | |
| 191 | + if(!CollectionUtils.isEmpty(rooms)) { | |
| 192 | + List<Integer> pIdlIst = rooms.stream().distinct().collect(Collectors.toList()); | |
| 193 | + List<StudentBean> studentBeans = userDao.getStudentByRoomIds(schoolId,pIdlIst); | |
| 194 | + //去重重复数据 | |
| 195 | + List<StudentBean> studentList = studentBeans.stream().collect(Collectors.collectingAndThen( | |
| 196 | + Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(StudentBean::getStudent_num))), ArrayList::new)); | |
| 197 | + return studentList; | |
| 198 | + } | |
| 199 | + return null; | |
| 200 | + } | |
| 201 | + | |
| 202 | + /** | |
| 203 | + * 根据班级关键字获取学生数据信息 | |
| 204 | + * @param schoolId | |
| 205 | + * @param keyword | |
| 206 | + * @return | |
| 207 | + */ | |
| 208 | + public List<StudentBean> getStudentByKeyword(Integer schoolId,String keyword) { | |
| 209 | + List<StudentBean> students = userDao.getStudentByKeyword(schoolId,keyword); | |
| 210 | + //去重重复数据 | |
| 211 | + List<StudentBean> studentList = students.stream().collect(Collectors.collectingAndThen( | |
| 212 | + Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(StudentBean::getStudent_num))), ArrayList::new)); | |
| 213 | + return studentList; | |
| 214 | + } | |
| 179 | 215 | } | ... | ... |
cloud/dahua/src/main/java/com/example/dahua/service/imp/UserOperateServiceImpl.java
| ... | ... | @@ -70,7 +70,7 @@ public class UserOperateServiceImpl implements UserOperateService { |
| 70 | 70 | |
| 71 | 71 | |
| 72 | 72 | @Override |
| 73 | - public void sendFaceByClassId(Integer schoolId,String classIds,String deviceIds) { | |
| 73 | + public void sendFaceByClassId(Integer schoolId,String classIds,String deviceIds,String sex,Integer studentType) { | |
| 74 | 74 | //下发设备集合 |
| 75 | 75 | List<String> deviceList = new ArrayList<>(); |
| 76 | 76 | if(StringUtils.isEmpty(deviceIds)){ |
| ... | ... | @@ -80,7 +80,39 @@ public class UserOperateServiceImpl implements UserOperateService { |
| 80 | 80 | deviceList= new ArrayList<>(Arrays.asList(deviceArr)); |
| 81 | 81 | } |
| 82 | 82 | //根据类型获取下发用户信息 |
| 83 | - List<StudentBean> studentBeanList = baseService.getStudentByClassId(schoolId,classIds); | |
| 83 | + List<StudentBean> studentBeanList = baseService.getStudentByClassId(schoolId,classIds,studentType,sex); | |
| 84 | + log.info("统计共有下发用户数量:{}",studentBeanList.size()); | |
| 85 | + //下發人臉 | |
| 86 | + sendFace(studentBeanList,deviceList,schoolId,2); | |
| 87 | + } | |
| 88 | + | |
| 89 | + @Override | |
| 90 | + public void sendFaceByRoomId(Integer schoolId,Integer roomId,String deviceIds) { | |
| 91 | + //下发设备集合 | |
| 92 | + List<String> deviceList = null; | |
| 93 | + if(StringUtils.isEmpty(deviceIds)){ | |
| 94 | + deviceList = userDao.selectDeviceBySchoolId(schoolId); | |
| 95 | + }else{ | |
| 96 | + deviceList= Arrays.asList( deviceIds.split(",")); | |
| 97 | + } | |
| 98 | + //根据类型获取下发用户信息 | |
| 99 | + List<StudentBean> studentBeanList = baseService.getStudentListByRoomId(schoolId,roomId); | |
| 100 | + log.info("统计共有下发用户数量:{}",studentBeanList.size()); | |
| 101 | + //下發人臉 | |
| 102 | + sendFace(studentBeanList,deviceList,schoolId,2); | |
| 103 | + } | |
| 104 | + | |
| 105 | + @Override | |
| 106 | + public void sendFaceByKeyword(Integer schoolId,String keyword,String deviceIds) { | |
| 107 | + //下发设备集合 | |
| 108 | + List<String> deviceList = null; | |
| 109 | + if(StringUtils.isEmpty(deviceIds)){ | |
| 110 | + deviceList = userDao.selectDeviceBySchoolId(schoolId); | |
| 111 | + }else{ | |
| 112 | + deviceList= Arrays.asList( deviceIds.split(",")); | |
| 113 | + } | |
| 114 | + //根据类型获取下发用户信息 | |
| 115 | + List<StudentBean> studentBeanList = baseService.getStudentByKeyword(schoolId,keyword); | |
| 84 | 116 | log.info("统计共有下发用户数量:{}",studentBeanList.size()); |
| 85 | 117 | //下發人臉 |
| 86 | 118 | sendFace(studentBeanList,deviceList,schoolId,2); |
| ... | ... | @@ -325,11 +357,11 @@ public class UserOperateServiceImpl implements UserOperateService { |
| 325 | 357 | |
| 326 | 358 | |
| 327 | 359 | @Override |
| 328 | - public List<Map<String, Object>> exportStudent(Integer schoolId,String classIds) { | |
| 360 | + public List<Map<String, Object>> exportStudent(Integer schoolId,String classIds,Integer studentType,String sex) { | |
| 329 | 361 | // 将sheet1、sheet2使用得map进行包装 |
| 330 | 362 | List<Map<String, Object>> sheetsList = new ArrayList<>(); |
| 331 | 363 | //根据类型获取下发用户信息 |
| 332 | - List<StudentBean> studentBeanList = baseService.getStudentByClassId(schoolId,classIds); | |
| 364 | + List<StudentBean> studentBeanList = baseService.getStudentByClassId(schoolId,classIds,studentType,sex); | |
| 333 | 365 | log.info("统计共有下发用户数量:{}",studentBeanList.size()); |
| 334 | 366 | |
| 335 | 367 | List<ExportStudentBean> studentBeans = studentBeanList.stream().map(s->{ | ... | ... |
cloud/dahua/src/main/resources/mapper/usermapper.xml
| ... | ... | @@ -49,8 +49,39 @@ |
| 49 | 49 | and StudentId in (select student_id from SZ_V_School_Student where school_id= #{schoolId}) order by newid() |
| 50 | 50 | </select> |
| 51 | 51 | |
| 52 | + <select id="getRoomBySchoolId" resultType="java.lang.Integer"> | |
| 53 | + select Id from ss_room where schoolId = #{schoolId} and pId = #{groupId} | |
| 54 | + </select> | |
| 55 | + | |
| 56 | + <select id="getStudentByRoomIds" resultType="com.example.dahua.bean.StudentBean"> | |
| 57 | + SELECT | |
| 58 | + ssu.* | |
| 59 | + from SS_RoomNumber ssr | |
| 60 | + LEFT JOIN SZ_V_School_Student ssu ON ssr.studentId = ssu.student_id | |
| 61 | + <where> | |
| 62 | + <if test="schoolId != null"> | |
| 63 | + and ssr.schoolId = #{schoolId} | |
| 64 | + </if> | |
| 65 | + <if test="pIdList != null and pIdList.size()>0"> | |
| 66 | + and ssr.Pid in | |
| 67 | + <foreach item="item" collection="pIdList" open="(" separator="," close=")" index=""> | |
| 68 | + #{item} | |
| 69 | + </foreach> | |
| 70 | + </if> | |
| 71 | + </where> | |
| 72 | + </select> | |
| 73 | + | |
| 52 | 74 | <select id="getStudentByClassId" resultType="com.example.dahua.bean.StudentBean"> |
| 53 | 75 | select * from SZ_V_School_Student where school_id = #{schoolId} |
| 76 | + <if test="studentType != null"> | |
| 77 | + and student_type = #{studentType} | |
| 78 | + </if> | |
| 79 | + <if test="sexList != null and sexList.size() >0"> | |
| 80 | + and sex in | |
| 81 | + <foreach item="item" collection="sexList" separator="," open="(" close=")" index=""> | |
| 82 | + #{item} | |
| 83 | + </foreach> | |
| 84 | + </if> | |
| 54 | 85 | <if test="classIds != null and classIds.size() >0"> |
| 55 | 86 | and class_id in |
| 56 | 87 | <foreach item="item" collection="classIds" separator="," open="(" close=")" index=""> |
| ... | ... | @@ -60,6 +91,14 @@ |
| 60 | 91 | and student_num != '' and photo !='' |
| 61 | 92 | </select> |
| 62 | 93 | |
| 94 | + <select id="getStudentByKeyword" resultType="com.example.dahua.bean.StudentBean"> | |
| 95 | + select * from SZ_V_School_Student where school_id = #{schoolId} | |
| 96 | + <if test="keyword != null and keyword !=''"> | |
| 97 | + and class_name like concat('%', #{keyword}, '%') | |
| 98 | + </if> | |
| 99 | + and student_num != '' and photo !='' | |
| 100 | + </select> | |
| 101 | + | |
| 63 | 102 | <select id="getGroupByClassId" resultType="java.lang.Integer"> |
| 64 | 103 | SELECT |
| 65 | 104 | Pid | ... | ... |
cloud/fIle-center/src/main/resources/application.yml
| 1 | 1 | #阿里云文件上传 |
| 2 | 2 | aliyun: |
| 3 | 3 | oss: |
| 4 | - access-key: QiuM3PwHTnVotcGy | |
| 5 | - accessKeySecret: Yqs7RlaC1MioZu2YYJ6u0TdeO13VFC | |
| 4 | + access-key: LTAI5t9bvWV4Rnu9CvWNRL6J | |
| 5 | + accessKeySecret: YGs4fH0BYTqMM26vXJ74lk3ce1Ha5A | |
| 6 | 6 | endpoint: http://oss-cn-hangzhou.aliyuncs.com |
| 7 | 7 | bucketName: szyundisk |
| 8 | 8 | domain: https://szyundisk.oss-cn-hangzhou.aliyuncs.com | ... | ... |
cloud/haikangface/src/main/java/com/sincere/haikangface/CMSServer.java
| ... | ... | @@ -37,10 +37,7 @@ import java.net.InetAddress; |
| 37 | 37 | import java.net.UnknownHostException; |
| 38 | 38 | import java.nio.ByteBuffer; |
| 39 | 39 | import java.text.SimpleDateFormat; |
| 40 | -import java.util.Date; | |
| 41 | -import java.util.HashMap; | |
| 42 | -import java.util.List; | |
| 43 | -import java.util.Map; | |
| 40 | +import java.util.*; | |
| 44 | 41 | import java.util.regex.Pattern; |
| 45 | 42 | |
| 46 | 43 | @Component |
| ... | ... | @@ -64,10 +61,10 @@ public class CMSServer implements ApplicationRunner { |
| 64 | 61 | // 存储设备登录句柄 |
| 65 | 62 | static Map<String, NativeLong> map = new HashMap<>(); |
| 66 | 63 | |
| 67 | - private String ip_cloud = "114.55.30.100"; | |
| 68 | - private String strPath = "E://EhomePicServer/"; | |
| 69 | -// private String ip_cloud = "120.26.116.253"; | |
| 70 | -// private String strPath = "D://EhomePicServer/"; | |
| 64 | +// private String ip_cloud = "114.55.30.100"; | |
| 65 | +// private String strPath = "E://EhomePicServer/"; | |
| 66 | + private String ip_cloud = "120.26.116.253"; | |
| 67 | + private String strPath = "D://EhomePicServer/"; | |
| 71 | 68 | |
| 72 | 69 | private String ip; |
| 73 | 70 | { |
| ... | ... | @@ -388,10 +385,8 @@ public class CMSServer implements ApplicationRunner { |
| 388 | 385 | saveFaceRecoder(deviceID, cardNo, time, picDataUrlId, currTemperature,outOrIn); |
| 389 | 386 | //944柯桥实验幼儿园,海康一体机考勤签到 |
| 390 | 387 | if(StringUtils.isNotBlank(schoolId)){ |
| 391 | - if(Integer.parseInt(schoolId)== 944){ | |
| 392 | - log.info("柯桥实验考勤:考勤卡号:{} "+ cardNo); | |
| 393 | - } | |
| 394 | - if(Integer.parseInt(schoolId)== 944 && !StringUtils.isEmpty(cardNo) && isNumeric(cardNo)){ | |
| 388 | + if((Objects.equals(schoolId,"1066") || Objects.equals(schoolId,"944") ) | |
| 389 | + && !StringUtils.isEmpty(cardNo) && isNumeric(cardNo)){ | |
| 395 | 390 | kaoQinRecord(outOrIn,cardNo,deviceID,time); |
| 396 | 391 | } |
| 397 | 392 | } |
| ... | ... | @@ -408,10 +403,8 @@ public class CMSServer implements ApplicationRunner { |
| 408 | 403 | saveFaceRecoder(deviceID, cardNo, time, picDataUrlId, currTemperature,outOrIn); |
| 409 | 404 | //944柯桥实验幼儿园,海康一体机考勤签到 |
| 410 | 405 | if(StringUtils.isNotBlank(schoolId)){ |
| 411 | - if(Integer.parseInt(schoolId)== 944){ | |
| 412 | - log.info("柯桥实验考勤:考勤卡号:{} "+ cardNo); | |
| 413 | - } | |
| 414 | - if(Integer.parseInt(schoolId)== 944 && !StringUtils.isEmpty(cardNo) && isNumeric(cardNo)){ | |
| 406 | + if((Objects.equals(schoolId,"1066") || Objects.equals(schoolId,"944") ) | |
| 407 | + && !StringUtils.isEmpty(cardNo) && isNumeric(cardNo)){ | |
| 415 | 408 | kaoQinRecord(outOrIn,cardNo,deviceID,time); |
| 416 | 409 | } |
| 417 | 410 | } |
| ... | ... | @@ -421,10 +414,8 @@ public class CMSServer implements ApplicationRunner { |
| 421 | 414 | saveFaceRecoder(deviceID, cardNo, time, picDataUrlId, currTemperature,outOrIn); |
| 422 | 415 | //944柯桥实验幼儿园,海康一体机考勤签到 |
| 423 | 416 | if(StringUtils.isNotBlank(schoolId)){ |
| 424 | - if(Integer.parseInt(schoolId)== 944){ | |
| 425 | - log.info("柯桥实验考勤:考勤卡号:{} "+ cardNo); | |
| 426 | - } | |
| 427 | - if(Integer.parseInt(schoolId)== 944 && !StringUtils.isEmpty(cardNo) && isNumeric(cardNo)){ | |
| 417 | + if((Objects.equals(schoolId,"1066") || Objects.equals(schoolId,"944") ) | |
| 418 | + && !StringUtils.isEmpty(cardNo) && isNumeric(cardNo)){ | |
| 428 | 419 | kaoQinRecord(outOrIn,cardNo,deviceID,time); |
| 429 | 420 | } |
| 430 | 421 | } |
| ... | ... | @@ -456,9 +447,9 @@ public class CMSServer implements ApplicationRunner { |
| 456 | 447 | checkIn.setCheckTime(eventTime); |
| 457 | 448 | sendRecordDao.checkIn(checkIn); |
| 458 | 449 | if (checkIn.getIsSuccess() == 1) { |
| 459 | - log.info("柯桥实验幼儿园考勤成功: checkIn: {}, 方向:{}", JsonUtils.nonDefaultMapper().toJson(checkIn),outOrIn == 1 ? "门" : "出门"); | |
| 450 | + log.info("考勤成功: checkIn: {}, 方向:{}",JSON.toJSONString(checkIn),outOrIn == 1 ? "门" : "出门"); | |
| 460 | 451 | } else { |
| 461 | - log.info("柯桥实验幼儿园考勤失败: checkIn: {}, 方向:{}",JsonUtils.nonDefaultMapper().toJson(checkIn),outOrIn == 1 ? "进门" : "出门"); | |
| 452 | + log.info("考勤失败: checkIn: {}, 方向:{}",JSON.toJSONString(checkIn),outOrIn == 1 ? "进门" : "出门"); | |
| 462 | 453 | } |
| 463 | 454 | } |
| 464 | 455 | ... | ... |
cloud/haikangface/src/main/java/com/sincere/haikangface/control/UserOperateController.java
| ... | ... | @@ -100,7 +100,8 @@ public class UserOperateController { |
| 100 | 100 | |
| 101 | 101 | @ApiOperation(value = "下发未下发的人脸至指定设备2.0") |
| 102 | 102 | @RequestMapping(value = "sendFaceForNoSend", method = RequestMethod.POST) |
| 103 | - public Result sendFaceForNoSend(@RequestParam("schoolId") Integer schoolId,@RequestParam("userType") Integer userType, | |
| 103 | + public Result sendFaceForNoSend(@RequestParam("schoolId") Integer schoolId, | |
| 104 | + @RequestParam("userType") Integer userType, | |
| 104 | 105 | @RequestParam(value = "studentType",required = false) Integer studentType, |
| 105 | 106 | @RequestParam(value = "sex",required = false) String sex, |
| 106 | 107 | @RequestParam(value = "deviceIds",required = false) String deviceIds, |
| ... | ... | @@ -153,6 +154,14 @@ public class UserOperateController { |
| 153 | 154 | return userOperateService.sendFaceByKeyword(schoolId,deviceIds,keyword,studentType,sex,isCheck); |
| 154 | 155 | } |
| 155 | 156 | |
| 157 | + @ApiOperation(value = "指定班级下发未下发人脸") | |
| 158 | + @RequestMapping(value = "noSendByKeyword", method = RequestMethod.POST) | |
| 159 | + public Result noSendByKeyword(@RequestParam("schoolId") Integer schoolId, | |
| 160 | + @RequestParam(value = "keyword",required = false) String keyword, | |
| 161 | + @RequestParam(value = "deviceIds",required = false) String deviceIds) { | |
| 162 | + return userOperateService.noSendByKeyword(schoolId,keyword,deviceIds); | |
| 163 | + } | |
| 164 | + | |
| 156 | 165 | @ApiOperation(value = "根据宿舍分组下发") |
| 157 | 166 | @RequestMapping(value = "sendFaceByRoomId", method = RequestMethod.POST) |
| 158 | 167 | public Result sendFaceByRoomId(@RequestParam("schoolId") Integer schoolId, | ... | ... |
cloud/haikangface/src/main/java/com/sincere/haikangface/service/UserOperateService.java
| ... | ... | @@ -143,6 +143,15 @@ public interface UserOperateService { |
| 143 | 143 | */ |
| 144 | 144 | Result sendFaceByKeyword(Integer schoolId,String deviceIds,String keyword,Integer studentType,String sex,Integer isCheck); |
| 145 | 145 | |
| 146 | + Result noSendByKeyword(Integer schoolId,String keyword,String deviceIds); | |
| 147 | + | |
| 148 | + /** | |
| 149 | + * 根据寝室号下发人脸 | |
| 150 | + * @param schoolId | |
| 151 | + * @param groupId | |
| 152 | + * @param deviceIds | |
| 153 | + * @return | |
| 154 | + */ | |
| 146 | 155 | Result sendFaceByRoomId(Integer schoolId,Integer groupId,String deviceIds); |
| 147 | 156 | |
| 148 | 157 | /** | ... | ... |
cloud/haikangface/src/main/java/com/sincere/haikangface/service/impl/UserOperateServiceImpl.java
| ... | ... | @@ -641,7 +641,6 @@ public class UserOperateServiceImpl implements UserOperateService { |
| 641 | 641 | log.warn("该学校下未查询到下发设备"); |
| 642 | 642 | return ResultGenerator.genFailResult("该学校下未查询到下发设备"); |
| 643 | 643 | } |
| 644 | - | |
| 645 | 644 | //下发用户集合 |
| 646 | 645 | List<StudentBean> list = null; |
| 647 | 646 | if (userType == EnumSzBusinessType.EnumUserType.STUDENT.code && groupId ==null) { |
| ... | ... | @@ -667,7 +666,6 @@ public class UserOperateServiceImpl implements UserOperateService { |
| 667 | 666 | return ResultGenerator.genSuccessResult(objectMapper.toJson(map)); |
| 668 | 667 | } |
| 669 | 668 | |
| 670 | - | |
| 671 | 669 | @Async |
| 672 | 670 | public void sendFaceForNoSend(Integer schoolId,Integer userType,List<StudentBean> studentList,List<String> deviceIds){ |
| 673 | 671 | log.info("统计共有:"+studentList.size()+"张卡,"+deviceIds.size()+"台设备." ); |
| ... | ... | @@ -1071,7 +1069,28 @@ public class UserOperateServiceImpl implements UserOperateService { |
| 1071 | 1069 | return ResultGenerator.genSuccessResult(objectMapper.toJson(map)); |
| 1072 | 1070 | } |
| 1073 | 1071 | |
| 1072 | + @Override | |
| 1073 | + public Result noSendByKeyword(Integer schoolId,String keyword,String deviceIds) { | |
| 1074 | + //下发设备集合 | |
| 1075 | + List<String> deviceList = Arrays.asList(deviceIds.split(",")); | |
| 1076 | + //根据类型获取下发用户信息 | |
| 1077 | + List<StudentBean> studentBeanList = baseService.getStudentByKeyword(schoolId,keyword,null,null); | |
| 1078 | + | |
| 1079 | + //异步执行下发 | |
| 1080 | + sendFaceForNoSend(schoolId,2,studentBeanList,deviceList); | |
| 1074 | 1081 | |
| 1082 | + int fileSize = studentBeanList.size(); | |
| 1083 | + int clintNum = deviceList.size(); | |
| 1084 | + //下发所用时长 | |
| 1085 | + int timeLength = new Double(clintNum * fileSize * 0.06).intValue(); | |
| 1086 | + //下发截止时间 | |
| 1087 | + String dateStr = baseService.getTime(fileSize,clintNum,timeLength); | |
| 1088 | + Map map = new HashMap(); | |
| 1089 | + map.put("timeLength",timeLength); | |
| 1090 | + map.put("afterDate",dateStr); | |
| 1091 | + map.put("fileSize",fileSize); | |
| 1092 | + return ResultGenerator.genSuccessResult(objectMapper.toJson(map)); | |
| 1093 | + } | |
| 1075 | 1094 | |
| 1076 | 1095 | @Override |
| 1077 | 1096 | public Result sendFaceByRoomId(Integer schoolId,Integer roomId,String deviceIds) { |
| ... | ... | @@ -1090,7 +1109,7 @@ public class UserOperateServiceImpl implements UserOperateService { |
| 1090 | 1109 | Integer clintType = userDao.getClintTypeByDeviceId(deviceList.get(0)); |
| 1091 | 1110 | // if(clintType.intValue()== 22 || clintType.intValue()== 29){ |
| 1092 | 1111 | // //发送大华设备 |
| 1093 | -// HttpUtil.uploadDHImgByClassId(String.valueOf(schoolId),deviceIds); | |
| 1112 | +// HttpUtil.uploadDHImgByClassId(String.valueOf(schoolId),deviceIds,roomId); | |
| 1094 | 1113 | // } |
| 1095 | 1114 | if(clintType.intValue()== 18 || clintType.intValue()== 28){ |
| 1096 | 1115 | //发送海康设备:异步执行 | ... | ... |
cloud/haikangface/src/main/resources/application.yaml
| ... | ... | @@ -31,6 +31,22 @@ spring: |
| 31 | 31 | username: szjxtuser |
| 32 | 32 | password: RQminVCJota3H1u8bBYH |
| 33 | 33 | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| 34 | + hikari: | |
| 35 | + #连接池名 | |
| 36 | + pool-name: SzDateHikari | |
| 37 | + #最小空闲连接数 | |
| 38 | + minimum-idle: 20 | |
| 39 | + # 空闲连接存活最大时间,默认600000(10分钟) | |
| 40 | + idle-timeout: 180000 | |
| 41 | + # 连接池最大连接数,默认是10 | |
| 42 | + maximum-pool-size: 200 | |
| 43 | + # 此属性控制从池返回的连接的默认自动提交行为,默认值:true | |
| 44 | + auto-commit: true | |
| 45 | + # 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟 | |
| 46 | + max-lifetime: 1800000 | |
| 47 | + # 数据库连接超时时间,默认30秒,即30000 | |
| 48 | + connection-timeout: 30000 | |
| 49 | + connection-test-query: SELECT 1 | |
| 34 | 50 | # resources: |
| 35 | 51 | # static-locations: classpath:/META-INF/resources/,classpath:/resources/, classpath:/static/, classpath:/public/, file:C:/EhomePicServer/ |
| 36 | 52 | ... | ... |
cloud/haikangface/src/main/resources/mapper/usermapper.xml
| ... | ... | @@ -117,7 +117,7 @@ |
| 117 | 117 | </foreach> |
| 118 | 118 | </if> |
| 119 | 119 | <if test="keyword != null and keyword !=''"> |
| 120 | - and class_name concat('%', #{keyword}, '%') | |
| 120 | + and class_name like concat('%', #{keyword}, '%') | |
| 121 | 121 | </if> |
| 122 | 122 | and student_num != '' and photo !='' |
| 123 | 123 | </select> | ... | ... |
cloud/quartz/src/main/resources/application.yaml
| ... | ... | @@ -4,26 +4,23 @@ server: |
| 4 | 4 | spring: |
| 5 | 5 | application: |
| 6 | 6 | name: quartz-server |
| 7 | + datasource: | |
| 8 | + master: ## 查询 | |
| 9 | + username: szjxtuser | |
| 10 | + password: RQminVCJota3H1u8bBYH | |
| 11 | + jdbc-url: jdbc:sqlserver://116.62.155.137:33419;database=SmartAdmin | |
| 12 | + driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver | |
| 13 | + slave: ## 短信 | |
| 14 | + username: sa | |
| 15 | + password: qaz!@#0401 | |
| 16 | + jdbc-url: jdbc:sqlserver://60.190.202.38:49469;database=XST | |
| 17 | + driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver | |
| 18 | + yxy: ## 翼学云 | |
| 19 | + username: szyxt | |
| 20 | + password: QWer123$%^ | |
| 21 | + jdbc-url: jdbc:sqlserver://47.110.50.251:33419;database=SZYXT | |
| 22 | + driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver | |
| 7 | 23 | |
| 8 | -datasource: | |
| 9 | - master: ## 查询 | |
| 10 | - username: szjxtuser | |
| 11 | - password: RQminVCJota3H1u8bBYH | |
| 12 | - jdbcUrl: jdbc:sqlserver://116.62.155.137:33419;database=SmartAdmin | |
| 13 | - driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver | |
| 14 | - slave: ## 短信 | |
| 15 | - username: sa | |
| 16 | - password: qaz!@#0401 | |
| 17 | - jdbcUrl: jdbc:sqlserver://60.190.202.38:49469;database=XST | |
| 18 | - driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver | |
| 19 | - yxy: ## 翼学云 | |
| 20 | - username: szyxt | |
| 21 | - password: QWer123$%^ | |
| 22 | - jdbcUrl: jdbc:sqlserver://47.110.50.251:33419;database=SZYXT | |
| 23 | -# username: SZJXTUSER | |
| 24 | -# password: xst200919 | |
| 25 | -# jdbcUrl: jdbc:sqlserver://60.190.202.57:14333;database=SZYXT | |
| 26 | - driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver | |
| 27 | 24 | ##mybatis |
| 28 | 25 | mybatis: |
| 29 | 26 | mapper-locations: classpath:mapper/*.xml |
| ... | ... | @@ -32,12 +29,12 @@ mybatis: |
| 32 | 29 | ribbon: |
| 33 | 30 | ReadTimeout: 50000 |
| 34 | 31 | ConnectTimeout: 5000 |
| 35 | -#eureka: | |
| 36 | -# instance: | |
| 37 | -# hostname: localhost | |
| 38 | -# lease-expiration-duration-in-seconds: 60 | |
| 39 | -# lease-renewal-interval-in-seconds: 10 | |
| 40 | -# client: | |
| 41 | -# service-url: | |
| 42 | -# defaultZone: http://121.40.109.21:8761/eureka/,http://121.40.109.21:8762/eureka/ | |
| 32 | +eureka: | |
| 33 | + instance: | |
| 34 | + hostname: localhost | |
| 35 | + lease-expiration-duration-in-seconds: 60 | |
| 36 | + lease-renewal-interval-in-seconds: 10 | |
| 37 | + client: | |
| 38 | + service-url: | |
| 39 | + defaultZone: http://localhost:8761/eureka/,http://localhost:8762/eureka/ | |
| 43 | 40 | ... | ... |