Browse Source

Merge branch 'exam_song' of http://git.dayaedu.com/yonge/mec

zouxuan 4 years ago
parent
commit
4d88aee274
17 changed files with 35 additions and 786 deletions
  1. 1 1
      codegen/src/main/resources/generateConfigration.xml
  2. 0 47
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysExamSongAccompanimentDao.java
  3. 0 43
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ExamSongDto.java
  4. 0 157
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysExamSongAccompaniment.java
  5. 0 10
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/SysExamSongQueryInfo.java
  6. 0 18
      mec-biz/src/main/java/com/ym/mec/biz/service/SysExamSongAccompanimentService.java
  7. 0 7
      mec-biz/src/main/java/com/ym/mec/biz/service/SysExamSongService.java
  8. 0 63
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysExamSongAccompanimentServiceImpl.java
  9. 1 75
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysExamSongServiceImpl.java
  10. 3 5
      mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml
  11. 0 198
      mec-biz/src/main/resources/config/mybatis/SysExamSongAccompanimentMapper.xml
  12. 10 6
      mec-biz/src/main/resources/config/mybatis/SysExamSongMapper.xml
  13. 0 33
      mec-student/src/main/java/com/ym/mec/student/controller/SysExamSongAccompanimentController.java
  14. 0 63
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/SysExamSongAccompanimentController.java
  15. 15 6
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/SysExamSongController.java
  16. 0 45
      mec-web/src/main/java/com/ym/mec/web/controller/SysExamSongAccompanimentController.java
  17. 5 9
      mec-web/src/main/java/com/ym/mec/web/controller/SysExamSongController.java

+ 1 - 1
codegen/src/main/resources/generateConfigration.xml

@@ -8,7 +8,7 @@
 		<catalog>mec_dev</catalog>
 		<schema>mec_dev</schema>
 	</dbConfiguration>
-	<srcBase>/Users/chenxiaoyu/Documents/javabean</srcBase>
+	<srcBase>/Users/zouxuan/Documents/javabean</srcBase>
 	<pojoPackageName>com.ym.mec.biz.dal.entity</pojoPackageName>
 	<daoPackageName>com.ym.mec.biz.dal.dao</daoPackageName>
 	<servicePackageName>com.ym.mec.biz.service</servicePackageName>

+ 0 - 47
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysExamSongAccompanimentDao.java

@@ -1,47 +0,0 @@
-package com.ym.mec.biz.dal.dao;
-
-
-import com.ym.mec.biz.dal.entity.SysExamSongAccompaniment;
-import com.ym.mec.common.dal.BaseDAO;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-import java.util.Map;
-
-public interface SysExamSongAccompanimentDao extends BaseDAO<Integer, SysExamSongAccompaniment> {
-
-
-    /**
-     * 批量新增
-     * @param sysExamSongAccompaniments
-     * @param sysExamSongId
-     */
-    void batchInsert(@Param("sysExamSongAccompaniments") List<SysExamSongAccompaniment> sysExamSongAccompaniments, @Param("sysExamSongId") Integer sysExamSongId);
-
-    void deleteBySongId(Integer examSongId);
-
-    void batchUpdate(@Param("sysExamSongAccompaniment") List<SysExamSongAccompaniment> sysExamSongAccompaniment);
-
-    /**
-     * 获取已存在的声部
-     * @param sysExamSongId
-     * @param examSongAccIds
-     * @return
-     */
-    List<Integer> findSubjectByExamId(@Param("sysExamSongId") Integer sysExamSongId, @Param("examSongAccIds") List<Integer> examSongAccIds);
-
-    /**
-     * 批量删除
-     * @param delExamSongAccompanimentIds
-     */
-    void batchDel(@Param("delExamSongAccompanimentIds") List<Integer> delExamSongAccompanimentIds);
-
-    /**
-     * 用于学生端,教师端分页查询伴奏列表
-     * @param params
-     * @return
-     */
-    List<SysExamSongAccompaniment> queryAccPage(Map<String, Object> params);
-
-    int findAccCount(Map<String, Object> params);
-}

+ 0 - 43
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ExamSongDto.java

