Browse Source

Merge remote-tracking branch 'origin/dev' into dev

fanxp 1 year ago
parent
commit
eef94afd4b
21 changed files with 397 additions and 57 deletions
  1. 1 1
      src/main/java/com/xjrsoft/module/attendance/controller/StudentStatisticsController.java
  2. 31 3
      src/main/java/com/xjrsoft/module/hikvision/util/DataUtil.java
  3. 24 8
      src/main/java/com/xjrsoft/module/job/AttenDanceWarnNoticeTask.java
  4. 48 34
      src/main/java/com/xjrsoft/module/job/AttendanceMessageTask.java
  5. 0 3
      src/main/java/com/xjrsoft/module/job/HikvisionBaseDataTask.java
  6. 1 1
      src/main/java/com/xjrsoft/module/job/InsertOutInRecordTask.java
  7. 9 0
      src/main/java/com/xjrsoft/module/organization/controller/UserController.java
  8. 1 1
      src/main/java/com/xjrsoft/module/personnel/controller/StundentFaceProcessController.java
  9. 1 1
      src/main/java/com/xjrsoft/module/personnel/controller/TeacherFaceProcessController.java
  10. 4 0
      src/main/java/com/xjrsoft/module/personnel/service/IStundentFaceProcessService.java
  11. 4 0
      src/main/java/com/xjrsoft/module/personnel/service/ITeacherFaceProcessService.java
  12. 48 0
      src/main/java/com/xjrsoft/module/personnel/service/impl/StundentFaceProcessServiceImpl.java
  13. 47 0
      src/main/java/com/xjrsoft/module/personnel/service/impl/TeacherFaceProcessServiceImpl.java
  14. 4 0
      src/main/java/com/xjrsoft/module/student/controller/StudentManagerController.java
  15. 4 0
      src/main/java/com/xjrsoft/module/teacher/controller/TeacherbaseManagerController.java
  16. 1 0
      src/main/java/com/xjrsoft/module/workflow/service/IWorkflowExecuteService.java
  17. 9 0
      src/main/java/com/xjrsoft/module/workflow/service/impl/WorkflowExecuteServiceImpl.java
  18. 5 5
      src/main/resources/mapper/base/WhitelistManagement.xml
  19. 16 0
      src/main/resources/sqlScript/20240531_sql.sql
  20. 123 0
      src/main/resources/sqlScript/20240604_sql.sql
  21. 16 0
      src/main/resources/sqlScript/20240618_sql.sql

+ 1 - 1
src/main/java/com/xjrsoft/module/attendance/controller/StudentStatisticsController.java

@@ -327,7 +327,7 @@ public class StudentStatisticsController {
                 }
                 record.setLeaveCount(allLeaveCount);
 
-                Set<Long> collect = notStayMap.get(record.getId()).stream().map(StudentOutInRecordVo::getUserId).collect(Collectors.toSet());
+                List<Long> collect = notStayMap.get(record.getId()).stream().map(StudentOutInRecordVo::getUserId).collect(Collectors.toList());
 
                 record.setActualCount(collect.size());
                 record.setStudentCount(record.getStudentCount() * dayOfWeeks.size() * 3);

+ 31 - 3
src/main/java/com/xjrsoft/module/hikvision/util/DataUtil.java

@@ -1,5 +1,6 @@
 package com.xjrsoft.module.hikvision.util;
 
+import cn.hutool.db.Entity;
 import com.google.gson.JsonArray;
 import com.google.gson.JsonElement;
 import com.google.gson.JsonObject;
@@ -12,7 +13,6 @@ import com.xjrsoft.module.hikvision.mapper.HikvisionDataMapper;
 import com.xjrsoft.module.organization.entity.Department;
 import com.xjrsoft.module.personnel.entity.CarMessageApply;
 import com.xjrsoft.module.system.entity.DictionaryDetail;
-import com.xjrsoft.module.teacher.mapper.FaceImportMapper;
 import lombok.extern.slf4j.Slf4j;
 import lombok.var;
 
