Bladeren bron

Merge remote-tracking branch 'origin/master'

Joburgess 5 jaren geleden
bovenliggende
commit
985b31139a
25 gewijzigde bestanden met toevoegingen van 451 en 58 verwijderingen
  1. 11 0
      mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/dto/MenuQueryInfo.java
  2. 29 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/PracticeLessonApplyDao.java
  3. 5 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ResourceRespositoryDao.java
  4. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentManageDao.java
  5. 54 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/PracticeSumDto.java
  6. 22 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentHasCourseDto.java
  7. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentManageListDto.java
  8. 61 11
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ResourceRespository.java
  9. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentManageQueryInfo.java
  10. 15 0
      mec-biz/src/main/java/com/ym/mec/biz/service/PracticeLessonApplyService.java
  11. 4 0
      mec-biz/src/main/java/com/ym/mec/biz/service/ResourceRespositoryService.java
  12. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentManageService.java
  13. 47 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeLessonApplyServiceImpl.java
  14. 31 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ResourceRespositoryServiceImpl.java
  15. 6 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentManageServiceImpl.java
  16. 1 1
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  17. 40 1
      mec-biz/src/main/resources/config/mybatis/PracticeLessonApplyMapper.xml
  18. 21 2
      mec-biz/src/main/resources/config/mybatis/ResourceRespositoryMapper.xml
  19. 49 6
      mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml
  20. 1 1
      mec-biz/src/main/resources/config/mybatis/TeacherMapper.xml
  21. 2 13
      mec-student/src/main/java/com/ym/mec/student/controller/PracticeLessonApplyController.java
  22. 4 3
      mec-student/src/main/java/com/ym/mec/student/controller/ResourceRepositoryController.java
  23. 4 3
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/ResourceRepositoryController.java
  24. 12 6
      mec-web/src/main/java/com/ym/mec/web/controller/APIController.java
  25. 8 5
      mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

+ 11 - 0
mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/dto/MenuQueryInfo.java

@@ -12,8 +12,19 @@ public class MenuQueryInfo{
     @ApiModelProperty(value = "节点状态,默认0显示,1不显示",required = false)
     private Integer hid;
 
+    @ApiModelProperty(value = "科目编号",required = false)
+    private Integer subjectId;
+
     private Integer userId;
 
+    public Integer getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Integer subjectId) {
+        this.subjectId = subjectId;
+    }
+
     public Integer getHid() {
         return hid;
     }

+ 29 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/PracticeLessonApplyDao.java

@@ -1,6 +1,11 @@
 package com.ym.mec.biz.dal.dao;
 
+import com.ym.mec.biz.dal.dto.PracticeSumDto;
 import com.ym.mec.biz.dal.entity.PracticeLessonApply;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Set;
 
 public interface PracticeLessonApplyDao extends com.ym.mec.common.dal.BaseDAO<Integer, PracticeLessonApply> {
 
@@ -11,4 +16,28 @@ public interface PracticeLessonApplyDao extends com.ym.mec.common.dal.BaseDAO<In
      * @return
      */
     PracticeLessonApply findByUserId(Integer userId);
+
+    /**
+     * 陪练课列表页
+     * @return
+     */
+    List<PracticeSumDto> practiceSum(@Param("userIds") Set<Integer> userIds);
+
+    /**
+     * 获取学生总人数
+     * @return
+     */
+    Integer getTotalNum(@Param("userIds") Set<Integer> userIds);
+
+    /**
+     * 激活总人数
+     * @return
+     */
+    Integer getActiveNum(@Param("userIds") Set<Integer> userIds);
+
+    /**
+     * 预约总人数
+     * @return
+     */
+    Integer getMakeNum(@Param("userIds") Set<Integer> userIds);
 }

+ 5 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ResourceRespositoryDao.java

@@ -1,8 +1,12 @@
 package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.entity.ResourceRespository;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface ResourceRespositoryDao extends com.ym.mec.common.dal.BaseDAO<Integer, ResourceRespository> {
 
-	
+
+    List<ResourceRespository> findList(@Param("parentId") Integer parentId, @Param("delFlag") String delFlag, @Param("subjectId") Integer subjectId);
 }

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentManageDao.java

@@ -10,6 +10,7 @@ import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 /**
  * @Author Joburgess
@@ -235,4 +236,6 @@ public interface StudentManageDao {
      * @return
      */
     Integer countRepliedNum(Integer courseScheduleId);
+
+    List<StudentHasCourseDto> queryCourseStudent(@Param("userIds") Set<Integer> userIds);
 }

+ 54 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/PracticeSumDto.java