@@ -1,43 +0,0 @@
-package com.ym.mec.biz.dal.dto;
-
-import com.ym.mec.biz.dal.entity.SysExamSong;
-import com.ym.mec.biz.dal.entity.SysExamSongAccompaniment;
-import io.swagger.annotations.ApiModelProperty;
-
-import java.util.List;
-
-public class ExamSongDto {
-
-    @ApiModelProperty(value = "曲目",required = false)
-    private SysExamSong sysExamSong;
-
-    @ApiModelProperty(value = "伴奏",required = false)
-    private List<SysExamSongAccompaniment> sysExamSongAccompaniments;
-
-    @ApiModelProperty(value = "需要删除的id",required = false)
-    private List<Integer> delExamSongAccompanimentIds;
-
-    public List<Integer> getDelExamSongAccompanimentIds() {
-        return delExamSongAccompanimentIds;
-    }
-
-    public void setDelExamSongAccompanimentIds(List<Integer> delExamSongAccompanimentIds) {
-        this.delExamSongAccompanimentIds = delExamSongAccompanimentIds;
-    }
-
-    public SysExamSong getSysExamSong() {
-        return sysExamSong;
-    }
-
-    public void setSysExamSong(SysExamSong sysExamSong) {
-        this.sysExamSong = sysExamSong;
-    }
-
-    public List<SysExamSongAccompaniment> getSysExamSongAccompaniments() {
-        return sysExamSongAccompaniments;
-    }
-
-    public void setSysExamSongAccompaniments(List<SysExamSongAccompaniment> sysExamSongAccompaniments) {
-        this.sysExamSongAccompaniments = sysExamSongAccompaniments;
-    }
-}

+ 0 - 157
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysExamSongAccompaniment.java

@@ -1,157 +0,0 @@
-package com.ym.mec.biz.dal.entity;
-
-import org.apache.commons.lang3.builder.ToStringBuilder;
-
-/**
- * 对应数据库表(sys_exam_song_accompaniment):
- */
-public class SysExamSongAccompaniment {
-
-	/**  */
-	private Integer id;
-	
-	/**  */
-	private Integer examSongId;
-	
-	/**  */
-	private Integer subjectId;
-
-	/**  */
-	private String subjectName;
-	
-	/**  */
-	private String mp3Url;
-	
-	/**  */
-	private String xmlUrl;
-
-	/**  */
-	private String examSongName;
-
-	/**  */
-	private String type;
-
-	/**  */
-	private String url;
-
-	/**  */
-	private int delFlag;
-
-	private Integer speed;
-	
-	/**  */
-	private java.util.Date createTime;
-	
-	/**  */
-	private java.util.Date updateTime;
-
-	public String getUrl() {
-		return url;
-	}
-
-	public void setUrl(String url) {
-		this.url = url;
-	}
-
-	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 getSubjectName() {
-		return subjectName;
-	}
-
-	public void setSubjectName(String subjectName) {
-		this.subjectName = subjectName;
-	}
-
-	public int getDelFlag() {
-		return delFlag;
-	}
-
-	public void setDelFlag(int delFlag) {
-		this.delFlag = delFlag;
-	}
-
-	public Integer getSpeed() {
-		return speed;
-	}
-
-	public void setSpeed(Integer speed) {
-		this.speed = speed;
-	}
-
-	public void setId(Integer id){
-		this.id = id;
-	}
-	
-	public Integer getId(){
-		return this.id;
-	}
-			
-	public void setExamSongId(Integer examSongId){
-		this.examSongId = examSongId;
-	}
-	
-	public Integer getExamSongId(){
-		return this.examSongId;
-	}
-			
-	public void setSubjectId(Integer subjectId){
-		this.subjectId = subjectId;
-	}
-	
-	public Integer getSubjectId(){
-		return this.subjectId;
-	}
-			
-	public void setMp3Url(String mp3Url){
-		this.mp3Url = mp3Url;
-	}
-	
-	public String getMp3Url(){
-		return this.mp3Url;
-	}
-			
-	public void setXmlUrl(String xmlUrl){
-		this.xmlUrl = xmlUrl;
-	}
-	
-	public String getXmlUrl(){
-		return this.xmlUrl;
-	}
-			
-	public void setCreateTime(java.util.Date createTime){
-		this.createTime = createTime;
-	}
-	
-	public java.util.Date getCreateTime(){
-		return this.createTime;
-	}
-			
-	public void setUpdateTime(java.util.Date updateTime){
-		this.updateTime = updateTime;
-	}
-	
-	public java.util.Date getUpdateTime(){
-		return this.updateTime;
-	}
-			
-	@Override
-	public String toString() {
-		return ToStringBuilder.reflectionToString(this);
-	}
-
-}

