Просмотр исходного кода

老师布置作业时新增分谱

zouxuan 3 лет назад
Родитель
Сommit
69e9391ef3

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentCourseHomeworkDao.java

@@ -56,6 +56,7 @@ public interface StudentCourseHomeworkDao extends BaseDAO<Long, StudentCourseHom
     List<StudentCourseHomework> constructInitialStudentHomeworkRecordsWithPayment(@Param("courseScheduleID") Long courseScheduleID,
                                                                                   @Param("courseHomeworkID") Long courseHomeworkID,
                                                                                   @Param("musicScoreId") String musicScoreId,
+                                                                                  @Param("musicScoreContent") String musicScoreContent,
                                                                                   @Param("userIdList") List<Integer> userIdList);
 
     /**

+ 14 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ExtracurricularExercises.java

@@ -1,13 +1,12 @@
 package com.ym.mec.biz.dal.entity;
 
+import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.MusicScoreSubjectDto;
 import com.ym.mec.biz.dal.enums.ImSendTypeEnum;
 import com.ym.mec.common.entity.BaseEntity;
-
+import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
-import com.ym.mec.auth.api.entity.SysUser;
-
 import java.util.List;
 
 /**
@@ -19,32 +18,41 @@ public class ExtracurricularExercises extends BaseEntity {
 	private Long id;
 	
 	/** 老师编号 */
+	@ApiModelProperty(value="等级")
 	private Integer teacherId;
 	
 	private SysUser teacher = new SysUser();
 	
 	/** 学生列表 */
+	@ApiModelProperty(value="学生列表")
 	private String studentIdList;
 	
 	/** 批次号 */
+	@ApiModelProperty(value="批次号")
 	private String batchNo;
 	
 	/** 标题 */
+	@ApiModelProperty(value="标题")
 	private String title;
 	
 	/** 附件地址(多个用逗号分隔) */
+	@ApiModelProperty(value="附件地址(多个用逗号分隔)")
 	private String attachments;
 	
 	/** 作业内容 */
+	@ApiModelProperty(value="作业内容")
 	private String content;
 	
 	/** 截止日期 */
+	@ApiModelProperty(value="截止日期")
 	private java.util.Date expireDate;
 	
 	/** 完成人数 */
+	@ApiModelProperty(value="完成人数")
 	private Integer completedNum;
 	
 	/** 预计人数 */
+	@ApiModelProperty(value="预计人数")
 	private Integer expectNum;
 	
 	/**  */
