7 コミット 04e78d60b9 ... 31270f1407

作者 SHA1 メッセージ 日付
  superb 31270f1407 Merge branch 'master' into superb 1 年間 前
  superb 6f8b24a810 签到增删改查 1 年間 前
  wuheng 0cb089babc Merge branch 'wheng' of wuheng/eas-system into master 1 年間 前
  wuheng 656ffd8763 过滤器放行 token 1 年間 前
  wuheng a229d1fb00 Merge branch 'wheng' of wuheng/eas-system into master 1 年間 前
  wuheng 3f1b90f9ad token 1 年間 前
  wuheng 2e5e451a83 Merge branch 'superb' of wuheng/eas-system into master 1 年間 前

+ 1 - 1
common/src/main/java/com/koobietech/eas/common/utils/JwtManager.java

@@ -70,7 +70,7 @@ public class JwtManager {
             jwtUserDto.setUsername(verify.getClaim("user").asString());
             jwtUserDto.setType(UserType.valueOf(verify.getClaim("type").asString()));
         } catch ( JWTVerificationException e){
-            //throw new EasException("token 不正确!");
+            throw new EasException("token 不正确!");
         }
         return jwtUserDto;
     }

+ 78 - 0
controller/src/main/java/com/koobietech/eas/controller/EasArcTlsAttendanceController.java

@@ -0,0 +1,78 @@
+package com.koobietech.eas.controller;
+
+import com.github.pagehelper.PageHelper;
+import com.koobietech.eas.common.result.JsonPageResult;
+import com.koobietech.eas.common.result.JsonResult;
+import com.koobietech.eas.common.result.PageData;
+import com.koobietech.eas.mbg.model.EasArcTlsAttendance;
+import com.koobietech.eas.mbg.model.EasEduClassroom;
+import com.koobietech.eas.service.EasArcTlsAttendanceService;
+import io.swagger.v3.oas.annotations.Operation;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+@RestController
+@RequestMapping("/attendance")
+public class EasArcTlsAttendanceController {
+
+    @Resource
+    private EasArcTlsAttendanceService easArcTlsAttendanceService;
+
+    @GetMapping("/getStudentList")
+    @Operation(summary = "获取学生列表", description = "签到的时候会根据班级来获取学生列表(class_id)")
+    public JsonResult getStudentList(@RequestParam Long scheduleId) {
+        return JsonResult.data(easArcTlsAttendanceService.getStudentList(scheduleId));
+    }
+
+    @PostMapping("/query")
+    @Operation(summary = "查询签到记录", description = "前端构造查询条件,可以都为空,根据参数查询签到表信息(调用了分页组件)")
+    public JsonPageResult query(@RequestBody EasArcTlsAttendance attendance,
+                                @RequestParam Integer pageNum, @RequestParam Integer pageSize) {
+        PageHelper.startPage(pageNum, pageSize);
+        PageData ret = easArcTlsAttendanceService.query(attendance);
+        return JsonPageResult.data(ret);
+    }
+
+    @PostMapping("/add")
+    @Operation(summary = "添加签到记录", description = "用于添加签到信息")
+    public JsonResult add(@RequestBody EasArcTlsAttendance attendance) {
+        //增加的时候,加一个判断,如果已经存在,就转到更新方法(“/update”)
+        boolean isExist = easArcTlsAttendanceService.isExist(attendance);
+
+        if (isExist) {
+            return update(attendance);
+        }else{
+            boolean isAdded = easArcTlsAttendanceService.add(attendance);
+            if (isAdded) {
+                return JsonResult.ok("添加签到记录成功");
+            }
+            return JsonResult.fail("添加签到记录失败");
+        }
+    }
+
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除签到记录", description = "删除签到记录数据根据时间和学员ID")
+    public JsonResult delete(@RequestBody EasArcTlsAttendance attendance) {
+        Boolean ret = easArcTlsAttendanceService.delete(attendance);
+        if (ret) {
+            return JsonResult.ok("删除签到记录成功");
+        }
+        return JsonResult.fail("删除签到记录失败");
+    }
+
+
+    @PutMapping("/update")
+    @Operation(summary = "更新签到记录", description = "更新签到记录")
+    public JsonResult update(@RequestBody EasArcTlsAttendance attendance) {
+        Boolean ret = easArcTlsAttendanceService.update(attendance);
+        if (ret) {
+            return JsonResult.ok("更新签到记录成功");
+        }
+        return JsonResult.fail("更新签到记录失败");
+    }
+
+
+
+}

BIN
controller/src/main/resources/Temp/StuRegistTemp.docx


BIN
controller/src/main/resources/temp/StuRegistTemp.docx


+ 17 - 0
mbg/src/main/java/com/koobietech/eas/mbg/model/EasArcTlsAttendance.java