+ 0 - 10
mec-biz/src/main/java/com/ym/mec/biz/dal/page/SysExamSongQueryInfo.java

@@ -14,16 +14,6 @@ public class SysExamSongQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "类型",required = true)
     private String type;
 
-    private Integer sysExamSongId;
-
-    public Integer getSysExamSongId() {
-        return sysExamSongId;
-    }
-
-    public void setSysExamSongId(Integer sysExamSongId) {
-        this.sysExamSongId = sysExamSongId;
-    }
-
     public Integer getCreateUserId() {
         return createUserId;
     }

+ 0 - 18
mec-biz/src/main/java/com/ym/mec/biz/service/SysExamSongAccompanimentService.java

@@ -1,18 +0,0 @@
-package com.ym.mec.biz.service;
-
-
-import com.ym.mec.biz.dal.entity.SysExamSongAccompaniment;
-import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
-import com.ym.mec.common.page.PageInfo;
-import com.ym.mec.common.service.BaseService;
-
-import java.util.List;
-
-public interface SysExamSongAccompanimentService extends BaseService<Integer, SysExamSongAccompaniment> {
-
-    void updateAcc(SysExamSongAccompaniment sysExamSongAccompaniment);
-
-    List<SysExamSongAccompaniment> queryAll(SysExamSongQueryInfo queryInfo);
-
-    List<SysExamSongAccompaniment> queryAccPage(SysExamSongQueryInfo queryInfo);
-}

+ 0 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/SysExamSongService.java

@@ -1,16 +1,9 @@
 package com.ym.mec.biz.service;
 
 
-import com.ym.mec.biz.dal.dto.ExamSongDto;
 import com.ym.mec.biz.dal.entity.SysExamSong;
-import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
 import com.ym.mec.common.service.BaseService;
 
 public interface SysExamSongService extends BaseService<Integer, SysExamSong> {
 
-    void add(ExamSongDto examSongDto);
-
-    void del(Integer sysExamSongId);
-
-    void updateExamSong(ExamSongDto examSongDto);
 }

+ 0 - 63
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysExamSongAccompanimentServiceImpl.java

@@ -1,63 +0,0 @@
-package com.ym.mec.biz.service.impl;
-
-
-import com.ym.mec.biz.dal.dao.SysExamSongAccompanimentDao;
-import com.ym.mec.biz.dal.entity.SysExamSongAccompaniment;
-import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
-import com.ym.mec.biz.service.SysExamSongAccompanimentService;
-import com.ym.mec.common.dal.BaseDAO;
-import com.ym.mec.common.exception.BizException;
-import com.ym.mec.common.page.PageInfo;
-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 org.springframework.transaction.annotation.Transactional;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-@Service
-public class SysExamSongAccompanimentServiceImpl extends BaseServiceImpl<Integer, SysExamSongAccompaniment> implements SysExamSongAccompanimentService {
-	
-	@Autowired
-	private SysExamSongAccompanimentDao sysExamSongAccompanimentDao;
-
-	@Override
-	public BaseDAO<Integer, SysExamSongAccompaniment> getDAO() {
-		return sysExamSongAccompanimentDao;
-	}
-
-	@Override
-	@Transactional(rollbackFor = Exception.class)
-	public void updateAcc(SysExamSongAccompaniment sysExamSongAccompaniment) {
-		SysExamSongAccompaniment accompaniment = sysExamSongAccompanimentDao.get(sysExamSongAccompaniment.getId());
-		if(accompaniment == null){
-			throw new BizException("操作失败:伴奏信息不存在");
-		}
-		List<Integer> idList = new ArrayList<>();
-		idList.add(accompaniment.getId());
-		List<Integer> subjectIds = sysExamSongAccompanimentDao.findSubjectByExamId(accompaniment.getExamSongId(),idList);
-		if(subjectIds.size() > 0 && subjectIds.contains(accompaniment.getId())){
-			throw new BizException("操作失败:请勿提交重复的伴奏声部");
-		}
-		sysExamSongAccompanimentDao.update(sysExamSongAccompaniment);
-	}
-
-	@Override
-	public List<SysExamSongAccompaniment> queryAll(SysExamSongQueryInfo queryInfo) {
-		Map<String, Object> params = new HashMap<>();
-		MapUtil.populateMap(params, queryInfo);
-		return sysExamSongAccompanimentDao.queryPage(params);
-	}
-
-	@Override
-	public List<SysExamSongAccompaniment> queryAccPage(SysExamSongQueryInfo queryInfo) {
-		Map<String, Object> params = new HashMap<String, Object>();
-		MapUtil.populateMap(params, queryInfo);
-		return sysExamSongAccompanimentDao.queryAccPage(params);
-	}
-}