@@ -0,0 +1,54 @@
+package com.ym.mec.biz.dal.dto;
+
+public class PracticeSumDto{
+
+    private String organName;
+
+    private Integer totalNum;
+
+    private Integer activeNum;
+
+    private Integer makeNum;
+
+    private float per;
+
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
+
+    public Integer getTotalNum() {
+        return totalNum;
+    }
+
+    public void setTotalNum(Integer totalNum) {
+        this.totalNum = totalNum;
+    }
+
+    public Integer getActiveNum() {
+        return activeNum;
+    }
+
+    public void setActiveNum(Integer activeNum) {
+        this.activeNum = activeNum;
+    }
+
+    public Integer getMakeNum() {
+        return makeNum;
+    }
+
+    public void setMakeNum(Integer makeNum) {
+        this.makeNum = makeNum;
+    }
+
+    public float getPer() {
+        return per;
+    }
+
+    public void setPer(float per) {
+        this.per = per;
+    }
+}

+ 22 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentHasCourseDto.java

@@ -1,5 +1,7 @@
 package com.ym.mec.biz.dal.dto;
 
+import com.ym.mec.biz.dal.enums.YesOrNoEnum;
+
 public class StudentHasCourseDto{
     private String organName;
 
@@ -13,6 +15,26 @@ public class StudentHasCourseDto{
 
     private Integer userId;
 
+    private YesOrNoEnum isActive;
+
+    private YesOrNoEnum isMake;
+
+    public YesOrNoEnum getIsActive() {
+        return isActive;
+    }
+
+    public void setIsActive(YesOrNoEnum isActive) {
+        this.isActive = isActive;
+    }
+
+    public YesOrNoEnum getIsMake() {
+        return isMake;
+    }
+
+    public void setIsMake(YesOrNoEnum isMake) {
+        this.isMake = isMake;
+    }
+
     public String getSubjectName() {
         return subjectName;
     }

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

@@ -46,8 +46,18 @@ public class StudentManageListDto {
     
     private Boolean isActive;
 
+    private Boolean isMake;
+
     private Long hasCourse;
 
+    public Boolean getIsMake() {
+        return isMake;
+    }
+
+    public void setIsMake(Boolean make) {
+        isMake = make;
+    }
+
     public Long getHasCourse() {
         return hasCourse;
     }

+ 61 - 11
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ResourceRespository.java

@@ -1,7 +1,10 @@
 package com.ym.mec.biz.dal.entity;
 
+import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
+import java.util.List;
+
 /**
  * 对应数据库表(resource_respository):
  */
@@ -9,22 +12,69 @@ public class ResourceRespository {
 
 	/**  */
 	private Integer id;
-	
-	/**  */
+
+	@ApiModelProperty(value = "资源名",required = false)
 	private String name;
-	
-	/**  */
+
+	@ApiModelProperty(value = "地址",required = false)
 	private String url;
-	
-	/**  */
+
+	private Integer order;
+
+	private Integer subjectId;
+
+	private Integer level;
+
+	private Integer parentId;
+
 	private boolean delFlag;
-	
-	/**  */
+
 	private java.util.Date createTime;
-	
-	/**  */
+
 	private java.util.Date updateTime;
-	
+
+	private List<ResourceRespository> repositories;
+
+	public List<ResourceRespository> getRepositories() {
+		return repositories;
+	}
+
+	public void setRepositories(List<ResourceRespository> repositories) {
+		this.repositories = repositories;
+	}
+
+	public Integer getOrder() {
+		return order;
+	}
+
+	public void setOrder(Integer order) {
+		this.order = order;
+	}
+
+	public Integer getSubjectId() {
+		return subjectId;
+	}
+
+	public void setSubjectId(Integer subjectId) {
+		this.subjectId = subjectId;
+	}
+
+	public Integer getLevel() {
+		return level;
+	}
+
+	public void setLevel(Integer level) {
+		this.level = level;
+	}
+
+	public Integer getParentId() {
+		return parentId;
+	}
+
+	public void setParentId(Integer parentId) {
+		this.parentId = parentId;
+	}
+
 	public void setId(Integer id){
 		this.id = id;
 	}

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

@@ -30,8 +30,18 @@ public class StudentManageQueryInfo extends QueryInfo {
     
     private Boolean isActive;
 
+    private Boolean isMake;
+
     private Boolean hasCourse;
 
+    public Boolean getIsMake() {
+        return isMake;
+    }
+
+    public void setIsMake(Boolean make) {
+        isMake = make;
+    }
+
     public List<Integer> getUserIds() {
         return userIds;
     }

+ 15 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/PracticeLessonApplyService.java

@@ -3,6 +3,8 @@ package com.ym.mec.biz.service;
 import com.ym.mec.biz.dal.entity.PracticeLessonApply;
 import com.ym.mec.common.service.BaseService;
 
+import java.util.Map;
+
 public interface PracticeLessonApplyService extends BaseService<Integer, PracticeLessonApply>{
 
     /**
@@ -11,4 +13,17 @@ public interface PracticeLessonApplyService extends BaseService<Integer, Practic
      * @return
      */
     PracticeLessonApply findByUserId(Integer userId);
+
+    /**
+     * 预约人数列表页
+     * @return
+     */
+    Map<String, Object> practiceSum();
+
+    /**
+     * 新增记录
+     * @param memo
+     * @return
+     */
+    void add(String memo);
 }

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/ResourceRespositoryService.java

@@ -1,8 +1,12 @@
 package com.ym.mec.biz.service;
 
+import com.ym.mec.auth.api.dto.MenuQueryInfo;
 import com.ym.mec.biz.dal.entity.ResourceRespository;
 import com.ym.mec.common.service.BaseService;
 
+import java.util.List;
+
 public interface ResourceRespositoryService extends BaseService<Integer, ResourceRespository> {
 
+    List<ResourceRespository> queryTree(MenuQueryInfo menuQueryInfo);
 }

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/StudentManageService.java

@@ -134,7 +134,7 @@ public interface StudentManageService {
     List<StudentRegisterPerDto> queryStudentPer();
 
     /**
-     * 获取有课没有激活的列表
+     * 获取有课没有激活的列表(变更为所有有课学生)
      * @return
      */
     List<StudentHasCourseDto> queryHasCourseStudent(String organId);

+ 47 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeLessonApplyServiceImpl.java

@@ -1,5 +1,10 @@
 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.CourseScheduleStudentPaymentDao;
+import com.ym.mec.biz.dal.dto.PracticeSumDto;
+import com.ym.mec.common.exception.BizException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -8,12 +13,19 @@ import com.ym.mec.biz.dal.entity.PracticeLessonApply;
 import com.ym.mec.biz.service.PracticeLessonApplyService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
 
 @Service
 public class PracticeLessonApplyServiceImpl extends BaseServiceImpl<Integer, PracticeLessonApply>  implements PracticeLessonApplyService {
 	
 	@Autowired
 	private PracticeLessonApplyDao practiceLessonApplyDao;
+	@Autowired
+	private CourseScheduleStudentPaymentDao scheduleStudentPaymentDao;
+	@Autowired
+	private SysUserFeignService sysUserFeignService;
 
 	@Override
 	public BaseDAO<Integer, PracticeLessonApply> getDAO() {
@@ -24,4 +36,39 @@ public class PracticeLessonApplyServiceImpl extends BaseServiceImpl<Integer, Pra
 	public PracticeLessonApply findByUserId(Integer userId) {
 		return practiceLessonApplyDao.findByUserId(userId);
 	}
+
+	@Override
+	public Map<String, Object> practiceSum() {
+		Set<Integer> musicUserIds = scheduleStudentPaymentDao.queryMusicStudentPer();
+		Set<Integer> vipUserIds = scheduleStudentPaymentDao.queryVipStudentPer();
+		musicUserIds.addAll(vipUserIds);
+		List<PracticeSumDto> practiceSumDtos = practiceLessonApplyDao.practiceSum(musicUserIds);
+		Integer totalNum = practiceLessonApplyDao.getTotalNum(musicUserIds);
+		Integer activeNum = practiceLessonApplyDao.getActiveNum(musicUserIds);
+		Integer makeNum = practiceLessonApplyDao.getMakeNum(musicUserIds);
+		Map<String,Object> map = new HashMap<>(4);
+		map.put("totalNum",totalNum);
+		map.put("activeNum",activeNum);
+		map.put("makeNum",makeNum);
+		map.put("practiceSumDtos",practiceSumDtos);
+		return map;
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public void add(String memo) {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (sysUser == null) {
+			throw new BizException("获取用户信息失败");
+		}
+		PracticeLessonApply lessonApply = practiceLessonApplyDao.findByUserId(sysUser.getId());
+		if(lessonApply != null){
+			throw new BizException("您已申请过陪练课!");
+		}
+		PracticeLessonApply practiceLessonApply = new PracticeLessonApply();
+		practiceLessonApply.setCreateTime(new Date());
+		practiceLessonApply.setMemo(memo);
+		practiceLessonApply.setUserId(sysUser.getId());
+		practiceLessonApplyDao.insert(practiceLessonApply);
+	}
 }

+ 31 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ResourceRespositoryServiceImpl.java

@@ -1,13 +1,15 @@
 package com.ym.mec.biz.service.impl;
 
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
+import com.ym.mec.auth.api.dto.MenuQueryInfo;
 import com.ym.mec.biz.dal.dao.ResourceRespositoryDao;
 import com.ym.mec.biz.dal.entity.ResourceRespository;
 import com.ym.mec.biz.service.ResourceRespositoryService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
 
 @Service
 public class ResourceRespositoryServiceImpl extends BaseServiceImpl<Integer, ResourceRespository> implements ResourceRespositoryService{
@@ -19,5 +21,30 @@ public class ResourceRespositoryServiceImpl extends BaseServiceImpl<Integer, Res
 	public BaseDAO<Integer, ResourceRespository> getDAO() {
 		return resourceRespositoryDao;
 	}
-	
+
+	@Override
+	public List<ResourceRespository> queryTree(MenuQueryInfo menuQueryInfo) {
+		List<ResourceRespository> resourceRespositories = resourceRespositoryDao.findList(menuQueryInfo.getParentId(),menuQueryInfo.getDelFlag(),menuQueryInfo.getSubjectId());
+		for (ResourceRespository repository:resourceRespositories) {
+			repository = getTree(repository,menuQueryInfo.getDelFlag(),menuQueryInfo.getSubjectId());
+		}
+		return resourceRespositories;
+	}
+
+	private ResourceRespository getTree(ResourceRespository repository, String delFlag,Integer subjectId){
+		//得到根节点对象
+		//获取子节点list
+		List<ResourceRespository> repositories = null;
+		repositories = resourceRespositoryDao.findList(repository.getId(),delFlag,subjectId);
+		//如果存在子节点
+		if(repositories != null && repositories.size() > 0) {
+			//将子节点list放入父节点对象
+			repository.setRepositories(repositories);
+			//遍历子节点....
+			for (ResourceRespository sysMenu : repositories) {
+				getTree(sysMenu,delFlag,subjectId);
+			}
+		}
+		return repository;
+	}
 }

+ 6 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentManageServiceImpl.java

@@ -358,6 +358,12 @@ public class StudentManageServiceImpl implements StudentManageService {
 
     @Override
     public List<StudentHasCourseDto> queryHasCourseStudent(String organId) {
+//        Set<Integer> musicUserIds = scheduleStudentPaymentDao.queryMusicStudentPer();
+//        Set<Integer> vipUserIds = scheduleStudentPaymentDao.queryVipStudentPer();
+//        musicUserIds.addAll(vipUserIds);
+        //学员编号", "姓名", "分部", "所在乐团", "乐团所属声部", "所在vip课","是否激活","是否预约
+//        获取编号,姓名,分部,"是否激活","是否预约
+//        List<StudentHasCourseDto> studentHasCourseDtos = studentManageDao.queryCourseStudent(vipUserIds);
         return studentManageDao.queryHasCourseStudent(organId);
     }
 

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

@@ -1743,7 +1743,7 @@
         SELECT COUNT(*) FROM course_schedule WHERE class_group_id_=#{classGroupId} AND CONCAT(class_date_,' ',end_class_time_)&lt;#{currentCourseDate}
     </select>
     <select id="countCourseScheduleByMusicGroupId" resultType="java.lang.Integer">
-        SELECT count(cs.id_) FROM course_schedule cs WHERE cs.music_group_id_ = #{musicGroupId} LIMIT 1
+        SELECT count(cs.id_) FROM course_schedule cs WHERE cs.music_group_id_ = #{musicGroupId} and cs.group_type_ = 'MUSIC' and cs.status_ != 'OVER' LIMIT 1
     </select>
     <select id="findClassGroupCourseSchedules" resultMap="CourseSchedule">
         SELECT

+ 40 - 1
mec-biz/src/main/resources/config/mybatis/PracticeLessonApplyMapper.xml

@@ -41,6 +41,45 @@
 		SELECT COUNT(*) FROM practice_lesson_apply
 	</select>
     <select id="findByUserId" resultMap="PracticeLessonApply">
-		SELECT * FROM practice_lesson_apply WHERE user_id_ = #{userId} LIMIT 1
+		SELECT * FROM practice_lesson_apply WHERE user_id_ = #{userId} LIMIT 1 FOR UPDATE
+	</select>
+	<resultMap id="practiceSumMap" type="com.ym.mec.biz.dal.dto.PracticeSumDto">
+		<result property="organName" column="organName"/>
+		<result property="per" column="per"/>
+		<result property="activeNum" column="activeNum"/>
+		<result property="makeNum" column="makeNum"/>
+		<result property="totalNum" column="totalNum"/>
+	</resultMap>
+    <select id="practiceSum" resultMap="practiceSumMap">
+		SELECT o.name_ organName,COUNT(su.id_) totalNum,COUNT(ps.id_) activeNum,COUNT(pla.user_id_) makeNum,COUNT(pla.user_id_) / COUNT(su.id_) per FROM sys_user su
+		LEFT JOIN practice_lesson_apply pla ON pla.user_id_ = su.id_
+		LEFT JOIN organization o ON o.id_ = su.organ_id_
+		LEFT JOIN sys_user ps ON ps.id_ = su.id_ AND ps.password_ IS NOT NULL
+		WHERE su.user_type_ LIKE '%STUDENT%' AND su.organ_id_ NOT IN (36,38,39) AND su.id_ IN
+		<foreach collection="userIds" separator="," open="(" close=")" item="item">
+			#{item}
+		</foreach>
+		GROUP BY su.organ_id_
+		ORDER BY per DESC
+	</select>
+	<select id="getTotalNum" resultType="java.lang.Integer">
+		SELECT COUNT(su.id_) FROM sys_user su
+		WHERE su.user_type_ LIKE '%STUDENT%' AND su.organ_id_ NOT IN (36,38,39) AND su.id_ IN
+		<foreach collection="userIds" separator="," open="(" close=")" item="item">
+			#{item}
+		</foreach>
+	</select>
+	<select id="getActiveNum" resultType="java.lang.Integer">
+		SELECT COUNT(su.id_) FROM sys_user su
+		WHERE su.user_type_ LIKE '%STUDENT%' AND su.password_ IS NOT NULL AND su.organ_id_ NOT IN (36,38,39) AND su.id_ IN
+		<foreach collection="userIds" separator="," open="(" close=")" item="item">
+			#{item}
+		</foreach>
+	</select>
+	<select id="getMakeNum" resultType="java.lang.Integer">
+		SELECT COUNT(id_) FROM practice_lesson_apply WHERE user_id_ IN
+		<foreach collection="userIds" separator="," open="(" close=")" item="item">
+			#{item}
+		</foreach>
 	</select>
 </mapper>

+ 21 - 2
mec-biz/src/main/resources/config/mybatis/ResourceRespositoryMapper.xml

@@ -10,6 +10,10 @@
 		<result column="id_" property="id" />
 		<result column="name_" property="name" />
 		<result column="url_" property="url" />
+		<result column="order_" property="order" />
+		<result column="subject_id_" property="subjectId" />
+		<result column="level_" property="level" />
+		<result column="parent_id_" property="parentId" />
 		<result column="del_flag_" property="delFlag" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
@@ -23,8 +27,8 @@
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ResourceRespository" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO resource_respository (id_,name_,url_,del_flag_,create_time_,update_time_)
-		VALUES(#{id},#{name},#{url},#{delFlag},now(),now())
+		INSERT INTO resource_respository (id_,name_,url_,order_,subject_id_,level_,parent_id_,del_flag_,create_time_,update_time_)
+		VALUES(#{id},#{name},#{url},#{order},#{subjectId},#{level},#{parentId},#{delFlag},now(),now())
 	</insert>
 	
 	
@@ -51,4 +55,19 @@
 			</if>
 		</where>
 	</select>
+    <select id="findList" resultMap="ResourceRespository">
+		SELECT * FROM resource_respository
+		<where>
+			<if test="delFlag != null">
+				AND del_flag_ = #{delFlag}
+			</if>
+			<if test="parentId != null">
+				AND parent_id_ = #{parentId}
+			</if>
+			<if test="subjectId != null">
+				AND subject_id_ = #{subjectId}
+			</if>
+		</where>
+		ORDER BY order_ DESC
+	</select>
 </mapper>

+ 49 - 6
mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml

@@ -14,6 +14,7 @@
         <result property="currentGrade" column="current_grade_"/>
         <result property="currentClass" column="current_class_"/>
         <result property="isActive" column="isActive_"/>
+        <result property="isMake" column="isMake_"/>
         <!--<collection property="musicGroups" resultMap="musicGroup" javaType="list"/>-->
     </resultMap>
 
@@ -123,8 +124,10 @@
     <select id="findStudentsByOrganId" resultMap="studentManageListDto">
         SELECT su.id_ user_id_,su.username_,su.gender_,su.phone_ parents_phone_,su.real_name_,
         su.birthdate_,su.nation_,
-        CASE WHEN su.password_ IS NULL THEN 0 ELSE 1 END isActive_
+        CASE WHEN su.password_ IS NULL THEN 0 ELSE 1 END isActive_,
+        CASE WHEN pla.id_ IS NULL THEN 0 ELSE 1 END isMake_
         FROM sys_user su
+        LEFT JOIN practice_lesson_apply pla ON su.id_ = pla.user_id_
         <include refid="findStudentsByOrganIdSql"/>
         ORDER BY su.create_time_ DESC
         <include refid="global.limit"/>
@@ -144,6 +147,12 @@
             <if test="isActive != null and isActive == false">
                 AND su.password_ is null
             </if>
+            <if test="isMake != null and isMake == true">
+                AND pla.id_ IS NOT NULL
+            </if>
+            <if test="isMake != null and isMake == false">
+                AND pla.id_ IS NULL
+            </if>
             <if test="userIds != null">
                 AND su.id_ IN
                 <foreach collection="userIds" open="(" close=")" separator="," item="item">
@@ -157,6 +166,7 @@
         SELECT COUNT(DISTINCT su.id_)
         FROM sys_user su
         LEFT JOIN student_registration sr ON su.id_ = sr.user_id_
+        LEFT JOIN practice_lesson_apply pla ON su.id_ = pla.user_id_
         WHERE su.user_type_ LIKE '%STUDENT%'
         <include refid="queryHasCourseSql"/>
     </select>
@@ -569,16 +579,23 @@
             AND (su.phone_ LIKE CONCAT('%',#{search},'%') OR su.username_ LIKE CONCAT('%',#{search},'%') OR su.id_ LIKE CONCAT('%',#{search},'%'))
         </if>
         <if test="isActive != null and isActive == true">
-            and su.password_ is not null
+            AND su.password_ IS NOT NULL
         </if>
         <if test="isActive != null and isActive == false">
-            and su.password_ is null
+            AND su.password_ IS NULL
+        </if>
+        <if test="isMake != null and isMake == true">
+            AND pla.id_ IS NOT NULL
+        </if>
+        <if test="isMake != null and isMake == false">
+            AND pla.id_ IS NULL
         </if>
     </sql>
     <select id="queryHasCourse" resultType="java.lang.Integer">
         SELECT su.id_ FROM sys_user su
         LEFT JOIN course_schedule_student_payment cssp ON cssp.user_id_ = su.id_
         LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_
+        LEFT JOIN practice_lesson_apply pla ON su.id_ = pla.user_id_
         WHERE su.user_type_ LIKE '%STUDENT%' AND cs.status_ != 'OVER'
         <include refid="queryHasCourseSql"/>
         GROUP BY su.id_
@@ -589,6 +606,7 @@
         SELECT COUNT(DISTINCT su.id_) FROM sys_user su
         LEFT JOIN course_schedule_student_payment cssp ON cssp.user_id_ = su.id_
         LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_
+        LEFT JOIN practice_lesson_apply pla ON su.id_ = pla.user_id_
         WHERE su.user_type_ LIKE '%STUDENT%' AND cs.status_ != 'OVER'
         <include refid="queryHasCourseSql"/>
     </select>
@@ -596,6 +614,7 @@
         SELECT su.id_ FROM sys_user su
         LEFT JOIN course_schedule_student_payment cssp ON cssp.user_id_ = su.id_
         LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_ AND cs.status_ != 'OVER'
+        LEFT JOIN practice_lesson_apply pla ON su.id_ = pla.user_id_
         <include refid="queryNotCourseSql"/>
         GROUP BY su.id_
         HAVING COUNT(cs.id_) = 0
@@ -606,6 +625,7 @@
         SELECT COUNT(e.id_) FROM (SELECT su.id_ FROM sys_user su
         LEFT JOIN course_schedule_student_payment cssp ON cssp.user_id_ = su.id_
         LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_ AND cs.status_ != 'OVER'
+        LEFT JOIN practice_lesson_apply pla ON su.id_ = pla.user_id_
         <include refid="queryNotCourseSql"/>
         GROUP BY su.id_
         HAVING COUNT(cs.id_) = 0)e
@@ -625,6 +645,12 @@
             <if test="isActive != null and isActive == false">
                 and su.password_ is null
             </if>
+            <if test="isMake != null and isMake == true">
+                and pla.id_ IS NOT NULL
+            </if>
+            <if test="isMake != null and isMake == false">
+                and pla.id_ IS NULL
+            </if>
         </where>
     </sql>
     <select id="queryStudentHasCourse" resultType="java.util.Map">
@@ -648,10 +674,26 @@
         <result property="organName" column="organ_name_"/>
         <result property="subjectName" column="music_group_subject_"/>
         <result property="userId" column="id_"/>
+        <result property="isActive" column="is_active_" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result property="isMake" column="is_make_" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
     </resultMap>
+    <select id="queryCourseStudent" resultMap="StudentHasCourseDtoMap">
+        SELECT su.id_,su.username_,o.name_ organ_name_,
+        CASE WHEN su.password_ IS NULL THEN 0 ELSE 1 END is_active_,
+        CASE WHEN pla.id_ IS NULL THEN 0 ELSE 1 END is_make_
+        FROM sys_user su
+        LEFT JOIN organization o ON su.organ_id_ = o.id_
+        LEFT JOIN practice_lesson_apply pla ON pla.user_id_ = su.id_
+        WHERE su.id_ IN
+        <foreach collection="userIds" separator="," open="(" close=")" item="item">
+            #{item}
+        </foreach>
+    </select>
     <select id="queryHasCourseStudent" resultMap="StudentHasCourseDtoMap">
         SELECT su.id_,GROUP_CONCAT(DISTINCT su.username_) username_,GROUP_CONCAT(DISTINCT mg.name_) music_group_name_,
-        GROUP_CONCAT(DISTINCT vg.name_) vip_group_name_,GROUP_CONCAT(DISTINCT o.name_) organ_name_,GROUP_CONCAT(DISTINCT s.name_) music_group_subject_
+        GROUP_CONCAT(DISTINCT vg.name_) vip_group_name_,GROUP_CONCAT(DISTINCT o.name_) organ_name_,GROUP_CONCAT(DISTINCT s.name_) music_group_subject_,
+        CASE WHEN su.password_ IS NULL THEN 0 ELSE 1 END is_active_,
+        CASE WHEN pla.id_ IS NULL THEN 0 ELSE 1 END is_make_
         FROM sys_user su
         LEFT JOIN course_schedule_student_payment cssp ON su.id_ = cssp.user_id_
         LEFT JOIN music_group mg ON cssp.music_group_id_ = mg.id_ AND cssp.group_type_ = 'MUSIC'
@@ -659,12 +701,13 @@
         LEFT JOIN organization o ON su.organ_id_ = o.id_
         LEFT JOIN student_registration sr ON su.id_ = sr.user_id_ AND cssp.music_group_id_ = sr.music_group_id_
         LEFT JOIN `subject` s ON s.id_ = sr.actual_subject_id_
-        WHERE cssp.id_ IS NOT NULL AND su.user_type_ LIKE '%STUDENT%' AND (sr.music_group_status_ != 'QUIT' OR sr.id_ IS NULL) AND su.password_ IS NULL
+        LEFT JOIN practice_lesson_apply pla ON su.id_ = pla.user_id_
+        WHERE cssp.id_ IS NOT NULL AND su.user_type_ LIKE '%STUDENT%' AND (sr.music_group_status_ != 'QUIT' OR sr.id_ IS NULL)
         AND (mg.status_ = 'PROGRESS' OR vg.group_status_ IN (2,4))
         <if test="organId != null and organId != ''">
             AND FIND_IN_SET(su.organ_id_,#{organId})
         </if>
-        GROUP BY su.id_
+        GROUP BY su.id_,pla.id_
     </select>
     <select id="getHasCourse" resultType="java.lang.Long">
         SELECT COUNT(DISTINCT su.id_) FROM sys_user su

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

@@ -241,7 +241,7 @@
             </foreach>
         </if>
         <if test="search != null">
-            AND (su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))
+            AND (su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%') OR t.id_ = #{search})
         </if>
     </sql>
 

+ 2 - 13
mec-student/src/main/java/com/ym/mec/student/controller/PracticeLessonApplyController.java

@@ -32,19 +32,8 @@ public class PracticeLessonApplyController extends BaseController {
 	@ApiOperation("新增陪练课申请")
 	@PostMapping(value = "add")
 	public Object add(String memo) {
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if (sysUser == null) {
-			return failed("获取用户信息失败");
-		}
-		PracticeLessonApply lessonApply = practiceLessonApplyService.findByUserId(sysUser.getId());
-		if(lessonApply != null){
-			throw new BizException("您已申请过陪练课!");
-		}
-		PracticeLessonApply practiceLessonApply = new PracticeLessonApply();
-		practiceLessonApply.setCreateTime(new Date());
-		practiceLessonApply.setMemo(memo);
-		practiceLessonApply.setUserId(sysUser.getId());
-		return succeed(practiceLessonApplyService.insert(practiceLessonApply));
+		practiceLessonApplyService.add(memo);
+		return succeed();
 	}
 
 	@ApiOperation("根据用户编号查询是否申请过")

+ 4 - 3
mec-student/src/main/java/com/ym/mec/student/controller/ResourceRepositoryController.java

@@ -1,5 +1,6 @@
 package com.ym.mec.student.controller;
 
+import com.ym.mec.auth.api.dto.MenuQueryInfo;
 import com.ym.mec.biz.service.ResourceRespositoryService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.page.QueryInfo;
@@ -25,8 +26,8 @@ public class ResourceRepositoryController extends BaseController {
     }
 
     @ApiOperation(value = "获取资源列表")
-    @GetMapping("/queryPage")
-    public Object queryPage(QueryInfo queryInfo){
-        return succeed(resourceRepositoryService.queryPage(queryInfo));
+    @GetMapping("/queryTree")
+    public Object queryTree(MenuQueryInfo menuQueryInfo){
+        return succeed(resourceRepositoryService.queryTree(menuQueryInfo));
     }
 }

+ 4 - 3
mec-teacher/src/main/java/com/ym/mec/teacher/controller/ResourceRepositoryController.java

@@ -1,5 +1,6 @@
 package com.ym.mec.teacher.controller;
 
+import com.ym.mec.auth.api.dto.MenuQueryInfo;
 import com.ym.mec.biz.service.ResourceRespositoryService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.page.QueryInfo;
@@ -25,8 +26,8 @@ public class ResourceRepositoryController extends BaseController {
     }
 
     @ApiOperation(value = "获取资源列表")
-    @GetMapping("/queryPage")
-    public Object queryPage(QueryInfo queryInfo){
-        return succeed(resourceRepositoryService.queryPage(queryInfo));
+    @GetMapping("/queryTree")
+    public Object queryTree(MenuQueryInfo menuQueryInfo){
+        return succeed(resourceRepositoryService.queryTree(menuQueryInfo));
     }
 }

+ 12 - 6
mec-web/src/main/java/com/ym/mec/web/controller/APIController.java

@@ -1,17 +1,15 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.biz.dal.dao.SysUserCashAccountDao;
+import com.ym.mec.biz.dal.entity.SysUserCashAccount;
+import com.ym.mec.biz.service.PracticeLessonApplyService;
+import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
-
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import com.ym.mec.biz.dal.dao.SysUserCashAccountDao;
-import com.ym.mec.biz.dal.entity.SysUserCashAccount;
-import com.ym.mec.common.controller.BaseController;
-
 @RequestMapping("api")
 @Api(tags = "对外接口")
 @RestController
@@ -20,6 +18,9 @@ public class APIController extends BaseController {
 	@Autowired
 	private SysUserCashAccountDao sysUserCashAccountDao;
 
+	@Autowired
+	private PracticeLessonApplyService practiceLessonApplyService;
+
 	@GetMapping("/createCashAccount")
 	public Boolean createCashAccount(Integer userId) {
 		// 添加用户现金账户
@@ -28,4 +29,9 @@ public class APIController extends BaseController {
 		return true;
 	}
 
+	@GetMapping("/practiceSum")
+	public Object practiceSum() {
+		return succeed(practiceLessonApplyService.practiceSum());
+	}
+
 }

+ 8 - 5
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -192,16 +192,19 @@ public class ExportController extends BaseController {
     @ApiOperation(value = "导出学员是否有课")
     @PostMapping("export/studentHasCourse")
     @PreAuthorize("@pcs.hasPermissions('export/studentHasCourse')")
-    public void studentHasCourse(HttpServletResponse response) {
+    public void studentHasCourse(HttpServletResponse response,String organId) {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         if (sysUser == null) {
             throw new BizException("获取用户信息失败");
         }
-        Employee employee = employeeDao.get(sysUser.getId());
-        List<StudentHasCourseDto> hasCourseDtos = studentManageService.queryHasCourseStudent(employee.getOrganIdList());
+        if(StringUtils.isEmpty(organId)){
+            Employee employee = employeeDao.get(sysUser.getId());
+            organId = employee.getOrganIdList();
+        }
+        List<StudentHasCourseDto> hasCourseDtos = studentManageService.queryHasCourseStudent(organId);
         try {
-            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"学员编号", "姓名", "分部", "所在乐团", "乐团所属声部", "所在vip课"}, new String[]{
-                    "userId", "userName", "organName", "musicGroupName", "subjectName", "vipGroupName"}, hasCourseDtos);
+            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"学员编号", "姓名", "分部", "所在乐团", "乐团所属声部", "所在vip课","是否激活","是否预约"}, new String[]{
+                    "userId", "userName", "organName", "musicGroupName", "subjectName", "vipGroupName","isActive.msg","isMake.msg"}, hasCourseDtos);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
             response.flushBuffer();