@@ -287,8 +287,9 @@ public class DataUtil {
             paramJson.addProperty("birthday", objectMap.get("birthday")==null?"":objectMap.get("birthday").toString());
             paramJson.addProperty("personType", 2);
 
-            int gender;
-            switch (objectMap.get("gender").toString()) {
+            int gender = 0;
+            String genderData = objectMap.get("gender") == null ? "" : objectMap.get("gender").toString();
+            switch (genderData) {
                 case "SB10001":
                     gender = 1;
                     break;
@@ -573,4 +574,31 @@ public class DataUtil {
 //        }
 //        db.executeBatch(sqls);
 //    };
+
+    /**
+     * 根据用用户id,删除海康人员信息
+     * @param userIds
+     */
+    public void deletePerson(List<Long> userIds){
+        String tableName = "hikvision_data";
+        Entity where = Entity.create(tableName);
+        where.set("source_id", userIds);
+
+        List<Map<String, Object>> maps = SqlRunnerAdapter.db().dynamicSelect(tableName, where);
+        if(maps.isEmpty()){
+            return;
+        }
+        String apiPath = "/api/resource/v1/person/batch/delete";
+        JsonArray personIds = new JsonArray();
+
+        for (Map<String, Object> map : maps) {
+            personIds.add(map.get("hikvision_id").toString());
+        }
+        ApiUtil apiUtil = new ApiUtil();
+
+        JsonObject param = new JsonObject();
+        param.add("personIds", personIds);
+        String result = apiUtil.doPost(apiPath, param.toString(), null);
+        log.info("海康人员删除:param:" + param + ",result:" + result);
+    }
 }

+ 24 - 8
src/main/java/com/xjrsoft/module/job/AttenDanceWarnNoticeTask.java

@@ -59,7 +59,7 @@ public class AttenDanceWarnNoticeTask {
     @Autowired
     private IWechatMessageLogService wechatMessageLogService;
 
-    @Scheduled(cron = "0 */5 * * * ?")
+    @Scheduled(cron = "0 */1 * * * ?")
     public void RefreshConnectionPool() {
         String active = SpringUtil.getActiveProfile();
         if("dev".equals(active)){
@@ -101,7 +101,7 @@ public class AttenDanceWarnNoticeTask {
 
         //获取最近的时间
         LocalDateTime recentlyTime = getRecentlyTime(ruleDetailsList, now);
-        if(recentlyTime.getHour() != now.getHour() && Math.abs(recentlyTime.getMinute() - now.getMinute()) <= 2){
+        if(recentlyTime.getHour() != now.getHour() && Math.abs(recentlyTime.getMinute() - now.getMinute()) >= 2){
             log.info("未到时间,不进行推送");
             return;
         }
@@ -249,19 +249,35 @@ public class AttenDanceWarnNoticeTask {
                     && ruleDetail.getIsAttendance() != null && ruleDetail.getIsAttendance() == 1){
                 if(ruleDetail.getAmStartTime() != null){
                     LocalDateTime amStartTime = now.with(ruleDetail.getAmStartTime().toLocalTime());
-                    result.add(amStartTime.plusMinutes(- ruleDetail.getAgoMinutes()));
-                    result.add(amStartTime.plusMinutes(ruleDetail.getOverMinutes()));
+                    if(ruleDetail.getAgoMinutes() != null){
+                        result.add(amStartTime.plusMinutes(- ruleDetail.getAgoMinutes()));
+                    }
+
+                    if(ruleDetail.getOverMinutes() != null){
+                        result.add(amStartTime.plusMinutes(ruleDetail.getOverMinutes()));
+                    }
+
                 }
                 if(ruleDetail.getPmStartTime() != null){
                     LocalDateTime pmStartTime = now.with(ruleDetail.getPmStartTime().toLocalTime());
-                    result.add(pmStartTime.plusMinutes(- ruleDetail.getAgoMinutes()));
-                    result.add(pmStartTime.plusMinutes(ruleDetail.getOverMinutes()));
+                    if(ruleDetail.getAgoMinutes() != null){
+                        result.add(pmStartTime.plusMinutes(- ruleDetail.getAgoMinutes()));
+                    }
+
+                    if(ruleDetail.getOverMinutes() != null){
+                        result.add(pmStartTime.plusMinutes(ruleDetail.getOverMinutes()));
+                    }
                 }
 
                 if(ruleDetail.getEveningStartTime() != null){
                     LocalDateTime eveningStartTime = now.with(ruleDetail.getEveningStartTime().toLocalTime());
-                    result.add(eveningStartTime.plusMinutes(- ruleDetail.getAgoMinutes()));
-                    result.add(eveningStartTime.plusMinutes(ruleDetail.getOverMinutes()));
+                    if(ruleDetail.getAgoMinutes() != null){
+                        result.add(eveningStartTime.plusMinutes(- ruleDetail.getAgoMinutes()));
+                    }
+
+                    if(ruleDetail.getOverMinutes() != null){
+                        result.add(eveningStartTime.plusMinutes(ruleDetail.getOverMinutes()));
+                    }
                 }
             }
         }

+ 48 - 34
src/main/java/com/xjrsoft/module/job/AttendanceMessageTask.java

@@ -106,19 +106,6 @@ public class AttendanceMessageTask {
         }
         //查询今天的考勤规则
         List<AttendanceRuleDetails> ruleDetails = ruleCategoryService.getTodayRules();
-
-
-//        WechatMessageLog log = wechatMessageLogService.getOne(
-//                new QueryWrapper<WechatMessageLog>().lambda()
-//                        .select(WechatMessageLog.class, x -> VoToColumnUtil.fieldsToColumns(WechatMessageLog.class).contains(x.getProperty()))
-//                        .eq(WechatMessageLog::getSendTime, recentlyTime)
-//                        .eq(WechatMessageLog::getTemplateId, wechatTemplate)
-//        );
-//        if(log != null){//已经推送过,不再进行推送
-//            return;
-//        }
-
-
         List<AttendanceMessageSet> list = messageSetService.list();
         //判断是上午还是下午
         Integer timePeriod = null;
@@ -142,16 +129,6 @@ public class AttendanceMessageTask {
         //查询需要通知的人
 
         for (AttendanceMessageSet messageSet : list) {
-            List<XjrUser> userList = userService.list(
-                new MPJLambdaWrapper<XjrUser>().distinct()
-                .select(XjrUser::getId)
-                .select(XjrUser.class, x -> VoToColumnUtil.fieldsToColumns(XjrUser.class).contains(x.getProperty()))
-                .leftJoin(UserRoleRelation.class, UserRoleRelation::getUserId, XjrUser::getId)
-                .leftJoin(AttendanceMessageUserRelation.class, AttendanceMessageUserRelation::getUserId, XjrUser::getId)
-                .in(UserRoleRelation::getRoleId, roleTypes)
-                .eq(AttendanceMessageUserRelation::getAttendanceMessageSetId, messageSet.getId())
-            );
-
             LocalDateTime recentlyTime = null;
             String characterKey = "character_string18";
             String wechatTemplate = weChatUtil.getAttendanceMsgLateTemplate();
@@ -160,16 +137,34 @@ public class AttendanceMessageTask {
                 characterKey = "character_string18";
                 //获取最近的时间
                 recentlyTime = getRecentlyTime(ruleDetails, now);
-                if(!recentlyTime.isEqual(now)){
-                    log.info("未到时间,不需要提醒");
+                if(recentlyTime.getHour() != now.getHour() && Math.abs(recentlyTime.getMinute() - now.getMinute()) >= 2){
+                    log.info("未到时间,不进行推送");
+                    continue;
+                }
+                long count = wechatMessageLogService.count(
+                        new QueryWrapper<WechatMessageLog>().lambda()
+                                .eq(WechatMessageLog::getSendTime, recentlyTime)
+                                .eq(WechatMessageLog::getTemplateId, wechatTemplate)
+                );
+                if(count > 0){//已经推送过,不再进行推送
+                    log.info("已推送过,不进行推送");
                     continue;
                 }
             }else if(messageSet.getMessageCategory() != null && messageSet.getMessageCategory() == 3){
                 wechatTemplate = weChatUtil.getAttendanceMsgAbsenceTemplate();
                 recentlyTime = getRecentlyOverTime(ruleDetails, now);
                 characterKey = "character_string36";
-                if(!recentlyTime.isEqual(now)){
-                    log.info("未到时间,不需要提醒");
+                if(recentlyTime.getHour() != now.getHour() && Math.abs(recentlyTime.getMinute() - now.getMinute()) >= 2){
+                    log.info("未到时间,不进行推送");
+                    continue;
+                }
+                long count = wechatMessageLogService.count(
+                        new QueryWrapper<WechatMessageLog>().lambda()
+                                .eq(WechatMessageLog::getSendTime, recentlyTime)
+                                .eq(WechatMessageLog::getTemplateId, wechatTemplate)
+                );
+                if(count > 0){//已经推送过,不再进行推送
+                    log.info("已推送过,不进行推送");
                     continue;
                 }
             }
@@ -178,6 +173,16 @@ public class AttendanceMessageTask {
                 continue;
             }
 
+            List<XjrUser> userList = userService.list(
+                    new MPJLambdaWrapper<XjrUser>().distinct()
+                            .select(XjrUser::getId)
+                            .select(XjrUser.class, x -> VoToColumnUtil.fieldsToColumns(XjrUser.class).contains(x.getProperty()))
+                            .leftJoin(UserRoleRelation.class, UserRoleRelation::getUserId, XjrUser::getId)
+                            .leftJoin(AttendanceMessageUserRelation.class, AttendanceMessageUserRelation::getUserId, XjrUser::getId)
+                            .in(UserRoleRelation::getRoleId, roleTypes)
+                            .eq(AttendanceMessageUserRelation::getAttendanceMessageSetId, messageSet.getId())
+            );
+
             //没有需要通知的,直接跳过
             if(userList.isEmpty()){
                 continue;
@@ -189,7 +194,7 @@ public class AttendanceMessageTask {
             String format = recentlyTime.format(formatter);
 
             userCount += userList.size();
-            if(messageSet.getRoleType() != null && messageSet.getRoleType() == 2){
+            if(messageSet.getRoleType() != null && messageSet.getRoleType() == 1){
                 //教师总人数
                 long teacherCout = userService.count(
                         new MPJLambdaWrapper<XjrUser>()
@@ -235,9 +240,9 @@ public class AttendanceMessageTask {
                 for (XjrUser xjrUser : userList) {
                     weChatSendMessageDto.setMsgId(IdUtil.getSnowflakeNextId() + "");
                     weChatSendMessageDto.setUserId(xjrUser.getOpenId());
-                    weChatService.sendTemplateMessage(weChatSendMessageDto);
+//                    weChatService.sendTemplateMessage(weChatSendMessageDto);
                 }
-            }else if(messageSet.getRoleType() != null && messageSet.getRoleType() == 3){
+            }else if(messageSet.getRoleType() != null && messageSet.getRoleType() == 2){
                 //教师总人数
                 long teacherCout = userService.count(
                         new MPJLambdaWrapper<XjrUser>()
@@ -280,7 +285,7 @@ public class AttendanceMessageTask {
                 for (XjrUser xjrUser : userList) {
                     weChatSendMessageDto.setMsgId(IdUtil.getSnowflakeNextId() + "");
                     weChatSendMessageDto.setUserId(xjrUser.getOpenId());
-                    weChatService.sendTemplateMessage(weChatSendMessageDto);
+//                    weChatService.sendTemplateMessage(weChatSendMessageDto);
                 }
             }
 
@@ -334,16 +339,25 @@ public class AttendanceMessageTask {
             if(ruleDetail.getIsAllowInOutSchool() != null && ruleDetail.getIsAllowInOutSchool() == 1
                     && ruleDetail.getIsAttendance() != null && ruleDetail.getIsAttendance() == 1){
                 if(ruleDetail.getAmStartTime() != null){
-                    LocalDateTime amStartTime = now.with(ruleDetail.getAmStartTime().toLocalTime()).plusMinutes(ruleDetail.getOverMinutes());
+                    LocalDateTime amStartTime = now.with(ruleDetail.getAmStartTime().toLocalTime());
+                    if(ruleDetail.getOverMinutes() != null){
+                        amStartTime.plusMinutes(ruleDetail.getOverMinutes());
+                    }
                     result.add(amStartTime);
                 }
                 if(ruleDetail.getPmStartTime() != null){
-                    LocalDateTime pmStartTime = now.with(ruleDetail.getPmStartTime().toLocalTime()).plusMinutes(ruleDetail.getOverMinutes());
+                    LocalDateTime pmStartTime = now.with(ruleDetail.getPmStartTime().toLocalTime());
+                    if(ruleDetail.getOverMinutes() != null){
+                        pmStartTime.plusMinutes(ruleDetail.getOverMinutes());
+                    }
                     result.add(pmStartTime);
                 }
 
                 if(ruleDetail.getEveningStartTime() != null){
-                    LocalDateTime eveningStartTime = now.with(ruleDetail.getEveningStartTime().toLocalTime()).plusMinutes(ruleDetail.getOverMinutes());
+                    LocalDateTime eveningStartTime = now.with(ruleDetail.getEveningStartTime().toLocalTime());
+                    if(ruleDetail.getOverMinutes() != null){
+                        eveningStartTime.plusMinutes(ruleDetail.getOverMinutes());
+                    }
                     result.add(eveningStartTime);
                 }
             }

+ 0 - 3
src/main/java/com/xjrsoft/module/job/HikvisionBaseDataTask.java

@@ -6,7 +6,6 @@ import com.xjrsoft.common.utils.SqlRunnerAdapterUtil;
 import com.xjrsoft.module.hikvision.entity.HikvisionData;
 import com.xjrsoft.module.hikvision.mapper.HikvisionDataMapper;
 import com.xjrsoft.module.hikvision.util.DataUtil;
-import com.xjrsoft.module.teacher.mapper.FaceImportMapper;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Scheduled;
@@ -25,8 +24,6 @@ import java.util.Set;
 @Component
 @Slf4j
 public class HikvisionBaseDataTask {
-    @Autowired
-    private FaceImportMapper faceImportMapper;
 
     @Autowired
     private HikvisionDataMapper hikvisionDataMapper;

+ 1 - 1
src/main/java/com/xjrsoft/module/job/InsertOutInRecordTask.java

@@ -20,7 +20,7 @@ public class InsertOutInRecordTask {
 
     OutInRecordUtil out_in_recordUtil = new OutInRecordUtil();
 
-    @Scheduled(cron = "*/60 * * * * ?")
+    @Scheduled(cron = "* */60 * * * ?")
     public void RefreshConnectionPool() {
         String active = SpringUtil.getActiveProfile();
         if(!"prod".equals(active)){

+ 9 - 0
src/main/java/com/xjrsoft/module/organization/controller/UserController.java

@@ -33,6 +33,7 @@ import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.entity.BaseGrade;
 import com.xjrsoft.module.base.service.IBaseClassService;
 import com.xjrsoft.module.base.service.IBaseGradeService;
+import com.xjrsoft.module.hikvision.util.DataUtil;
 import com.xjrsoft.module.organization.dto.AddUserDto;
 import com.xjrsoft.module.organization.dto.BindOpenidDto;
 import com.xjrsoft.module.organization.dto.LoginResetPasswordDto;
@@ -409,6 +410,11 @@ public class UserController {
         List<String> processIds = historicProcessInstances.stream().map(HistoricProcessInstance::getId).collect(Collectors.toList());
         int myApplicationCount = 0;
         for (HistoricProcessInstance historicProcessInstance : historicProcessInstances) {
+            Long countByProcessId = workflowExecuteService.getCountByProcessId(historicProcessInstance.getId());
+            if(countByProcessId == 0L){
+                continue;
+
+            }
             if (!ObjectUtil.isNotNull(historicProcessInstance.getEndTime())) {
                 myApplicationCount ++;
             }
@@ -591,6 +597,9 @@ public class UserController {
         if (ids.contains(StpUtil.getLoginIdAsLong())) {
             R.error("当前登录账户不能删除!");
         }
+        //删除海康的用户信息
+        DataUtil dataUtil = new DataUtil();
+        dataUtil.deletePerson(ids);
         //删除时需要同时删除用户部门关联表和用户角色关联表和用户岗位关系表数据。
         return R.ok(userService.deleteBatch(ids));
     }

+ 1 - 1
src/main/java/com/xjrsoft/module/personnel/controller/StundentFaceProcessController.java

@@ -163,7 +163,7 @@ public class StundentFaceProcessController {
     @ApiOperation(value = "删除学生人脸信息审核")
     @SaCheckPermission("stundentfaceprocess:delete")
     public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
-        return RT.ok(stundentFaceProcessService.removeBatchByIds(ids));
+        return RT.ok(stundentFaceProcessService.removeByIds(ids));
     }
 
     @PostMapping(value = "/batch-import")

+ 1 - 1
src/main/java/com/xjrsoft/module/personnel/controller/TeacherFaceProcessController.java

@@ -148,7 +148,7 @@ public class TeacherFaceProcessController {
     @ApiOperation(value = "删除人脸信息审核")
     @SaCheckPermission("teacherfaceprocess:delete")
     public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
-        return RT.ok(teacherFaceProcessService.removeBatchByIds(ids));
+        return RT.ok(teacherFaceProcessService.removeByIds(ids));
 
     }
 

+ 4 - 0
src/main/java/com/xjrsoft/module/personnel/service/IStundentFaceProcessService.java

@@ -3,6 +3,8 @@ package com.xjrsoft.module.personnel.service;
 import com.github.yulichang.base.MPJBaseService;
 import com.xjrsoft.module.personnel.entity.StundentFaceProcess;
 
+import java.util.List;
+
 /**
 * @title: 学生人脸信息审核
 * @Author dzx
@@ -11,4 +13,6 @@ import com.xjrsoft.module.personnel.entity.StundentFaceProcess;
 */
 
 public interface IStundentFaceProcessService extends MPJBaseService<StundentFaceProcess> {
+
+    Boolean removeByIds(List<Long> ids);
 }

+ 4 - 0
src/main/java/com/xjrsoft/module/personnel/service/ITeacherFaceProcessService.java

@@ -3,6 +3,8 @@ package com.xjrsoft.module.personnel.service;
 import com.github.yulichang.base.MPJBaseService;
 import com.xjrsoft.module.personnel.entity.TeacherFaceProcess;
 
+import java.util.List;
+
 /**
 * @title: 人脸信息审核
 * @Author dzx
@@ -11,4 +13,6 @@ import com.xjrsoft.module.personnel.entity.TeacherFaceProcess;
 */
 
 public interface ITeacherFaceProcessService extends MPJBaseService<TeacherFaceProcess> {
+
+    Boolean removeByIds(List<Long> ids);
 }

+ 48 - 0
src/main/java/com/xjrsoft/module/personnel/service/impl/StundentFaceProcessServiceImpl.java

@@ -1,12 +1,23 @@
 package com.xjrsoft.module.personnel.service.impl;
 
+import cn.dev33.satoken.stp.StpUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.google.gson.JsonObject;
+import com.xjrsoft.common.enums.DeleteMark;
+import com.xjrsoft.module.hikvision.mapper.HikvisionDataMapper;
+import com.xjrsoft.module.hikvision.util.ApiUtil;
+import com.xjrsoft.module.personnel.entity.FaceManagement;
 import com.xjrsoft.module.personnel.entity.StundentFaceProcess;
 import com.xjrsoft.module.personnel.mapper.StundentFaceProcessMapper;
+import com.xjrsoft.module.personnel.service.IFaceManagementService;
 import com.xjrsoft.module.personnel.service.IStundentFaceProcessService;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
+import java.util.List;
+
 /**
 * @title: 学生人脸信息审核
 * @Author dzx
@@ -16,4 +27,41 @@ import org.springframework.stereotype.Service;
 @Service
 @AllArgsConstructor
 public class StundentFaceProcessServiceImpl extends MPJBaseServiceImpl<StundentFaceProcessMapper, StundentFaceProcess> implements IStundentFaceProcessService {
+
+    private final HikvisionDataMapper hikvisionDataMapper;
+
+    private final IFaceManagementService faceManagementService;
+
+
+    //删除人脸后,移除海康那边的人脸
+    @Override
+    public Boolean removeByIds(List<Long> ids) {
+        List<StundentFaceProcess> list = this.baseMapper.selectBatchIds(ids);
+        ApiUtil apiUtil = new ApiUtil();
+        String apiPath = "/api/resource/v1/face/single/delete";
+        for (StundentFaceProcess process : list) {
+            String studentHikvisionId = hikvisionDataMapper.getStudentHikvisionId(process.getUserId());
+
+            JsonObject paramJson = new JsonObject();
+            paramJson.addProperty("faceId", studentHikvisionId);
+
+            String result = apiUtil.doPost(apiPath, paramJson.toString(), null);
+            process.setExamStatus(2);
+            process.setHikvisionResult(result);
+            process.setDeleteMark(DeleteMark.DELETED.getCode());
+            process.setModifyUserId(StpUtil.getLoginIdAsLong());
+            process.setModifyDate(new Date());
+            this.baseMapper.updateById(process);
+
+            FaceManagement faceManagement = faceManagementService.getOne(
+                    new QueryWrapper<FaceManagement>().lambda()
+                            .eq(FaceManagement::getUserId, process.getUserId())
+                            .eq(FaceManagement::getFileId, process.getFacePhoto())
+            );
+
+            faceManagement.setRegisterBase64(null);
+            faceManagementService.update(faceManagement);
+        }
+        return true;
+    }
 }

+ 47 - 0
src/main/java/com/xjrsoft/module/personnel/service/impl/TeacherFaceProcessServiceImpl.java

@@ -1,12 +1,23 @@
 package com.xjrsoft.module.personnel.service.impl;
 
+import cn.dev33.satoken.stp.StpUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.google.gson.JsonObject;
+import com.xjrsoft.common.enums.DeleteMark;
+import com.xjrsoft.module.hikvision.mapper.HikvisionDataMapper;
+import com.xjrsoft.module.hikvision.util.ApiUtil;
+import com.xjrsoft.module.personnel.entity.FaceManagement;
 import com.xjrsoft.module.personnel.entity.TeacherFaceProcess;
 import com.xjrsoft.module.personnel.mapper.TeacherFaceProcessMapper;
+import com.xjrsoft.module.personnel.service.IFaceManagementService;
 import com.xjrsoft.module.personnel.service.ITeacherFaceProcessService;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
+import java.util.List;
+
 /**
 * @title: 人脸信息审核
 * @Author dzx
@@ -16,4 +27,40 @@ import org.springframework.stereotype.Service;
 @Service
 @AllArgsConstructor
 public class TeacherFaceProcessServiceImpl extends MPJBaseServiceImpl<TeacherFaceProcessMapper, TeacherFaceProcess> implements ITeacherFaceProcessService {
+    private final HikvisionDataMapper hikvisionDataMapper;
+
+    private final IFaceManagementService faceManagementService;
+
+
+    //删除人脸后,移除海康那边的人脸
+    @Override
+    public Boolean removeByIds(List<Long> ids) {
+        List<TeacherFaceProcess> list = this.baseMapper.selectBatchIds(ids);
+        ApiUtil apiUtil = new ApiUtil();
+        String apiPath = "/api/resource/v1/face/single/delete";
+        for (TeacherFaceProcess process : list) {
+            String studentHikvisionId = hikvisionDataMapper.getStudentHikvisionId(process.getUserId());
+
+            JsonObject paramJson = new JsonObject();
+            paramJson.addProperty("faceId", studentHikvisionId);
+
+            String result = apiUtil.doPost(apiPath, paramJson.toString(), null);
+            process.setExamStatus(2);
+            process.setHikvisionResult(result);
+            process.setDeleteMark(DeleteMark.DELETED.getCode());
+            process.setModifyUserId(StpUtil.getLoginIdAsLong());
+            process.setModifyDate(new Date());
+            this.baseMapper.updateById(process);
+
+            FaceManagement faceManagement = faceManagementService.getOne(
+                    new QueryWrapper<FaceManagement>().lambda()
+                            .eq(FaceManagement::getUserId, process.getUserId())
+                            .eq(FaceManagement::getFileId, process.getFacePhoto())
+            );
+
+            faceManagement.setRegisterBase64(null);
+            faceManagementService.update(faceManagement);
+        }
+        return true;
+    }
 }

+ 4 - 0
src/main/java/com/xjrsoft/module/student/controller/StudentManagerController.java

@@ -26,6 +26,7 @@ import com.xjrsoft.module.base.entity.BaseGrade;
 import com.xjrsoft.module.base.service.IBaseClassService;
 import com.xjrsoft.module.base.service.IBaseGradeService;
 import com.xjrsoft.module.concat.service.IXjrUserService;
+import com.xjrsoft.module.hikvision.util.DataUtil;
 import com.xjrsoft.module.organization.entity.UserDeptRelation;
 import com.xjrsoft.module.organization.service.IUserDeptRelationService;
 import com.xjrsoft.module.room.service.IRoomBedService;
@@ -217,6 +218,9 @@ public class StudentManagerController {
     @ApiOperation(value = "删除")
     @SaCheckPermission("studentmanager:delete")
     public R delete(@Valid @RequestBody List<Long> ids) {
+        //删除海康的用户信息
+        DataUtil dataUtil = new DataUtil();
+        dataUtil.deletePerson(ids);
         return R.ok(studentManagerService.delete(ids));
     }
 

+ 4 - 0
src/main/java/com/xjrsoft/module/teacher/controller/TeacherbaseManagerController.java

@@ -14,6 +14,7 @@ import com.xjrsoft.common.model.result.R;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
 import com.xjrsoft.common.utils.VoToColumnUtil;
+import com.xjrsoft.module.hikvision.util.DataUtil;
 import com.xjrsoft.module.organization.entity.UserDeptRelation;
 import com.xjrsoft.module.organization.service.IUserDeptRelationService;
 import com.xjrsoft.module.system.entity.DictionaryDetail;
@@ -140,6 +141,9 @@ public class TeacherbaseManagerController {
     @ApiOperation(value = "删除")
     @SaCheckPermission("teacherbasemanager:delete")
     public R delete(@Valid @RequestBody List<Long> ids){
+        //删除海康的用户信息
+        DataUtil dataUtil = new DataUtil();
+        dataUtil.deletePerson(ids);
         return R.ok(teacherbaseManagerService.delete(ids));
 
     }

+ 1 - 0
src/main/java/com/xjrsoft/module/workflow/service/IWorkflowExecuteService.java

@@ -459,4 +459,5 @@ public interface IWorkflowExecuteService {
 
     List<UserDefinedProcessRecordListVo> listAuditApproveRecord(ApproveRecordListDto dto);
 
+    Long getCountByProcessId(String processId);
 }

+ 9 - 0
src/main/java/com/xjrsoft/module/workflow/service/impl/WorkflowExecuteServiceImpl.java

@@ -13,6 +13,7 @@ import cn.hutool.core.util.StrUtil;
 import cn.hutool.db.Session;
 import cn.hutool.extra.spring.SpringUtil;
 import cn.hutool.json.JSONUtil;
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -6107,6 +6108,14 @@ public class WorkflowExecuteServiceImpl implements IWorkflowExecuteService {
         return userDefinedProcessRecordListVos;
     }
 
+    @Override
+    public Long getCountByProcessId(String processId) {
+        return xjrWorkflowExtraMapper.selectCount(
+                new QueryWrapper<WorkflowExtra>().lambda()
+                        .eq(WorkflowExtra::getProcessId, processId)
+        );
+    }
+
     /**
      * 获取上一节点信息
      * 分两种情况:

+ 5 - 5
src/main/resources/mapper/base/WhitelistManagement.xml

@@ -17,17 +17,17 @@
         left join xjr_dictionary_detail t4 on t4.code = t2.stduy_status
         left join xjr_user t5 ON t5.id = t3.teacher_id
         WHERE t.delete_mark = 0
-        <if test="dto.credentialNumber != null">
-            AND t.credential_number = #{dto.credentialNumber}
+        <if test="dto.credentialNumber != null and dto.credentialNumber != ''">
+            AND t.credential_number like concat('%', #{dto.credentialNumber}, '%')
         </if>
-        <if test="dto.name != null">
-            AND t.name = #{dto.name}
+        <if test="dto.name != null and dto.name != ''">
+            AND t.name like concat('%', #{dto.name}, '%')
         </if>
         <if test="dto.phone != null">
             AND t.phone = #{dto.phone}
         </if>
         <if test="dto.readWay != null">
-            AND t4.code = #{dto.readWay}
+            AND t4.code like concat('%', #{dto.readWay}, '%')
         </if>
         <if test="dto.classId != null">
             AND t3.id = #{dto.classId}

+ 16 - 0
src/main/resources/sqlScript/20240531_sql.sql

@@ -0,0 +1,16 @@
+-- ----------------------------------------------
+-- 节假日
+-- ----------------------------------------------
+DROP TABLE IF EXISTS holiday_date;
+CREATE TABLE `holiday_date` (
+  `id` BIGINT NOT NULL COMMENT '主键编号',
+  `date` VARCHAR(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '日期yyyy-MM-dd',
+  `year` INT NOT NULL,
+  `month` INT NOT NULL,
+  `day` INT NOT NULL,
+  `status` INT DEFAULT '0' COMMENT '0=普通工作日 1=周末 2=需要补班的工作日 3=法定节假日',
+  `way` INT NOT NULL DEFAULT '1' COMMENT '方式 1=系统数据 2=用户数据',
+  `delete_status` INT NOT NULL DEFAULT '0' COMMENT '删除状态 0=正常 1=删除',
+  PRIMARY KEY (`id`) USING BTREE,
+  UNIQUE KEY `only` (`date`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb3;

+ 123 - 0
src/main/resources/sqlScript/20240604_sql.sql

@@ -0,0 +1,123 @@
+-- ------------------------------------------------
+-- 班级课程
+-- ------------------------------------------------
+DROP TABLE IF EXISTS base_class_course;
+CREATE TABLE `base_class_course` (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL,
+  `create_date` DATETIME(3) DEFAULT NULL,
+  `modify_user_id` BIGINT DEFAULT NULL,
+  `modify_date` DATETIME(3) DEFAULT NULL,
+  `delete_mark` INT DEFAULT NULL,
+  `enabled_mark` INT DEFAULT NULL,
+  `sort_code` INT DEFAULT NULL,
+  `class_id` BIGINT DEFAULT NULL COMMENT '班级id(base_class)',
+  `course_id` BIGINT DEFAULT NULL COMMENT '课程id(base_course_subject)',
+  `textbook_id` BIGINT DEFAULT NULL COMMENT '教材id(textbook)',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='班级课程';
+
+-- ------------------------------------------------
+-- 教师奖项
+-- ------------------------------------------------
+DROP TABLE IF EXISTS teacher_award_item;
+CREATE TABLE `teacher_award_item` (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL,
+  `create_date` DATETIME(3) DEFAULT NULL,
+  `modify_user_id` BIGINT DEFAULT NULL,
+  `modify_date` DATETIME(3) DEFAULT NULL,
+  `delete_mark` INT DEFAULT NULL,
+  `enabled_mark` INT DEFAULT NULL,
+  `sort_code` INT DEFAULT NULL,
+  `name` VARCHAR(200) DEFAULT NULL COMMENT '奖项名称',
+  `is_thesis` INT DEFAULT NULL COMMENT '是否论文(1:是 0:否)',
+  `is_standard` INT DEFAULT NULL COMMENT '是否频分标准(1:是 0:否)',
+  `score` DECIMAL(6,2) DEFAULT NULL COMMENT '分数',
+  `parent_id` BIGINT DEFAULT NULL COMMENT '父级id',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='教师奖项';
+
+
+ALTER TABLE `teacher_award`   
+  ADD COLUMN `teacher_award_item_id` BIGINT NULL   COMMENT '奖项id(teacher_award_item)' AFTER `status`;
+  
+ALTER TABLE `xjr_user`   
+  CHANGE `avatar` `avatar` MEDIUMBLOB NULL   COMMENT '头像';
+  
+ALTER TABLE textbook
+    ADD use_type INT NULL COMMENT '使用类型(单位:学期)';
+
+ALTER TABLE `base_student_school_roll`   
+  ADD INDEX (`learn_status`);
+ALTER TABLE `xjr_dictionary_detail`   
+  ADD INDEX (`name`, `code`);
+
+DROP TABLE IF EXISTS `base_system_config`;
+CREATE TABLE `base_system_config`  (
+  `id` BIGINT NOT NULL,
+  `code` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '编号',
+  `value` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '值',
+  `remark` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '说明',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = INNODB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '系统参数配置' ROW_FORMAT = DYNAMIC;
+
+DROP TABLE IF EXISTS `base_user_student`;
+CREATE TABLE `base_user_student` (
+  `id` BIGINT NOT NULL COMMENT '主键',
+  `create_date` DATE DEFAULT NULL COMMENT '创建时间',
+  `modify_date` DATE DEFAULT NULL COMMENT '修改时间',
+  `user_id` BIGINT NOT NULL COMMENT '家长ID(xjr_user)',
+  `user_phone` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '家长手机号',
+  `student_id` BIGINT NOT NULL COMMENT '学生ID(xjr_user)',
+  `student_nane` VARCHAR(255) DEFAULT NULL COMMENT '学生姓名',
+  `student_identity` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '学生身份证号',
+  `class_id` BIGINT DEFAULT NULL COMMENT '学生班级id(base_class)',
+  `teacher_id` BIGINT DEFAULT NULL COMMENT '学生班主任id(xjr_user)',
+  `status` INT DEFAULT NULL COMMENT '流程状态(0:审核中,1:通过,2:拒绝)',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='家长学生关联表';
+
+ALTER TABLE wf_textbook_subscription_item
+    ADD textbook_id BIGINT NULL COMMENT '教材id';
+ALTER TABLE wf_textbook_subscription
+    ADD subscription_method INT NULL COMMENT '征订方式(1:按班级征订 2:按教材征订)';
+
+ALTER TABLE `jianyue_data`   
+  CHANGE `source_id` `source_id` VARCHAR(100) NULL COMMENT '数据id';
+
+
+DROP TABLE IF EXISTS `teacher_award`;
+CREATE TABLE `teacher_award` (
+  `id` BIGINT NOT NULL COMMENT '主键编号',
+  `create_user_id` BIGINT DEFAULT NULL COMMENT '创建人',
+  `create_date` DATETIME DEFAULT NULL COMMENT '创建时间',
+  `modify_user_id` BIGINT DEFAULT NULL COMMENT '修改人',
+  `modify_date` DATETIME DEFAULT NULL COMMENT '修改时间',
+  `delete_mark` INT NOT NULL COMMENT '删除标记',
+  `enabled_mark` INT NOT NULL COMMENT '有效标志',
+  `sort_code` INT DEFAULT NULL COMMENT '序号',
+  `applicant_user_id` BIGINT DEFAULT NULL COMMENT '申请人',
+  `award_type` VARCHAR(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '获奖类型',
+  `award_level` VARCHAR(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '奖项级别',
+  `competition_name` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '奖项名称',
+  `award_grade` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '获奖等级',
+  `award_score` DECIMAL(6,2) DEFAULT NULL COMMENT '奖项分数',
+  `paper_name` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '作品名称',
+  `issn` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '国际标准刊号字',
+  `media_type` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '媒体类型(期刊、图书、报纸、音像、论文集)',
+  `journal_name` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '媒体名称',
+  `journal_number` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '国内统一刊号CN',
+  `journal_level` VARCHAR(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '期刊级别(核心期刊、一般期刊、(校级、内部论文))',
+  `issue_date` DATE DEFAULT NULL COMMENT '发表时间',
+  `approval_user_id` BIGINT DEFAULT NULL COMMENT '审核人',
+  `remark` VARCHAR(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '备注',
+  `file_id` BIGINT DEFAULT NULL COMMENT '附件文件id',
+  `status` INT NOT NULL DEFAULT '0' COMMENT '状态(1:结束 0:未结束)',
+  `teacher_award_item_id` BIGINT DEFAULT NULL COMMENT '奖项id(teacher_award_item)',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='教师获奖登记';
+
+
+ALTER TABLE teacher_award
+    ADD whole_competition_name VARCHAR(256) NULL COMMENT '奖项名称全称';

+ 16 - 0
src/main/resources/sqlScript/20240618_sql.sql

@@ -0,0 +1,16 @@
+-- 给每个绑定考勤规则的用户增加考勤相关状态
+ALTER TABLE `attendance_user_relation`   
+  ADD COLUMN `attendance_status` VARCHAR(20) DEFAULT 0  NULL COMMENT '考勤状态' AFTER `attendance_rule_category_id`,
+  ADD COLUMN `attendance_time` DATETIME NULL   COMMENT '最新考勤时间' AFTER `attendance_status`;
+
+ALTER TABLE `attendance_user_relation`   
+  ADD COLUMN `attendance_mode` VARCHAR(20) DEFAULT 0  NULL COMMENT '考勤方式',
+  ADD COLUMN `car_number` VARCHAR(20) NULL COMMENT '车牌号' AFTER `attendance_mode`;
+
+
+ALTER TABLE wf_textbook_subscription_item
+    ADD instockroom_num INT DEFAULT 0 NULL COMMENT '当前征订任务征订项已经入库数量';
+ALTER TABLE wf_textbook_subscription_item
+    ADD alteration_type INT DEFAULT 0 NULL COMMENT '变更类型(0:未变更,1:变更征订数量,2:变更课程)';
+ALTER TABLE wf_textbook_subscription_item
+    CHANGE instockroom_num in_stockroom_num INT DEFAULT 0 NULL COMMENT '当前征订任务征订项已经入库数量';