+ 1 - 75
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysExamSongServiceImpl.java

@@ -1,97 +1,23 @@
 package com.ym.mec.biz.service.impl;
 
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dao.SysExamSongAccompanimentDao;
 import com.ym.mec.biz.dal.dao.SysExamSongDao;
-import com.ym.mec.biz.dal.dto.ExamSongDto;
 import com.ym.mec.biz.dal.entity.SysExamSong;
-import com.ym.mec.biz.dal.entity.SysExamSongAccompaniment;
 import com.ym.mec.biz.service.SysExamSongService;
 import com.ym.mec.common.dal.BaseDAO;
-import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.stream.Collectors;
 
 @Service
 public class SysExamSongServiceImpl extends BaseServiceImpl<Integer, SysExamSong> implements SysExamSongService {
 	
 	@Autowired
 	private SysExamSongDao sysExamSongDao;
-	@Autowired
-	private SysExamSongAccompanimentDao sysExamSongAccompanimentDao;
-	@Autowired
-	private SysUserFeignService sysUserFeignService;
 
 	@Override
 	public BaseDAO<Integer, SysExamSong> getDAO() {
 		return sysExamSongDao;
 	}
-
-	@Override
-	@Transactional(rollbackFor = Exception.class)
-	public void add(ExamSongDto examSongDto) {
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if(sysUser == null){
-			throw new BizException("请登录");
-		}
-		SysExamSong sysExamSong = examSongDto.getSysExamSong();
-		sysExamSong.setCreateUserId(sysUser.getId());
-		sysExamSongDao.insert(sysExamSong);
-		List<SysExamSongAccompaniment> sysExamSongAccompaniment = examSongDto.getSysExamSongAccompaniments();
-		if(sysExamSongAccompaniment != null && sysExamSongAccompaniment.size() > 0){
-			sysExamSongAccompanimentDao.batchInsert(sysExamSongAccompaniment,sysExamSong.getId());
-		}
-	}
-
-	@Override
-	@Transactional(rollbackFor = Exception.class)
-	public void del(Integer sysExamSongId) {
-		sysExamSongDao.delete(sysExamSongId);
-		sysExamSongAccompanimentDao.deleteBySongId(sysExamSongId);
-	}
-
-	@Override
-	@Transactional(rollbackFor = Exception.class)
-	public void updateExamSong(ExamSongDto examSongDto) {
-		SysExamSong sysExamSong = examSongDto.getSysExamSong();
-		sysExamSongDao.update(sysExamSong);
-		List<Integer> delExamSongAccompanimentIds = examSongDto.getDelExamSongAccompanimentIds();
-		if(delExamSongAccompanimentIds != null && delExamSongAccompanimentIds.size() > 0){
-			sysExamSongAccompanimentDao.batchDel(delExamSongAccompanimentIds);
-		}
-		List<SysExamSongAccompaniment> sysExamSongAccompaniment = examSongDto.getSysExamSongAccompaniments();
-		if(sysExamSongAccompaniment != null && sysExamSongAccompaniment.size() > 0){
-			List<Integer> subjectIdList = sysExamSongAccompaniment.stream().map(e -> e.getSubjectId()).collect(Collectors.toList());
-			subjectIdList.removeAll(Collections.singleton(null));
-			if(subjectIdList.size() > 0){
-				List<Integer> idList = sysExamSongAccompaniment.stream().map(e -> e.getId()).collect(Collectors.toList());
-				List<Integer> subjectIds = sysExamSongAccompanimentDao.findSubjectByExamId(sysExamSong.getId(),idList);
-				int subjectSize = subjectIds.size() + subjectIdList.size();
-				subjectIdList.addAll(subjectIds);
-				int size = new HashSet<>(subjectIdList).size();
-				if(size < subjectSize){
-					throw new BizException("操作失败:请勿提交重复的伴奏声部");
-				}
-			}
-			//获取需要修改的伴奏
-			List<SysExamSongAccompaniment> updateCollect = sysExamSongAccompaniment.stream().filter(e -> e.getId() != null).collect(Collectors.toList());
-			if(updateCollect.size() > 0){
-				sysExamSongAccompanimentDao.batchUpdate(updateCollect);
-			}
-			//获取需要新增的伴奏
-			List<SysExamSongAccompaniment> addCollect = sysExamSongAccompaniment.stream().filter(e -> e.getId() == null).collect(Collectors.toList());
-			if(addCollect.size() > 0){
-				sysExamSongAccompanimentDao.batchInsert(addCollect,sysExamSong.getId());
-			}
-		}
-	}
+	
 }

