Przeglądaj źródła

Merge branch 'master' of http://49.234.186.218:9000/root/ieplus

jinxia.mo 1 miesiąc temu
rodzic
commit
8df8736993

+ 3 - 2
ie-admin/src/main/java/com/ruoyi/web/controller/dz/DzCardsController.java

@@ -85,8 +85,9 @@ public class DzCardsController extends BaseController
             dzCards.setDeptId(SecurityUtils.getDeptId());
         } else if (UserTypeEnum.isSchool(userType)) {
             dzCards.setCampusId(sysUser.getUserTypeId());
-        }
-        if ((UserTypeEnum.isAgent(userType) || UserTypeEnum.isTeacher(userType)) && null == dzCards.getAgentId()) {
+        } else if(UserTypeEnum.isTeacher(userType)) {
+            dzCards.setTeacherId(sysUser.getUserTypeId());
+        } else if (UserTypeEnum.isAgent(userType)) {
             //代理商及老师只能查看分配给自己的卡
             DzAgent agent = agentService.selectDzAgentByUserId(SecurityUtils.getUserId());
             if (null != agent) {

+ 9 - 1
ie-system/src/main/java/com/ruoyi/dz/domain/DzCards.java

@@ -100,7 +100,7 @@ public class DzCards extends BaseEntity
     /** 校区班级ID */
     @Excel(name = "校区班级ID")
     private Long classId;
-
+    private Long teacherId;
     /** 班级/入学年份 */
     @Excel(name = "班级/入学年份")
     private Integer year;
@@ -356,6 +356,14 @@ public class DzCards extends BaseEntity
         return schoolId;
     }
 
+    public Long getTeacherId() {
+        return teacherId;
+    }
+
+    public void setTeacherId(Long teacherId) {
+        this.teacherId = teacherId;
+    }
+
     public void setClassId(Long classId)
     {
         this.classId = classId;

+ 3 - 0
ie-system/src/main/resources/mapper/dz/DzCardsMapper.xml

@@ -122,6 +122,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="agentId != null ">
                 AND (agent_id = #{agentId} OR agent_id IN ( SELECT t.agent_id FROM dz_agent t WHERE t.agent_id=#{agentId} ))
             </if>
+            <if test="teacherId != null ">
+                AND c.class_id IN ( SELECT t.class_id FROM dz_teacher_class t WHERE t.teacher_id=#{teacherId} and now() &lt; t.out_date )
+            </if>
             <if test="leafAgentId != null "> and c.leaf_agent_id = #{leafAgentId}</if>
             <if test="campusId != null "> and c.campus_id = #{campusId}</if>
             <if test="campusClassId != null "> and c.campus_class_id = #{campusClassId}</if>