@@ -47,6 +47,14 @@ public class EasArcTlsAttendance implements Serializable {
     @Schema(description = "a  表示正常出勤,   b  表示迟到、早退, c  表示旷课, d  表示请假, e表示无效")
     private String afternoon;
 
+    /**
+     * 学员姓名
+     *
+     * @mbg.generated
+     */
+    @Schema(description = "学员姓名")
+    private String studentName;
+
     /**
      * 学生档案号
      *
@@ -129,6 +137,14 @@ public class EasArcTlsAttendance implements Serializable {
         this.afternoon = afternoon;
     }
 
+    public String getStudentName() {
+        return studentName;
+    }
+
+    public void setStudentName(String studentName) {
+        this.studentName = studentName;
+    }
+
     public String getStudentNumber() {
         return studentNumber;
     }
@@ -173,6 +189,7 @@ public class EasArcTlsAttendance implements Serializable {
         sb.append(", month=").append(month);
         sb.append(", morning=").append(morning);
         sb.append(", afternoon=").append(afternoon);
+        sb.append(", studentName=").append(studentName);
         sb.append(", studentNumber=").append(studentNumber);
         sb.append(", createUid=").append(createUid);
         sb.append(", createTime=").append(createTime);

+ 70 - 0
mbg/src/main/java/com/koobietech/eas/mbg/model/EasArcTlsAttendanceExample.java

@@ -512,6 +512,76 @@ public class EasArcTlsAttendanceExample {
             return (Criteria) this;
         }
 
+        public Criteria andStudentNameIsNull() {
+            addCriterion("student_name is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentNameIsNotNull() {
+            addCriterion("student_name is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentNameEqualTo(String value) {
+            addCriterion("student_name =", value, "studentName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentNameNotEqualTo(String value) {
+            addCriterion("student_name <>", value, "studentName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentNameGreaterThan(String value) {
+            addCriterion("student_name >", value, "studentName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentNameGreaterThanOrEqualTo(String value) {
+            addCriterion("student_name >=", value, "studentName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentNameLessThan(String value) {
+            addCriterion("student_name <", value, "studentName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentNameLessThanOrEqualTo(String value) {
+            addCriterion("student_name <=", value, "studentName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentNameLike(String value) {
+            addCriterion("student_name like", value, "studentName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentNameNotLike(String value) {
+            addCriterion("student_name not like", value, "studentName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentNameIn(List<String> values) {
+            addCriterion("student_name in", values, "studentName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentNameNotIn(List<String> values) {
+            addCriterion("student_name not in", values, "studentName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentNameBetween(String value1, String value2) {
+            addCriterion("student_name between", value1, value2, "studentName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentNameNotBetween(String value1, String value2) {
+            addCriterion("student_name not between", value1, value2, "studentName");
+            return (Criteria) this;
+        }
+
         public Criteria andStudentNumberIsNull() {
             addCriterion("student_number is null");
             return (Criteria) this;

+ 0 - 6
mbg/src/main/java/com/koobietech/eas/mbg/model/EasArcTlsStudents.java

@@ -1,9 +1,6 @@
 package com.koobietech.eas.mbg.model;
 
-import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.v3.oas.annotations.media.Schema;
-import org.springframework.format.annotation.DateTimeFormat;
-
 import java.io.Serializable;
 import java.util.Date;
 
@@ -54,7 +51,6 @@ public class EasArcTlsStudents implements Serializable {
      * @mbg.generated
      */
     @Schema(description = "学生出生日期")
-    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date birthdate;
 
     /**
@@ -87,7 +83,6 @@ public class EasArcTlsStudents implements Serializable {
      * @mbg.generated
      */
     @Schema(description = "学生入学进入培训班日期")
-    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date enrollmentDate;
 
     /**
@@ -96,7 +91,6 @@ public class EasArcTlsStudents implements Serializable {
      * @mbg.generated
      */
     @Schema(description = "学生在培训班毕业日期")
-    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date graduationDate;
 
     /**

+ 3 - 3
mbg/src/main/java/com/koobietech/eas/mbg/model/EasEduSubjects.java

@@ -29,7 +29,7 @@ public class EasEduSubjects implements Serializable {
      * @mbg.generated
      */
     @Schema(description = "学科分类")
-    private String categoryId;
+    private Integer categoryId;
 
     /**
      * 创建时间
@@ -89,11 +89,11 @@ public class EasEduSubjects implements Serializable {
         this.description = description;
     }
 
-    public String getCategoryId() {
+    public Integer getCategoryId() {
         return categoryId;
     }
 
-    public void setCategoryId(String categoryId) {
+    public void setCategoryId(Integer categoryId) {
         this.categoryId = categoryId;
     }
 

+ 10 - 20
mbg/src/main/java/com/koobietech/eas/mbg/model/EasEduSubjectsExample.java

@@ -315,62 +315,52 @@ public class EasEduSubjectsExample {
             return (Criteria) this;
         }
 
-        public Criteria andCategoryIdEqualTo(String value) {
+        public Criteria andCategoryIdEqualTo(Integer value) {
             addCriterion("category_id =", value, "categoryId");
             return (Criteria) this;
         }
 
-        public Criteria andCategoryIdNotEqualTo(String value) {
+        public Criteria andCategoryIdNotEqualTo(Integer value) {
             addCriterion("category_id <>", value, "categoryId");
             return (Criteria) this;
         }
 
-        public Criteria andCategoryIdGreaterThan(String value) {
+        public Criteria andCategoryIdGreaterThan(Integer value) {
             addCriterion("category_id >", value, "categoryId");
             return (Criteria) this;
         }
 
-        public Criteria andCategoryIdGreaterThanOrEqualTo(String value) {
+        public Criteria andCategoryIdGreaterThanOrEqualTo(Integer value) {
             addCriterion("category_id >=", value, "categoryId");
             return (Criteria) this;
         }
 
-        public Criteria andCategoryIdLessThan(String value) {
+        public Criteria andCategoryIdLessThan(Integer value) {
             addCriterion("category_id <", value, "categoryId");
             return (Criteria) this;
         }
 
-        public Criteria andCategoryIdLessThanOrEqualTo(String value) {
+        public Criteria andCategoryIdLessThanOrEqualTo(Integer value) {
             addCriterion("category_id <=", value, "categoryId");
             return (Criteria) this;
         }
 
-        public Criteria andCategoryIdLike(String value) {
-            addCriterion("category_id like", value, "categoryId");
-            return (Criteria) this;
-        }
-
-        public Criteria andCategoryIdNotLike(String value) {
-            addCriterion("category_id not like", value, "categoryId");
-            return (Criteria) this;
-        }
-
-        public Criteria andCategoryIdIn(List<String> values) {
+        public Criteria andCategoryIdIn(List<Integer> values) {
             addCriterion("category_id in", values, "categoryId");
             return (Criteria) this;
         }
 
-        public Criteria andCategoryIdNotIn(List<String> values) {
+        public Criteria andCategoryIdNotIn(List<Integer> values) {
             addCriterion("category_id not in", values, "categoryId");
             return (Criteria) this;
         }
 
-        public Criteria andCategoryIdBetween(String value1, String value2) {
+        public Criteria andCategoryIdBetween(Integer value1, Integer value2) {
             addCriterion("category_id between", value1, value2, "categoryId");
             return (Criteria) this;
         }
 
-        public Criteria andCategoryIdNotBetween(String value1, String value2) {
+        public Criteria andCategoryIdNotBetween(Integer value1, Integer value2) {
             addCriterion("category_id not between", value1, value2, "categoryId");
             return (Criteria) this;
         }

+ 17 - 0
mbg/src/main/java/com/koobietech/eas/mbg/model/EasSysStudent.java

@@ -63,6 +63,14 @@ public class EasSysStudent implements Serializable {
     @Schema(description = "学生密码")
     private String passwd;
 
+    /**
+     * 学员头像
+     *
+     * @mbg.generated
+     */
+    @Schema(description = "学员头像")
+    private String avatar;
+
     /**
      * 创建时间
      *
@@ -177,6 +185,14 @@ public class EasSysStudent implements Serializable {
         this.passwd = passwd;
     }
 
+    public String getAvatar() {
+        return avatar;
+    }
+
+    public void setAvatar(String avatar) {
+        this.avatar = avatar;
+    }
+
     public Date getCreateTime() {
         return createTime;
     }
@@ -239,6 +255,7 @@ public class EasSysStudent implements Serializable {
         sb.append(", email=").append(email);
         sb.append(", enrollmentDate=").append(enrollmentDate);
         sb.append(", passwd=").append(passwd);
+        sb.append(", avatar=").append(avatar);
         sb.append(", createTime=").append(createTime);
         sb.append(", modifyTime=").append(modifyTime);
         sb.append(", admissionsId=").append(admissionsId);

+ 70 - 0
mbg/src/main/java/com/koobietech/eas/mbg/model/EasSysStudentExample.java

@@ -672,6 +672,76 @@ public class EasSysStudentExample {
             return (Criteria) this;
         }
 
+        public Criteria andAvatarIsNull() {
+            addCriterion("avatar is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAvatarIsNotNull() {
+            addCriterion("avatar is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAvatarEqualTo(String value) {
+            addCriterion("avatar =", value, "avatar");
+            return (Criteria) this;
+        }
+
+        public Criteria andAvatarNotEqualTo(String value) {
+            addCriterion("avatar <>", value, "avatar");
+            return (Criteria) this;
+        }
+
+        public Criteria andAvatarGreaterThan(String value) {
+            addCriterion("avatar >", value, "avatar");
+            return (Criteria) this;
+        }
+
+        public Criteria andAvatarGreaterThanOrEqualTo(String value) {
+            addCriterion("avatar >=", value, "avatar");
+            return (Criteria) this;
+        }
+
+        public Criteria andAvatarLessThan(String value) {
+            addCriterion("avatar <", value, "avatar");
+            return (Criteria) this;
+        }
+
+        public Criteria andAvatarLessThanOrEqualTo(String value) {
+            addCriterion("avatar <=", value, "avatar");
+            return (Criteria) this;
+        }
+
+        public Criteria andAvatarLike(String value) {
+            addCriterion("avatar like", value, "avatar");
+            return (Criteria) this;
+        }
+
+        public Criteria andAvatarNotLike(String value) {
+            addCriterion("avatar not like", value, "avatar");
+            return (Criteria) this;
+        }
+
+        public Criteria andAvatarIn(List<String> values) {
+            addCriterion("avatar in", values, "avatar");
+            return (Criteria) this;
+        }
+
+        public Criteria andAvatarNotIn(List<String> values) {
+            addCriterion("avatar not in", values, "avatar");
+            return (Criteria) this;
+        }
+
+        public Criteria andAvatarBetween(String value1, String value2) {
+            addCriterion("avatar between", value1, value2, "avatar");
+            return (Criteria) this;
+        }
+
+        public Criteria andAvatarNotBetween(String value1, String value2) {
+            addCriterion("avatar not between", value1, value2, "avatar");
+            return (Criteria) this;
+        }
+
         public Criteria andCreateTimeIsNull() {
             addCriterion("create_time is null");
             return (Criteria) this;

+ 23 - 8
mbg/src/main/resources/com/koobietech/eas/mbg/mapper/EasArcTlsAttendanceMapper.xml

@@ -8,6 +8,7 @@
     <result column="month" jdbcType="INTEGER" property="month" />
     <result column="morning" jdbcType="CHAR" property="morning" />
     <result column="afternoon" jdbcType="CHAR" property="afternoon" />
+    <result column="student_name" jdbcType="VARCHAR" property="studentName" />
     <result column="student_number" jdbcType="VARCHAR" property="studentNumber" />
     <result column="create_uid" jdbcType="INTEGER" property="createUid" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
@@ -72,8 +73,8 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, checkin_date, schedule_id, month, morning, afternoon, student_number, create_uid, 
-    create_time, modify_time
+    id, checkin_date, schedule_id, month, morning, afternoon, student_name, student_number, 
+    create_uid, create_time, modify_time
   </sql>
   <select id="selectByExample" parameterType="com.koobietech.eas.mbg.model.EasArcTlsAttendanceExample" resultMap="BaseResultMap">
     select
@@ -110,13 +111,13 @@
       SELECT LAST_INSERT_ID()
     </selectKey>
     insert into eas_arc_tls_attendance (checkin_date, schedule_id, month, 
-      morning, afternoon, student_number, 
-      create_uid, create_time, modify_time
-      )
+      morning, afternoon, student_name, 
+      student_number, create_uid, create_time, 
+      modify_time)
     values (#{checkinDate,jdbcType=DATE}, #{scheduleId,jdbcType=INTEGER}, #{month,jdbcType=INTEGER}, 
-      #{morning,jdbcType=CHAR}, #{afternoon,jdbcType=CHAR}, #{studentNumber,jdbcType=VARCHAR}, 
-      #{createUid,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{modifyTime,jdbcType=TIMESTAMP}
-      )
+      #{morning,jdbcType=CHAR}, #{afternoon,jdbcType=CHAR}, #{studentName,jdbcType=VARCHAR}, 
+      #{studentNumber,jdbcType=VARCHAR}, #{createUid,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{modifyTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.koobietech.eas.mbg.model.EasArcTlsAttendance">
     <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
@@ -139,6 +140,9 @@
       <if test="afternoon != null">
         afternoon,
       </if>
+      <if test="studentName != null">
+        student_name,
+      </if>
       <if test="studentNumber != null">
         student_number,
       </if>
@@ -168,6 +172,9 @@
       <if test="afternoon != null">
         #{afternoon,jdbcType=CHAR},
       </if>
+      <if test="studentName != null">
+        #{studentName,jdbcType=VARCHAR},
+      </if>
       <if test="studentNumber != null">
         #{studentNumber,jdbcType=VARCHAR},
       </if>
@@ -209,6 +216,9 @@
       <if test="record.afternoon != null">
         afternoon = #{record.afternoon,jdbcType=CHAR},
       </if>
+      <if test="record.studentName != null">
+        student_name = #{record.studentName,jdbcType=VARCHAR},
+      </if>
       <if test="record.studentNumber != null">
         student_number = #{record.studentNumber,jdbcType=VARCHAR},
       </if>
@@ -234,6 +244,7 @@
       month = #{record.month,jdbcType=INTEGER},
       morning = #{record.morning,jdbcType=CHAR},
       afternoon = #{record.afternoon,jdbcType=CHAR},
+      student_name = #{record.studentName,jdbcType=VARCHAR},
       student_number = #{record.studentNumber,jdbcType=VARCHAR},
       create_uid = #{record.createUid,jdbcType=INTEGER},
       create_time = #{record.createTime,jdbcType=TIMESTAMP},
@@ -260,6 +271,9 @@
       <if test="afternoon != null">
         afternoon = #{afternoon,jdbcType=CHAR},
       </if>
+      <if test="studentName != null">
+        student_name = #{studentName,jdbcType=VARCHAR},
+      </if>
       <if test="studentNumber != null">
         student_number = #{studentNumber,jdbcType=VARCHAR},
       </if>
@@ -282,6 +296,7 @@
       month = #{month,jdbcType=INTEGER},
       morning = #{morning,jdbcType=CHAR},
       afternoon = #{afternoon,jdbcType=CHAR},
+      student_name = #{studentName,jdbcType=VARCHAR},
       student_number = #{studentNumber,jdbcType=VARCHAR},
       create_uid = #{createUid,jdbcType=INTEGER},
       create_time = #{createTime,jdbcType=TIMESTAMP},

+ 7 - 7
mbg/src/main/resources/com/koobietech/eas/mbg/mapper/EasEduSubjectsMapper.xml

@@ -5,7 +5,7 @@
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="name" jdbcType="VARCHAR" property="name" />
     <result column="description" jdbcType="VARCHAR" property="description" />
-    <result column="category_id" jdbcType="VARCHAR" property="categoryId" />
+    <result column="category_id" jdbcType="INTEGER" property="categoryId" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
     <result column="create_uid" jdbcType="INTEGER" property="createUid" />
@@ -109,7 +109,7 @@
     insert into eas_edu_subjects (name, description, category_id, 
       create_time, modify_time, create_uid, 
       disabled)
-    values (#{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{categoryId,jdbcType=VARCHAR}, 
+    values (#{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{categoryId,jdbcType=INTEGER}, 
       #{createTime,jdbcType=TIMESTAMP}, #{modifyTime,jdbcType=TIMESTAMP}, #{createUid,jdbcType=INTEGER}, 
       #{disabled,jdbcType=CHAR})
   </insert>
@@ -149,7 +149,7 @@
         #{description,jdbcType=VARCHAR},
       </if>
       <if test="categoryId != null">
-        #{categoryId,jdbcType=VARCHAR},
+        #{categoryId,jdbcType=INTEGER},
       </if>
       <if test="createTime != null">
         #{createTime,jdbcType=TIMESTAMP},
@@ -184,7 +184,7 @@
         description = #{record.description,jdbcType=VARCHAR},
       </if>
       <if test="record.categoryId != null">
-        category_id = #{record.categoryId,jdbcType=VARCHAR},
+        category_id = #{record.categoryId,jdbcType=INTEGER},
       </if>
       <if test="record.createTime != null">
         create_time = #{record.createTime,jdbcType=TIMESTAMP},
@@ -208,7 +208,7 @@
     set id = #{record.id,jdbcType=INTEGER},
       name = #{record.name,jdbcType=VARCHAR},
       description = #{record.description,jdbcType=VARCHAR},
-      category_id = #{record.categoryId,jdbcType=VARCHAR},
+      category_id = #{record.categoryId,jdbcType=INTEGER},
       create_time = #{record.createTime,jdbcType=TIMESTAMP},
       modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
       create_uid = #{record.createUid,jdbcType=INTEGER},
@@ -227,7 +227,7 @@
         description = #{description,jdbcType=VARCHAR},
       </if>
       <if test="categoryId != null">
-        category_id = #{categoryId,jdbcType=VARCHAR},
+        category_id = #{categoryId,jdbcType=INTEGER},
       </if>
       <if test="createTime != null">
         create_time = #{createTime,jdbcType=TIMESTAMP},
@@ -248,7 +248,7 @@
     update eas_edu_subjects
     set name = #{name,jdbcType=VARCHAR},
       description = #{description,jdbcType=VARCHAR},
-      category_id = #{categoryId,jdbcType=VARCHAR},
+      category_id = #{categoryId,jdbcType=INTEGER},
       create_time = #{createTime,jdbcType=TIMESTAMP},
       modify_time = #{modifyTime,jdbcType=TIMESTAMP},
       create_uid = #{createUid,jdbcType=INTEGER},

+ 22 - 7
mbg/src/main/resources/com/koobietech/eas/mbg/mapper/EasSysStudentMapper.xml

@@ -10,6 +10,7 @@
     <result column="email" jdbcType="VARCHAR" property="email" />
     <result column="enrollment_date" jdbcType="DATE" property="enrollmentDate" />
     <result column="passwd" jdbcType="VARCHAR" property="passwd" />
+    <result column="avatar" jdbcType="VARCHAR" property="avatar" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
     <result column="admissions_id" jdbcType="INTEGER" property="admissionsId" />
@@ -77,7 +78,7 @@
   </sql>
   <sql id="Base_Column_List">
     id, student_number, student_name, gender, phone, email, enrollment_date, passwd, 
-    create_time, modify_time, admissions_id, manager_id, create_uid, disabled
+    avatar, create_time, modify_time, admissions_id, manager_id, create_uid, disabled
   </sql>
   <select id="selectByExample" parameterType="com.koobietech.eas.mbg.model.EasSysStudentExample" resultMap="BaseResultMap">
     select
@@ -115,14 +116,14 @@
     </selectKey>
     insert into eas_sys_student (student_number, student_name, gender, 
       phone, email, enrollment_date, 
-      passwd, create_time, modify_time, 
-      admissions_id, manager_id, create_uid, 
-      disabled)
+      passwd, avatar, create_time, 
+      modify_time, admissions_id, manager_id, 
+      create_uid, disabled)
     values (#{studentNumber,jdbcType=VARCHAR}, #{studentName,jdbcType=VARCHAR}, #{gender,jdbcType=CHAR}, 
       #{phone,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{enrollmentDate,jdbcType=DATE}, 
-      #{passwd,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{modifyTime,jdbcType=TIMESTAMP}, 
-      #{admissionsId,jdbcType=INTEGER}, #{managerId,jdbcType=INTEGER}, #{createUid,jdbcType=INTEGER}, 
-      #{disabled,jdbcType=CHAR})
+      #{passwd,jdbcType=VARCHAR}, #{avatar,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{modifyTime,jdbcType=TIMESTAMP}, #{admissionsId,jdbcType=INTEGER}, #{managerId,jdbcType=INTEGER}, 
+      #{createUid,jdbcType=INTEGER}, #{disabled,jdbcType=CHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.koobietech.eas.mbg.model.EasSysStudent">
     <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
@@ -151,6 +152,9 @@
       <if test="passwd != null">
         passwd,
       </if>
+      <if test="avatar != null">
+        avatar,
+      </if>
       <if test="createTime != null">
         create_time,
       </if>
@@ -192,6 +196,9 @@
       <if test="passwd != null">
         #{passwd,jdbcType=VARCHAR},
       </if>
+      <if test="avatar != null">
+        #{avatar,jdbcType=VARCHAR},
+      </if>
       <if test="createTime != null">
         #{createTime,jdbcType=TIMESTAMP},
       </if>
@@ -245,6 +252,9 @@
       <if test="record.passwd != null">
         passwd = #{record.passwd,jdbcType=VARCHAR},
       </if>
+      <if test="record.avatar != null">
+        avatar = #{record.avatar,jdbcType=VARCHAR},
+      </if>
       <if test="record.createTime != null">
         create_time = #{record.createTime,jdbcType=TIMESTAMP},
       </if>
@@ -278,6 +288,7 @@
       email = #{record.email,jdbcType=VARCHAR},
       enrollment_date = #{record.enrollmentDate,jdbcType=DATE},
       passwd = #{record.passwd,jdbcType=VARCHAR},
+      avatar = #{record.avatar,jdbcType=VARCHAR},
       create_time = #{record.createTime,jdbcType=TIMESTAMP},
       modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
       admissions_id = #{record.admissionsId,jdbcType=INTEGER},
@@ -312,6 +323,9 @@
       <if test="passwd != null">
         passwd = #{passwd,jdbcType=VARCHAR},
       </if>
+      <if test="avatar != null">
+        avatar = #{avatar,jdbcType=VARCHAR},
+      </if>
       <if test="createTime != null">
         create_time = #{createTime,jdbcType=TIMESTAMP},
       </if>
@@ -342,6 +356,7 @@
       email = #{email,jdbcType=VARCHAR},
       enrollment_date = #{enrollmentDate,jdbcType=DATE},
       passwd = #{passwd,jdbcType=VARCHAR},
+      avatar = #{avatar,jdbcType=VARCHAR},
       create_time = #{createTime,jdbcType=TIMESTAMP},
       modify_time = #{modifyTime,jdbcType=TIMESTAMP},
       admissions_id = #{admissionsId,jdbcType=INTEGER},

+ 29 - 24
security/src/main/java/com/koobietech/eas/security/filter/EasSecurityFilter.java

@@ -1,5 +1,6 @@
 package com.koobietech.eas.security.filter;
 
+import com.koobietech.eas.common.exception.EasException;
 import com.koobietech.eas.common.pojo.JwtUserDto;
 import com.koobietech.eas.common.utils.JwtManager;
 import com.koobietech.eas.dao.adminLoginPojo.Permission;
@@ -38,39 +39,43 @@ public class EasSecurityFilter extends OncePerRequestFilter {
         //从请求里面拿到token
         String token = request.getHeader("Authorization");
         //判断token是否存在
-        if (StringUtils.hasText(token) && false) {
+        if (StringUtils.hasText(token)) {
             //解析token成JwtUserDto
-            JwtUserDto jwtUserDto = jwtManager.decodeJwt(token);
-            //判断token是否有效
-            UserDetail userDetail = loginRedisService.checkToken(jwtUserDto);
+            JwtUserDto jwtUserDto = null;
+            try {
+                //过滤器 允许 Token 不正确, 后面Security 会拦截处理
+                jwtUserDto = jwtManager.decodeJwt(token);
+            } catch ( EasException e) {}
+            if ( Objects.nonNull(jwtUserDto) ) {
+                //判断token是否有效
+                UserDetail userDetail = loginRedisService.checkToken(jwtUserDto);
 
-            // 获取当前的 SecurityContext 对象,用于保存当前用户的安全上下文信息
-            SecurityContext context = SecurityContextHolder.getContext();
+                // 获取当前的 SecurityContext 对象,用于保存当前用户的安全上下文信息
+                SecurityContext context = SecurityContextHolder.getContext();
 
-            if (Objects.nonNull(userDetail)) {
-                // 如果获取到了有效的用户对象
+                if (Objects.nonNull(userDetail)) {
+                    // 如果获取到了有效的用户对象
 
-                // 获取用户的权限列表
-                List<Permission> permission = userDetail.getPermissions();
+                    // 获取用户的权限列表
+                    List<Permission> permission = userDetail.getPermissions();
 
-                // 创建一个 ArrayList 集合,用于存储用户权限对应的 SimpleGrantedAuthority 权限对象
-                ArrayList<SimpleGrantedAuthority> objects = new ArrayList<>();
+                    // 创建一个 ArrayList 集合,用于存储用户权限对应的 SimpleGrantedAuthority 权限对象
+                    ArrayList<SimpleGrantedAuthority> objects = new ArrayList<>();
 
-                // 遍历用户的权限列表
-                for (Permission adminPermission : permission) {
-                    // 创建一个 SimpleGrantedAuthority 权限对象,并添加到集合中
-                    SimpleGrantedAuthority authority = new SimpleGrantedAuthority(adminPermission.getDescription());
-                    objects.add(authority);
-                }
+                    // 遍历用户的权限列表
+                    for (Permission adminPermission : permission) {
+                        // 创建一个 SimpleGrantedAuthority 权限对象,并添加到集合中
+                        SimpleGrantedAuthority authority = new SimpleGrantedAuthority(adminPermission.getDescription());
+                        objects.add(authority);
+                    }
 
-                // 使用用户的用户名、空凭证参数和权限对象集合创建一个 UsernamePasswordAuthenticationToken 身份验证令牌
-                UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(userDetail.getUsername(), null, objects);
+                    // 使用用户的用户名、空凭证参数和权限对象集合创建一个 UsernamePasswordAuthenticationToken 身份验证令牌
+                    UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(userDetail.getUsername(), null, objects);
 
-                // 将身份验证令牌设置到当前的 SecurityContext 中
-                context.setAuthentication(authenticationToken);
+                    // 将身份验证令牌设置到当前的 SecurityContext 中
+                    context.setAuthentication(authenticationToken);
+                }
             }
-            //放行
-            filterChain.doFilter(request, response);
         }
         filterChain.doFilter(request, response);
     }

+ 20 - 0
service/src/main/java/com/koobietech/eas/service/EasArcTlsAttendanceService.java

@@ -0,0 +1,20 @@
+package com.koobietech.eas.service;
+
+import com.koobietech.eas.common.result.PageData;
+import com.koobietech.eas.mbg.model.EasArcTlsAttendance;
+
+import java.util.List;
+
+public interface EasArcTlsAttendanceService {
+    PageData query(EasArcTlsAttendance attendance);
+
+    Boolean add(EasArcTlsAttendance attendance);
+
+    Boolean delete(EasArcTlsAttendance attendance);
+
+    Boolean update(EasArcTlsAttendance attendance);
+
+    boolean isExist(EasArcTlsAttendance attendance);
+
+    List<EasArcTlsAttendance> getStudentList(Long scheduleId);
+}

+ 209 - 0
service/src/main/java/com/koobietech/eas/service/impl/EasArcTlsAttendanceServiceImpl.java

@@ -0,0 +1,209 @@
+package com.koobietech.eas.service.impl;
+
+import com.koobietech.eas.common.exception.EasException;
+import com.koobietech.eas.common.result.PageData;
+import com.koobietech.eas.mbg.mapper.EasArcTlsAttendanceMapper;
+import com.koobietech.eas.mbg.mapper.EasEduCltRelationMapper;
+import com.koobietech.eas.mbg.mapper.EasEduScheduleMapper;
+import com.koobietech.eas.mbg.mapper.EasSysStudentMapper;
+import com.koobietech.eas.mbg.model.*;
+import com.koobietech.eas.service.EasArcTlsAttendanceService;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+public class EasArcTlsAttendanceServiceImpl implements EasArcTlsAttendanceService {
+
+    @Resource
+    private EasArcTlsAttendanceMapper easArcTlsAttendanceMapper;
+
+    @Resource
+    private EasEduCltRelationMapper easEduCltRelationMapper;
+
+    @Resource
+    private EasSysStudentMapper easSysStudentMapper;
+
+    @Resource
+    private EasEduScheduleMapper easEduScheduleMapper;
+
+
+    @Override
+    public PageData query(EasArcTlsAttendance attendance) {
+        EasArcTlsAttendanceExample easArcTlsAttendanceExample = new EasArcTlsAttendanceExample();
+        EasArcTlsAttendanceExample.Criteria criteria = easArcTlsAttendanceExample.createCriteria();
+        if (Objects.nonNull(attendance)) {
+
+            if (Objects.nonNull(attendance.getId()) && attendance.getId() != 0) {
+                criteria.andIdEqualTo(attendance.getId());
+            }
+            if (Objects.nonNull(attendance.getCheckinDate())) {
+                criteria.andCheckinDateEqualTo(attendance.getCheckinDate());
+            }
+            if (Objects.nonNull(attendance.getScheduleId()) && attendance.getScheduleId() != 0) {
+                criteria.andScheduleIdEqualTo(attendance.getScheduleId());
+            }
+            if (Objects.nonNull(attendance.getMonth()) && attendance.getMonth() != 0) {
+                criteria.andMonthEqualTo(attendance.getMonth());
+            }
+            if (StringUtils.hasText(attendance.getMorning())) {
+                criteria.andMorningEqualTo(attendance.getMorning());
+            }
+            if (StringUtils.hasText(attendance.getAfternoon())) {
+                criteria.andAfternoonEqualTo(attendance.getAfternoon());
+            }
+            if (StringUtils.hasText(attendance.getStudentNumber())) {
+                criteria.andStudentNumberLike("%" + attendance.getStudentNumber() + "%");
+            }
+            if (Objects.nonNull(attendance.getCreateUid()) && attendance.getCreateUid() != 0) {
+                criteria.andCreateUidEqualTo(attendance.getCreateUid());
+            }
+            if (Objects.nonNull(attendance.getCreateTime())) {
+                criteria.andCreateTimeEqualTo(attendance.getCreateTime());
+            }
+            if (Objects.nonNull(attendance.getModifyTime())) {
+                criteria.andModifyTimeEqualTo(attendance.getModifyTime());
+            }
+        }
+
+        List<EasArcTlsAttendance> easArcTlsAttendances =
+                easArcTlsAttendanceMapper.selectByExample(easArcTlsAttendanceExample);
+        long l = easArcTlsAttendanceMapper.countByExample(easArcTlsAttendanceExample);
+        PageData ret = new PageData();
+        ret.setData(easArcTlsAttendances);
+        ret.setTotal(l);
+        return ret;
+
+    }
+
+    @Override
+    public Boolean add(EasArcTlsAttendance attendance) {
+        //签到日期前端会自己传 所以就不需要再写一次了
+        attendance.setCreateTime(new Date());
+        attendance.setModifyTime(new Date());
+        return easArcTlsAttendanceMapper.insert(attendance) == 1;
+
+    }
+
+    @Override
+    public Boolean delete(EasArcTlsAttendance attendance) {
+        //虽然接收的是对象,但是后端是根据checkin_date和student_number来删除的
+        EasArcTlsAttendanceExample easArcTlsAttendanceExample = new EasArcTlsAttendanceExample();
+        EasArcTlsAttendanceExample.Criteria criteria = easArcTlsAttendanceExample.createCriteria();
+        if (Objects.nonNull(attendance)) {
+            if (Objects.nonNull(attendance.getCheckinDate())
+                    && StringUtils.hasText(attendance.getStudentNumber())) {
+                criteria.andCheckinDateEqualTo(attendance.getCheckinDate());
+                criteria.andStudentNumberEqualTo(attendance.getStudentNumber());
+                return easArcTlsAttendanceMapper.deleteByExample(easArcTlsAttendanceExample) == 1;
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public Boolean update(EasArcTlsAttendance attendance) {
+        attendance.setModifyTime(new Date());
+        return easArcTlsAttendanceMapper.updateByPrimaryKey(attendance) == 1;
+    }
+
+    @Override
+    public boolean isExist(EasArcTlsAttendance attendance) {
+        EasArcTlsAttendanceExample easArcTlsAttendanceExample = new EasArcTlsAttendanceExample();
+        EasArcTlsAttendanceExample.Criteria criteria = easArcTlsAttendanceExample.createCriteria();
+        if (Objects.nonNull(attendance)) {
+            if (Objects.nonNull(attendance.getCheckinDate())
+                    && StringUtils.hasText(attendance.getStudentNumber())) {
+                criteria.andCheckinDateEqualTo(attendance.getCheckinDate());
+                criteria.andStudentNumberEqualTo(attendance.getStudentNumber());
+                return easArcTlsAttendanceMapper.countByExample(easArcTlsAttendanceExample) == 1;
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public List<EasArcTlsAttendance> getStudentList(Long scheduleId) {
+        // 根据课表ID查找EasEduSchedule表,获取班级ID
+        EasEduSchedule easEduSchedule = easEduScheduleMapper.selectByPrimaryKey(scheduleId);
+        Long classId = Optional.ofNullable(easEduSchedule)
+                .map(s -> Long.valueOf(s.getClassId()))
+                .orElseThrow(() -> new EasException("未查询到对应课表,请检查数据库", 9595));
+
+        // 根据班级ID查找EasEduCltRelation表,获取学生ID列表
+        EasEduCltRelationExample easEduCltRelationExample = new EasEduCltRelationExample();
+        easEduCltRelationExample.createCriteria().andClassIdEqualTo(classId);
+
+        // 查询EasEduCltRelation表,获取符合条件的学生ID列表
+        List<Long> studentIds = easEduCltRelationMapper.selectByExample(easEduCltRelationExample)
+                .stream()
+                .map(r -> Long.valueOf(r.getStudentId()))
+                .collect(Collectors.toList());
+
+        // 根据学生ID列表查询EasSysStudent表,获取学生信息
+        EasSysStudentExample easSysStudentExample = new EasSysStudentExample();
+        easSysStudentExample.createCriteria().andIdIn(studentIds);
+        List<EasSysStudent> easSysStudents = easSysStudentMapper.selectByExample(easSysStudentExample);
+
+        // 封装查询结果到PageData对象并返回
+        return easSysStudents.stream()
+                .map(s -> {
+                    EasArcTlsAttendance easArcTlsAttendance = new EasArcTlsAttendance();
+                    easArcTlsAttendance.setStudentNumber(s.getStudentNumber());
+                    easArcTlsAttendance.setStudentName(s.getStudentName());
+                    return easArcTlsAttendance;
+                })
+                .collect(Collectors.toList());
+    }
+
+//    @Override
+//    public List<EasArcTlsAttendance> getStudentList(Long scheduleId) {
+//        // 创建查询条件,根据课表ID查找EasEduSchedule表,获取班级ID
+//        EasEduSchedule easEduSchedule = easEduScheduleMapper.selectByPrimaryKey(scheduleId);
+//        if (Objects.nonNull(easEduSchedule)) {
+//            Long classId = Long.valueOf(easEduSchedule.getClassId()); // 将班级ID赋值给classId变量
+//
+//            // 创建查询条件,根据班级ID查找EasEduCltRelation表,获取学生ID
+//            EasEduCltRelationExample easEduCltRelationExample = new EasEduCltRelationExample();
+//            EasEduCltRelationExample.Criteria criteriaFindStuId = easEduCltRelationExample.createCriteria();
+//            criteriaFindStuId.andClassIdEqualTo(classId); // 设置班级ID作为查询条件
+//
+//            // 查询EasEduCltRelation表,获取符合条件的学生ID列表
+//            List<EasEduCltRelation> easEduCltRelations = easEduCltRelationMapper.selectByExample(easEduCltRelationExample);
+//            List<Long> studentIds = new ArrayList<>();
+//            for (EasEduCltRelation easEduCltRelation : easEduCltRelations) {
+//                studentIds.add(Long.valueOf(easEduCltRelation.getStudentId())); // 将学生ID添加到列表中
+//            }
+//
+//            // 根据学生ID列表查询EasSysStudent表,获取学生信息
+//            EasSysStudentExample easSysStudentExample = new EasSysStudentExample();
+//            EasSysStudentExample.Criteria criteriaFindStu = easSysStudentExample.createCriteria();
+//            if (!studentIds.isEmpty()) {
+//                criteriaFindStu.andIdIn(studentIds); // 设置学生ID列表作为查询条件
+//            }
+//            List<EasSysStudent> easSysStudents = easSysStudentMapper.selectByExample(easSysStudentExample);
+//
+//            // 封装查询结果到PageData对象并返回
+//            PageData ret = new PageData();
+//            ret.setData(easSysStudents);
+//            List<EasArcTlsAttendance> list = new ArrayList<>();
+//            easSysStudents.forEach(easSysStudent -> {
+//                EasArcTlsAttendance easArcTlsAttendance = new EasArcTlsAttendance();
+//                easArcTlsAttendance.setStudentNumber(easSysStudent.getStudentNumber());
+//                easArcTlsAttendance.setStudentName(easSysStudent.getStudentName());
+//                list.add(easArcTlsAttendance);
+//            });
+//            return list;
+//        } else {
+//            throw new EasException("未查询到对应课表,请检查数据库",9595); // 如果查询不到课表,则返回空列表
+//        }
+//    }
+
+}
+
+
+
+