瀏覽代碼

Merge remote-tracking branch 'origin/master'

周箭河 5 年之前
父節點
當前提交
a0f17d4023
共有 32 個文件被更改,包括 1441 次插入18 次删除
  1. 77 0
      cms/src/main/java/com/ym/mec/cms/controller/HelpCenterCatalogController.java
  2. 83 0
      cms/src/main/java/com/ym/mec/cms/controller/HelpCenterContentControlller.java
  3. 42 0
      cms/src/main/java/com/ym/mec/cms/controller/queryinfo/HelpCenterContentQueryInfo.java
  4. 13 0
      cms/src/main/java/com/ym/mec/cms/dal/dao/HelpCenterCatalogDao.java
  5. 13 0
      cms/src/main/java/com/ym/mec/cms/dal/dao/HelpCenterContentDao.java
  6. 126 0
      cms/src/main/java/com/ym/mec/cms/dal/entity/HelpCenterCatalog.java
  7. 121 0
      cms/src/main/java/com/ym/mec/cms/dal/entity/HelpCenterContent.java
  8. 31 0
      cms/src/main/java/com/ym/mec/cms/service/HelpCenterCatalogService.java
  9. 11 0
      cms/src/main/java/com/ym/mec/cms/service/HelpCenterContentService.java
  10. 56 0
      cms/src/main/java/com/ym/mec/cms/service/impl/HelpCenterCatalogServiceImpl.java
  11. 41 0
      cms/src/main/java/com/ym/mec/cms/service/impl/HelpCenterContentServiceImpl.java
  12. 96 0
      cms/src/main/resources/config/mybatis/HelpCenterCatalogMapper.xml
  13. 164 0
      cms/src/main/resources/config/mybatis/HelpCenterContentMapper.xml
  14. 1 1
      mec-auth/mec-auth-server/src/main/resources/bootstrap-test.properties
  15. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupStudentMapperDao.java
  16. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java
  17. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CoursesGroupDao.java
  18. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SubjectDao.java
  19. 110 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseGroupTeacherCardDto.java
  20. 60 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/GroupCourseTimesDto.java
  21. 9 8
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CoursesGroup.java
  22. 2 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/ClassGroupTypeEnum.java
  23. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/GroupStatusEnum.java
  24. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/service/CoursesGroupService.java
  25. 5 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  26. 196 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CoursesGroupServiceImpl.java
  27. 16 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/GroupClassServiceImpl.java
  28. 13 0
      mec-biz/src/main/resources/config/mybatis/ClassGroupStudentMapperMapper.xml
  29. 29 0
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  30. 7 3
      mec-biz/src/main/resources/config/mybatis/CoursesGroupMapper.xml
  31. 6 0
      mec-biz/src/main/resources/config/mybatis/SubjectMapper.xml
  32. 64 0
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/CourseGroupController.java

+ 77 - 0
cms/src/main/java/com/ym/mec/cms/controller/HelpCenterCatalogController.java

