فهرست منبع

Merge remote-tracking branch 'origin/master'

Joburgess 5 سال پیش
والد
کامیت
72ee2fd0a9
45فایلهای تغییر یافته به همراه1179 افزوده شده و 262 حذف شده
  1. 1 1
      mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/web/controller/UserController.java
  2. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupDao.java
  3. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupTeacherMapperDao.java
  4. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDao.java
  5. 7 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysMessageConfigDao.java
  6. 34 6
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysMessageDao.java
  7. 5 3
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseListDto.java
  8. 4 4
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ClassGroupTeacherMapper.java
  9. 9 10
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysMessage.java
  10. 50 31
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysMessageConfig.java
  11. 34 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/MessageSendMode.java
  12. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/SendStatusEnum.java
  13. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/service/SysMessageConfigService.java
  14. 121 6
      mec-biz/src/main/java/com/ym/mec/biz/service/SysMessageService.java
  15. 16 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java
  16. 6 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMessageConfigServiceImpl.java
  17. 269 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMessageServiceImpl.java
  18. 11 7
      mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml
  19. 5 5
      mec-biz/src/main/resources/config/mybatis/ClassGroupTeacherMapperMapper.xml
  20. 3 0
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml
  21. 80 49
      mec-biz/src/main/resources/config/mybatis/SysMessageConfigMapper.xml
  22. 141 76
      mec-biz/src/main/resources/config/mybatis/SysMessageMapper.xml
  23. 5 0
      mec-common/common-core/pom.xml
  24. 10 0
      mec-education/pom.xml
  25. 3 1
      mec-education/src/main/java/com/ym/mec/education/EducationApplication.java
  26. 20 0
      mec-education/src/main/java/com/ym/mec/education/base/BaseQuery.java
  27. 12 2
      mec-education/src/main/java/com/ym/mec/education/base/PageResponse.java
  28. 14 15
      mec-education/src/main/java/com/ym/mec/education/config/ResourceServerConfig.java
  29. 2 5
      mec-education/src/main/java/com/ym/mec/education/config/WebMvcConfig.java
  30. 71 7
      mec-education/src/main/java/com/ym/mec/education/controller/MusicGroupController.java
  31. 44 0
      mec-education/src/main/java/com/ym/mec/education/controller/StudentAttendanceController.java
  32. 43 0
      mec-education/src/main/java/com/ym/mec/education/enums/ReturnCodeEnum.java
  33. 1 1
      mec-education/src/main/java/com/ym/mec/education/mapper/ClassGroupMapper.java
  34. 1 1
      mec-education/src/main/java/com/ym/mec/education/mapper/ClassGroupTeacherMapperMapper.java
  35. 1 1
      mec-education/src/main/java/com/ym/mec/education/mapper/StudentAttendanceMapper.java
  36. 16 0
      mec-education/src/main/java/com/ym/mec/education/req/MusicGroupReq.java
  37. 96 0
      mec-education/src/main/java/com/ym/mec/education/resp/MusicGroupResp.java
  38. 1 1
      mec-education/src/main/java/com/ym/mec/education/service/IClassGroupService.java
  39. 1 1
      mec-education/src/main/java/com/ym/mec/education/service/IClassGroupTeacherMapperService.java
  40. 1 1
      mec-education/src/main/java/com/ym/mec/education/service/IStudentAttendanceService.java
  41. 1 1
      mec-education/src/main/java/com/ym/mec/education/service/impl/ClassGroupServiceImpl.java
  42. 1 1
      mec-education/src/main/java/com/ym/mec/education/service/impl/ClassGroupTeacherMapperServiceImpl.java
  43. 1 1
      mec-education/src/main/java/com/ym/mec/education/service/impl/StudentAttendanceServiceImpl.java
  44. 0 2
      mec-student/src/main/java/com/ym/mec/student/controller/CourseController.java
  45. 12 11
      mec-web/src/main/java/com/ym/mec/web/controller/SysMessageController.java

+ 1 - 1
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/web/controller/UserController.java

@@ -68,7 +68,7 @@ public class UserController extends BaseController {
 	public Object add(SysUser sysUser) {
 //		sysUser.setPassword(new BCryptPasswordEncoder().encode(sysUser.getPassword()));
 		sysUserService.insert(sysUser);
-		return succeed();
+		return succeed(sysUser.getId());
 	}
 
 	@ApiOperation(value = "设置密码")

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

@@ -107,4 +107,11 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
      * @return
      */
     List<ImGroupModel> queryUserGroups(Integer userId);
+
+    /**
+     * 获取vip课的学生名称列表
+     * @param musicGroupId
+     * @return
+     */
+    List<String> findVipStuNames(String musicGroupId);
 }

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

@@ -26,5 +26,5 @@ public interface ClassGroupTeacherMapperDao extends BaseDAO<Long, ClassGroupTeac
      * @param ClassGroupList
      * @return
      */
-    List<ClassGroupTeacherMapper> findClassGroupTeachers(@Param("classGroupList") List ClassGroupList);
+    List<ClassGroupTeacherMapper> findClassGroupTeachers(@Param("ClassGroupList") List ClassGroupList);
 }

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDao.java

@@ -3,6 +3,8 @@ package com.ym.mec.biz.dal.dao;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.common.dal.BaseDAO;
 
+import java.util.List;
+
 public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPaymentCalender> {
 
 
@@ -11,4 +13,11 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
      * @param musicGroupId
      */
     void delByGroupId(String musicGroupId);
+
+    /**
+     * 根据乐团编号获取乐团缴费日历
+     * @param musicGroupId
+     * @return
+     */
+    List<MusicGroupPaymentCalender> findByMusicGroupId(String musicGroupId);
 }

+ 7 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysMessageConfigDao.java

@@ -1,9 +1,15 @@
 package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.entity.SysMessageConfig;
+import com.ym.mec.biz.dal.entity.SysMessageConfig.MessageType;
 import com.ym.mec.common.dal.BaseDAO;
 
 public interface SysMessageConfigDao extends BaseDAO<Integer, SysMessageConfig> {
 
-	
+	/**
+	 * 根据消息类型查询对象
+	 * @param type
+	 * @return
+	 */
+	public SysMessageConfig queryByType(MessageType type);
 }

+ 34 - 6
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysMessageDao.java

@@ -1,15 +1,43 @@
 package com.ym.mec.biz.dal.dao;
 
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+
 import com.ym.mec.biz.dal.entity.SysMessage;
 import com.ym.mec.common.dal.BaseDAO;
 
 public interface SysMessageDao extends BaseDAO<Long, SysMessage> {
 
+	/**
+	 * 根据状态查询最近N分钟的记录
+	 * @param status 状态值
+	 * @param recentMin 最近分钟数
+	 * @return
+	 */
+	public List<SysMessage> queryByStatusAndTime(@Param("status") int status, @Param("recentMin") int recentMin);
+
+	/**
+	 * 批量插入
+	 * @param messages
+	 * @return
+	 */
+	public int batchInsert(List<SysMessage> messages);
+
+	/**
+	 * 查询消息未读条数
+	 * @param userId
+	 * @return
+	 */
+	public int queryCountOfUnread(Integer userId);
+
+	/**
+	 * 修改用户所有消息阅读状态
+	 */
+	public int updateStatus(@Param("userId") Integer userId, @Param("status") int status);
 
-    /**
-     * 获取用户未读消息数
-     * @param id
-     * @return
-     */
-    int findNewMessageNum(Integer id);
+	/**
+	 * 修改单个消息状态
+	 */
+	public int updateOneStatus(@Param("id") Integer id, @Param("status") int status);
 }

+ 5 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseListDto.java

@@ -2,13 +2,15 @@ package com.ym.mec.biz.dal.dto;
 
 import io.swagger.annotations.ApiModelProperty;
 
