Jelajahi Sumber

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

dzx 1 tahun lalu
induk
melakukan
146833959c

+ 2 - 33
src/main/java/com/xjrsoft/module/hikvision/util/FaceImportUtil.java

@@ -18,7 +18,7 @@ public class FaceImportUtil {
 
     public static String ImportTeacherFace(Long id) {
         JsonObject paramJson = new JsonObject();
-        paramJson.addProperty("personId", faceImportMapper.GetTeacherHikvisionIdById(id));
+        paramJson.addProperty("personId", faceImportMapper.GetTeacherUserIdById(id));
         paramJson.addProperty("faceData", ImageToBase64(faceImportMapper.GetTeacherHikvisionImgById(id)));
 
         Map<String, String> querys = new HashMap<>();
@@ -32,7 +32,7 @@ public class FaceImportUtil {
 
     public static String ImportStudentFace(Long id) {
         JsonObject paramJson = new JsonObject();
-        paramJson.addProperty("personId", faceImportMapper.GetStudentHikvisionIdById(id));
+        paramJson.addProperty("personId", faceImportMapper.GetStudentUserIdById(id));
         paramJson.addProperty("faceData", ImageToBase64(faceImportMapper.GetStudentHikvisionImgById(id)));
 
         Map<String, String> querys = new HashMap<>();
@@ -64,35 +64,4 @@ public class FaceImportUtil {
         }
         return base64String;
     }
-
-    //    public String AddFace(Long id){
-//        JsonObject paramJson = new JsonObject();
-//        paramJson.addProperty("name", teacherFaceImportMapper.GetHikvisionIdById(id));
-//        paramJson.addProperty("description", "none");
-//
-//        Map<String, String> querys = new HashMap<>();
-//
-//        String apiPath = "/api/frs/v1/face/group/single/addition";
-//        String response = ApiUtil.doPost(apiPath, String.valueOf(paramJson), querys);
-////        ObjectMapper mapper = new ObjectMapper();
-////        try {
-////            JsonNode rootNode = mapper.readTree(response);
-////            JsonNode dataNode = rootNode.path("data");
-////            JsonNode indexCodeNode = dataNode.path("indexCode");
-////
-////            if (indexCodeNode != null && !indexCodeNode.isNull()) {
-////                String indexCode = indexCodeNode.asText();
-////                return indexCode;
-////            } else {
-////                System.out.println("IndexCode is null or not present");
-////                return null;
-////            }
-////        } catch (JsonProcessingException e) {
-////            e.printStackTrace();
-////            return null;
-////        } catch (Exception e) {
-////            e.printStackTrace();
-////            return null;
-////        }
-//    }
 }

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

@@ -72,6 +72,7 @@ public class ReservationSchoolController {
         LambdaQueryWrapper<ReservationSchool> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper
                     .orderByDesc(ReservationSchool::getId)
+                .eq(ReservationSchool::getCreateUserId,StpUtil.getLoginIdAsLong())
                 .select(ReservationSchool.class,x -> VoToColumnUtil.fieldsToColumns(ReservationSchoolPageVo.class).contains(x.getProperty()));
 
         if(ObjectUtil.isNotNull(dto.getType())) {

+ 2 - 2
src/main/java/com/xjrsoft/module/teacher/mapper/FaceImportMapper.java

@@ -6,10 +6,10 @@ import org.apache.ibatis.annotations.Param;
 
 @Mapper
 public interface FaceImportMapper {
-    String GetTeacherHikvisionIdById(@Param("id") Long id);
+    String GetTeacherUserIdById(@Param("id") Long id);
     String GetTeacherHikvisionImgById(@Param("id") Long id);
 
-    String GetStudentHikvisionIdById(@Param("id") Long id);
+    String GetStudentUserIdById(@Param("id") Long id);
     String GetStudentHikvisionImgById(@Param("id") Long id);
 }
 

+ 4 - 6
src/main/resources/mapper/teacher/TeacherFaceImportMapper.xml

@@ -3,10 +3,9 @@
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.xjrsoft.module.teacher.mapper.FaceImportMapper">
-    <select id="GetTeacherHikvisionIdById" parameterType="long" resultType="java.lang.String">
-        select t1.hikvision_id
+    <select id="GetTeacherUserIdById" parameterType="long" resultType="java.lang.String">
+        select t.user_id
         from teacher_face_process t
-        left join hikvision_data t1 on t1.source_id = t.user_id
         <if test="id != null">
             where t.id = #{id}
         </if>
@@ -23,10 +22,9 @@
         and t.status = 1
     </select>
 
-    <select id="GetStudentHikvisionIdById" parameterType="long" resultType="java.lang.String">
-        select t1.hikvision_id
+    <select id="GetStudentUserIdById" parameterType="long" resultType="java.lang.String">
+        select t1.user_id
         from stundent_face_process t
-        left join hikvision_data t1 on t1.source_id = t.user_id
         <if test="id != null">
             where t.id = #{id}
         </if>