瀏覽代碼

智能陪练

zouxuan 4 年之前
父節點
當前提交
86fd063a73

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysMusicScoreAccompanimentDao.java

@@ -6,6 +6,7 @@ import com.ym.mec.common.dal.BaseDAO;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 public interface SysMusicScoreAccompanimentDao extends BaseDAO<Integer, SysMusicScoreAccompaniment> {
 
@@ -17,4 +18,10 @@ public interface SysMusicScoreAccompanimentDao extends BaseDAO<Integer, SysMusic
     List<Integer> findSubjectByMusicScoreId(@Param("sysMusicScoreId") Integer sysMusicScoreId, @Param("idList") List<Integer> idList);
 
     void batchUpdate(List<SysMusicScoreAccompaniment> sysMusicScoreAccompaniments);
+
+    void deleteBySongId(Integer id);
+
+    Object queryAccPage(Map<String, Object> params);
+
+    int findAccCount(Map<String, Object> params);
 }

+ 12 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysMusicScore.java

@@ -27,6 +27,9 @@ public class SysMusicScore {
 	
 	/** 原音MP3 */
 	private String url;
+
+	/** 原音MP3 */
+	private String createUserName;
 	
 	/** 上传人 */
 	private Integer createUserId;
@@ -39,7 +42,15 @@ public class SysMusicScore {
 	
 	/**  */
 	private java.util.Date createTime;
-	
+
+	public String getCreateUserName() {
+		return createUserName;
+	}
+
+	public void setCreateUserName(String createUserName) {
+		this.createUserName = createUserName;
+	}
+
 	public void setId(Integer id){
 		this.id = id;
 	}

+ 45 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysMusicScoreAccompaniment.java

@@ -15,6 +15,9 @@ public class SysMusicScoreAccompaniment {
 	
 	/**  */
 	private Integer subjectId;
+
+	/**  */
+	private String subjectName;
 	
 	/**  */
 	private String mp3Url;
@@ -27,13 +30,54 @@ public class SysMusicScoreAccompaniment {
 	
 	/**  */
 	private String xmlUrl;
+
+	/**  */
+	private String examSongName;
+
+	/**  */
+	private String type;
+
+	/**  */
+	private String url;
 	
 	/**  */
 	private java.util.Date createTime;
 	
 	/**  */
 	private java.util.Date updateTime;
-	
+
+	public String getSubjectName() {
+		return subjectName;
+	}
+
+	public void setSubjectName(String subjectName) {
+		this.subjectName = subjectName;
+	}
+
+	public String getExamSongName() {
+		return examSongName;
+	}
+
+	public void setExamSongName(String examSongName) {
+		this.examSongName = examSongName;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public String getUrl() {
+		return url;
+	}
+
+	public void setUrl(String url) {
+		this.url = url;
+	}
+
 	public void setId(Integer id){
 		this.id = id;
 	}

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

@@ -10,4 +10,6 @@ public interface SysMusicScoreAccompanimentService extends BaseService<Integer,
     void updateAcc(SysMusicScoreAccompaniment sysMusicScoreAccompaniment);
 
     Object queryAll(SysExamSongQueryInfo queryInfo);
+
+    Object queryAccPage(SysExamSongQueryInfo queryInfo);
 }

+ 28 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMusicScoreAccompanimentServiceImpl.java

@@ -6,10 +6,17 @@ import com.ym.mec.biz.dal.entity.SysMusicScoreAccompaniment;
 import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
 import com.ym.mec.biz.service.SysMusicScoreAccompanimentService;
 import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.util.collection.MapUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 @Service
 public class SysMusicScoreAccompanimentServiceImpl extends BaseServiceImpl<Integer, SysMusicScoreAccompaniment> implements SysMusicScoreAccompanimentService {
 	
@@ -23,11 +30,30 @@ public class SysMusicScoreAccompanimentServiceImpl extends BaseServiceImpl<Integ
 
 	@Override
 	public void updateAcc(SysMusicScoreAccompaniment sysMusicScoreAccompaniment) {
-
+		SysMusicScoreAccompaniment accompaniment = sysMusicScoreAccompanimentDao.get(sysMusicScoreAccompaniment.getId());
+		if(accompaniment == null){
+			throw new BizException("操作失败:伴奏信息不存在");
+		}
+		List<Integer> idList = new ArrayList<>();
+		idList.add(accompaniment.getId());
+		List<Integer> subjectIds = sysMusicScoreAccompanimentDao.findSubjectByMusicScoreId(accompaniment.getExamSongId(),idList);
+		if(subjectIds.size() > 0 && subjectIds.contains(accompaniment.getId())){
+			throw new BizException("操作失败:请勿提交重复的伴奏声部");
+		}
+		sysMusicScoreAccompanimentDao.update(sysMusicScoreAccompaniment);
 	}
 
 	@Override
 	public Object queryAll(SysExamSongQueryInfo queryInfo) {
-		return null;
+		Map<String, Object> params = new HashMap<>();
+		MapUtil.populateMap(params, queryInfo);
+		return sysMusicScoreAccompanimentDao.queryPage(params);
+	}
+
+	@Override
+	public Object queryAccPage(SysExamSongQueryInfo queryInfo) {
+		Map<String, Object> params = new HashMap<String, Object>();
+		MapUtil.populateMap(params, queryInfo);
+		return sysMusicScoreAccompanimentDao.queryAccPage(params);
 	}
 }

+ 3 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMusicScoreServiceImpl.java

@@ -89,7 +89,9 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class)
 	public void del(Integer id) {
-
+		sysMusicScoreDao.delete(id);
+		sysMusicScoreAccompanimentDao.deleteBySongId(id);
 	}
 }

+ 128 - 38
mec-biz/src/main/resources/config/mybatis/SysMusicScoreAccompanimentMapper.xml

@@ -10,17 +10,27 @@
 		<result column="id_" property="id" />
 		<result column="exam_song_id_" property="examSongId" />
 		<result column="subject_id_" property="subjectId" />
+		<result column="subject_name_" property="subjectName" />
 		<result column="mp3_url_" property="mp3Url" />
+		<result column="xml_url_" property="xmlUrl" />
+		<result column="name_" property="examSongName" />
+		<result column="type_" property="type" />
+		<result column="url_" property="url" />
 		<result column="del_flag_" property="delFlag" />
 		<result column="speed_" property="speed" />
-		<result column="xml_url_" property="xmlUrl" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 	</resultMap>
-	
+	<delete id="deleteBySongId">
+
+	</delete>
+
 	<!-- 根据主键查询一条记录 -->
 	<select id="get" resultMap="SysMusicScoreAccompaniment" >
-		SELECT * FROM sys_music_score_accompaniment WHERE id_ = #{id} 
+		SELECT sesa.*,ses.name_,ses.type_,ses.url_
+		FROM sys_music_score_accompaniment sesa
+		LEFT JOIN sys_exam_song ses ON ses.id_ = sesa.exam_song_id_
+		WHERE sesa.id_ = #{id}
 	</select>
 	
 	<!-- 全查询 -->
@@ -34,50 +44,69 @@
 		VALUES(#{examSongId},#{subjectId},#{mp3Url},#{delFlag},#{speed},#{xmlUrl},NOW(),NOW())
 	</insert>
     <insert id="batchInsert">
-
+		INSERT INTO sys_music_score_accompaniment (exam_song_id_,subject_id_,mp3_url_,del_flag_,speed_,xml_url_,create_time_,update_time_)
+		VALUES
+		<foreach collection="sysExamSongAccompaniments" item="item"  separator=",">
+			(#{item.examSongId},#{item.subjectId},#{item.mp3Url},#{item.delFlag},#{item.speed},#{item.xmlUrl},NOW(),NOW())
+		</foreach>
 	</insert>
 
     <!-- 根据主键查询一条记录 -->
 	<update id="update" parameterType="com.ym.mec.biz.dal.entity.SysMusicScoreAccompaniment">
-		UPDATE sys_music_score_accompaniment <set>
-<if test="delFlag != null">
-del_flag_ = #{delFlag},
-</if>
-<if test="subjectId != null">
-subject_id_ = #{subjectId},
-</if>
-<if test="id != null">
-id_ = #{id},
-</if>
-<if test="updateTime != null">
-update_time_ = #{updateTime},
-</if>
-<if test="xmlUrl != null">
-xml_url_ = #{xmlUrl},
-</if>
-<if test="examSongId != null">
-exam_song_id_ = #{examSongId},
-</if>
-<if test="mp3Url != null">
-mp3_url_ = #{mp3Url},
-</if>
-<if test="speed != null">
-speed_ = #{speed},
-</if>
-<if test="createTime != null">
-create_time_ = #{createTime},
-</if>
-</set> WHERE id_ = #{id} 
+		UPDATE sys_music_score_accompaniment
+		<set>
+		<if test="subjectId != null">
+			subject_id_ = #{subjectId},
+		</if>
+		<if test="speed != null">
+			speed_ = #{speed},
+		</if>
+		<if test="xmlUrl != null">
+			xml_url_ = #{xmlUrl},
+		</if>
+		<if test="examSongId != null">
+			exam_song_id_ = #{examSongId},
+		</if>
+		<if test="mp3Url != null">
+			mp3_url_ = #{mp3Url},
+		</if>
+		update_time_ = NOW()
+	</set>WHERE id_ = #{id}
 	</update>
 	<update id="batchDel">
-
+		UPDATE sys_music_score_accompaniment SET del_flag_ = 1,update_time_ = NOW() WHERE id_ IN
+		<foreach collection="delExamSongAccompanimentIds" item="item" open="(" close=")" separator=",">
+			#{item}
+		</foreach>
+	</update>
+	<update id="batchUpdate">
+		<foreach collection="sysExamSongAccompaniment" item="item" separator=";">
+			UPDATE sys_music_score_accompaniment
+			<set>
+				<if test="item.speed != null">
+					speed_ = #{item.speed},
+				</if>
+				<if test="item.subjectId != null">
+					subject_id_ = #{item.subjectId},
+				</if>
+				<if test="item.xmlUrl != null">
+					xml_url_ = #{item.xmlUrl},
+				</if>
+				<if test="item.examSongId != null">
+					exam_song_id_ = #{item.examSongId},
+				</if>
+				<if test="item.mp3Url != null">
+					mp3_url_ = #{item.mp3Url},
+				</if>
+				update_time_ = NOW()
+			</set> WHERE id_ = #{item.id}
+		</foreach>
 	</update>
-	<update id="batchUpdate"></update>
 
 	<!-- 根据主键删除一条记录 -->
-	<delete id="delete" >
-		DELETE FROM sys_music_score_accompaniment WHERE id_ = #{id} 
-	</delete>
+	<update id="delete" >
+		UPDATE sys_music_score_accompaniment SET del_flag_ = 1,update_time_ = NOW() WHERE id_ = #{id}
+	</update>
 	
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="SysMusicScoreAccompaniment" parameterType="map">
@@ -89,6 +118,67 @@ create_time_ = #{createTime},
 		SELECT COUNT(*) FROM sys_music_score_accompaniment
 	</select>
 	<select id="findSubjectByMusicScoreId" resultType="java.lang.Integer">
+		SELECT subject_id_ FROM sys_music_score_accompaniment
+		<where>
+			del_flag_ = 0
+			<if test="sysMusicScoreId != null">
+				AND exam_song_id_ = #{sysMusicScoreId}
+			</if>
+			<if test="idList != null and idList.size > 0">
+				AND id_ NOT IN
+				<foreach collection="idList" open="(" close=")" item="item" separator=",">
+					#{item}
+				</foreach>
+			</if>
+		</where>
+	</select>
+	<select id="queryAccPage" resultType="java.lang.Object">
+		SELECT sesa.*,ses.name_,ses.type_,ses.url_,s.name_ subject_name_
+		FROM sys_music_score_accompaniment sesa
+		LEFT JOIN sys_exam_song ses ON ses.id_ = sesa.exam_song_id_
+		LEFT JOIN subject s ON s.id_ = sesa.subject_id_
+		<include refid="queryPageSql"/>
+	</select>
 
+	<select id="findAccCount" resultType="java.lang.Integer">
+		SELECT COUNT(DISTINCT sesa.id_) FROM sys_music_score_accompaniment sesa
+		LEFT JOIN sys_exam_song ses ON ses.id_ = sesa.exam_song_id_
+		<include refid="queryPageSql"/>
 	</select>
+
+	<sql id="queryPageSql">
+		<where>
+			sesa.del_flag_ = 0
+			<if test="search != null and search != ''">
+				AND (sesa.id_ = #{search} OR ses.name_ LIKE CONCAT('%',#{search},'%'))
+			</if>
+			<if test="sysExamSongId != null">
+				AND sesa.exam_song_id_ = #{sysExamSongId}
+			</if>
+			<if test="subjectId != null">
+				AND sesa.subject_id_ = #{subjectId}
+			</if>
+			<if test="type != null and type == 'COMMON'">
+				AND ses.type_ = #{type}
+			</if>
+			<if test="type != null and type == 'ALL'">
+				<if test="createUserId != null">
+					AND (ses.type_ = 'COMMON' OR (ses.create_user_id_ = #{createUserId} AND ses.type_ = 'PERSON'))
+				</if>
+			</if>
+			<if test="type != null and type == 'PERSON'">
+				<if test="createUserId != null">
+					AND ses.type_ = #{type} AND ses.create_user_id_ = #{createUserId}
+				</if>
+				<if test="createUserId == null">
+					AND ses.type_ = #{type}
+				</if>
+			</if>
+			<if test="type == null or type == ''">
+				<if test="createUserId != null">
+					AND ses.create_user_id_ = #{createUserId}
+				</if>
+			</if>
+		</where>
+	</sql>
 </mapper>

+ 71 - 47
mec-biz/src/main/resources/config/mybatis/SysMusicScoreMapper.xml

@@ -8,13 +8,13 @@
 	
 	<resultMap type="com.ym.mec.biz.dal.entity.SysMusicScore" id="SysMusicScore">
 		<result column="id_" property="id" />
-		<result column="music_score_categories_id_" property="musicScoreCategoriesId" />
 		<result column="name_" property="name" />
-		<result column="type_" property="type" />
+		<result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
 		<result column="subject_ids_" property="subjectIds" />
 		<result column="speed_" property="speed" />
 		<result column="url_" property="url" />
 		<result column="create_user_id_" property="createUserId" />
+		<result column="create_user_name_" property="createUserName" />
 		<result column="del_flag_" property="delFlag" />
 		<result column="update_time_" property="updateTime" />
 		<result column="create_time_" property="createTime" />
@@ -32,65 +32,89 @@
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SysMusicScore" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		<!--
-		<selectKey resultClass="int" keyProperty="id" > 
-		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
-		</selectKey>
-		-->
-		INSERT INTO sys_music_score (id_,music_score_categories_id_,name_,type_,subject_ids_,speed_,url_,create_user_id_,del_flag_,update_time_,create_time_) VALUES(#{id},#{musicScoreCategoriesId},#{name},#{type},#{subjectIds},#{speed},#{url},#{createUserId},#{delFlag},#{updateTime},#{createTime})
+		INSERT INTO sys_music_score (music_score_categories_id_,name_,type_,speed_,url_,create_user_id_,del_flag_,update_time_,create_time_)
+		VALUES(#{musicScoreCategoriesId},#{name},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{speed},#{url},#{createUserId},#{delFlag},NOW(),NOW())
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
 	<update id="update" parameterType="com.ym.mec.biz.dal.entity.SysMusicScore">
 		UPDATE sys_music_score <set>
-<if test="delFlag != null">
-del_flag_ = #{delFlag},
-</if>
-<if test="createUserId != null">
-create_user_id_ = #{createUserId},
-</if>
-<if test="id != null">
-id_ = #{id},
-</if>
-<if test="url != null">
-url_ = #{url},
-</if>
-<if test="updateTime != null">
-update_time_ = #{updateTime},
-</if>
-<if test="subjectIds != null">
-subject_ids_ = #{subjectIds},
-</if>
-<if test="musicScoreCategoriesId != null">
-music_score_categories_id_ = #{musicScoreCategoriesId},
-</if>
-<if test="type != null">
-type_ = #{type},
-</if>
-<if test="name != null">
-name_ = #{name},
-</if>
-<if test="speed != null">
-speed_ = #{speed},
-</if>
-<if test="createTime != null">
-create_time_ = #{createTime},
-</if>
-</set> WHERE id_ = #{id} 
+		<if test="delFlag != null">
+			del_flag_ = #{delFlag},
+		</if>
+		<if test="createUserId != null">
+			create_user_id_ = #{createUserId},
+		</if>
+		<if test="url != null and url != ''">
+			url_ = #{url},
+		</if>
+		<if test="subjectIds != null and subjectIds != ''">
+			subject_ids_ = #{subjectIds},
+		</if>
+		<if test="type != null">
+			type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+		</if>
+		<if test="name != null and name != ''">
+			name_ = #{name},
+		</if>
+		<if test="speed != null">
+			speed_ = #{speed},
+		</if>
+		<if test="updateTime != null">
+			update_time_ = NOW()
+		</if>
+	</set>
+		WHERE id_ = #{id}
 	</update>
 	
 	<!-- 根据主键删除一条记录 -->
-	<delete id="delete" >
-		DELETE FROM sys_music_score WHERE id_ = #{id} 
-	</delete>
+	<update id="delete" >
+		UPDATE sys_music_score SET del_flag_ = 1 WHERE id_ = #{id}
+	</update>
 	
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="SysMusicScore" parameterType="map">
-		SELECT * FROM sys_music_score ORDER BY id_ <include refid="global.limit"/>
+		SELECT ses.*,su.real_name_ create_user_name_
+		FROM sys_music_score ses
+		LEFT JOIN sys_user su ON ses.create_user_id_ = su.id_
+		<include refid="queryPageSql"/>
+		GROUP BY ses.id_
+		ORDER BY ses.id_ DESC
+		<include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM sys_music_score
+		SELECT COUNT(0) FROM sys_music_score ses
+		<include refid="queryPageSql"/>
 	</select>
+	<sql id="queryPageSql">
+		<where>
+			ses.del_flag_ = 0
+			<if test="search != null and search != ''">
+				AND (ses.id_ = #{search} OR ses.name_ LIKE CONCAT('%',#{search},'%'))
+			</if>
+			<if test="type != null and type == 'COMMON'">
+				AND ses.type_ = #{type}
+			</if>
+			<if test="type != null and type == 'ALL'">
+				<if test="createUserId != null">
+					AND (ses.type_ = 'COMMON' OR (ses.create_user_id_ = #{createUserId} AND ses.type_ = 'PERSON'))
+				</if>
+			</if>
+			<if test="type != null and type == 'PERSON'">
+				<if test="createUserId != null">
+					AND ses.type_ = #{type} AND ses.create_user_id_ = #{createUserId}
+				</if>
+				<if test="createUserId == null">
+					AND ses.type_ = #{type}
+				</if>
+			</if>
+			<if test="type == null or type == ''">
+				<if test="createUserId != null">
+					AND ses.create_user_id_ = #{createUserId}
+				</if>
+			</if>
+		</where>
+	</sql>
 </mapper>

+ 25 - 0
mec-student/src/main/java/com/ym/mec/student/controller/SysMusicScoreAccompanimentController.java

@@ -0,0 +1,25 @@
+package com.ym.mec.student.controller;
+
+import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
+import com.ym.mec.biz.service.SysMusicScoreAccompanimentService;
+import com.ym.mec.common.controller.BaseController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RequestMapping("sysMusicScoreAccompaniment")
+@Api(tags = "曲库服务")
+@RestController
+public class SysMusicScoreAccompanimentController extends BaseController {
+
+    @Autowired
+    private SysMusicScoreAccompanimentService sysMusicScoreAccompanimentService;
+
+    @ApiOperation(value = "分页查询")
+    @GetMapping("/queryPage")
+    public Object queryPage(SysExamSongQueryInfo queryInfo) {
+        queryInfo.setType("COMMON");
+        return succeed(sysMusicScoreAccompanimentService.queryAccPage(queryInfo));
+    }
+}

+ 25 - 0
mec-student/src/main/java/com/ym/mec/student/controller/SysMusicScoreController.java

@@ -0,0 +1,25 @@
+package com.ym.mec.student.controller;
+
+import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
+import com.ym.mec.biz.service.SysMusicScoreService;
+import com.ym.mec.common.controller.BaseController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RequestMapping("sysMusicScore")
+@Api(tags = "曲库")
+@RestController
+public class SysMusicScoreController extends BaseController {
+
+    @Autowired
+    private SysMusicScoreService sysMusicScoreService;
+
+    @ApiOperation(value = "分页查询")
+    @GetMapping("/queryPage")
+    public Object queryPage(SysExamSongQueryInfo queryInfo) {
+        queryInfo.setType("COMMON");
+        return succeed(sysMusicScoreService.queryPage(queryInfo));
+    }
+}

+ 54 - 0
mec-teacher/src/main/java/com/ym/mec/teacher/controller/SysMusicScoreAccompanimentController.java

@@ -0,0 +1,54 @@
+package com.ym.mec.teacher.controller;
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.entity.SysMusicScoreAccompaniment;
+import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
+import com.ym.mec.biz.service.SysMusicScoreAccompanimentService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.exception.BizException;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RequestMapping("sysMusicScoreAccompaniment")
+@Api(tags = "曲库服务")
+@RestController
+public class SysMusicScoreAccompanimentController extends BaseController {
+
+    @Autowired
+    private SysMusicScoreAccompanimentService sysMusicScoreAccompanimentService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
+    @ApiOperation(value = "修改")
+    @PostMapping("/update")
+    public Object update(@RequestBody SysMusicScoreAccompaniment sysMusicScoreAccompaniment) {
+        sysMusicScoreAccompanimentService.updateAcc(sysMusicScoreAccompaniment);
+        return succeed();
+    }
+
+    @ApiOperation(value = "删除")
+    @PostMapping("/del")
+    public Object del(Integer id) {
+        sysMusicScoreAccompanimentService.delete(id);
+        return succeed();
+    }
+
+    @ApiOperation(value = "分页查询")
+    @GetMapping("/queryPage")
+    public Object queryPage(SysExamSongQueryInfo queryInfo) {
+        String type = queryInfo.getType();
+        if(StringUtils.isEmpty(type)){
+            queryInfo.setType("ALL");
+        }
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if(sysUser == null){
+            throw new BizException("请登录");
+        }
+        queryInfo.setCreateUserId(sysUser.getId());
+        return succeed(sysMusicScoreAccompanimentService.queryAccPage(queryInfo));
+    }
+}

+ 56 - 0
mec-teacher/src/main/java/com/ym/mec/teacher/controller/SysMusicScoreController.java

@@ -0,0 +1,56 @@
+package com.ym.mec.teacher.controller;
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dto.MusicScoreDto;
+import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
+import com.ym.mec.biz.service.SysMusicScoreService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.exception.BizException;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+@RequestMapping("sysMusicScore")
+@Api(tags = "曲库")
+@RestController
+public class SysMusicScoreController extends BaseController {
+
+    @Autowired
+    private SysMusicScoreService sysMusicScoreService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
+    @ApiOperation(value = "新增")
+    @PostMapping("/add")
+    public Object add(@RequestBody MusicScoreDto examSongDto) {
+        sysMusicScoreService.add(examSongDto);
+        return succeed();
+    }
+
+    @ApiOperation(value = "删除")
+    @PostMapping("/del")
+    public Object del(Integer id) {
+        sysMusicScoreService.del(id);
+        return succeed();
+    }
+
+    @ApiOperation(value = "分页查询")
+    @GetMapping("/queryPage")
+    @PreAuthorize("@pcs.hasPermissions('sysMusicScore/queryPage')")
+    public Object queryPage(SysExamSongQueryInfo queryInfo) {
+        String type = queryInfo.getType();
+        if(StringUtils.isEmpty(type)){
+            queryInfo.setType("ALL");
+        }
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if(sysUser == null){
+            throw new BizException("请登录");
+        }
+        queryInfo.setCreateUserId(sysUser.getId());
+        return succeed(sysMusicScoreService.queryPage(queryInfo));
+    }
+}