+import java.util.List;
+
 public class CourseListDto {
 
     @ApiModelProperty(value = "乐团、vip课编号",required = true)
     private String musicGroupId;
 
     @ApiModelProperty(value = "学生姓名",required = true)
-    private String studentNames;
+    private List<String> studentNames;
 
     @ApiModelProperty(value = "乐团、vip课名称",required = true)
     private String musicGroupName;
@@ -36,11 +38,11 @@ public class CourseListDto {
         this.musicGroupId = musicGroupId;
     }
 
-    public String getStudentNames() {
+    public List<String> getStudentNames() {
         return studentNames;
     }
 
-    public void setStudentNames(String studentNames) {
+    public void setStudentNames(List<String> studentNames) {
         this.studentNames = studentNames;
     }
 

+ 4 - 4
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ClassGroupTeacherMapper.java

@@ -33,7 +33,7 @@ public class ClassGroupTeacherMapper {
 	private Integer userId;
 
 	@ApiModelProperty(value = "用户名",required = false)
-	private Integer userName;
+	private Integer realName;
 
 	/** 薪酬 */
 	@ApiModelProperty(value = "薪酬",required = false)
@@ -110,11 +110,11 @@ public class ClassGroupTeacherMapper {
 	}
 
 	public Integer getUserName() {
-		return userName;
+		return realName;
 	}
 
-	public void setUserName(Integer userName) {
-		this.userName = userName;
+	public void setUserName(Integer realName) {
+		this.realName = realName;
 	}
 			
 	@Override

+ 9 - 10
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysMessage.java

@@ -1,13 +1,12 @@
 package com.ym.mec.biz.dal.entity;
 
-import com.ym.mec.biz.dal.enums.SendStatusEnum;
-import com.ym.mec.biz.dal.enums.SendTypeEnum;
-import com.ym.mec.biz.dal.enums.YesOrNoEnum;
-
 import io.swagger.annotations.ApiModelProperty;
 
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
+import com.ym.mec.biz.dal.enums.SendStatusEnum;
+import com.ym.mec.biz.dal.enums.SendTypeEnum;
+
 /**
  * 对应数据库表(sys_message):
  */
@@ -52,7 +51,7 @@ public class SysMessage {
 	
 	/** 用户编号 */
 	@ApiModelProperty(value = "用户编号",required = false)
-	private Long userId;
+	private Integer userId;
 	
 	/** 备注 */
 	@ApiModelProperty(value = "备注",required = false)
@@ -60,7 +59,7 @@ public class SysMessage {
 	
 	/** 是否已读 */
 	@ApiModelProperty(value = "是否已读",required = false)
-	private YesOrNoEnum readStatus;
+	private Integer readStatus;
 	
 	public void setId(Long id){
 		this.id = id;
@@ -126,11 +125,11 @@ public class SysMessage {
 		return this.modifyOn;
 	}
 			
-	public void setUserId(Long userId){
+	public void setUserId(Integer userId){
 		this.userId = userId;
 	}
 	
-	public Long getUserId(){
+	public Integer getUserId(){
 		return this.userId;
 	}
 			
@@ -158,11 +157,11 @@ public class SysMessage {
 		this.status = status;
 	}
 
-	public YesOrNoEnum getReadStatus() {
+	public Integer getReadStatus() {
 		return readStatus;
 	}
 
-	public void setReadStatus(YesOrNoEnum readStatus) {
+	public void setReadStatus(Integer readStatus) {
 		this.readStatus = readStatus;
 	}
 

+ 50 - 31
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysMessageConfig.java

@@ -2,77 +2,96 @@ package com.ym.mec.biz.dal.entity;
 
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
+import com.ym.mec.common.enums.BaseEnum;
+
 /**
  * 对应数据库表(sys_message_config):
  */
 public class SysMessageConfig {
 
+	public enum MessageType implements BaseEnum<String, MessageType> {
+
+		;
+
+		private String code;
+
+		private MessageType(String code) {
+			this.code = code;
+		}
+
+		@Override
+		public String getCode() {
+			return code;
+		}
+
+	}
+
 	/**  */
 	private Integer id;
-	
+
 	/** 消息类型 */
-	private String messageType;
-	
+	private MessageType messageType;
+
 	/** 消息内容 */
 	private String content;
-	
+
 	/** 描述 */
 	private String description;
-	
+
 	/** 最后修改时间 */
 	private java.util.Date modifyOn;
-	
+
 	/** 跳转url */
 	private String url;
-	
-	public void setId(Integer id){
+
+	public void setId(Integer id) {
 		this.id = id;
 	}
-	
-	public Integer getId(){
+
+	public Integer getId() {
 		return this.id;
 	}
-			
-	public void setMessageType(String messageType){
+
+	public void setMessageType(MessageType messageType) {
 		this.messageType = messageType;
 	}
-	
-	public String getMessageType(){
+
+	public MessageType getMessageType() {
 		return this.messageType;
 	}
-			
-	public void setContent(String content){
+
+	public void setContent(String content) {
 		this.content = content;
 	}
-	
-	public String getContent(){
+
+	public String getContent() {
 		return this.content;
 	}
-			
-	public void setDescription(String description){
+
+	public void setDescription(String description) {
 		this.description = description;
 	}
-	
-	public String getDescription(){
+
+	public String getDescription() {
 		return this.description;
 	}
-			
-	public void setModifyOn(java.util.Date modifyOn){
+
+	public void setModifyOn(java.util.Date modifyOn) {
 		this.modifyOn = modifyOn;
 	}
-	
-	public java.util.Date getModifyOn(){
+
+	public java.util.Date getModifyOn() {
 		return this.modifyOn;
 	}
-			
-	public void setUrl(String url){
+
+	public void setUrl(String url) {
 		this.url = url;
 	}
-	
-	public String getUrl(){
+
+	public String getUrl() {
 		return this.url;
 	}
-			
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 34 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/MessageSendMode.java

@@ -0,0 +1,34 @@
+package com.ym.mec.biz.dal.enums;
+
+public enum MessageSendMode {
+
+	// 短信
+	SMS(1),
+	// 邮件
+	EMAIL(2),
+	// app推送
+	PUSH(3);
+
+	private int index;
+
+	private MessageSendMode(int index) {
+		this.index = index;
+	}
+
+	public int getIndex() {
+		return index;
+	}
+
+	public void setIndex(int index) {
+		this.index = index;
+	}
+
+	public static MessageSendMode getMessageSendMode(int index) {
+		for (MessageSendMode mode : values()) {
+			if (mode.getIndex() == index) {
+				return mode;
+			}
+		}
+		return null;
+	}
+}

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/SendStatusEnum.java

@@ -3,10 +3,10 @@ package com.ym.mec.biz.dal.enums;
 import com.ym.mec.common.enums.BaseEnum;
 
 /**
- 状态,1,发送失败;2,待发送;3,发送中;4,发送完成
+ 状态,-1,发送失败;0,待发送;1,发送中;2,发送完成
  */
 public enum SendStatusEnum implements BaseEnum<Integer, SendStatusEnum> {
-	FAILED(1, "发送失败"), WAIT(2, "待发送"), INT(3, "发送中"), SUCCESS(4, "发送完成");
+	FAILED(-1, "发送失败"), WAIT(0, "待发送"), SENDING(1, "发送中"), SUCCESSED(2, "发送完成");
 
 	private Integer code;
 

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

@@ -1,8 +1,15 @@
 package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.entity.SysMessageConfig;
+import com.ym.mec.biz.dal.entity.SysMessageConfig.MessageType;
 import com.ym.mec.common.service.BaseService;
 
 public interface SysMessageConfigService extends BaseService<Integer, SysMessageConfig> {
 
+	/**
+	 * 根据消息类型查询对象
+	 * @param type
+	 * @return
+	 */
+	public SysMessageConfig queryByType(MessageType type);
 }

+ 121 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/SysMessageService.java

@@ -1,14 +1,129 @@
 package com.ym.mec.biz.service;
 
+import java.util.Date;
+
 import com.ym.mec.biz.dal.entity.SysMessage;
+import com.ym.mec.biz.dal.entity.SysMessageConfig.MessageType;
+import com.ym.mec.biz.dal.enums.SendStatusEnum;
+import com.ym.mec.biz.dal.enums.SendTypeEnum;
 import com.ym.mec.common.service.BaseService;
+import com.ym.mec.thirdparty.message.MessageSenderPluginContext.MessageSender;
 
 public interface SysMessageService extends BaseService<Long, SysMessage> {
 
-    /**
-     * 获取用户未读消息数
-     * @param id
-     * @return
-     */
-    int findNewMessageNum(Integer id);
+	/**
+	 * 添加消息
+	 * @param userId 用户编号
+	 * @param subject 消息主题
+	 * @param content 消息内容
+	 * @param receivers 接收人,多个人用逗号分开
+	 * @param triggerTime 触发时间
+	 * @param mode 消息的发送模式
+	 * @param status 消息的当前状态
+	 * @param errorMsg 错误消息
+	 * @param readStatus 阅读状态
+	 * @param memo 备注
+	 * @return
+	 */
+	public int addMessage(Integer userId, String subject, String content, String receivers, Date triggerTime, SendTypeEnum mode, SendStatusEnum status,
+			String errorMsg, Integer readStatus, String memo);
+
+	/**
+	 * 修改消息对象
+	 * @param message
+	 * @return
+	 */
+	public int updateMessage(SysMessage message);
+
+	/**
+	 * 批量发送消息
+	 * @param messageSender 消息发送者
+	 * @param mode 消息模式
+	 * @param subject 消息主题
+	 * @param content 消息内容
+	 * @param receivers 消息接受者
+	 * @param triggerTime 触发时间
+	 * @return
+	 */
+	public boolean batchSendMessage(MessageSender messageSender, SendTypeEnum mode, String subject, String content, String receivers, Date triggerTime,
+			Integer readStatus, String memo);
+
+	/**
+	 * 发送消息
+	 * @param messageSender 消息发送者
+	 * @param userId 用户编号
+	 * @param mode 消息模式
+	 * @param messageType 消息类型
+	 * @param receiver 消息接受者
+	 * @param triggerTime 触发时间
+	 * @param readStatus 阅读状态(0-未读  1-已读)
+	 * @param url 超链接地址
+	 * @param args 参数
+	 * @return
+	 */
+	public void sendMessage(MessageSender messageSender, Integer userId, SendTypeEnum mode, MessageType messageType, String receiver, Date triggerTime,
+			Integer readStatus, String url, Object... args);
+
+	/**
+	 * 发送消息
+	 * @param messageSender 消息发送者
+	 * @param userId 用户编号
+	 * @param mode 消息模式
+	 * @param title 消息标题
+	 * @param content 消息内容
+	 * @param receiver 消息接受者
+	 * @param triggerTime 触发时间
+	 * @param readStatus 阅读状态(0-未读  1-已读)
+	 * @param url 超链接地址
+	 * @return
+	 */
+	public void sendMessage(MessageSender messageSender, Integer userId, SendTypeEnum mode, String title, String content, String receiver, Date triggerTime,
+			Integer readStatus, String url);
+
+	/**
+	 * 发送验证码
+	 * @param messageSender 消息发送者
+	 * @param userId 用户编号
+	 * @param mode 消息模式
+	 * @param messageType 消息类型
+	 * @param receiver 消息接受者
+	 * @return
+	 */
+	public boolean sendSecurityCode(MessageSender messageSender, Integer userId, SendTypeEnum mode, MessageType messageType, String receiver);
+
+	/**
+	 * 获取已经发送的验证码
+	 * @param type
+	 * @param mobileNOOrEmailAddr
+	 * @return
+	 */
+	public String getSendedVerificationCode(MessageType type, String mobileNOOrEmailAddr);
+
+	/**
+	 * 删除已有的key
+	 * @param type
+	 * @param mobileNOOrEmailAddr
+	 */
+	public void delSendedVerificationCode(MessageType type, String mobileNOOrEmailAddr);
+
+	/**
+	 * 查询消息未读条数
+	 * @param userId
+	 * @return
+	 */
+	public int queryCountOfUnread(Integer userId);
+
+	/**
+	 *
+	 * @param userId 用户id
+	 * @param status 状态/1 已读,0未读
+	 * @return
+	 */
+	public int updateStatus(Integer userId, int status);
+
+	/**
+	 * 修改单条消息状态
+	 */
+	public int updateOneStatus(Integer id, int status);
+
 }

+ 16 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.service.impl;
 
 import com.ym.mec.biz.dal.dao.ClassGroupDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
 import com.ym.mec.biz.dal.dao.TeacherDao;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
@@ -12,14 +13,14 @@ import com.ym.mec.common.entity.ImGroupModel;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.util.collection.MapUtil;
-
-import io.swagger.annotations.ApiImplicitParams;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
-import java.time.*;
+import java.time.Instant;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
 import java.util.*;
 
 @Service
@@ -30,6 +31,8 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     @Autowired
     private TeacherDao teacherDao;
     @Autowired
+    private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
+    @Autowired
     private ClassGroupRelationService classGroupRelationService;
     @Autowired
     private ClassGroupStudentMapperService classGroupStudentMapperService;
@@ -229,7 +232,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     @Override
     public PageInfo<TeacherVipClassInfoDto> getTeacherVipClass(VipClassQueryInfo queryInfo) {
         PageInfo<TeacherVipClassInfoDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
-        Map<String, Object> params = new HashMap<String, Object>();
+        Map<String, Object> params = new HashMap<>();
         MapUtil.populateMap(params, queryInfo);
         List<TeacherVipClassInfoDto> dataList = null;
         int count = classGroupDao.countTeacherVipClass(params);
@@ -323,6 +326,15 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     }
 
     public List<CourseListDto> queryCoursePage(Integer userId) {
+        List<CourseListDto> courseListDtos = classGroupDao.queryCoursePage(userId);
+        courseListDtos.forEach(e->{
+            if("VIP".equals(e.getTeachMode())){
+                e.setStudentNames(classGroupDao.findVipStuNames(e.getMusicGroupId()));
+            }else {
+                List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByMusicGroupId(e.getMusicGroupId());
+
+            }
+        });
         return classGroupDao.queryCoursePage(userId);
     }
 

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

@@ -5,6 +5,7 @@ import org.springframework.stereotype.Service;
 
 import com.ym.mec.biz.dal.dao.SysMessageConfigDao;
 import com.ym.mec.biz.dal.entity.SysMessageConfig;
+import com.ym.mec.biz.dal.entity.SysMessageConfig.MessageType;
 import com.ym.mec.biz.service.SysMessageConfigService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
@@ -19,5 +20,10 @@ public class SysMessageConfigServiceImpl extends BaseServiceImpl<Integer, SysMes
 	public BaseDAO<Integer, SysMessageConfig> getDAO() {
 		return sysMessageConfigDao;
 	}
+
+	@Override
+	public SysMessageConfig queryByType(MessageType type) {
+		return sysMessageConfigDao.queryByType(type);
+	}
 	
 }

+ 269 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMessageServiceImpl.java

@@ -1,27 +1,292 @@
 package com.ym.mec.biz.service.impl;
 
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Random;
+
+import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.SysMessageDao;
 import com.ym.mec.biz.dal.entity.SysMessage;
+import com.ym.mec.biz.dal.entity.SysMessageConfig;
+import com.ym.mec.biz.dal.entity.SysMessageConfig.MessageType;
+import com.ym.mec.biz.dal.enums.SendStatusEnum;
+import com.ym.mec.biz.dal.enums.SendTypeEnum;
+import com.ym.mec.biz.service.SysMessageConfigService;
 import com.ym.mec.biz.service.SysMessageService;
+import com.ym.mec.common.cache.Cache;
 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.thirdparty.message.MessageSenderPluginContext;
+import com.ym.mec.thirdparty.message.MessageSenderPluginContext.MessageSender;
+import com.ym.mec.util.string.MessageFormatter;
 
 @Service
-public class SysMessageServiceImpl extends BaseServiceImpl<Long, SysMessage>  implements SysMessageService {
-	
+public class SysMessageServiceImpl extends BaseServiceImpl<Long, SysMessage> implements SysMessageService {
+
+	private final static Logger LOGGER = LoggerFactory.getLogger(SysMessageServiceImpl.class);
+
 	@Autowired
 	private SysMessageDao sysMessageDao;
 
+	@Autowired
+	private SysMessageConfigService sysMessageConfigService;
+
+	@Autowired
+	private MessageSenderPluginContext messageSenderPluginContext;
+
+	@Autowired
+	private SysUserFeignService sysUserFeignService;
+
+	@Autowired
+	private Cache redisCache;
+
+	// 验证码有效期
+	public static final int CODE_EXPIRE = 60 * 5;
+
+	// 发送验证码的间隔时间
+	public static final int CODE_INTERVAL_TIME = 60;
+
+	private final int DEFAULT_CODE = 888888;
+
+	@Value("${message.debugMode:true}")
+	private boolean debugMode = false;
+
 	@Override
 	public BaseDAO<Long, SysMessage> getDAO() {
 		return sysMessageDao;
 	}
 
 	@Override
-	public int findNewMessageNum(Integer id) {
-		return sysMessageDao.findNewMessageNum(id);
+	public int addMessage(Integer userId, String subject, String content, String receivers, Date triggerTime, SendTypeEnum mode, SendStatusEnum status,
+			String errorMsg, Integer readStatus, String memo) {
+		SysMessage message = null;
+		Date date = new Date();
+
+		List<SysMessage> messages = new ArrayList<SysMessage>();
+		String[] tels = StringUtils.split(receivers, ',');
+		if (tels != null && tels.length > 0) {
+			for (String tel : tels) {
+				message = new SysMessage();
+				if (userId == null) {
+					SysUser user = sysUserFeignService.getUserByMobile(tel);
+					if (user != null) {
+						userId = user.getId();
+					}
+				}
+				message.setUserId(userId);
+				message.setContent(content);
+				message.setCreateOn(date);
+				message.setModifyOn(date);
+				message.setReceiver(tel);
+				if (triggerTime == null) {
+					triggerTime = date;
+				}
+				message.setSendTime(triggerTime);
+				message.setTitle(subject);
+				message.setStatus(status);
+				message.setType(mode);
+				message.setErrorMsg(errorMsg);
+				message.setReadStatus(readStatus);
+				message.setMemo(memo);
+
+				messages.add(message);
+			}
+		}
+		return sysMessageDao.batchInsert(messages);
+	}
+
+	@Override
+	public int updateMessage(SysMessage message) {
+		return sysMessageDao.update(message);
+	}
+
+	@Override
+	@Async
+	public boolean batchSendMessage(MessageSender messageSender, SendTypeEnum mode, String subject, String content, String receivers, Date triggerTime,
+			Integer readStatus, String memo) {
+
+		if (StringUtils.isBlank(receivers)) {
+			throw new BizException("消息接收人不能为空");
+		}
+		if (StringUtils.isBlank(content)) {
+			throw new BizException("消息内容不能为空");
+		}
+		String[] tos = StringUtils.split(receivers, ',');
+		if (tos != null && tos.length > 0) {
+			Date date = new Date();
+			SendStatusEnum status = SendStatusEnum.WAIT;
+
+			String errorMsg = null;
+			try {
+				// 立即发送
+				if (triggerTime == null || date.after(triggerTime)) {
+					status = SendStatusEnum.SENDING;
+					if (debugMode == true || messageSenderPluginContext.batchSend(messageSender, subject, content, tos, memo)) {
+						status = SendStatusEnum.SUCCESSED;
+					} else {
+						status = SendStatusEnum.FAILED;
+					}
+				}
+			} catch (Exception e) {
+				status = SendStatusEnum.FAILED;
+				errorMsg = e.getMessage();
+				LOGGER.warn("消息发送失败", e);
+			}
+			return addMessage(null, subject, content, receivers, triggerTime, mode, status, errorMsg, readStatus, memo) > 0;
+		}
+
+		return false;
+	}
+
+	@Override
+	@Async
+	public void sendMessage(MessageSender messageSender, Integer userId, SendTypeEnum mode, MessageType type, String receiver, Date triggerTime,
+			Integer readStatus, String url, Object... args) {
+
+		if (StringUtils.isBlank(receiver)) {
+			throw new BizException("接收地址不能为空");
+		}
+		SysMessageConfig messageConfig = sysMessageConfigService.queryByType(type);
+		if (messageConfig == null) {
+			throw new BizException("消息类型错误");
+		}
+		Date date = new Date();
+		SendStatusEnum status = SendStatusEnum.WAIT;
+		String errorMsg = null;
+		// 立即发送
+		if (triggerTime == null || date.after(triggerTime)) {
+			status = SendStatusEnum.SENDING;
+			try {
+				if (debugMode == true
+						|| messageSenderPluginContext.send(messageSender, receiver, messageConfig.getDescription(),
+								MessageFormatter.arrayFormat(messageConfig.getContent(), args), url)) {
+					status = SendStatusEnum.SUCCESSED;
+				} else {
+					status = SendStatusEnum.FAILED;
+				}
+			} catch (Exception e) {
+				status = SendStatusEnum.FAILED;
+				errorMsg = e.getMessage();
+				LOGGER.warn("消息发送失败", e);
+			}
+		}
+		addMessage(userId, type.getCode(), MessageFormatter.arrayFormat(messageConfig.getContent(), args), receiver, triggerTime, mode, status, errorMsg,
+				readStatus, url);
+	}
+
+	@Override
+	@Async
+	public void sendMessage(MessageSender messageSender, Integer userId, SendTypeEnum mode, String title, String content, String receiver, Date triggerTime,
+			Integer readStatus, String url) {
+		if (StringUtils.isBlank(receiver)) {
+			throw new BizException("接收地址不能为空");
+		}
+		Date date = new Date();
+		SendStatusEnum status = SendStatusEnum.WAIT;
+		String errorMsg = null;
+		// 立即发送
+		if (triggerTime == null || date.after(triggerTime)) {
+			status = SendStatusEnum.SENDING;
+			try {
+				if (debugMode == true || messageSenderPluginContext.send(messageSender, receiver, title, content, url)) {
+					status = SendStatusEnum.SUCCESSED;
+				} else {
+					status = SendStatusEnum.FAILED;
+				}
+			} catch (Exception e) {
+				status = SendStatusEnum.FAILED;
+				errorMsg = e.getMessage();
+				LOGGER.warn("消息发送失败", e);
+			}
+		}
+		addMessage(userId, title, content, receiver, triggerTime, mode, status, errorMsg, readStatus, url);
+	}
+
+	@Override
+	public boolean sendSecurityCode(MessageSender messageSender, Integer userId, SendTypeEnum mode, MessageType messageType, String receiver) {
+		String key1 = getVerificationCode1CacheKey(messageType, receiver);
+		if (redisCache.get(key1) != null) {
+			throw new BizException("请勿频繁操作,获取验证码间隔时间为60秒");
+		}
+
+		String key = getVerificationCodeCacheKey(messageType, receiver);
+		int code = DEFAULT_CODE;
+		if (debugMode == false) {
+			code = getRandomCode(messageType, receiver);
+		}
+		sendMessage(messageSender, userId, mode, messageType, receiver, null, 1, "", code);
+		redisCache.put(key, code, CODE_EXPIRE);
+		redisCache.put(key1, code, CODE_INTERVAL_TIME);
+		return true;
+	}
+
+	@Override
+	public String getSendedVerificationCode(MessageType type, String mobileNOOrEmailAddr) {
+		if (debugMode == true) {
+			return DEFAULT_CODE + "";
+		}
+		String key = getVerificationCodeCacheKey(type, mobileNOOrEmailAddr);
+		Object object = redisCache.get(key);
+		return object == null ? null : object.toString();
+	}
+
+	@Override
+	public void delSendedVerificationCode(MessageType type, String mobileNOOrEmailAddr) {
+		String key = getVerificationCodeCacheKey(type, mobileNOOrEmailAddr);
+		if (StringUtils.isNotBlank(key)) {
+			redisCache.delete(key);
+		}
+	}
+
+	@Override
+	public int queryCountOfUnread(Integer userId) {
+		return sysMessageDao.queryCountOfUnread(userId);
+	}
+
+	public void setDebugMode(boolean debugMode) {
+		this.debugMode = debugMode;
+	}
+
+	private int getRandomCode(MessageType type, String mobileNo) {
+		int min = 100000;
+		int max = 999999;
+		Random random = new Random();
+
+		return random.nextInt(max) % (max - min + 1) + min;
+	}
+
+	private static String getVerificationCodeCacheKey(MessageType type, String mobileNOOrEmailAddr) {
+		return "verificationCode" + type.name() + mobileNOOrEmailAddr;
+	}
+
+	private static String getVerificationCode1CacheKey(MessageType type, String mobileNOOrEmailAddr) {
+		return "verificationCode" + mobileNOOrEmailAddr;
+	}
+
+	/**
+	 *
+	 * @param userId 用户id数组
+	 * @param status 状态/1 已读,0未读
+	 * @return 修改的条数
+	 */
+	@Override
+	public int updateStatus(Integer userId, int status) {
+		return sysMessageDao.updateStatus(userId, status);
+	}
+
+	@Override
+	public int updateOneStatus(Integer id, int status) {
+		return sysMessageDao.updateOneStatus(id, status);
 	}
 }

+ 11 - 7
mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml

@@ -257,14 +257,12 @@
     </select>
 
     <resultMap type="com.ym.mec.biz.dal.dto.CourseListDto" id="CourseListDto">
-        <result column="id_" property="musicGroupName"/>
+        <result column="music_group_name_" property="musicGroupName"/>
         <result column="music_group_id_" property="musicGroupId"/>
-        <result column="subject_id_list_" property="teachMode"/>
-        <result column="name_" property="totalClassTimes"/>
-        <result column="student_num_" property="currentClassTimes"/>
-        <result column="create_time_" property="studentNames"/>
-        <result column="update_time_" property="teacherName"/>
-        <result column="type_" property="address"/>
+        <result column="type_" property="teachMode"/>
+        <result column="total_class_times_" property="totalClassTimes"/>
+        <result column="current_class_times_" property="currentClassTimes"/>
+        <result column="address_" property="address"/>
     </resultMap>
     <select id="queryCoursePage" resultMap="CourseListDto">
         SELECT * FROM (
@@ -297,4 +295,10 @@
         LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
         WHERE cgsm.user_id_ = #{userId}
     </select>
+    <select id="findVipStuNames" resultType="java.lang.String">
+        SELECT su.username_ FROM vip_group_class_group_mapper vgcgm
+        LEFT JOIN class_group_student_mapper cgsm ON vgcgm.class_group_id_ = cgsm.class_group_id_
+        LEFT JOIN sys_user su ON cgsm.user_id_ = su.id_
+        WHERE vgcgm.vip_group_id_ = #{musicGroupId}
+    </select>
 </mapper>

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

@@ -9,7 +9,7 @@
         <result column="music_group_id_" property="musicGroupId"/>
         <result column="class_group_id_" property="classGroupId"/>
         <result column="teacher_role_" property="teacherRole"/>
-        <result column="username_" property="userName"/>
+        <result column="real_name_" property="realName"/>
         <result column="user_id_" property="userId"/>
         <result column="salary_" property="salary"/>
         <result column="create_time_" property="createTime"/>
@@ -101,12 +101,12 @@
 
     <!-- 获取乐团班级的老师 -->
     <select id="findClassGroupTeachers" resultMap="ClassGroupTeacherMapper">
-        SELECT u.username_, ct.*
+        SELECT u.real_name_, ct.*
         FROM sys_user u,
         class_group_teacher_mapper ct
-        WHERE class_group_id_ IN
-        <foreach collection="classGroupList" item="classGroup" index="index" open="(" close=")" separator=",">
-            #{classGroup.id}
+        WHERE u.id_=ct.user_id_ AND ct.class_group_id_ IN
+        <foreach collection="ClassGroupList" item="item" index="index" open="(" close=")" separator=",">
+            #{item.id}
         </foreach>
     </select>
 </mapper>

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml

@@ -72,4 +72,7 @@
     <select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM music_group_payment_calender
 	</select>
+    <select id="findByMusicGroupId" resultMap="MusicGroupPaymentCalender">
+        SELECT * FROM music_group_payment_calender mgpc WHERE music_group_id_ = #{musicGroupId}
+    </select>
 </mapper>

+ 80 - 49
mec-biz/src/main/resources/config/mybatis/SysMessageConfigMapper.xml

@@ -1,76 +1,107 @@
 <?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.SysMessageConfigDao">
-	
-	<resultMap type="com.ym.mec.biz.dal.entity.SysMessageConfig" id="SysMessageConfig">
+
+	<resultMap type="com.ym.mec.biz.dal.entity.SysMessageConfig"
+		id="SysMessageConfig">
 		<result column="id_" property="id" />
-		<result column="message_type_" property="messageType" />
+		<result column="message_type_" property="messageType"
+			typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler" />
 		<result column="content_" property="content" />
 		<result column="description_" property="description" />
 		<result column="modify_on_" property="modifyOn" />
 		<result column="url_" property="url" />
 	</resultMap>
-	
+
+	<sql id="queryCondition">
+		<where>
+			<if test="messageType != null">
+				and message_type_ =
+				#{messageType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+			</if>
+			<if test="content != null">
+				and content_ = #{content,jdbcType=VARCHAR},
+			</if>
+			<if test="description != null">
+				and description_ = #{description,jdbcType=TIMESTAMP}
+			</if>
+		</where>
+	</sql>
+
 	<!-- 根据主键查询一条记录 -->
-	<select id="get" resultMap="SysMessageConfig" >
-		SELECT * FROM sys_message_config WHERE id_ = #{id} 
+	<select id="get" resultMap="SysMessageConfig">
+		SELECT * FROM
+		sys_message_config WHERE id_ = #{id}
 	</select>
-	
+
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="SysMessageConfig">
-		SELECT * FROM sys_message_config ORDER BY id_
+		SELECT * FROM sys_message_config
+		ORDER BY id_
 	</select>
-	
+
 	<!-- 向数据库增加一条记录 -->
-	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SysMessageConfig" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		<!--
-		<selectKey resultClass="int" keyProperty="id" > 
-		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
-		</selectKey>
-		-->
-		INSERT INTO sys_message_config (id_,message_type_,content_,description_,modify_on_,url_) VALUES(#{id},#{messageType},#{content},#{description},#{modifyOn},#{url})
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SysMessageConfig"
+		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
+			AS ID FROM DUAL </selectKey> -->
+		INSERT INTO sys_message_config
+		(id_,message_type_,content_,description_,modify_on_,url_)
+		VALUES(#{id},#{messageType},#{content},#{description},#{modifyOn},#{url})
 	</insert>
-	
+
 	<!-- 根据主键查询一条记录 -->
 	<update id="update" parameterType="com.ym.mec.biz.dal.entity.SysMessageConfig">
-		UPDATE sys_message_config <set>
-<if test="modifyOn != null">
-modify_on_ = #{modifyOn},
-</if>
-<if test="messageType != null">
-message_type_ = #{messageType},
-</if>
-<if test="id != null">
-id_ = #{id},
-</if>
-<if test="url != null">
-url_ = #{url},
-</if>
-<if test="content != null">
-content_ = #{content},
-</if>
-<if test="description != null">
-description_ = #{description},
-</if>
-</set> WHERE id_ = #{id} 
+		UPDATE sys_message_config
+		<set>
+			<if test="modifyOn != null">
+				modify_on_ = #{modifyOn},
+			</if>
+			<if test="messageType != null">
+				message_type_ = #{messageType},
+			</if>
+			<if test="id != null">
+				id_ = #{id},
+			</if>
+			<if test="url != null">
+				url_ = #{url},
+			</if>
+			<if test="content != null">
+				content_ = #{content},
+			</if>
+			<if test="description != null">
+				description_ = #{description},
+			</if>
+		</set>
+		WHERE id_ = #{id}
 	</update>
-	
+
 	<!-- 根据主键删除一条记录 -->
-	<delete id="delete" >
-		DELETE FROM sys_message_config WHERE id_ = #{id} 
+	<delete id="delete">
+		DELETE FROM sys_message_config WHERE id_ =
+		#{id}
 	</delete>
-	
+
 	<!-- 分页查询 -->
-	<select id="queryPage" resultMap="SysMessageConfig" parameterType="map">
-		SELECT * FROM sys_message_config ORDER BY id_ <include refid="global.limit"/>
+	<select id="queryPage" resultMap="SysMessageConfig"
+		parameterType="map">
+		select * from sys_message_config
+		<include refid="queryCondition" />
+		order by update_time_ desc
+		<include refid="global.limit" />
 	</select>
-	
+
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM sys_message_config
+		select count(*) from sys_message_config
+		<include refid="queryCondition" />
+	</select>
+
+	<select id="queryByType" resultMap="SysMessageConfig">
+		select
+		<include refid="Base_Column_List" />
+		from xjd_message_config
+		where message_type_ = #{messageType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 	</select>
 </mapper>

+ 141 - 76
mec-biz/src/main/resources/config/mybatis/SysMessageMapper.xml

@@ -6,7 +6,7 @@
 -->
 <mapper namespace="com.ym.mec.biz.dal.dao.SysMessageDao">
 
-    <resultMap type="com.ym.mec.biz.dal.entity.SysMessage" id="SysMessage">
+    <resultMap type="com.ym.mec.biz.dal.entity.SysMessage" id="message">
         <result column="id_" property="id"/>
         <result column="title_" property="title"/>
         <result column="content_" property="content"/>
@@ -19,90 +19,155 @@
         <result column="modify_on_" property="modifyOn"/>
         <result column="user_id_" property="userId"/>
         <result column="memo_" property="memo"/>
-        <result column="read_status_" property="readStatus" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="read_status_" property="readStatus"/>
     </resultMap>
 
-    <!-- 根据主键查询一条记录 -->
-    <select id="get" resultMap="SysMessage">
-		SELECT * FROM sys_message WHERE id_ = #{id} 
-	</select>
+	<sql id="queryCondition">
+		<where>
+			<if test="userId != null">
+				and user_id_ = #{userId,jdbcType=BIGINT}
+			</if>
+			<if test="receiver != null">
+				and receiver_ like '%' #{receiver} '%'
+			</if>
+			<if test="status != null">
+				and status_ = #{status,jdbcType=TINYINT}
+			</if>
+			<if test="readStatus != null">
+				and read_status_ = #{readStatus,jdbcType=TINYINT}
+			</if>
+			<if test="title != null">
+				and title_ like '%' #{title} '%'
+			</if>
+			<if test="type != null">
+				and type_ = #{type}
+			</if>
+		</where>
+	</sql>
 
-    <!-- 全查询 -->
-    <select id="findAll" resultMap="SysMessage">
-		SELECT * FROM sys_message ORDER BY id_
+    <select id="get" resultMap="message" parameterType="java.lang.Long">
+		select
+		<include refid="Base_Column_List" />
+		from sys_message
+		where id_ = #{id,jdbcType=BIGINT}
 	</select>
 
-    <!-- 向数据库增加一条记录 -->
-    <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SysMessage" useGeneratedKeys="true" keyColumn="id"
-            keyProperty="id">
-        <!--
-        <selectKey resultClass="int" keyProperty="id" >
-        SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
-        </selectKey>
-        -->
-        INSERT INTO sys_message
-        (id_,title_,content_,type_,receiver_,send_time_,error_msg_,create_on_,modify_on_,user_id_,memo_)
-        VALUES(#{id},#{title},#{content},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-        #{receiver},#{sendTime},#{errorMsg},now(),now(),#{userId},#{memo})
-    </insert>
+	<delete id="delete" parameterType="java.lang.Long">
+		delete from
+		sys_message
+		where
+		id_ = #{id,jdbcType=BIGINT}
+	</delete>
+
+	<insert id="insert" parameterType="com.ljfq.xjd.dal.model.Message">
+		insert into sys_message (id_, user_id_,
+		title_, content_,
+		type_, status_, receiver_,
+		send_time_, error_msg_,read_status_,memo_, create_on_,
+		modify_on_)
+		values (#{id,jdbcType=BIGINT},#{userId,jdbcType=BIGINT}, #{title,jdbcType=VARCHAR},
+		#{content,jdbcType=VARCHAR},
+		#{type,jdbcType=TINYINT},
+		#{status,jdbcType=TINYINT}, #{receiver,jdbcType=VARCHAR},
+		#{sendTime},#{errorMsg,jdbcType=VARCHAR},#{readStatus},#{memo},
+		#{createOn},
+		#{modifyOn})
+	</insert>
+
+	<insert id="batchInsert" parameterType="com.ljfq.xjd.dal.model.Message">
+		insert into sys_message (id_, user_id_,
+		title_, content_,
+		type_, status_, receiver_,
+		send_time_, error_msg_,read_status_,memo_, create_on_,
+		modify_on_)
+		values
+		<foreach collection="list" item="item" index="index"
+			separator=",">
+			(
+			#{item.id,jdbcType=BIGINT},#{item.userId,jdbcType=BIGINT}, #{item.title,jdbcType=VARCHAR},
+			#{item.content,jdbcType=VARCHAR},
+			#{item.type,jdbcType=TINYINT},
+			#{item.status,jdbcType=TINYINT}, #{item.receiver,jdbcType=VARCHAR},
+			#{item.sendTime},#{item.errorMsg,jdbcType=VARCHAR},#{item.readStatus},#{item.memo},
+			#{item.createOn},
+			#{item.modifyOn}
+			)
+		</foreach>
+	</insert>
+
+	<update id="update" parameterType="com.ljfq.xjd.dal.model.Message">
+		update sys_message
+		<set>
+			<if test="userId != null">
+				user_id_ = #{userId,jdbcType=BIGINT},
+			</if>
+			<if test="title != null">
+				title_ = #{title,jdbcType=VARCHAR},
+			</if>
+			<if test="content != null">
+				content_ = #{content,jdbcType=VARCHAR},
+			</if>
+			<if test="type != null">
+				type_ = #{type,jdbcType=TINYINT},
+			</if>
+			<if test="status != null">
+				status_ = #{status,jdbcType=TINYINT},
+			</if>
+			<if test="receiver != null">
+				receiver_ = #{receiver,jdbcType=VARCHAR},
+			</if>
+			<if test="sendTime != null">
+				send_time_ = #{sendTime},
+			</if>
+			<if test="errorMsg != null">
+				error_msg_ = #{errorMsg,jdbcType=VARCHAR},
+			</if>
+			<if test="readStatus != null">
+				read_status_ = #{readStatus,jdbcType=TINYINT},
+			</if>
+			<if test="memo != null">
+				memo_ = #{memo,jdbcType=VARCHAR},
+			</if>
+			<if test="createOn != null">
+				create_on_ = #{createOn},
+			</if>
+			<if test="modifyOn != null">
+				modify_on_ = #{modifyOn},
+			</if>
+		</set>
+		where id_ = #{id,jdbcType=BIGINT}
+	</update>
+	<update id="updateStatus">
+		update sys_message set read_status_=#{status}
+		where user_id_ =#{userId}
+	</update>
 
-    <!-- 根据主键查询一条记录 -->
-    <update id="update" parameterType="com.ym.mec.biz.dal.entity.SysMessage">
-        UPDATE sys_message
-        <set>
-            <if test="status != null">
-                status_ = #{status typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"},
-            </if>
-            <if test="receiver != null">
-                receiver_ = #{receiver},
-            </if>
-            <if test="modifyOn != null">
-                modify_on_ = #{modifyOn},
-            </if>
-            <if test="sendTime != null">
-                send_time_ = #{sendTime},
-            </if>
-            <if test="readStatus != null">
-                read_status_ = #{readStatus typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"},
-            </if>
-            <if test="content != null">
-                content_ = #{content},
-            </if>
-            <if test="memo != null">
-                memo_ = #{memo},
-            </if>
-            <if test="userId != null">
-                user_id_ = #{userId},
-            </if>
-            <if test="errorMsg != null">
-                error_msg_ = #{errorMsg},
-            </if>
-            <if test="title != null">
-                title_ = #{title},
-            </if>
-            <if test="type != null">
-                type_ = #{type typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"},
-            </if>
-        </set>
-        WHERE id_ = #{id}
+    <update id="updateOneStatus">
+       update sys_message set read_status_=#{status}
+		where id_ =#{id}
     </update>
 
-    <!-- 根据主键删除一条记录 -->
-    <delete id="delete">
-		DELETE FROM sys_message WHERE id_ = #{id} 
-	</delete>
+    <select id="findCount" parameterType="map" resultType="int">
+		select count(*) from sys_message
+		<include refid="queryCondition" />
+	</select>
 
-    <!-- 分页查询 -->
-    <select id="queryPage" resultMap="SysMessage" parameterType="map">
-        SELECT * FROM sys_message ORDER BY id_
-        <include refid="global.limit"/>
-    </select>
+	<select id="queryPage" parameterType="map" resultMap="message">
+		select * from sys_message
+		<include refid="queryCondition" />
+		<include refid="global.orderby" />
+		<include refid="global.limit" />
+	</select>
+
+	<select id="queryByStatusAndTime" resultMap="message">
+		select
+		<include refid="Base_Column_List" />
+		from sys_message where status_ = #{status} and <![CDATA[DATE_ADD(CURDATE(),
+		INTERVAL #{recentMin} MINUTE) >= date(send_time_)]]>
+	</select>
 
-    <!-- 查询当前表的总记录数 -->
-    <select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM sys_message
+	<select id="queryCountOfUnread" resultType="int" parameterType="java.lang.Long">
+		select count(*) from sys_message
+		where user_id_ = #{userId,jdbcType=BIGINT} and read_status_ = 0
 	</select>
-    <select id="findNewMessageNum" resultType="java.lang.Integer">
-        SELECT COUNT(id_) FROM sys_message WHERE status_ = 4 AND read_status_ = 0
-    </select>
 </mapper>

+ 5 - 0
mec-common/common-core/pom.xml

@@ -43,5 +43,10 @@
 			<groupId>com.ym</groupId>
 			<artifactId>mec-thirdparty</artifactId>
 		</dependency>
+		<dependency>
+			<groupId>org.springframework.security.oauth</groupId>
+			<artifactId>spring-security-oauth2</artifactId>
+			<version>2.2.1.RELEASE</version>
+		</dependency>
 	</dependencies>
 </project>

+ 10 - 0
mec-education/pom.xml

@@ -91,6 +91,16 @@
 			<groupId>javax.persistence</groupId>
 			<artifactId>javax.persistence-api</artifactId>
 		</dependency>
+		<dependency>
+			<groupId>com.ym</groupId>
+			<artifactId>common-core</artifactId>
+			<exclusions>
+				<exclusion>
+					<groupId>org.mybatis.spring.boot</groupId>
+					<artifactId>mybatis-spring-boot-starter</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
 
 	</dependencies>
 	<build>

+ 3 - 1
mec-education/src/main/java/com/ym/mec/education/EducationApplication.java

@@ -7,12 +7,14 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.cloud.client.loadbalancer.LoadBalanced;
 import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.web.client.RestTemplate;
 
-@MapperScan("com.ym.mec.education.mapper*")
+@MapperScan("com.ym.mec.education.mapper")
 @SpringBootApplication
 @EnableDiscoveryClient
+@ComponentScan(basePackages = "com.ym.mec")
 @Configuration
 @EnableSwagger2Doc
 public class EducationApplication {

+ 20 - 0
mec-education/src/main/java/com/ym/mec/education/base/BaseQuery.java

@@ -0,0 +1,20 @@
+package com.ym.mec.education.base;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.io.Serializable;
+
+/**
+ * @version V1.0
+ * @Description: TODO
+ * @date Date : 2019年09月25日 21:50
+ */
+@Data
+public class BaseQuery implements Serializable {
+
+    @ApiModelProperty(value = "起始页",required = false)
+    private Integer pageNo = 1;
+
+    @ApiModelProperty(value = "每页显示记录数",required = false)
+    private Integer pageSize = 10;
+}

+ 12 - 2
mec-education/src/main/java/com/ym/mec/education/base/PageResponse.java

@@ -1,7 +1,8 @@
 package com.ym.mec.education.base;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.ym.mec.education.enums.ReturnCodeEnum;
 import org.apache.commons.lang3.StringUtils;
-
 import java.io.Serializable;
 import java.util.Collections;
 import java.util.List;
@@ -32,6 +33,15 @@ public class PageResponse<T> extends Response implements Serializable {
         this.isAsc = true;
     }
 
+    public static PageResponse success(IPage page) {
+        PageResponse pageResponse = new PageResponse(Math.toIntExact(page.getCurrent()), Math.toIntExact(page.getSize()));
+        pageResponse.setReturnCode(ReturnCodeEnum.CODE_1000.getCode());
+        pageResponse.setMessage(ReturnCodeEnum.CODE_1000.getValue());
+        pageResponse.setRecords(page.getRecords());
+        pageResponse.setTotal(Math.toIntExact(page.getTotal()));
+        return pageResponse;
+    }
+
     public PageResponse(Integer current, Integer size) {
         this(current, size, true);
     }
@@ -165,4 +175,4 @@ public class PageResponse<T> extends Response implements Serializable {
         return pg.append(" }").toString();
     }
 
-}
+}

+ 14 - 15
mec-education/src/main/java/com/ym/mec/education/config/ResourceServerConfig.java

@@ -1,4 +1,3 @@
-/*
 package com.ym.mec.education.config;
 
 import org.springframework.beans.factory.annotation.Autowired;
@@ -7,7 +6,6 @@ import org.springframework.security.config.annotation.web.builders.HttpSecurity;
 import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
 import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
 import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer;
-
 import com.ym.mec.common.security.BaseAccessDeniedHandler;
 import com.ym.mec.common.security.BaseAuthenticationEntryPoint;
 
@@ -15,21 +13,22 @@ import com.ym.mec.common.security.BaseAuthenticationEntryPoint;
 @EnableResourceServer
 public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
 
-	@Autowired
-	private BaseAccessDeniedHandler baseAccessDeniedHandler;
+    @Autowired
+    private BaseAccessDeniedHandler baseAccessDeniedHandler;
 
-	@Autowired
-	private BaseAuthenticationEntryPoint baseAuthenticationEntryPoint;
+    @Autowired
+    private BaseAuthenticationEntryPoint baseAuthenticationEntryPoint;
 
-	@Override
-	public void configure(HttpSecurity http) throws Exception {
-		http.csrf().disable().authorizeRequests().antMatchers("/v2/api-docs").permitAll().anyRequest().authenticated().and().httpBasic();
-	}
+    @Override
+    public void configure(HttpSecurity http) throws Exception {
+        http.csrf().disable().authorizeRequests().antMatchers("/v2/api-docs").permitAll()
+                .antMatchers("/api/**").permitAll()
+                .anyRequest().authenticated().and().httpBasic();
+    }
 
-	@Override
-	public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
-		resources.authenticationEntryPoint(baseAuthenticationEntryPoint).accessDeniedHandler(baseAccessDeniedHandler);
-	}
+    @Override
+    public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
+        resources.authenticationEntryPoint(baseAuthenticationEntryPoint).accessDeniedHandler(baseAccessDeniedHandler);
+    }
 
 }
-*/

+ 2 - 5
mec-education/src/main/java/com/ym/mec/education/config/WebMvcConfig.java

@@ -1,4 +1,3 @@
-/*
 package com.ym.mec.education.config;
 
 import java.io.IOException;
@@ -39,10 +38,9 @@ import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
 @Configuration
 public class WebMvcConfig implements WebMvcConfigurer {
 
-	*/
-/**
+	/**
 	 * 枚举类的转换器 addConverterFactory
-	 *//*
+	 */
 
 	@Override
 	public void addFormatters(FormatterRegistry registry) {
@@ -107,4 +105,3 @@ public class WebMvcConfig implements WebMvcConfigurer {
 	}
 
 }
-*/

+ 71 - 7
mec-education/src/main/java/com/ym/mec/education/controller/MusicGroupController.java

@@ -1,12 +1,30 @@
 package com.ym.mec.education.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.google.common.collect.Lists;
 import com.netflix.hystrix.contrib.javanica.annotation.DefaultProperties;
 import com.ym.mec.education.base.BaseResponse;
+import com.ym.mec.education.base.PageResponse;
+import com.ym.mec.education.entity.ClassGroup;
+import com.ym.mec.education.entity.ClassGroupTeacherMapper;
+import com.ym.mec.education.entity.MusicGroup;
+import com.ym.mec.education.enums.ReturnCodeEnum;
+import com.ym.mec.education.req.MusicGroupReq;
+import com.ym.mec.education.resp.MusicGroupResp;
+import com.ym.mec.education.service.IClassGroupService;
+import com.ym.mec.education.service.IClassGroupTeacherMapperService;
+import com.ym.mec.education.service.IMusicGroupService;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.util.CollectionUtils;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
 
-import javax.persistence.GenerationType;
 
 /**
  * @author : chengp
@@ -14,10 +32,20 @@ import javax.persistence.GenerationType;
  * @Description: TODO
  * @date Date : 2019年09月25日 17:39
  */
-@RestController(value = "musicGroup")
+@RestController
+@RequestMapping("/api/musicGroup")
 @DefaultProperties(defaultFallback = "defaultFallback")
 @Slf4j
 public class MusicGroupController {
+
+    @Autowired
+    private IMusicGroupService musicGroupService;
+
+    @Autowired
+    private IClassGroupService classGroupService;
+
+    @Autowired
+    private IClassGroupTeacherMapperService classGroupTeacherMapperService;
     /**
      * 服务降级处理
      *
@@ -30,9 +58,45 @@ public class MusicGroupController {
         return response;
     }
 
-    @GetMapping(value = "/say")
-    public String say(){
+    @PostMapping(value = "/groupList")
+    public PageResponse groupList(@RequestBody MusicGroupReq req){
+        PageResponse response = new PageResponse();
+        IPage page = new Page();
+        QueryWrapper<MusicGroup> queryWrapper = new QueryWrapper<>();
+        IPage<MusicGroup> queryPage =  musicGroupService.page(page,queryWrapper);
+        if(queryPage.getRecords() == null && queryPage.getRecords().isEmpty()){
+            response.setReturnCode(ReturnCodeEnum.CODE_1005.getCode());
+            return response;
+        }
+
+        List<MusicGroup> musicGroupList  = queryPage.getRecords();
+        List<MusicGroupResp> musicGroupResps = Lists.newArrayList();
+        musicGroupList.forEach(g ->{
+            MusicGroupResp musicGroupResp = new MusicGroupResp();
+            BeanUtils.copyProperties(g,musicGroupResp);
+            QueryWrapper<ClassGroup> queryWrapper1 = new QueryWrapper<>();
+            queryWrapper1.eq("music_group_id_",g.getId());
+            List<ClassGroup> classGroups = classGroupService.list(queryWrapper1);
+            if(!CollectionUtils.isEmpty(classGroups)){
+                int studNum = classGroups.stream().mapToInt(ClassGroup::getStudentNum).sum();
+                musicGroupResp.setStudentNum(studNum);
+            }
+
+            QueryWrapper<ClassGroupTeacherMapper> queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.eq("music_group_id_",g.getId());
+            List<ClassGroupTeacherMapper> classGroupTeacherMappers = classGroupTeacherMapperService.list(queryWrapper2);
 
-        return  "utyrewertyu";
+            if(!CollectionUtils.isEmpty(classGroupTeacherMappers)){
+                int teachNum = classGroupTeacherMappers.size();
+                musicGroupResp.setStudentNum(teachNum);
+            }
+            musicGroupResps.add(musicGroupResp);
+        });
+        int count = musicGroupService.count(queryWrapper);
+        response.setRecords(musicGroupResps);
+        response.setReturnCode(ReturnCodeEnum.CODE_1000.getCode());
+        response.setMessage(ReturnCodeEnum.CODE_1000.getValue());
+        response.setTotal(count);
+        return  response;
     }
 }

+ 44 - 0
mec-education/src/main/java/com/ym/mec/education/controller/StudentAttendanceController.java

@@ -0,0 +1,44 @@
+package com.ym.mec.education.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ym.mec.education.base.PageResponse;
+import com.ym.mec.education.entity.StudentAttendance;
+import com.ym.mec.education.req.StudentAttendanceReq;
+import com.ym.mec.education.service.IStudentAttendanceService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import java.util.Objects;
+
+/**
+ * @program: mec
+ * @description: 考勤记录
+ * @author: xw
+ * @create: 2019-09-25 21:22
+ */
+@RestController
+@RequestMapping("api/studentAttendance")
+@Slf4j
+public class StudentAttendanceController {
+
+    @Autowired
+    private IStudentAttendanceService studentAttendanceService;
+
+    @PostMapping("/page")
+    public PageResponse page(@RequestBody StudentAttendanceReq studentAttendanceReq) {
+        Page<StudentAttendance> page = new Page(studentAttendanceReq.getPageNo(), studentAttendanceReq.getPageSize());
+        QueryWrapper<StudentAttendance> queryWrapper = new QueryWrapper<>();
+        queryWrapper.lambda().eq(Objects.nonNull(studentAttendanceReq.getMusicGroupId()),
+                StudentAttendance::getMusicGroupId, studentAttendanceReq.getMusicGroupId())
+                .eq(Objects.nonNull(studentAttendanceReq.getClassGroupId()),
+                        StudentAttendance::getClassGroupId, studentAttendanceReq.getClassGroupId());
+        IPage<StudentAttendance> pageResult = studentAttendanceService.page(page, queryWrapper);
+        return PageResponse.success(pageResult);
+    }
+
+}

+ 43 - 0
mec-education/src/main/java/com/ym/mec/education/enums/ReturnCodeEnum.java

@@ -0,0 +1,43 @@
+package com.ym.mec.education.enums;
+
+/**
+ * @version V1.0
+ * @Description: TODO
+ * @date Date : 2019年09月25日 21:15
+ */
+public enum ReturnCodeEnum {
+    CODE_1000(1000, "message.common.success"),
+    CODE_1001(1001, "message.security.unauthorized"),
+    CODE_1002(1002, "message.common.information.nonexistence"),
+    CODE_1003(1003, "message.payment.type.error"),
+    CODE_1004(1004, "message.common.server.error"),
+    CODE_1005(1005, "message.common.failed"),
+    CODE_1006(1006, "message.common.parameters.missing"),
+    CODE_1007(1007, "message.common.timeout"),
+    CODE_1008(1008, "message.common.information.already.exists"),
+    CODE_1009(1009, "message.common.session.expired"),
+    CODE_1010(1010, "message.security.authfailed"),
+    CODE_1011(1011, "message.app.sign.authfailed");
+
+    private Integer code;
+    private String value;
+
+    private ReturnCodeEnum(Integer code, String value) {
+        this.code = code;
+        this.value = value;
+    }
+
+    public final Integer getCode() {
+        return this.code;
+    }
+
+    public final String getValue() {
+        return this.value;
+    }
+
+
+    @Override
+    public String toString() {
+        return this.code + "=" + this.value;
+    }
+}

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/mapper/ClassGroupMapper.java

@@ -1,6 +1,6 @@
 package com.ym.mec.education.mapper;
 
-import com.baomidou.mybatisplus.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ym.mec.education.entity.ClassGroup;
 
 /**

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/mapper/ClassGroupTeacherMapperMapper.java

@@ -1,6 +1,6 @@
 package com.ym.mec.education.mapper;
 
-import com.baomidou.mybatisplus.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ym.mec.education.entity.ClassGroupTeacherMapper;
 
 /**

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/mapper/StudentAttendanceMapper.java

@@ -1,7 +1,7 @@
 package com.ym.mec.education.mapper;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ym.mec.education.entity.StudentAttendance;
-import com.baomidou.mybatisplus.mapper.BaseMapper;
 
 /**
  * <p>

+ 16 - 0
mec-education/src/main/java/com/ym/mec/education/req/MusicGroupReq.java

@@ -0,0 +1,16 @@
+package com.ym.mec.education.req;
+
+import com.ym.mec.education.base.BaseQuery;
+import lombok.Data;
+import java.io.Serializable;
+
+/**
+ * @version V1.0
+ * @Description: TODO
+ * @date Date : 2019年09月25日 20:59
+ */
+@Data
+public class MusicGroupReq extends BaseQuery {
+
+    private String name;
+}

+ 96 - 0
mec-education/src/main/java/com/ym/mec/education/resp/MusicGroupResp.java

@@ -0,0 +1,96 @@
+package com.ym.mec.education.resp;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author : chengp
+ * @version V1.0
+ * @Description: TODO
+ * @date Date : 2019年09月25日 21:36
+ */
+@Data
+public class MusicGroupResp implements Serializable {
+
+
+    private static final long serialVersionUID = 1L;
+
+    private String id;
+    /**
+     * 乐团名称
+     */
+    private String name;
+    /**
+     * 所属分部
+     */
+    private Integer organId;
+    /**
+     * 学校(合作单位)
+     */
+    private Integer schoolId;
+    /**
+     * 报名截止日期
+     */
+    private Date applyExpireDate;
+    /**
+     * 运营主管
+     */
+    private Integer teamTeacherId;
+    /**
+     * 教务老师
+     */
+    private Integer educationalTeacherId;
+    /**
+     * 收费类型
+     */
+    private Integer chargeTypeId;
+    /**
+     * 课程形态
+     */
+    private String courseForm;
+    private Date createTime;
+    private Date updateTime;
+    /**
+     * 状态(报名中、缴费中、筹备中、进行中、取消)
+     */
+    private String status;
+    /**
+     * 计费开始日期
+     */
+    private Date billStartDate;
+    /**
+     * 提高课班级数
+     */
+    private Integer improventClassesNum;
+    /**
+     * 招生年级(多个用|分开)
+     */
+    private String enrollClasses;
+    /**
+     * 缴费截止时间
+     */
+    private Date paymentExpireDate;
+    /**
+     * 是否是加课
+     */
+    private String isExtraClass;
+    /**
+     * 合作单位编号
+     */
+    private Integer cooperationOrganId;
+    /**
+     * 启蒙课日期
+     */
+    private Date enlightenmentCourseTime;
+    /**
+     * 家长会日期
+     */
+    private Date parentMeetingTime;
+
+    private Integer studentNum;
+
+    private Integer teacherNum;
+
+}

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/service/IClassGroupService.java

@@ -1,6 +1,6 @@
 package com.ym.mec.education.service;
 
-import com.baomidou.mybatisplus.service.IService;
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.ym.mec.education.entity.ClassGroup;
 
 /**

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/service/IClassGroupTeacherMapperService.java

@@ -1,6 +1,6 @@
 package com.ym.mec.education.service;
 
-import com.baomidou.mybatisplus.service.IService;
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.ym.mec.education.entity.ClassGroupTeacherMapper;
 
 /**

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/service/IStudentAttendanceService.java

@@ -1,7 +1,7 @@
 package com.ym.mec.education.service;
 
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.ym.mec.education.entity.StudentAttendance;
-import com.baomidou.mybatisplus.service.IService;
 
 /**
  * <p>

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/service/impl/ClassGroupServiceImpl.java

@@ -1,6 +1,6 @@
 package com.ym.mec.education.service.impl;
 
-import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ym.mec.education.entity.ClassGroup;
 import com.ym.mec.education.mapper.ClassGroupMapper;
 import com.ym.mec.education.service.IClassGroupService;

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/service/impl/ClassGroupTeacherMapperServiceImpl.java

@@ -1,6 +1,6 @@
 package com.ym.mec.education.service.impl;
 
-import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ym.mec.education.entity.ClassGroupTeacherMapper;
 import com.ym.mec.education.mapper.ClassGroupTeacherMapperMapper;
 import com.ym.mec.education.service.IClassGroupTeacherMapperService;

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/service/impl/StudentAttendanceServiceImpl.java

@@ -1,9 +1,9 @@
 package com.ym.mec.education.service.impl;
 
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ym.mec.education.entity.StudentAttendance;
 import com.ym.mec.education.mapper.StudentAttendanceMapper;
 import com.ym.mec.education.service.IStudentAttendanceService;
-import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
 /**

+ 0 - 2
mec-student/src/main/java/com/ym/mec/student/controller/CourseController.java

@@ -4,8 +4,6 @@ import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.service.ClassGroupService;
 import com.ym.mec.common.controller.BaseController;
-import com.ym.mec.common.security.AuthUser;
-import com.ym.mec.common.security.SecurityUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;

+ 12 - 11
mec-web/src/main/java/com/ym/mec/web/controller/SysMessageController.java

@@ -1,21 +1,22 @@
 package com.ym.mec.web.controller;
 
+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.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.entity.ChargeType;
 import com.ym.mec.biz.dal.entity.SysMessage;
-import com.ym.mec.biz.service.ChargeTypeService;
 import com.ym.mec.biz.service.SysMessageService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.page.QueryInfo;
-import com.ym.mec.common.security.SecurityUtils;
-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.web.bind.annotation.*;
-
-import java.util.Date;
 
 @RequestMapping("message")
 @Api(tags = "消息提醒服务")
@@ -57,7 +58,7 @@ public class SysMessageController extends BaseController {
         if(sysUser == null){
             return failed("请重新登录");
         }
-        return succeed(sysMessageService.findNewMessageNum(sysUser.getId()));
+        return succeed(sysMessageService.queryCountOfUnread(sysUser.getId()));
     }
 
     @ApiOperation(value = "分页查询消息提醒列表")