瀏覽代碼

feat:学员关联学校

Joburgess 4 年之前
父節點
當前提交
2e9a2dc876

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentClassInfoDto.java

@@ -16,6 +16,8 @@ public class StudentClassInfoDto {
 
     private Integer mainTeacherId;
 
+    private Integer cooperationOrganId;
+
     public Integer getStudentId() {
         return studentId;
     }
@@ -52,6 +54,14 @@ public class StudentClassInfoDto {
         return mainTeacherId;
     }
 
+    public Integer getCooperationOrganId() {
+        return cooperationOrganId;
+    }
+
+    public void setCooperationOrganId(Integer cooperationOrganId) {
+        this.cooperationOrganId = cooperationOrganId;
+    }
+
     public void setMainTeacherId(Integer mainTeacherId) {
         this.mainTeacherId = mainTeacherId;
     }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Student.java

@@ -54,6 +54,8 @@ public class Student extends SysUser {
 	@ApiModelProperty(value = "班级")
 	private String currentClass;
 
+	private Integer cooperationOrganId;
+
 	public Student(Integer userId, String subjectIdList) {
 		this.userId = userId;
 		this.subjectIdList = subjectIdList;
@@ -184,6 +186,14 @@ public class Student extends SysUser {
 		this.currentGradeNum = currentGradeNum;
 	}
 
+	public Integer getCooperationOrganId() {
+		return cooperationOrganId;
+	}
+
+	public void setCooperationOrganId(Integer cooperationOrganId) {
+		this.cooperationOrganId = cooperationOrganId;
+	}
+
 	@Override
 	public String getCurrentClass() {
 		return currentClass;

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServiceImpl.java

@@ -227,6 +227,9 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
             if(StringUtils.isBlank(student.getSubjectIdList())){
                 student.setSubjectIdList(studentClassInfoDto.getSubjectId().toString());
             }
+            if(Objects.isNull(student.getCooperationOrganId())){
+                student.setCooperationOrganId(studentClassInfoDto.getCooperationOrganId());
+            }
             needUpdateStudents.add(student);
         }
         if(!CollectionUtils.isEmpty(needUpdateStudents)){

+ 9 - 2
mec-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -21,6 +21,7 @@
         <result column="come_on_package_" property="comeOnPackage"/>
         <result column="current_grade_num_" property="currentGradeNum"/>
         <result column="current_class_" property="currentClass"/>
+        <result column="cooperation_organ_id_" property="cooperationOrganId"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -65,7 +66,7 @@
         <if test="operatingTag != null">
             operating_tag_,
         </if>
-        teacher_id_,create_time_,update_time_,service_tag_update_time_)
+        teacher_id_,create_time_,update_time_,service_tag_update_time_,cooperation_organ_id_)
         VALUES
         (#{userId},#{subjectIdList},
         <if test="serviceTag != null">
@@ -74,7 +75,7 @@
         <if test="operatingTag != null">
             #{operatingTag},
         </if>
-        #{teacherId},NOW(),NOW(),NOW())
+        #{teacherId},NOW(),NOW(),NOW(),#{cooperationOrganId})
     </insert>
 
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.Student">
@@ -111,6 +112,9 @@
             <if test="currentClass != null">
                 current_class_=#{currentClass},
             </if>
+            <if test="cooperationOrganId != null">
+                cooperation_organ_id_=#{cooperationOrganId},
+            </if>
                 update_time_ = NOW()
         </set>
         WHERE user_id_ = #{userId}
@@ -186,6 +190,9 @@
                 <if test="item.comeOnPackage != null">
                     come_on_package_=#{item.comeOnPackage},
                 </if>
+                <if test="item.cooperationOrganId != null">
+                    cooperation_organ_id_=#{item.cooperationOrganId},
+                </if>
                 update_time_ = NOW()
             </set>
             WHERE user_id_ = #{item.userId}

+ 2 - 1
mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml

@@ -941,7 +941,8 @@
                sr.music_group_id_ musicGroupId,
                sr.actual_subject_id_ subjectId,
                cgsm.class_group_id_ classGroupId,
-               cgtm.user_id_ mainTeacherId
+               cgtm.user_id_ mainTeacherId,
+               mg.cooperation_organ_id_ cooperationOrganId
         FROM student_registration sr
              LEFT JOIN music_group mg ON sr.music_group_id_=mg.id_
              LEFT JOIN class_group_student_mapper cgsm ON cgsm.group_type_='MUSIC' AND cgsm.music_group_id_=sr.music_group_id_ AND cgsm.user_id_=sr.user_id_