+ 3 - 5
mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml

@@ -740,12 +740,10 @@
     <select id="getAttendanceError" resultType="int">
 		SELECT COUNT(DISTINCT c.id_) FROM (SELECT cs.id_ FROM course_schedule cs
 		LEFT JOIN teacher_attendance ta ON ta.course_schedule_id_ = cs.id_
-		LEFT JOIN course_schedule_student_payment cssp ON cssp.course_schedule_id_ = cs.id_
-		LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cssp.course_schedule_id_ AND cssp.user_id_ = sa.user_id_
+		LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cs.id_
 		WHERE ta.teacher_id_ = cs.actual_teacher_id_
-		AND cs.status_ = 'OVER' AND cs.del_flag_ = 0 AND cs.class_date_ >= '2021-02-01'
-		AND (((ta.sign_in_status_ = 0 OR ta.sign_out_status_ = 0) AND ta.dispose_content_ IS NULL) OR (sa.id_ IS NULL OR (sa.status_ != 'NORMAL' AND sa.visit_flag_ = 0)))
-		AND (ta.dispose_content_ IS NOT NULL OR (ta.sign_in_status_ IS NOT NULL AND ta.sign_out_status_ IS NOT NULL))
+		AND cs.status_ = 'OVER' AND cs.del_flag_ = 0 AND cs.class_date_>='2021-02-01'
+		AND (ta.sign_in_status_ != 1 OR ta.sign_out_status_ != 1 OR sa.status_ != 'NORMAL') AND ta.dispose_content_ IS NULL
 		AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
 		<if test="organIds!=null and organIds.size() > 0">
 			AND cs.organ_id_ IN

+ 0 - 198
mec-biz/src/main/resources/config/mybatis/SysExamSongAccompanimentMapper.xml

@@ -1,198 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<!--
-这个文件是自动生成的。
-不要修改此文件。所有改动将在下次重新自动生成时丢失。
--->
-<mapper namespace="com.ym.mec.biz.dal.dao.SysExamSongAccompanimentDao">
-	
-	<resultMap type="com.ym.mec.biz.dal.entity.SysExamSongAccompaniment" id="SysExamSongAccompaniment">
-		<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="create_time_" property="createTime" />
-		<result column="update_time_" property="updateTime" />
-	</resultMap>
-	
-	<!-- 根据主键查询一条记录 -->
-	<select id="get" resultMap="SysExamSongAccompaniment" >
-		SELECT sesa.*,ses.name_,ses.type_,ses.url_
-		FROM sys_exam_song_accompaniment sesa
-		LEFT JOIN sys_exam_song ses ON ses.id_ = sesa.exam_song_id_
-		WHERE sesa.id_ = #{id}
-	</select>
-	
-	<!-- 全查询 -->
-	<select id="findAll" resultMap="SysExamSongAccompaniment">
-		SELECT * FROM sys_exam_song_accompaniment ORDER BY id_
-	</select>
-	
-	<!-- 向数据库增加一条记录 -->
-	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SysExamSongAccompaniment" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO sys_exam_song_accompaniment (exam_song_id_,subject_id_,mp3_url_,xml_url_,speed_,create_time_,update_time_)
-		VALUES(#{examSongId},#{subjectId},#{mp3Url},#{xmlUrl},#{speed},NOW(),NOW())
-	</insert>
-	<insert id="batchInsert">
-		INSERT INTO sys_exam_song_accompaniment (exam_song_id_,subject_id_,mp3_url_,xml_url_,speed_,create_time_,update_time_)
-		VALUES
-		<foreach collection="sysExamSongAccompaniments" item="item"  separator=",">
-			(#{sysExamSongId},#{item.subjectId},#{item.mp3Url},#{item.xmlUrl},#{item.speed},NOW(),NOW())
-		</foreach>
-	</insert>
-
-	<!-- 根据主键查询一条记录 -->
-	<update id="update" parameterType="com.ym.mec.biz.dal.entity.SysExamSongAccompaniment">
-		UPDATE sys_exam_song_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="delete" >
-		UPDATE sys_exam_song_accompaniment SET del_flag_ = 1,update_time_ = NOW() WHERE id_ = #{id}
-	</update>
-
-	<!-- 根据主键删除一条记录 -->
-	<update id="deleteBySongId" >
-		UPDATE sys_exam_song_accompaniment SET del_flag_ = 1,update_time_ = NOW() WHERE exam_song_id_ = #{examSongId}
-	</update>
-	<update id="batchUpdate">
-		<foreach collection="sysExamSongAccompaniment" item="item" separator=";">
-			UPDATE sys_exam_song_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="batchDel">
-		UPDATE sys_exam_song_accompaniment SET del_flag_ = 1,update_time_ = NOW() WHERE id_ IN
-		<foreach collection="delExamSongAccompanimentIds" item="item" open="(" close=")" separator=",">
-			#{item}
-		</foreach>
-
-	</update>
-
-    <!-- 分页查询 -->
-	<select id="queryPage" resultMap="SysExamSongAccompaniment" parameterType="map">
-		SELECT sesa.*,s.name_ subject_name_
-		FROM sys_exam_song_accompaniment sesa
-		LEFT JOIN `subject` s ON s.id_ = sesa.subject_id_
-		<where>
-			sesa.del_flag_ = 0
-			<if test="subjectId != null">
-				AND sesa.subject_id_ = #{subjectId}
-			</if>
-			<if test="sysExamSongId != null">
-				AND sesa.exam_song_id_ = #{sysExamSongId}
-			</if>
-		</where>
-		ORDER BY sesa.id_ DESC
-		<include refid="global.limit"/>
-	</select>
-	
-	<!-- 查询当前表的总记录数 -->
-	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM sys_exam_song_accompaniment
-	</select>
-
-	<select id="findSubjectByExamId" resultType="java.lang.Integer">
-		SELECT subject_id_ FROM sys_exam_song_accompaniment
-		<where>
-				del_flag_ = 0
-			<if test="sysExamSongId != null">
-				AND exam_song_id_ = #{sysExamSongId}
-			</if>
-			<if test="examSongAccIds != null and examSongAccIds.size > 0">
-				AND id_ NOT IN
-				<foreach collection="examSongAccIds" open="(" close=")" item="item" separator=",">
-					#{item}
-				</foreach>
-			</if>
-		</where>
-	</select>
-	<select id="queryAccPage" resultMap="SysExamSongAccompaniment">
-		SELECT sesa.*,ses.name_,ses.type_,ses.url_,s.name_ subject_name_
-		FROM sys_exam_song_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_exam_song_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>

+ 10 - 6
mec-biz/src/main/resources/config/mybatis/SysExamSongMapper.xml

@@ -62,9 +62,7 @@
 		<if test="speed != null">
 		speed_ = #{speed},
 		</if>
-		<if test="updateTime != null">
-			update_time_ = NOW()
-		</if>
+		update_time_ = NOW()
 		</set>
 		 WHERE id_ = #{id}
 	</update>
@@ -104,12 +102,18 @@
 	</sql>
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="SysExamSong" parameterType="map">
-		SELECT ses.*,su.real_name_ create_user_name_
-		FROM sys_exam_song ses
+		SELECT ses.*,GROUP_CONCAT(s.name_) subject_names_,su.real_name_ create_user_name_ FROM sys_exam_song ses
 		LEFT JOIN sys_user su ON ses.create_user_id_ = su.id_
+		LEFT JOIN `subject` s ON FIND_IN_SET(s.id_,ses.subject_ids_)
 		<include refid="queryPageSql"/>
 		GROUP BY ses.id_
-		ORDER BY ses.id_ DESC
+		public Integer getCreateUserId() {
+		return createUserId;
+		}
+
+		public void setCreateUserId(Integer createUserId) {
+		this.createUserId = createUserId;
+		}ORDER BY ses.id_ DESC
 		<include refid="global.limit"/>
 	</select>
 	

+ 0 - 33
mec-student/src/main/java/com/ym/mec/student/controller/SysExamSongAccompanimentController.java

@@ -1,33 +0,0 @@
-package com.ym.mec.student.controller;
-
-import com.ym.mec.biz.dal.entity.SysExamSongAccompaniment;
-import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
-import com.ym.mec.biz.service.SysExamSongAccompanimentService;
-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("sysExamSongAccompaniment")
-@Api(tags = "曲库伴奏服务")
-@RestController
-public class SysExamSongAccompanimentController extends BaseController {
-
-    @Autowired
-    private SysExamSongAccompanimentService sysExamSongAccompanimentService;
-
-    @ApiOperation(value = "分页查询")
-    @GetMapping("/queryPage")
-    public Object queryPage(SysExamSongQueryInfo queryInfo) {
-        queryInfo.setType("COMMON");
-        return succeed(sysExamSongAccompanimentService.queryAccPage(queryInfo));
-    }
-
-    @ApiOperation(value = "详情")
-    @GetMapping("/getDetail")
-    public Object queryPage(Integer id) {
-        return succeed(sysExamSongAccompanimentService.get(id));
-    }
-
-}

+ 0 - 63
mec-teacher/src/main/java/com/ym/mec/teacher/controller/SysExamSongAccompanimentController.java

@@ -1,63 +0,0 @@
-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.SysExamSongAccompaniment;
-import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
-import com.ym.mec.biz.service.SysExamSongAccompanimentService;
-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 io.swagger.annotations.ApiParam;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
-
-@RequestMapping("sysExamSongAccompaniment")
-@Api(tags = "曲库伴奏服务")
-@RestController
-public class SysExamSongAccompanimentController extends BaseController {
-
-    @Autowired
-    private SysExamSongAccompanimentService sysExamSongAccompanimentService;
-    @Autowired
-    private SysUserFeignService sysUserFeignService;
-
-    @ApiOperation(value = "修改")
-    @PostMapping("/update")
-    public Object update(@RequestBody SysExamSongAccompaniment sysExamSongAccompaniment) {
-        sysExamSongAccompanimentService.updateAcc(sysExamSongAccompaniment);
-        return succeed();
-    }
-
-    @ApiOperation(value = "删除")
-    @PostMapping("/del/{id}")
-    public Object del(@ApiParam(value = "收费类型编号", required = true) @PathVariable("id") Integer id) {
-        sysExamSongAccompanimentService.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(sysExamSongAccompanimentService.queryAccPage(queryInfo));
-    }
-
-    @ApiOperation(value = "详情")
-    @GetMapping("/getDetail")
-    public Object getDetail(Integer id) {
-        return succeed(sysExamSongAccompanimentService.get(id));
-    }
-
-}

+ 15 - 6
mec-teacher/src/main/java/com/ym/mec/teacher/controller/SysExamSongController.java

@@ -2,7 +2,6 @@ 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.ExamSongDto;
 import com.ym.mec.biz.dal.entity.SysExamSong;
 import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
 import com.ym.mec.biz.service.SysExamSongService;
@@ -10,10 +9,8 @@ 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 io.swagger.annotations.ApiParam;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 @RequestMapping("sysExamSong")
@@ -26,17 +23,29 @@ public class SysExamSongController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
 
+    @ApiOperation(value = "修改")
+    @PostMapping("/update")
+    public Object update(@RequestBody SysExamSong sysExamSong) {
+        sysExamSongService.update(sysExamSong);
+        return succeed();
+    }
+
     @ApiOperation(value = "新增")
     @PostMapping("/add")
-    public Object add(@RequestBody ExamSongDto examSongDto) {
-        sysExamSongService.add(examSongDto);
+    public Object add(@RequestBody SysExamSong sysExamSong) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if(sysUser == null){
+            throw new BizException("请登录");
+        }
+        sysExamSong.setCreateUserId(sysUser.getId());
+        sysExamSongService.insert(sysExamSong);
         return succeed();
     }
 
     @ApiOperation(value = "删除")
     @PostMapping("/del")
     public Object del(Integer id) {
-        sysExamSongService.del(id);
+        sysExamSongService.delete(id);
         return succeed();
     }
 

+ 0 - 45
mec-web/src/main/java/com/ym/mec/web/controller/SysExamSongAccompanimentController.java

@@ -1,45 +0,0 @@
-package com.ym.mec.web.controller;
-
-import com.ym.mec.biz.dal.entity.SysExamSongAccompaniment;
-import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
-import com.ym.mec.biz.service.SysExamSongAccompanimentService;
-import com.ym.mec.common.controller.BaseController;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
-
-@RequestMapping("sysExamSongAccompaniment")
-@Api(tags = "曲库伴奏服务")
-@RestController
-public class SysExamSongAccompanimentController extends BaseController {
-
-    @Autowired
-    private SysExamSongAccompanimentService sysExamSongAccompanimentService;
-
-    @ApiOperation(value = "修改")
-    @PostMapping("/update")
-    @PreAuthorize("@pcs.hasPermissions('sysExamSongAccompaniment/update')")
-    public Object update(@RequestBody SysExamSongAccompaniment sysExamSongAccompaniment) {
-        sysExamSongAccompanimentService.updateAcc(sysExamSongAccompaniment);
-        return succeed();
-    }
-
-    @ApiOperation(value = "删除")
-    @PostMapping("/del/{id}")
-    @PreAuthorize("@pcs.hasPermissions('sysExamSongAccompaniment/del')")
-    public Object del(@ApiParam(value = "收费类型编号", required = true) @PathVariable("id") Integer id) {
-        sysExamSongAccompanimentService.delete(id);
-        return succeed();
-    }
-
-    @ApiOperation(value = "分页查询")
-    @GetMapping("/queryPage")
-    @PreAuthorize("@pcs.hasPermissions('sysExamSongAccompaniment/queryPage')")
-    public Object queryPage(SysExamSongQueryInfo queryInfo) {
-        return succeed(sysExamSongAccompanimentService.queryAll(queryInfo));
-    }
-
-}

+ 5 - 9
mec-web/src/main/java/com/ym/mec/web/controller/SysExamSongController.java

@@ -1,13 +1,9 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dto.ExamSongDto;
 import com.ym.mec.biz.dal.entity.SysExamSong;
 import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
 import com.ym.mec.biz.service.SysExamSongService;
 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 io.swagger.annotations.ApiParam;
@@ -26,16 +22,16 @@ public class SysExamSongController extends BaseController {
     @ApiOperation(value = "修改")
     @PostMapping("/update")
     @PreAuthorize("@pcs.hasPermissions('sysExamSong/update')")
-    public Object update(@RequestBody ExamSongDto examSongDto) {
-        sysExamSongService.updateExamSong(examSongDto);
+    public Object update(@RequestBody SysExamSong sysExamSong) {
+        sysExamSongService.update(sysExamSong);
         return succeed();
     }
 
     @ApiOperation(value = "新增")
     @PostMapping("/add")
     @PreAuthorize("@pcs.hasPermissions('sysExamSong/add')")
-    public Object add(@RequestBody ExamSongDto examSongDto) {
-        sysExamSongService.add(examSongDto);
+    public Object add(@RequestBody SysExamSong sysExamSong) {
+        sysExamSongService.insert(sysExamSong);
         return succeed();
     }
 
@@ -43,7 +39,7 @@ public class SysExamSongController extends BaseController {
     @PostMapping("/del/{id}")
     @PreAuthorize("@pcs.hasPermissions('sysExamSong/del')")
     public Object del(@ApiParam(value = "收费类型编号", required = true) @PathVariable("id") Integer id) {
-        sysExamSongService.del(id);
+        sysExamSongService.delete(id);
         return succeed();
     }