@@ -53,8 +61,10 @@ public class ExtracurricularExercises extends BaseEntity {
 	/**  */
 	private java.util.Date updateTime;
 
+	@ApiModelProperty(value="是否及时回复")
 	private int isReplied;
 
+	@ApiModelProperty(value="是否提交")
 	private int isSubmit;
 
 	private int status;
@@ -64,6 +74,7 @@ public class ExtracurricularExercises extends BaseEntity {
 	private ImSendTypeEnum msgType = ImSendTypeEnum.TXT;
 
 	/** 伴奏列表(多个用逗号分隔) */
+	@ApiModelProperty(value="伴奏列表(多个用逗号分隔)")
 	private String musicScoreId;
 
 	private String musicScoreName;

+ 21 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ExtracurricularExercisesReply.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.entity;
 
+import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 import com.ym.mec.auth.api.entity.SysUser;
@@ -26,6 +27,7 @@ public class ExtracurricularExercisesReply extends BaseEntity {
 	private SysUser user = new SysUser();
 	
 	/** 作品附件 */
+	@ApiModelProperty(value="作品附件")
 	private String attachments;
 	
 	/**  */
@@ -35,25 +37,44 @@ public class ExtracurricularExercisesReply extends BaseEntity {
 	private java.util.Date updateTime;
 	
 	/** 备注 */
+	@ApiModelProperty(value="备注")
 	private String remark;
 	
 	/** 提交状态 */
+	@ApiModelProperty(value="提交状态")
 	private Integer status;
 	
 	/** 是否回复 */
+	@ApiModelProperty(value="是否回复")
 	private Integer isReplied;
 
+	@ApiModelProperty(value="是否及时回复")
 	private Integer isRepliedTimely;
 	
 	/** 是否已查看 */
+	@ApiModelProperty(value="是否已查看")
 	private Integer isView;
 	
 	private String organName;
 
+	@ApiModelProperty(value="提交时间")
 	private Date submitTime;
 
+	@ApiModelProperty(value="曲目编号,逗号分割")
 	private String musicScoreId;
 
+	/** 伴奏详情包含,曲目编号、分谱 */
+	@ApiModelProperty(value="伴奏详情包含,曲目编号、分谱")
+	private String musicScoreContent;
+
+	public String getMusicScoreContent() {
+		return musicScoreContent;
+	}
+
+	public void setMusicScoreContent(String musicScoreContent) {
+		this.musicScoreContent = musicScoreContent;
+	}
+
 	public String getMusicScoreId() {
 		return musicScoreId;
 	}

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentCourseHomework.java

@@ -31,16 +31,20 @@ public class StudentCourseHomework extends BaseEntity {
 	private String avatar;
 	
 	/**  */
+	@ApiModelProperty(value="作业编号")
 	private Long courseHomeworkId;
 
+	@ApiModelProperty(value="课程编号")
 	private Long courseScheduleId;
 	
 	private CourseHomework courseHomework = new CourseHomework();
 	
 	/** 作品附件 */
+	@ApiModelProperty(value="作品附件")
 	private String attachments;
 	
 	/** 评分 */
+	@ApiModelProperty(value="评分")
 	private Integer score;
 	
 	/**  */
@@ -51,15 +55,31 @@ public class StudentCourseHomework extends BaseEntity {
 
 	private boolean extra;
 
+	@ApiModelProperty(value="提交时间")
 	private Date submitTime;
 
 	private ImSendTypeEnum msgType = ImSendTypeEnum.TXT;
 
 	//伴奏编号
+	@ApiModelProperty(value="伴奏编号")
 	private String musicScoreId;
+
+	//伴奏编号
+	@ApiModelProperty(value="伴奏编号(包含分谱信息)")
+	private String musicScoreContent;
+
 	//伴奏编号
+	@ApiModelProperty(value="伴奏名称")
 	private String musicScoreName;
 
+	public String getMusicScoreContent() {
+		return musicScoreContent;
+	}
+
+	public void setMusicScoreContent(String musicScoreContent) {
+		this.musicScoreContent = musicScoreContent;
+	}
+
 	public String getMusicScoreName() {
 		return musicScoreName;
 	}

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

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.service.impl;
 
+import com.alibaba.fastjson.JSONObject;
 import com.ym.mec.biz.dal.dao.CourseHomeworkDao;
 import com.ym.mec.biz.dal.dao.CourseScheduleDao;
 import com.ym.mec.biz.dal.dao.StudentCourseHomeworkDao;
@@ -89,12 +90,14 @@ public class CourseHomeworkServiceImpl extends BaseServiceImpl<Long, CourseHomew
 					studentCourseHomeworks.addAll(studentCourseHomeworkDao.constructInitialStudentHomeworkRecordsWithPayment(courseSchedule.getId(),
 							oldCourseHomework.getId(),
 							StringUtils.join(scoreSubjectDto.getMusicScoreIdList(),","),
+							JSONObject.toJSONString(scoreSubjectDto.getMusicScoreHomeworkDtoList()),
 							scoreSubjectDto.getUserIdList()));
 				}
 			}else {
 				studentCourseHomeworks.addAll(studentCourseHomeworkDao.constructInitialStudentHomeworkRecordsWithPayment(courseSchedule.getId(),
 						oldCourseHomework.getId(),
 						oldCourseHomework.getMusicScoreId(),
+						"",
 						null));
 			}
 			if(CollectionUtils.isEmpty(studentCourseHomeworks)){

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

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.service.impl;
 
+import com.alibaba.fastjson.JSONObject;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.*;
@@ -584,12 +585,14 @@ public class CourseReviewServiceImpl extends BaseServiceImpl<Integer, CourseSche
                 studentCourseHomeworks.addAll(studentCourseHomeworkDao.constructInitialStudentHomeworkRecordsWithPayment(courseHomework.getCourseScheduleId(),
                         courseHomework.getId(),
                         StringUtils.join(scoreSubjectDto.getMusicScoreIdList(),","),
+                        JSONObject.toJSONString(scoreSubjectDto.getMusicScoreHomeworkDtoList()),
                         scoreSubjectDto.getUserIdList()));
             }
         }else {
             studentCourseHomeworks.addAll(studentCourseHomeworkDao.constructInitialStudentHomeworkRecordsWithPayment(courseHomework.getCourseScheduleId(),
                     courseHomework.getId(),
                     courseHomework.getMusicScoreId(),
+                    "",
                     null));
         }
         if(CollectionUtils.isEmpty(studentCourseHomeworks)){

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesServiceImpl.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.service.impl;
 
+import com.alibaba.fastjson.JSONObject;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.ExtracurricularExercises;
@@ -119,6 +120,7 @@ public class ExtracurricularExercisesServiceImpl extends BaseServiceImpl<Long, E
 					if(list.contains(studentId)){
 						MusicScoreSubjectDto musicScoreSubjectDto = collect.get(list).get(0);
 						studentExtraExercise.setMusicScoreId(StringUtils.join(musicScoreSubjectDto.getMusicScoreIdList(),","));
+						studentExtraExercise.setMusicScoreContent(JSONObject.toJSONString(musicScoreSubjectDto.getMusicScoreHomeworkDtoList()));
 						break;
 					}
 				}

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherAttendanceServiceImpl.java

@@ -343,12 +343,14 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 							studentCourseHomeworks.addAll(studentCourseHomeworkDao.constructInitialStudentHomeworkRecordsWithPayment(teacherAttendance.getCourseScheduleId(),
 									courseHomework.getId(),
 									StringUtils.join(scoreSubjectDto.getMusicScoreIdList(),","),
+									JSONObject.toJSONString(scoreSubjectDto.getMusicScoreHomeworkDtoList()),
 									scoreSubjectDto.getUserIdList()));
 						}
 					}else {
 						studentCourseHomeworks.addAll(studentCourseHomeworkDao.constructInitialStudentHomeworkRecordsWithPayment(teacherAttendance.getCourseScheduleId(),
 								courseHomework.getId(),
 								courseHomework.getMusicScoreId(),
+								"",
 								null));
 					}
 					if(CollectionUtils.isEmpty(studentCourseHomeworks)){

+ 15 - 4
mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesReplyMapper.xml

@@ -23,6 +23,7 @@
 		<result column="organ_name_" property="organName" />
 		<result column="submit_time_" property="submitTime" />
 		<result column="music_score_id_" property="musicScoreId" />
+		<result column="music_score_content_" property="musicScoreContent" />
 		<result column="tenant_id_" property="tenantId" />
 		<association property="extracurricularExercises" columnPrefix="ee_" resultMap="com.ym.mec.biz.dal.dao.ExtracurricularExercisesDao.ExtracurricularExercises"/>
 	</resultMap>
@@ -37,6 +38,7 @@
 		<result column="content_" property="content"/>
 		<result column="expire_date_" property="expireDate"/>
 		<result column="music_score_id_" property="musicScoreId" />
+		<result column="music_score_content_" property="musicScoreContent" />
 	</resultMap>
 
 	<sql id="queryPageCondition">
@@ -90,15 +92,21 @@
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ExtracurricularExercisesReply" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO extracurricular_exercises_reply (extracurricular_exercises_id_,user_id_,attachments_,create_time_,update_time_,remark_,status_,is_replied_,is_view_,is_replied_timely_,music_score_id_,tenant_id_)
-		VALUES(#{extracurricularExercisesId},#{userId},#{attachments},NOW(),NOW(),#{remark},#{status},#{isReplied},#{isView},#{isRepliedTimely},#{musicScoreId},#{tenantId})
+		INSERT INTO extracurricular_exercises_reply (extracurricular_exercises_id_,user_id_,attachments_,create_time_,
+		                                             update_time_,remark_,status_,is_replied_,is_view_,is_replied_timely_,music_score_id_,music_score_content_,tenant_id_)
+		VALUES(#{extracurricularExercisesId},#{userId},#{attachments},NOW(),NOW(),#{remark},#{status},#{isReplied},#{isView},
+		       #{isRepliedTimely},#{musicScoreId},#{musicScoreContent},#{tenantId})
 	</insert>
 
 	<insert id="batchInsert" parameterType="com.ym.mec.biz.dal.entity.ExtracurricularExercisesReply" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO extracurricular_exercises_reply (extracurricular_exercises_id_,user_id_,attachments_,create_time_,update_time_,remark_,status_,is_replied_,is_view_,is_replied_timely_,music_score_id_,tenant_id_)
+		INSERT INTO extracurricular_exercises_reply (extracurricular_exercises_id_,user_id_,attachments_,
+		                                             create_time_,update_time_,remark_,status_,is_replied_,is_view_,
+		                                             is_replied_timely_,music_score_id_,music_score_content_,tenant_id_)
 		VALUES
 		<foreach collection="replies" item="reply" separator=",">
-			(#{reply.extracurricularExercisesId},#{reply.userId},#{reply.attachments},NOW(),NOW(),#{reply.remark},#{reply.status},#{reply.isReplied},#{reply.isView},#{reply.isRepliedTimely},#{reply.musicScoreId},#{replay.tenantId})
+			(#{reply.extracurricularExercisesId},#{reply.userId},#{reply.attachments},NOW(),NOW(),
+			 #{reply.remark},#{reply.status},#{reply.isReplied},#{reply.isView},#{reply.isRepliedTimely},
+			 #{reply.musicScoreId},#{reply.musicScoreContent},#{replay.tenantId})
 		</foreach>
 	</insert>
 
@@ -109,6 +117,9 @@
 			<if test="musicScoreId != null">
 				music_score_id_ = #{musicScoreId},
 			</if>
+			<if test="musicScoreContent != null and musicScoreContent != ''">
+				music_score_content_ = #{musicScoreContent},
+			</if>
 			<if test="status != null">
 			status_ = #{status},
 			</if>

+ 11 - 4
mec-biz/src/main/resources/config/mybatis/StudentCourseHomeworkMapper.xml

@@ -26,6 +26,7 @@
         <result column="submit_time_" property="submitTime"/>
         <result column="music_score_name_" property="musicScoreName"/>
         <result column="music_score_id_" property="musicScoreId"/>
+        <result column="music_score_content_" property="musicScoreContent"/>
         <result column="tenant_id_" property="tenantId"/>
     </resultMap>
 
@@ -70,23 +71,25 @@
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.StudentCourseHomework" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
         INSERT INTO student_course_homework
-        (user_id_,course_schedule_id_,course_homework_id_,attachments_,score_,create_time_,update_time_,remark_,status_,is_replied_,is_view_,is_replied_timely_,music_score_id_,tenant_id_)
+        (user_id_,course_schedule_id_,course_homework_id_,attachments_,score_,create_time_,update_time_,
+         remark_,status_,is_replied_,is_view_,is_replied_timely_,music_score_id_,music_score_content_,tenant_id_)
         VALUES(#{userId},#{courseScheduleId},#{courseHomeworkId},#{attachments},#{score},now(),now(),#{remark},
                #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{isReplied,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-               #{isView,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{isRepliedTimely},#{musicScoreId},#{tenantId})
+               #{isView,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{isRepliedTimely},#{musicScoreId},#{musicScoreContent},#{tenantId})
     </insert>
 
     <insert id="batchInsertStudentCourseHomeworkRecord" parameterType="java.util.List" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
         INSERT INTO student_course_homework
         (user_id_,course_schedule_id_,course_homework_id_,attachments_,score_,create_time_,
-         update_time_,remark_,status_,is_replied_,is_view_,is_replied_timely_,music_score_id_,tenant_id_)
+         update_time_,remark_,status_,is_replied_,is_view_,is_replied_timely_,music_score_id_,music_score_content_,tenant_id_)
         VALUE
         <foreach collection="list" item="homework" separator=",">
             (#{homework.userId},#{homework.courseScheduleId},#{homework.courseHomeworkId},#{homework.attachments},
             #{homework.score},now(),now(),#{homework.remark},#{homework.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             #{homework.isReplied,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-            #{homework.isView,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{homework.isRepliedTimely},#{homework.musicScoreId},#{homework.tenantId})
+            #{homework.isView,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{homework.isRepliedTimely},
+            #{homework.musicScoreId},#{homework.musicScoreContent},#{homework.tenantId})
         </foreach>
     </insert>
 
@@ -97,6 +100,9 @@
             <if test="musicScoreId != null">
                 music_score_id_ = #{musicScoreId},
             </if>
+            <if test="musicScoreContent != null and musicScoreContent != ''">
+                music_score_content_ = #{musicScoreContent},
+            </if>
             <if test="courseHomeworkId != null">
                 course_homework_id_ = #{courseHomeworkId},
             </if>
@@ -251,6 +257,7 @@
         SELECT #{courseHomeworkID} course_homework_id_,
                #{courseScheduleID} course_schedule_id_,
                #{musicScoreId} music_score_id_,
+               #{musicScoreContent} music_score_content_,
                sa.user_id_,
                0                   status_,
                0                   is_replied_,