@@ -0,0 +1,77 @@
+package com.ym.mec.cms.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+
+import java.util.Date;
+import java.util.List;
+
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.GetMapping;
+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.cms.dal.entity.HelpCenterCatalog;
+import com.ym.mec.cms.service.HelpCenterCatalogService;
+import com.ym.mec.cms.service.HelpCenterContentService;
+import com.ym.mec.common.controller.BaseController;
+
+@RestController
+@RequestMapping("helpCenterCatalog")
+@Api(tags = "帮助中心分类")
+public class HelpCenterCatalogController extends BaseController {
+
+	@Autowired
+	private HelpCenterCatalogService helpCenterCatalogService;
+
+	@Autowired
+	private HelpCenterContentService helpCenterContentService;
+
+	@GetMapping(value = "list")
+	@ApiImplicitParams({ @ApiImplicitParam(name = "parentId", value = "父分类编号(可为空)", required = true, dataType = "Integer"),
+			@ApiImplicitParam(name = "status", value = "状态(1,显示 0,隐藏;可为空)", required = true, dataType = "Integer") })
+	public Object list(Integer parentId, Integer status) {
+		List<HelpCenterCatalog> dataList = helpCenterCatalogService.queryByParentId(parentId, status);
+		return succeed(dataList);
+	}
+
+	@GetMapping(value = "get")
+	@ApiImplicitParam(name = "id", value = "分类编号", required = true, dataType = "Integer", paramType = "path")
+	public Object findHelpCatalogById(Integer id) {
+		if (id == null || id <= 0)
+			return failed("请检查输入的ID");
+		return succeed(helpCenterCatalogService.get(id));
+	}
+
+	@PostMapping(value = "modify", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	public Object modifyHelpCatalog(HelpCenterCatalog helpCatalog) {
+		if (helpCatalog == null)
+			return failed("参数输入有误");
+		if (helpCatalog.getId() != null && helpCatalog.getId() > 0) {
+			helpCatalog.setModifyOn(new Date());
+			return helpCenterCatalogService.updateCatalog(helpCatalog) ? succeed() : failed("修改失败");
+		} else {
+			if (StringUtils.isBlank(helpCatalog.getText())) {
+				return failed("帮助分类不能为空");
+			}
+			helpCatalog.setCreateOn(new Date());
+			return helpCenterCatalogService.insert(helpCatalog) > 0 ? succeed() : failed("添加失败");
+		}
+	}
+
+	@PostMapping(value = "delete", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@ApiImplicitParam(name = "id", value = "分类编号", required = true, dataType = "Integer", paramType = "path")
+	public Object delHelpCatalog(Integer id) {
+		if (id == null || id <= 0)
+			return failed("ID解析失败");
+		List<HelpCenterCatalog> list = helpCenterCatalogService.queryByParentId(id, null);
+		if (list != null && list.size() > 0) {
+			return failed("删除失败,请先删除子集分类");
+		}
+		return helpCenterCatalogService.deleteCatalog(id) ? succeed() : failed("删除失败");
+	}
+}

+ 83 - 0
cms/src/main/java/com/ym/mec/cms/controller/HelpCenterContentControlller.java

@@ -0,0 +1,83 @@
+package com.ym.mec.cms.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+
+import java.util.Date;
+
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.GetMapping;
+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.cms.controller.queryinfo.HelpCenterContentQueryInfo;
+import com.ym.mec.cms.dal.entity.HelpCenterContent;
+import com.ym.mec.cms.service.HelpCenterCatalogService;
+import com.ym.mec.cms.service.HelpCenterContentService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.page.PageInfo;
+
+@RestController
+@RequestMapping("helpCenterContent")
+@Api(tags = "帮助中心内容")
+public class HelpCenterContentControlller extends BaseController {
+
+	@Autowired
+	private HelpCenterContentService helpCenterContentService;
+
+	@Autowired
+	private HelpCenterCatalogService helpCenterCatalogService;
+
+	@GetMapping(value = "list")
+	public Object findHelpContentByCondition(HelpCenterContentQueryInfo queryInfo) {
+
+		queryInfo.setSort("order_");
+		queryInfo.setOrder("asc");
+		PageInfo<HelpCenterContent> data = helpCenterContentService.queryPage(queryInfo);
+		return succeed(data);
+	}
+
+	@GetMapping(value = "get")
+	@ApiImplicitParam(name = "id", value = "编号", required = true, dataType = "Integer", paramType = "path")
+	public Object findHelpContentByKey(Integer id) {
+		if (id == null || id <= 0) {
+			return failed("请检查输入的参数");
+		}
+		return succeed(helpCenterContentService.get(id));
+	}
+
+	@PostMapping(value = "modify", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	public Object modifyHelpContent(HelpCenterContent helpContent) {
+		if (helpContent == null) {
+			return failed("参数输入有误");
+		}
+
+		if (helpContent.getId() != null && helpContent.getId() > 0) {
+			helpContent.setModifyOn(new Date());
+			return helpCenterContentService.update(helpContent) > 0 ? succeed() : failed("修改失败");
+		} else {
+			if (StringUtils.isBlank(helpContent.getContent())) {
+				return failed("帮助内容不能为空");
+			}
+			if (StringUtils.isBlank(helpContent.getTitle())) {
+				return failed("帮助中心标题不能为空");
+			}
+			if (helpContent.getCatalogId() < 0) {
+				return failed("请选择分类");
+			}
+			helpContent.setCreateOn(new Date());
+			return helpCenterContentService.insert(helpContent) > 0 ? succeed() : failed("添加失败");
+		}
+	}
+
+	@PostMapping(value = "delete", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@ApiImplicitParam(name = "id", value = "编号", required = true, dataType = "Integer", paramType = "path")
+	public Object delHelpContent(Integer id) {
+		if (id == null || id <= 0)
+			return failed("ID解析失败");
+		return helpCenterContentService.delete(id) > 0 ? succeed() : failed("删除失败");
+	}
+}

+ 42 - 0
cms/src/main/java/com/ym/mec/cms/controller/queryinfo/HelpCenterContentQueryInfo.java

@@ -0,0 +1,42 @@
+package com.ym.mec.cms.controller.queryinfo;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import com.ym.mec.common.page.QueryInfo;
+
+public class HelpCenterContentQueryInfo extends QueryInfo {
+
+	@ApiModelProperty(value = "父分类ID,多个用逗号分隔", required = false)
+	private String catalogIds;
+
+	@ApiModelProperty(value = "标题", required = false)
+	private String title;
+
+	@ApiModelProperty(value = "状态(1-显示 0-隐藏)", required = false)
+	private Integer status;
+
+	public String getCatalogIds() {
+		return catalogIds;
+	}
+
+	public void setCatalogIds(String catalogIds) {
+		this.catalogIds = catalogIds;
+	}
+
+	public String getTitle() {
+		return title;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+}

+ 13 - 0
cms/src/main/java/com/ym/mec/cms/dal/dao/HelpCenterCatalogDao.java

@@ -0,0 +1,13 @@
+package com.ym.mec.cms.dal.dao;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+
+import com.ym.mec.cms.dal.entity.HelpCenterCatalog;
+import com.ym.mec.common.dal.BaseDAO;
+
+public interface HelpCenterCatalogDao extends BaseDAO<Integer, HelpCenterCatalog> {
+
+	public List<HelpCenterCatalog> queryByParentId(@Param("parentId") Integer parentId, @Param("status") Integer status);
+}

+ 13 - 0
cms/src/main/java/com/ym/mec/cms/dal/dao/HelpCenterContentDao.java

@@ -0,0 +1,13 @@
+package com.ym.mec.cms.dal.dao;
+
+import java.util.Map;
+
+import com.ym.mec.cms.dal.entity.HelpCenterContent;
+import com.ym.mec.common.dal.BaseDAO;
+
+public interface HelpCenterContentDao extends BaseDAO<Integer, HelpCenterContent> {
+
+	public int updateContentByCatalog(Map<String, Object> map);
+
+	public int deleteContentByCatalog(Integer catalogId);
+}

+ 126 - 0
cms/src/main/java/com/ym/mec/cms/dal/entity/HelpCenterCatalog.java

@@ -0,0 +1,126 @@
+package com.ym.mec.cms.dal.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+
+public class HelpCenterCatalog {
+
+	@ApiModelProperty(value = "编号", required = false)
+	private Integer id;
+
+	@ApiModelProperty(value = "父分类ID", required = false)
+	private Integer parentId;
+
+	@ApiModelProperty(value = "分类名称", required = false)
+	private String text;
+
+	@ApiModelProperty(value = "描述", required = false)
+	private String description;
+
+	/**  */
+	private java.util.Date createOn;
+
+	/**  */
+	private java.util.Date modifyOn;
+
+	@ApiModelProperty(value = "排序", required = false)
+	private Integer order;
+
+	/**
+	 * 子集合
+	 */
+	private List<HelpCenterCatalog> children;
+
+	@ApiModelProperty(value = "状态 1 显示 0隐藏", required = false)
+	private Integer status;
+
+	public void setId(Integer id) {
+		this.id = id;
+	}
+
+	public Integer getId() {
+		return this.id;
+	}
+
+	public String getText() {
+		return text;
+	}
+
+	public void setText(String text) {
+		this.text = text;
+	}
+
+	public List<HelpCenterCatalog> getChildren() {
+		return children;
+	}
+
+	public void setChildren(List<HelpCenterCatalog> children) {
+		this.children = children;
+	}
+
+	public void setParentId(Integer parentId) {
+		this.parentId = parentId;
+	}
+
+	public Integer getParentId() {
+		return this.parentId;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	public String getDescription() {
+		return this.description;
+	}
+
+	public void setCreateOn(java.util.Date createOn) {
+		this.createOn = createOn;
+	}
+
+	public java.util.Date getCreateOn() {
+		return this.createOn;
+	}
+
+	public void setModifyOn(java.util.Date modifyOn) {
+		this.modifyOn = modifyOn;
+	}
+
+	public java.util.Date getModifyOn() {
+		return this.modifyOn;
+	}
+
+	public Integer getOrder() {
+		return order;
+	}
+
+	public void setOrder(Integer order) {
+		this.order = order;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public Integer getStatus() {
+		return this.status;
+	}
+
+	public String toString() {
+		StringBuilder buf = new StringBuilder();
+		buf.append("HelpCatalog [");
+		buf.append("id=").append(id).append(",");
+		buf.append("parentId=").append(parentId).append(",");
+		buf.append("text=").append(text).append(",");
+		buf.append("description=").append(description).append(",");
+		buf.append("createOn=").append(createOn).append(",");
+		buf.append("modifyOn=").append(modifyOn).append(",");
+		buf.append("order=").append(order).append(",");
+		buf.append("status=").append(status).append(",");
+		buf.setLength(buf.length() - 1);
+		buf.append("]");
+		return buf.toString();
+	}
+
+}

+ 121 - 0
cms/src/main/java/com/ym/mec/cms/dal/entity/HelpCenterContent.java

@@ -0,0 +1,121 @@
+package com.ym.mec.cms.dal.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+
+public class HelpCenterContent {
+
+	@ApiModelProperty(value = "编号", required = false)
+	private Integer id;
+
+	@ApiModelProperty(value = "标题", required = false)
+	private String title;
+
+	@ApiModelProperty(value = "内容", required = false)
+	private String content = "";
+
+	@ApiModelProperty(value = "分类ID", required = false)
+	private Integer catalogId;
+
+	/** 创建时间 */
+	private java.util.Date createOn;
+
+	/** 修改时间 */
+	private java.util.Date modifyOn;
+
+	@ApiModelProperty(value = "状态 1显示 0隐藏", required = false)
+	private Integer status;
+
+	@ApiModelProperty(value = "排序", required = false)
+	private Integer order;
+
+	private HelpCenterCatalog catalog;
+
+	public HelpCenterCatalog getCatalog() {
+		return catalog;
+	}
+
+	public void setCatalog(HelpCenterCatalog catalog) {
+		this.catalog = catalog;
+	}
+
+	public Integer getOrder() {
+		return order;
+	}
+
+	public void setOrder(Integer order) {
+		this.order = order;
+	}
+
+	public void setId(Integer id) {
+		this.id = id;
+	}
+
+	public Integer getId() {
+		return this.id;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
+
+	public String getTitle() {
+		return this.title;
+	}
+
+	public void setContent(String content) {
+		this.content = content;
+	}
+
+	public String getContent() {
+		return this.content;
+	}
+
+	public void setCatalogId(Integer catalogId) {
+		this.catalogId = catalogId;
+	}
+
+	public Integer getCatalogId() {
+		return this.catalogId;
+	}
+
+	public void setCreateOn(java.util.Date createOn) {
+		this.createOn = createOn;
+	}
+
+	public java.util.Date getCreateOn() {
+		return this.createOn;
+	}
+
+	public void setModifyOn(java.util.Date modifyOn) {
+		this.modifyOn = modifyOn;
+	}
+
+	public java.util.Date getModifyOn() {
+		return this.modifyOn;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public Integer getStatus() {
+		return this.status;
+	}
+
+	public String toString() {
+		StringBuilder buf = new StringBuilder();
+		buf.append("HelpContent [");
+		buf.append("id=").append(id).append(",");
+		buf.append("title=").append(title).append(",");
+		buf.append("content=").append(content).append(",");
+		buf.append("order=").append(order).append(",");
+		buf.append("catalogId=").append(catalogId).append(",");
+		buf.append("createOn=").append(createOn).append(",");
+		buf.append("modifyOn=").append(modifyOn).append(",");
+		buf.append("status=").append(status).append(",");
+		buf.setLength(buf.length() - 1);
+		buf.append("]");
+		return buf.toString();
+	}
+
+}

+ 31 - 0
cms/src/main/java/com/ym/mec/cms/service/HelpCenterCatalogService.java

@@ -0,0 +1,31 @@
+package com.ym.mec.cms.service;
+
+import java.util.List;
+
+import com.ym.mec.cms.dal.entity.HelpCenterCatalog;
+import com.ym.mec.common.service.BaseService;
+
+public interface HelpCenterCatalogService extends BaseService<Integer, HelpCenterCatalog> {
+
+	/**
+	 * 根据父节点查询所有子节点对象
+	 * @param parentId 父节点(可为null)
+	 * @param status 状态(可为null)
+	 * @return
+	 */
+	public List<HelpCenterCatalog> queryByParentId(Integer parentId, Integer status);
+
+	/**
+	 * 修改分类信息
+	 * @param catalog
+	 * @return
+	 */
+	public boolean updateCatalog(HelpCenterCatalog catalog);
+
+	/**
+	 * 删除分类信息
+	 * @param id
+	 * @return
+	 */
+	public boolean deleteCatalog(Integer id);
+}

+ 11 - 0
cms/src/main/java/com/ym/mec/cms/service/HelpCenterContentService.java

@@ -0,0 +1,11 @@
+package com.ym.mec.cms.service;
+
+import com.ym.mec.cms.dal.entity.HelpCenterContent;
+import com.ym.mec.common.service.BaseService;
+
+public interface HelpCenterContentService extends BaseService<Integer,HelpCenterContent>{
+	
+	public boolean updateContentByCatalog(Integer catalogId,Integer status);
+	
+	public boolean deleteContentByCatalog(Integer catalogId);
+}

+ 56 - 0
cms/src/main/java/com/ym/mec/cms/service/impl/HelpCenterCatalogServiceImpl.java

@@ -0,0 +1,56 @@
+package com.ym.mec.cms.service.impl;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.cms.dal.dao.HelpCenterCatalogDao;
+import com.ym.mec.cms.dal.entity.HelpCenterCatalog;
+import com.ym.mec.cms.service.HelpCenterCatalogService;
+import com.ym.mec.cms.service.HelpCenterContentService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+
+@Service
+public class HelpCenterCatalogServiceImpl extends BaseServiceImpl<Integer, HelpCenterCatalog> implements HelpCenterCatalogService {
+
+	@Autowired
+	private HelpCenterCatalogDao helpCenterCatalogDao;
+
+	@Autowired
+	private HelpCenterContentService helpCenterContentService;
+
+	@Override
+	public BaseDAO<Integer, HelpCenterCatalog> getDAO() {
+
+		return helpCenterCatalogDao;
+	}
+
+	@Override
+	public List<HelpCenterCatalog> queryByParentId(Integer parentId, Integer status) {
+
+		List<HelpCenterCatalog> dataList = helpCenterCatalogDao.queryByParentId(parentId, status);
+		if (dataList != null) {
+			for (HelpCenterCatalog sub : dataList) {
+				List<HelpCenterCatalog> subList = helpCenterCatalogDao.queryByParentId(sub.getId(), status);
+				if (subList == null) {
+					continue;
+				}
+				sub.setChildren(subList);
+				queryByParentId(sub.getId(), status);
+			}
+		}
+		return dataList;
+	}
+
+	public boolean updateCatalog(HelpCenterCatalog catalog) {
+		return helpCenterCatalogDao.update(catalog) > 0 && helpCenterContentService.updateContentByCatalog(catalog.getId(), catalog.getStatus());
+	}
+
+	@Override
+	public boolean deleteCatalog(Integer id) {
+		return helpCenterCatalogDao.delete(id) > 0 && helpCenterContentService.deleteContentByCatalog(id);
+	}
+
+}

+ 41 - 0
cms/src/main/java/com/ym/mec/cms/service/impl/HelpCenterContentServiceImpl.java

@@ -0,0 +1,41 @@
+package com.ym.mec.cms.service.impl;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.cms.dal.dao.HelpCenterContentDao;
+import com.ym.mec.cms.dal.entity.HelpCenterContent;
+import com.ym.mec.cms.service.HelpCenterContentService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+
+@Service
+public class HelpCenterContentServiceImpl extends BaseServiceImpl<Integer, HelpCenterContent> implements HelpCenterContentService {
+
+	@Autowired
+	private HelpCenterContentDao contentCenterDao;
+
+	@Override
+	public BaseDAO<Integer, HelpCenterContent> getDAO() {
+		return contentCenterDao;
+	}
+
+	@Override
+	public boolean updateContentByCatalog(Integer catalogId, Integer status) {
+		Map<String, Object> map = new HashMap<String, Object>();
+		map.put("catalogId", catalogId);
+		map.put("status", status);
+		contentCenterDao.updateContentByCatalog(map);
+		return true;
+	}
+
+	@Override
+	public boolean deleteContentByCatalog(Integer catalogId) {
+		contentCenterDao.deleteContentByCatalog(catalogId);
+		return true;
+	}
+
+}

+ 96 - 0
cms/src/main/resources/config/mybatis/HelpCenterCatalogMapper.xml

@@ -0,0 +1,96 @@
+<?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.cms.dal.dao.HelpCenterCatalogDao">
+	<resultMap id="HelpCenterCatalog" type="com.ym.mec.cms.dal.entity.HelpCenterCatalog">
+		<id column="id_" property="id" jdbcType="INTEGER" />
+		<result column="parent_id_" property="parentId" jdbcType="INTEGER" />
+		<result column="name_" property="text" jdbcType="VARCHAR" />
+		<result column="description_" property="description" jdbcType="VARCHAR" />
+		<result column="create_on_" property="createOn" jdbcType="TIMESTAMP" />
+		<result column="modify_on_" property="modifyOn" jdbcType="TIMESTAMP" />
+		<result column="order_" property="order" jdbcType="INTEGER" />
+		<result column="status_" property="status" jdbcType="INTEGER" />
+	</resultMap>
+
+	<sql id="Base_Column_List">
+		id_, parent_id_, name_, description_, create_on_, modify_on_, order_,status_
+	</sql>
+
+	<select id="get" resultMap="HelpCenterCatalog" parameterType="java.lang.Integer">
+		select
+		<include refid="Base_Column_List" />
+		from help_center_catalog
+		where id_ = #{id,jdbcType=INTEGER}
+	</select>
+
+	<select id="queryPage" parameterType="map" resultMap="HelpCenterCatalog">
+		select
+		<include refid="Base_Column_List" />
+		from
+		help_center_catalog
+		order by order_ asc
+	</select>
+
+	<select id="queryByParentId" parameterType="map" resultMap="HelpCenterCatalog">
+		select
+		<include refid="Base_Column_List" />
+		from
+		help_center_catalog
+		where 1 = 1
+		<if test="parentId != null">
+			and parent_id_= #{parentId,jdbcType=INTEGER}
+		</if>
+		<if test="status != null">
+			and status_ = #{status,jdbcType=INTEGER}
+		</if>
+		order by order_ desc
+	</select>
+
+	<delete id="delete" parameterType="java.lang.Integer">
+		delete from help_center_catalog
+		where id_ = #{id,jdbcType=INTEGER}
+	</delete>
+	
+	<delete id="batchDelete" parameterType="String">
+		delete from help_center_catalog
+		where id_ in #{ids}
+	</delete>
+	
+	<insert id="insert" parameterType="com.ym.mec.cms.dal.entity.HelpCenterCatalog">
+		insert into help_center_catalog (id_, parent_id_, name_,
+		description_, create_on_, modify_on_,
+		order_,status_)
+		values (#{id,jdbcType=INTEGER}, #{parentId,jdbcType=INTEGER},
+		#{text,jdbcType=VARCHAR},
+		#{description,jdbcType=VARCHAR}, #{createOn,jdbcType=TIMESTAMP}, #{modifyOn,jdbcType=TIMESTAMP},
+		#{order,jdbcType=INTEGER},#{status,jdbcType=INTEGER})
+	</insert>
+	
+	<update id="update" parameterType="com.ym.mec.cms.dal.entity.HelpCenterCatalog">
+		update help_center_catalog
+		<set>
+			<if test="parentId != null">
+				parent_id_ = #{parentId,jdbcType=INTEGER},
+			</if>
+			<if test="text != null">
+				name_ = #{text,jdbcType=VARCHAR},
+			</if>
+			<if test="description != null">
+				description_ = #{description,jdbcType=VARCHAR},
+			</if>
+			<if test="createOn != null">
+				create_on_ = #{createOn,jdbcType=TIMESTAMP},
+			</if>
+			<if test="modifyOn != null">
+				modify_on_ = #{modifyOn,jdbcType=TIMESTAMP},
+			</if>
+			<if test="order != null">
+				order_ = #{order,jdbcType=INTEGER},
+			</if>
+			<if test="status != null">
+				status_ = #{status,jdbcType=INTEGER},
+			</if>
+		</set>
+		where id_ = #{id,jdbcType=INTEGER}
+	</update>
+</mapper>

+ 164 - 0
cms/src/main/resources/config/mybatis/HelpCenterContentMapper.xml

@@ -0,0 +1,164 @@
+<?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.cms.dal.dao.HelpCenterContentDao">
+	<resultMap id="HelpCenterContent" type="com.ym.mec.cms.dal.entity.HelpCenterContent">
+		<id column="id_" property="id" jdbcType="INTEGER" />
+		<result column="title_" property="title" jdbcType="VARCHAR" />
+		<result column="create_on_" property="createOn" jdbcType="TIMESTAMP" />
+		<result column="modify_on_" property="modifyOn" jdbcType="TIMESTAMP" />
+		<result column="status_" property="status" jdbcType="INTEGER" />
+		<result column="order_" property="order" jdbcType="INTEGER" />
+		<result column="catalog_id_" property="catalogId" jdbcType="INTEGER" />
+		<association property="catalog" 
+			javaType="com.ym.mec.cms.dal.entity.HelpCenterCatalog">
+			<result column="catalog_id_" property="id" />
+			<result column="name_" property="text" />
+			<result column="parent_id_" property="parentId" />
+		</association>
+	</resultMap>
+
+	<resultMap id="HelpCenterContentBlobs" type="com.ym.mec.cms.dal.entity.HelpCenterContent"
+		extends="HelpCenterContent">
+		<result column="content_" property="content" jdbcType="LONGVARCHAR" />
+	</resultMap>
+	<!-- 查询条件 -->
+	<sql id="queryConditionUnion">
+		<where>
+			<if test="catalogIds != null">
+				and content.catalog_id_ in (${catalogIds})
+			</if>
+			<if test="title!= null and title != ''">
+				and content.title_ like '%' #{title} '%'
+			</if>
+			<if test="status!= null">
+				and content.status_ = #{status}
+			</if>
+		</where>
+	</sql>
+	
+	<sql id="Base_Column_List">
+		id_, title_, catalog_id_, create_on_, modify_on_,status_,order_
+	</sql>
+
+	<sql id="Base_Column_List_union">
+		content.id_, content.title_, content.catalog_id_,
+		content.create_on_,
+		content.modify_on_,content.status_,content.content_,content.order_,
+		catalog.id_,
+		catalog.name_, catalog.parent_id_
+	</sql>
+
+	<sql id="Blob_Column_List">
+		content_
+	</sql>
+
+	<select id="get" resultMap="HelpCenterContentBlobs" parameterType="java.lang.Integer">
+		select
+		<include refid="Base_Column_List_union" />
+		from help_center_content content left join help_center_catalog catalog on
+		content.catalog_id_=catalog.id_
+		where content.id_ =
+		#{id,jdbcType=INTEGER}
+	</select>
+
+	<select id="queryPage" parameterType="map" resultMap="HelpCenterContentBlobs">
+		select
+		<include refid="Base_Column_List_union" />
+		from help_center_content content left join help_center_catalog catalog on
+		content.catalog_id_=catalog.id_
+		<include refid="queryConditionUnion" />
+		order by order_ asc
+		<include refid="global.limit" />
+	</select>
+
+	<select id="findCount" parameterType="map" resultType="int">
+		select count(*) from help_center_content content left join help_center_catalog catalog on
+		content.catalog_id_=catalog.id_
+		<include refid="queryConditionUnion" />
+	</select>
+
+	<delete id="delete" parameterType="java.lang.Integer">
+		delete from help_center_content
+		where id_ = #{id,jdbcType=INTEGER}
+	</delete>
+	
+	<delete id="deleteContentByCatalog" parameterType="java.lang.Integer">
+		delete from help_center_content
+		where catalog_id_ = #{catalogId,jdbcType=INTEGER}
+	</delete>
+
+	<insert id="insert" parameterType="com.ym.mec.cms.dal.entity.HelpCenterContent">
+		insert into help_center_content
+		(id_, title_, catalog_id_,
+		create_on_, modify_on_, content_,status_,order_
+		)
+		values
+		(#{id,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR},
+		#{catalogId,jdbcType=INTEGER},
+		#{createOn,jdbcType=TIMESTAMP},
+		#{modifyOn,jdbcType=TIMESTAMP}, #{content,jdbcType=LONGVARCHAR},#{status,jdbcType=INTEGER},#{order,jdbcType=INTEGER}
+		)
+	</insert>
+
+	<update id="update" parameterType="com.ym.mec.cms.dal.entity.HelpCenterContent">
+		update help_center_content
+		<set>
+			<if test="title != null">
+				title_ = #{title,jdbcType=VARCHAR},
+			</if>
+			<if test="catalogId != null">
+				catalog_id_ = #{catalogId,jdbcType=INTEGER},
+			</if>
+			<if test="createOn != null">
+				create_on_ = #{createOn,jdbcType=TIMESTAMP},
+			</if>
+			<if test="modifyOn != null">
+				modify_on_ = #{modifyOn,jdbcType=TIMESTAMP},
+			</if>
+			<if test="content != null">
+				content_ = #{content,jdbcType=LONGVARCHAR},
+			</if>
+			<if test="status != null">
+				status_ = #{status,jdbcType=INTEGER},
+			</if>
+			<if test="order != null">
+				order_ = #{order,jdbcType=INTEGER},
+			</if>
+		</set>
+		where id_ = #{id,jdbcType=INTEGER}
+	</update>
+
+	<update id="updateBlobs" parameterType="com.ym.mec.cms.dal.entity.HelpCenterContent">
+		update help_center_content
+		set title_ = #{title,jdbcType=VARCHAR},
+		catalog_id_ =
+		#{catalogId,jdbcType=INTEGER},
+		create_on_ =
+		#{createOn,jdbcType=TIMESTAMP},
+		modify_on_ =
+		#{modifyOn,jdbcType=TIMESTAMP},
+		content_ =
+		#{content,jdbcType=LONGVARCHAR},
+		status_= #{status,jdbcType=INTEGER},
+		order_= #{order,jdbcType=INTEGER}
+		where id_ = #{id,jdbcType=INTEGER}
+	</update>
+
+	<update id="updateByKey" parameterType="com.ym.mec.cms.dal.entity.HelpCenterContent">
+		update help_center_content
+		set title_ = #{title,jdbcType=VARCHAR},
+		catalog_id_ =
+		#{catalogId,jdbcType=INTEGER},
+		create_on_ =
+		#{createOn,jdbcType=TIMESTAMP},
+		modify_on_ =
+		#{modifyOn,jdbcType=TIMESTAMP},
+		status_ = #{status,jdbcType=INTEGER},
+		order_ = #{order,jdbcType=INTEGER},
+		where id_ = #{id,jdbcType=INTEGER}
+	</update>
+	
+	<update id="updateContentByCatalog" parameterType="map">
+		update help_center_content set status_=#{status} where catalog_id_=#{catalogId}
+	</update>
+</mapper>

+ 1 - 1
mec-auth/mec-auth-server/src/main/resources/bootstrap-test.properties

@@ -1,7 +1,7 @@
 #\u6307\u5b9a\u5f00\u53d1\u73af\u5883
 #spring.profiles.active=dev
 #\u670d\u52a1\u5668\u5730\u5740
-spring.cloud.nacos.config.server-addr=47.96.85.100:8848
+spring.cloud.nacos.config.server-addr=47.99.212.176:8848
 #\u9ed8\u8ba4\u4e3aPublic\u547d\u540d\u7a7a\u95f4,\u53ef\u4ee5\u7701\u7565\u4e0d\u5199
 spring.cloud.nacos.config.namespace=02105743-16b8-46ab-87df-2aca0f3dbca3
 #\u6307\u5b9a\u914d\u7f6e\u7fa4\u7ec4 --\u5982\u679c\u662fPublic\u547d\u540d\u7a7a\u95f4 \u5219\u53ef\u4ee5\u7701\u7565\u7fa4\u7ec4\u914d\u7f6e

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupStudentMapperDao.java

@@ -172,6 +172,17 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
     List<ClassGroupStudentMapper> findByClassGroups(@Param("classGroupIds") List<Integer> classGroupIds);
 
     /**
+     * @describe 获取团体学员
+     * @author Joburgess
+     * @date 2020/3/8
+     * @param groupIds:
+     * @param groupType:
+     * @return java.util.List<com.ym.mec.biz.dal.entity.ClassGroupStudentMapper>
+     */
+    List<ClassGroupStudentMapper> findByGroups(@Param("groupIds") List<String> groupIds,
+                                               @Param("groupType") GroupType groupType);
+
+    /**
      * @param classGroupId: 班级编号列表
      * @return java.util.List<com.ym.mec.biz.dal.entity.ClassGroupStudentMapper>
      * @describe 根据班级获取学员

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java

@@ -1268,4 +1268,15 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
                                             @Param("groupType") GroupType groupType);
 
     List<CourseSchedule> findClassGroupLastTeacher(@Param("classGroupIds") List<Integer> classGroupIds);
+
+    /**
+     * @describe 获取团体课次信息
+     * @author Joburgess
+     * @date 2020/3/8
+     * @param groupIds:
+     * @param groupType:
+     * @return java.util.List<com.ym.mec.biz.dal.dto.GroupCourseTimesDto>
+     */
+    List<GroupCourseTimesDto> findGroupsCourseTimesInfo(@Param("groupIds") List<String> groupIds,
+                                                        @Param("groupType") GroupType groupType);
 }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CoursesGroupDao.java

@@ -2,8 +2,19 @@ package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.entity.CoursesGroup;
 import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface CoursesGroupDao extends BaseDAO<Long, CoursesGroup> {
 
+    /**
+     * @describe 获取指定教师的课程组列表
+     * @author Joburgess
+     * @date 2020/3/8
+     * @param teacherId: 教师编号
+     * @return java.util.List<com.ym.mec.biz.dal.entity.CoursesGroup>
+     */
+    List<CoursesGroup> findTeacherCourseGroups(@Param("teacherId") Integer teacherId);
 	
 }

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SubjectDao.java

@@ -104,6 +104,8 @@ public interface SubjectDao extends BaseDAO<Integer, Subject> {
 
     List<Subject> findBySubjectByIdList(@Param("subjectIdList") String subjectIdList);
 
+    List<Subject> findBySubjectIds(@Param("subjectIds") List<Integer> subjectIds);
+
     /**
      * @describe 获取乐团下对应用户的科目名称
      * @author Joburgess

+ 110 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseGroupTeacherCardDto.java

@@ -0,0 +1,110 @@
+package com.ym.mec.biz.dal.dto;
+
+import java.util.Date;
+
+/**
+ * @Author Joburgess
+ * @Date 2020/3/8
+ */
+public class CourseGroupTeacherCardDto {
+
+    private Long id;
+
+    private String name;
+
+    private Integer subjectId;
+
+    private String subjectName;
+
+    private Integer totalCourseTimes;
+
+    private Integer singleClassMinutes;
+
+    private java.util.Date coursesStartDate;
+
+    private java.util.Date coursesEndDate;
+
+    private Integer surplusClassTimes;
+
+    private String studentNames;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Integer getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Integer subjectId) {
+        this.subjectId = subjectId;
+    }
+
+    public String getSubjectName() {
+        return subjectName;
+    }
+
+    public void setSubjectName(String subjectName) {
+        this.subjectName = subjectName;
+    }
+
+    public Integer getTotalCourseTimes() {
+        return totalCourseTimes;
+    }
+
+    public void setTotalCourseTimes(Integer totalCourseTimes) {
+        this.totalCourseTimes = totalCourseTimes;
+    }
+
+    public Integer getSingleClassMinutes() {
+        return singleClassMinutes;
+    }
+
+    public void setSingleClassMinutes(Integer singleClassMinutes) {
+        this.singleClassMinutes = singleClassMinutes;
+    }
+
+    public Date getCoursesStartDate() {
+        return coursesStartDate;
+    }
+
+    public void setCoursesStartDate(Date coursesStartDate) {
+        this.coursesStartDate = coursesStartDate;
+    }
+
+    public Date getCoursesEndDate() {
+        return coursesEndDate;
+    }
+
+    public void setCoursesEndDate(Date coursesEndDate) {
+        this.coursesEndDate = coursesEndDate;
+    }
+
+    public Integer getSurplusClassTimes() {
+        return surplusClassTimes;
+    }
+
+    public void setSurplusClassTimes(Integer surplusClassTimes) {
+        this.surplusClassTimes = surplusClassTimes;
+    }
+
+    public String getStudentNames() {
+        return studentNames;
+    }
+
+    public void setStudentNames(String studentNames) {
+        this.studentNames = studentNames;
+    }
+}

+ 60 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/GroupCourseTimesDto.java

@@ -0,0 +1,60 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.enums.GroupType;
+
+/**
+ * @Author Joburgess
+ * @Date 2020/3/8
+ */
+public class GroupCourseTimesDto {
+
+    private String groupId;
+
+    private GroupType groupType;
+
+    private Integer classGroupId;
+
+    private Integer totalCourseTimes;
+
+    private Integer surplusClassTimes;
+
+    public String getGroupId() {
+        return groupId;
+    }
+
+    public void setGroupId(String groupId) {
+        this.groupId = groupId;
+    }
+
+    public GroupType getGroupType() {
+        return groupType;
+    }
+
+    public void setGroupType(GroupType groupType) {
+        this.groupType = groupType;
+    }
+
+    public Integer getClassGroupId() {
+        return classGroupId;
+    }
+
+    public void setClassGroupId(Integer classGroupId) {
+        this.classGroupId = classGroupId;
+    }
+
+    public Integer getTotalCourseTimes() {
+        return totalCourseTimes;
+    }
+
+    public void setTotalCourseTimes(Integer totalCourseTimes) {
+        this.totalCourseTimes = totalCourseTimes;
+    }
+
+    public Integer getSurplusClassTimes() {
+        return surplusClassTimes;
+    }
+
+    public void setSurplusClassTimes(Integer surplusClassTimes) {
+        this.surplusClassTimes = surplusClassTimes;
+    }
+}

+ 9 - 8
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CoursesGroup.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.entity;
 
+import com.ym.mec.biz.dal.enums.GroupStatusEnum;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 /**
@@ -32,7 +33,7 @@ public class CoursesGroup {
 	private Integer singleClassMinutes;
 	
 	/** 课程组状态 */
-	private String status;
+	private GroupStatusEnum status;
 	
 	/** 备注 */
 	private String memo;
@@ -127,15 +128,15 @@ public class CoursesGroup {
 	public Integer getSingleClassMinutes(){
 		return this.singleClassMinutes;
 	}
-			
-	public void setStatus(String status){
-		this.status = status;
+
+	public GroupStatusEnum getStatus() {
+		return status;
 	}
-	
-	public String getStatus(){
-		return this.status;
+
+	public void setStatus(GroupStatusEnum status) {
+		this.status = status;
 	}
-			
+
 	public void setMemo(String memo){
 		this.memo = memo;
 	}

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

@@ -12,7 +12,8 @@ public enum ClassGroupTypeEnum implements BaseEnum<String, ClassGroupTypeEnum> {
 	VIP("VIP", "vip课"),
 	DEMO("DEMO", "试听课"),
 	PRACTICE("PRACTICE", "网管课"),
-	SNAP("SNAP", "临时班级");
+	SNAP("SNAP", "临时班级"),
+	COMM("COMM","对外课程");
 
 	private String code;
 

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

@@ -8,6 +8,8 @@ import com.ym.mec.common.enums.BaseEnum;
  **/
 public enum GroupStatusEnum implements BaseEnum<String, GroupStatusEnum> {
 
+    NOT_START("NOT_START","未开始"),
+    APPLYING("APPLYING","报名中"),
     NORMAL("NORMAL", "正常"),
     LOCK("LOCK", "锁定"),
     FINISH("FINISH", "结束"),

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/CoursesGroupService.java

@@ -1,9 +1,12 @@
 package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.dto.CourseGroupCreateDto;
+import com.ym.mec.biz.dal.dto.CourseGroupTeacherCardDto;
 import com.ym.mec.biz.dal.entity.CoursesGroup;
 import com.ym.mec.common.service.BaseService;
 
+import java.util.List;
+
 public interface CoursesGroupService extends BaseService<Long, CoursesGroup> {
 
     /**
@@ -15,4 +18,13 @@ public interface CoursesGroupService extends BaseService<Long, CoursesGroup> {
      */
     void createCourseGroup(CourseGroupCreateDto courseGroupCreateInfo);
 
+    /**
+     * @describe 获取教师课程组列表
+     * @author Joburgess
+     * @date 2020/3/8
+     * @param teacherId: 教师编号
+     * @return java.util.List<com.ym.mec.biz.dal.dto.CourseGroupTeacherCardDto>
+     */
+    List<CourseGroupTeacherCardDto> findTeacherCourseGroups(Integer teacherId);
+
 }

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -1179,6 +1179,11 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 
                             throw new BizException(courseCheckInfo(preCourseSchedule, backCourseSchedule, existCourseScheduleIds, 1));
                         }
+
+                        if(Objects.isNull(preCourseSchedule.getId())){
+                            continue;
+                        }
+
                         //助教冲突检测
                         if (Objects.isNull(preCourseSchedule.getId())) {
                             IntegerAndIntegerListDto integerAndIntegerListDto = classGroupTeachingTeacherMap.get(preCourseSchedule.getClassGroupId());

+ 196 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CoursesGroupServiceImpl.java

@@ -1,17 +1,29 @@
 package com.ym.mec.biz.service.impl;
 
-import com.ym.mec.biz.dal.dao.CoursesGroupDao;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.CourseGroupCreateDto;
-import com.ym.mec.biz.dal.entity.CourseSchedule;
-import com.ym.mec.biz.dal.entity.CoursesGroup;
+import com.ym.mec.biz.dal.dto.CourseGroupTeacherCardDto;
+import com.ym.mec.biz.dal.dto.CourseTimeDto;
+import com.ym.mec.biz.dal.dto.GroupCourseTimesDto;
+import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.service.CourseScheduleService;
 import com.ym.mec.biz.service.CoursesGroupService;
 import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Isolation;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
 
-import java.util.List;
+import java.math.BigDecimal;
+import java.util.*;
+import java.util.stream.Collectors;
 
 @Service
 public class CoursesGroupServiceImpl extends BaseServiceImpl<Long, CoursesGroup> implements CoursesGroupService {
@@ -20,6 +32,26 @@ public class CoursesGroupServiceImpl extends BaseServiceImpl<Long, CoursesGroup>
     private CoursesGroupDao coursesGroupDao;
     @Autowired
     private CourseScheduleService courseScheduleService;
+    @Autowired
+    private ClassGroupDao classGroupDao;
+    @Autowired
+    private ClassGroupTeacherMapperDao classGroupTeacherMapperDao;
+    @Autowired
+    private ClassGroupTeacherSalaryDao classGroupTeacherSalaryDao;
+    @Autowired
+    private CourseScheduleDao courseScheduleDao;
+    @Autowired
+    private StudentAttendanceDao studentAttendanceDao;
+    @Autowired
+    private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
+    @Autowired
+    private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
+    @Autowired
+    private TeacherAttendanceDao teacherAttendanceDao;
+    @Autowired
+    private SubjectDao subjectDao;
+    @Autowired
+    private ClassGroupStudentMapperDao classGroupStudentMapperDao;
 
     @Override
     public BaseDAO<Long, CoursesGroup> getDAO() {
@@ -27,9 +59,169 @@ public class CoursesGroupServiceImpl extends BaseServiceImpl<Long, CoursesGroup>
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
     public void createCourseGroup(CourseGroupCreateDto courseGroupCreateInfo) {
+        CoursesGroup courseGroup = courseGroupCreateInfo.getCoursesGroup();
+        CourseGenerateDto courseCycleInfo = courseGroupCreateInfo.getCourseCycleInfo();
+        if(Objects.isNull(courseGroup.getName())|| StringUtils.isBlank(courseGroup.getName())){
+            throw new BizException("请填写课程班名称");
+        }
+        if(Objects.isNull(courseGroup.getSubjectId())){
+            throw new BizException("请选择科目");
+        }
+        if(Objects.isNull(courseGroup.getMaxStudentNum())){
+            throw new BizException("请填写班级人数");
+        }
+        if(Objects.isNull(courseCycleInfo.getSingleClassMinutes())){
+            throw new BizException("请填写课程时长");
+        }
+        if(Objects.isNull(courseCycleInfo.getCourseCreateStartTime())){
+            throw new BizException("请填写课程开始时间");
+        }
+        if(Objects.isNull(courseCycleInfo.getCourseTimes())){
+            throw new BizException("请填写课程数量");
+        }
 
+        //总课程时长
+        Integer totalCourseTime=courseCycleInfo.getCourseCount()*courseCycleInfo.getSingleClassMinutes();
+
+        Date now=new Date();
+        courseGroup.setSingleClassMinutes(courseCycleInfo.getSingleClassMinutes());
+        courseGroup.setStatus(GroupStatusEnum.APPLYING);
         List<CourseSchedule> newCourses = courseScheduleService.createCourses(courseGroupCreateInfo.getCourseCycleInfo());
+        for (CourseSchedule newCourse : newCourses) {
+            newCourse.setTeachMode(TeachModeEnum.ONLINE);
+            newCourse.setGroupType(GroupType.COMM);
+            newCourse.setType(CourseSchedule.CourseScheduleType.COMM);
+            newCourse.setTeacherId(courseGroup.getTeacherId());
+            newCourse.setActualTeacherId(courseGroup.getTeacherId());
+            newCourse.setIsLock(1);
+            newCourse.setStatus(CourseStatusEnum.NOT_START);
+            newCourse.setName(courseGroup.getName());
+        }
+        courseScheduleService.checkNewCourseSchedules(newCourses,false);
+
+        CourseSchedule firstCourseSchedule = newCourses.stream().min(Comparator.comparing(CourseSchedule::getStartClassTime)).get();
+        CourseSchedule latestCourseSchedule = newCourses.stream().max(Comparator.comparing(CourseSchedule::getEndClassTime)).get();
+        courseGroup.setCoursesStartDate(firstCourseSchedule.getStartClassTime());
+        courseGroup.setCoursesEndDate(latestCourseSchedule.getEndClassTime());
+
+        JSONArray courseTimesArray=new JSONArray();
+        for (CourseTimeDto courseTime : courseCycleInfo.getCourseTimes()) {
+            JSONObject courseTimeObject=new JSONObject();
+            courseTimeObject.put(String.valueOf(courseTime.getDayOfWeek()),courseTime.getStartClassTime());
+            courseTimesArray.add(courseTimeObject);
+        }
+
+        coursesGroupDao.insert(courseGroup);
+        //创建班级信息
+        ClassGroup classGroup = new ClassGroup();
+        classGroup.setSubjectIdList(courseGroup.getSubjectId().toString());
+        classGroup.setExpectStudentNum(1);
+        classGroup.setStudentNum(1);
+        classGroup.setName(courseGroup.getName());
+        classGroup.setTotalClassTimes(courseCycleInfo.getCourseCount());
+        classGroup.setType(ClassGroupTypeEnum.COMM);
+        classGroup.setDelFlag(0);
+        classGroup.setGroupType(GroupType.COMM);
+        classGroup.setMusicGroupId(courseGroup.getId().toString());
+        classGroup.setCreateTime(now);
+        classGroup.setUpdateTime(now);
+        classGroupDao.insert(classGroup);
+
+        //创建班级老师关联记录
+        ClassGroupTeacherMapper classGroupTeacherMapper = new ClassGroupTeacherMapper();
+        classGroupTeacherMapper.setMusicGroupId(courseGroup.getId().toString());
+        classGroupTeacherMapper.setClassGroupId(classGroup.getId());
+        classGroupTeacherMapper.setTeacherRole(TeachTypeEnum.BISHOP);
+        classGroupTeacherMapper.setUserId(courseGroup.getTeacherId());
+        classGroupTeacherMapper.setGroupType(GroupType.COMM);
+        classGroupTeacherMapper.setCreateTime(now);
+        classGroupTeacherMapper.setUpdateTime(now);
+        classGroupTeacherMapperDao.insert(classGroupTeacherMapper);
+
+        List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries = new ArrayList<>();
+        List<TeacherAttendance> teacherAttendances = new ArrayList<>();
+
+        for (CourseSchedule courseSchedule : newCourses) {
+            //课表
+            courseSchedule.setMusicGroupId(courseGroup.getId().toString());
+            courseSchedule.setClassGroupId(classGroup.getId());
+            courseSchedule.setCreateTime(now);
+            courseSchedule.setUpdateTime(now);
+        }
+        courseScheduleDao.batchAddCourseSchedules(newCourses);
+
+        for (CourseSchedule courseSchedule : newCourses) {
+            //课程与老师薪水表
+            CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
+            courseScheduleTeacherSalary.setCourseScheduleId(courseSchedule.getId());
+            courseScheduleTeacherSalary.setGroupType(GroupType.COMM);
+            courseScheduleTeacherSalary.setMusicGroupId(courseGroup.getId().toString());
+            courseScheduleTeacherSalary.setTeacherRole(classGroupTeacherMapper.getTeacherRole());
+            courseScheduleTeacherSalary.setUserId(courseGroup.getTeacherId());
+            courseScheduleTeacherSalary.setExpectSalary(BigDecimal.ZERO);
+            courseScheduleTeacherSalary.setCreateTime(now);
+            courseScheduleTeacherSalary.setUpdateTime(now);
+            courseScheduleTeacherSalary.setClassGroupId(classGroup.getId());
+            courseScheduleTeacherSalaries.add(courseScheduleTeacherSalary);
+
+            //教师签到记录
+            TeacherAttendance teacherAttendance = new TeacherAttendance();
+            teacherAttendance.setMusicGroupId(courseGroup.getId().toString());
+            teacherAttendance.setTeacherId(courseGroup.getTeacherId());
+            teacherAttendance.setClassGroupId(classGroup.getId());
+            teacherAttendance.setGroupType(GroupType.COMM);
+            teacherAttendance.setCourseScheduleId(courseSchedule.getId());
+            teacherAttendance.setCreateTime(now);
+            teacherAttendances.add(teacherAttendance);
+        }
+        courseScheduleTeacherSalaryDao.batchInsert(courseScheduleTeacherSalaries);
+        teacherAttendanceDao.batchInsert(teacherAttendances);
+    }
+
+    @Override
+    public List<CourseGroupTeacherCardDto> findTeacherCourseGroups(Integer teacherId) {
+        if(Objects.isNull(teacherId)){
+            throw new BizException("请指定老师");
+        }
+        List<CoursesGroup> teacherCourseGroups = coursesGroupDao.findTeacherCourseGroups(teacherId);
+        if (CollectionUtils.isEmpty(teacherCourseGroups)){
+            return new ArrayList<>();
+        }
+
+        List<String> groupIds = teacherCourseGroups.stream().map(group -> String.valueOf(group.getId())).collect(Collectors.toList());
+
+        List<Integer> subjectIds = teacherCourseGroups.stream().map(CoursesGroup::getSubjectId).collect(Collectors.toList());
+        List<Subject> subjects = subjectDao.findBySubjectIds(subjectIds);
+        Map<Integer, Subject> idSubjectMap = subjects.stream().collect(Collectors.toMap(Subject::getId, subject -> subject));
+
+        List<ClassGroupStudentMapper> students = classGroupStudentMapperDao.findByGroups(groupIds, GroupType.COMM);
+        Map<String, List<ClassGroupStudentMapper>> groupStudentsMap = students.stream().collect(Collectors.groupingBy(ClassGroupStudentMapper::getMusicGroupId));
+
+        List<GroupCourseTimesDto> groupsCourseTimesInfo = courseScheduleDao.findGroupsCourseTimesInfo(groupIds, GroupType.COMM);
+        Map<String, GroupCourseTimesDto> groupCourseTimesInfoMap = groupsCourseTimesInfo.stream().collect(Collectors.toMap(GroupCourseTimesDto::getGroupId, e -> e));
 
+        List<CourseGroupTeacherCardDto> groupCards=new ArrayList<>();
+        for (CoursesGroup teacherCourseGroup : teacherCourseGroups) {
+            CourseGroupTeacherCardDto groupCard=new CourseGroupTeacherCardDto();
+            groupCard.setId(teacherCourseGroup.getId());
+            groupCard.setName(teacherCourseGroup.getName());
+            groupCard.setSingleClassMinutes(teacherCourseGroup.getSingleClassMinutes());
+            groupCard.setCoursesStartDate(teacherCourseGroup.getCoursesStartDate());
+            groupCard.setCoursesEndDate(teacherCourseGroup.getCoursesEndDate());
+            groupCard.setSubjectId(teacherCourseGroup.getSubjectId());
+            groupCard.setSubjectName(idSubjectMap.get(teacherCourseGroup.getSubjectId()).getName());
+            GroupCourseTimesDto groupCourseTimesInfo = groupCourseTimesInfoMap.get(String.valueOf(teacherCourseGroup.getId()));
+            groupCard.setTotalCourseTimes(groupCourseTimesInfo.getTotalCourseTimes());
+            groupCard.setSurplusClassTimes(groupCourseTimesInfo.getSurplusClassTimes());
+            List<ClassGroupStudentMapper> groupStudents = groupStudentsMap.get(String.valueOf(teacherCourseGroup.getId()));
+            if(!CollectionUtils.isEmpty(groupStudentsMap)){
+                List<String> userNames = groupStudents.stream().map(ClassGroupStudentMapper::getUserName).collect(Collectors.toList());
+                groupCard.setStudentNames(StringUtils.join(userNames,","));
+            }
+            groupCards.add(groupCard);
+        }
+        return groupCards;
     }
 }

+ 16 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/GroupClassServiceImpl.java

@@ -2,6 +2,7 @@ package com.ym.mec.biz.service.impl;
 
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
+import com.ym.mec.biz.dal.entity.CoursesGroup;
 import com.ym.mec.biz.dal.entity.PracticeGroup;
 import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
@@ -56,6 +57,8 @@ public class GroupClassServiceImpl implements GroupClassService {
     private SysUserCashAccountService sysUserCashAccountService;
     @Autowired
     private StudentPaymentOrderDao studentPaymentOrderDao;
+    @Autowired
+    private CoursesGroupDao coursesGroupDao;
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -115,6 +118,7 @@ public class GroupClassServiceImpl implements GroupClassService {
         if(Objects.isNull(groupType)){
             throw new BizException("请指定课程组类型");
         }
+        Date now=new Date();
         if(groupType.equals(GroupType.PRACTICE)){
             PracticeGroup practiceGroup = practiceGroupDao.get(groupId);
             if(Objects.isNull(practiceGroup)){
@@ -127,7 +131,6 @@ public class GroupClassServiceImpl implements GroupClassService {
             if(refundAmount.compareTo(orders.get(0).getExpectAmount())>0){
                 throw new BizException("退款不可大于购买金额");
             }
-            Date now=new Date();
             if(!practiceGroup.getGroupStatus().equals(GroupStatusEnum.NORMAL)||practiceGroup.getCoursesExpireDate().before(now)){
                 throw new BizException("当前课程组不可关闭");
             }
@@ -139,6 +142,18 @@ public class GroupClassServiceImpl implements GroupClassService {
             practiceGroup.setGroupStatus(GroupStatusEnum.CANCEL);
             practiceGroup.setUpdateTime(now);
             practiceGroupDao.update(practiceGroup);
+        }else if(groupType.equals(GroupType.COMM)){
+            CoursesGroup coursesGroup = coursesGroupDao.get(groupId);
+            if(Objects.isNull(coursesGroup)){
+                throw new BizException("指定的课程组不存在");
+            }
+            if(coursesGroup.getCoursesEndDate().before(now)){
+                throw new BizException("当前课程组不可关闭");
+            }
+            cleanGroupInfo(groupId.toString(), GroupType.COMM);
+            coursesGroup.setMemo("主动关闭课程组");
+            coursesGroup.setStatus(GroupStatusEnum.CANCEL);
+            coursesGroupDao.update(coursesGroup);
         }
     }
 }

+ 13 - 0
mec-biz/src/main/resources/config/mybatis/ClassGroupStudentMapperMapper.xml

@@ -394,4 +394,17 @@
 		LEFT JOIN course_schedule_student_payment cssp on cssp.course_schedule_id_ = cs.id_ and cssp.user_id_ = cgsm.user_id_
 		WHERE cssp.id_ IS NULL AND cgsm.status_ != 'QUIT' and cs.id_ = #{courseScheduleId}
     </select>
+    <select id="findByGroups" resultMap="ClassGroupStudentMapper">
+      SELECT
+          cgsm.*,
+	      su.username_
+        FROM class_group_student_mapper cgsm
+            LEFT JOIN sys_user su ON cgsm.user_id_ = su.id_
+        WHERE
+          cgsm.group_type_=#{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+          AND cgsm.music_group_id_ IN
+          <foreach collection="groupIds" item="groupId" separator="," open="(" close=")">
+              #{groupId}
+          </foreach>
+    </select>
 </mapper>

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

@@ -2593,6 +2593,35 @@
         SELECT * FROM course_schedule WHERE group_type_=#{groupType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler} AND music_group_id_ = #{groupId} AND CONCAT(class_date_, ' ', start_class_time_)>NOW()
     </select>
 
+    <resultMap id="GroupCourseTimesDto" type="com.ym.mec.biz.dal.dto.GroupCourseTimesDto">
+        <result property="groupId" column="group_id_"/>
+        <result property="groupType" column="group_type_" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result property="classGroupId" column="class_group_id_"/>
+        <result property="totalCourseTimes" column="total_course_times_"/>
+        <result property="surplusClassTimes" column="surplus_class_times_"/>
+    </resultMap>
+
+    <select id="findGroupsCourseTimesInfo" resultMap="GroupCourseTimesDto">
+       SELECT
+            cg.music_group_id_ group_id_,
+            cg.group_type_,
+            cg.id_ class_group_id_,
+            cg.total_class_times_ total_course_times_,
+            COUNT( cs.id_ ) surplus_class_times_
+        FROM
+            course_schedule cs
+            LEFT JOIN class_group cg ON cs.class_group_id_ = cg.id_
+        WHERE
+            cs.group_type_ = #{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            AND CONCAT( cs.class_date_, ' ', cs.start_class_time_ ) > NOW( )
+            AND cs.music_group_id_ IN
+            <foreach collection="groupIds" item="groupId" separator="," open="(" close=")">
+                #{groupId}
+            </foreach>
+        GROUP BY
+            cg.id_
+    </select>
+
     <update id="updateCourseNameByGroup">
         UPDATE course_schedule SET name_=#{name} WHERE group_type_=#{groupType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler} AND music_group_id_ = #{groupId};
     </update>

+ 7 - 3
mec-biz/src/main/resources/config/mybatis/CoursesGroupMapper.xml

@@ -15,7 +15,7 @@
 		<result column="teaching_arrangement_" property="teachingArrangement" />
 		<result column="organ_id_" property="organId" />
 		<result column="single_class_minutes_" property="singleClassMinutes" />
-		<result column="status_" property="status" />
+		<result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
 		<result column="memo_" property="memo" />
 		<result column="teacher_id_" property="teacherId" />
 		<result column="max_student_num_" property="maxStudentNum" />
@@ -46,7 +46,7 @@
 		</selectKey>
 		-->
 		INSERT INTO courses_group (id_,name_,subject_id_,courses_start_date_,courses_end_date_,teaching_arrangement_,organ_id_,single_class_minutes_,status_,memo_,teacher_id_,max_student_num_,apply_closing_date_,teaching_plan_,teacher_salary_settlement_method_,total_courses_price_,total_course_discount_price_,create_time_,update_time_)
-		VALUES(#{id},#{name},#{subjectId},#{coursesStartDate},#{coursesEndDate},#{teachingArrangement},#{organId},#{singleClassMinutes},#{status},#{memo},#{teacherId},#{maxStudentNum},#{applyClosingDate},#{teachingPlan},#{teacherSalarySettlementMethod},#{totalCoursesPrice},#{totalCourseDiscountPrice},NOW(),NOW())
+		VALUES(#{id},#{name},#{subjectId},#{coursesStartDate},#{coursesEndDate},#{teachingArrangement},#{organId},#{singleClassMinutes},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{memo},#{teacherId},#{maxStudentNum},#{applyClosingDate},#{teachingPlan},#{teacherSalarySettlementMethod},#{totalCoursesPrice},#{totalCourseDiscountPrice},NOW(),NOW())
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -60,7 +60,7 @@
 				subject_id_ = #{subjectId},
 			</if>
 			<if test="status != null">
-				status_ = #{status},
+				status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
 			</if>
 			<if test="organId != null">
 				organ_id_ = #{organId},
@@ -125,4 +125,8 @@
 	<select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM courses_group
 	</select>
+
+    <select id="findTeacherCourseGroups" resultMap="CoursesGroup">
+		SELECT * FROM courses_group WHERE teacher_id_=#{teacherId} AND status_ IN ('APPLYING', 'NORMAL') ORDER BY id_ DESC
+    </select>
 </mapper>

+ 6 - 0
mec-biz/src/main/resources/config/mybatis/SubjectMapper.xml

@@ -216,4 +216,10 @@
             sr.user_id_=#{student.studentId} AND sr.music_group_id_=#{student.musicGroupId}
         </foreach>
     </select>
+    <select id="findBySubjectIds" resultMap="Subject">
+      SELECT * FROM subject WHERE id_ IN
+      <foreach collection="subjectIds" item="subjectId" separator="," open="(" close=")">
+          #{subjectId}
+      </foreach>
+    </select>
 </mapper>

+ 64 - 0
mec-teacher/src/main/java/com/ym/mec/teacher/controller/CourseGroupController.java

@@ -0,0 +1,64 @@
+package com.ym.mec.teacher.controller;
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dto.CourseGroupCreateDto;
+import com.ym.mec.biz.dal.enums.GroupType;
+import com.ym.mec.biz.service.CoursesGroupService;
+import com.ym.mec.biz.service.GroupClassService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Objects;
+
+/**
+ * @Author Joburgess
+ * @Date 2020/3/8
+ */
+@Api(tags = "对外课程组服务")
+@RequestMapping("courseGroup")
+@RestController
+public class CourseGroupController extends BaseController {
+
+    @Autowired
+    private CoursesGroupService coursesGroupService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private GroupClassService groupClassService;
+
+    @ApiOperation(value = "创建课程组")
+    @PostMapping("/createCourseGroup")
+    public HttpResponseResult createCourseGroup(@RequestBody CourseGroupCreateDto courseGroupCreateInfo){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if(Objects.isNull(sysUser)){
+            return failed(HttpStatus.FORBIDDEN,"请登录");
+        }
+        courseGroupCreateInfo.getCoursesGroup().setTeacherId(sysUser.getId());
+        coursesGroupService.createCourseGroup(courseGroupCreateInfo);
+        return succeed();
+    }
+
+    @ApiOperation(value = "获取课程组列表")
+    @GetMapping("/findTeacherCourseGroups")
+    public HttpResponseResult findTeacherCourseGroups(){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if(Objects.isNull(sysUser)){
+            return failed(HttpStatus.FORBIDDEN,"请登录");
+        }
+        return succeed(coursesGroupService.findTeacherCourseGroups(sysUser.getId()));
+    }
+
+    @ApiOperation(value = "关闭课程组")
+    @PostMapping("/cancelCourseGroup")
+    public HttpResponseResult cancelCourseGroup(Long groupId){
+        groupClassService.cancelGroup(groupId, GroupType.COMM, null);
+        return succeed();
+    }
+
+}