Explorar el Código

员工管理调整及试听课的创建、申请

Joburgess hace 5 años
padre
commit
3ab0ed7665

+ 54 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/DemoGroupDao.java

@@ -1,9 +1,63 @@
 package com.ym.mec.biz.dal.dao;
 
+import com.ym.mec.biz.dal.dto.StudentDemoGroupListDto;
+import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.DemoGroup;
 import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
 
 public interface DemoGroupDao extends BaseDAO<Long, DemoGroup> {
 
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/25
+     * 根据试听课ID获取班级中学生的分部ID列表
+     */
+    List<Integer> organIdListByDemoGroupId(Long demoGroupId);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/25
+     * 根据用户ID获取所在部门ID
+     */
+    Integer getOrganIdByUserId(Long userId);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/25
+     * 根据试听课信息构造课程计划
+     */
+    List<CourseSchedule> createCourseScheduleByDemoGroup(@Param("demoGroup") DemoGroup demoGroup);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/25
+     * 统计乐团已报名人数
+     */
+    Integer countDemoGroupStudents(Long demoGroupId);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/25
+     * 试听课列表获取
+     */
+    List<StudentDemoGroupListDto> findDemoGroupList(Map<String,Object> params);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/25
+     * 统计试听课
+     */
+    Integer countDemoGroupList(Map<String,Object> params);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/25
+     * 根据试听课ID获取关联班级ID
+     */
+    Integer findClassGroupIDByDemoGroupId(Long demoGroupId);
 	
 }

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

@@ -42,25 +42,25 @@ public class EmployeeDto {
     private java.util.Date demissionDate;
 
     @ApiModelProperty(value = "部门ID",required = false)
-    private Long organId;
+    private Long organIdList;
 
     @ApiModelProperty(value = "部门名称",required = false)
-    private String organName;
+    private String organNameList;
 
-    public Long getOrganId() {
-        return organId;
+    public Long getOrganIdList() {
+        return organIdList;
     }
 
-    public void setOrganId(Long organId) {
-        this.organId = organId;
+    public void setOrganIdList(Long organIdList) {
+        this.organIdList = organIdList;
     }
 
-    public String getOrganName() {
-        return organName;
+    public String getOrganNameList() {
+        return organNameList;
     }
 
-    public void setOrganName(String organName) {
-        this.organName = organName;
+    public void setOrganNameList(String organNameList) {
+        this.organNameList = organNameList;
     }
 
     public Integer getId() {

+ 87 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentDemoGroupListDto.java

@@ -0,0 +1,87 @@
+package com.ym.mec.biz.dal.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author Joburgess
+ * @Date 2019/9/25
+ */
+public class StudentDemoGroupListDto {
+
+    @ApiModelProperty(value = "试听课ID",required = false)
+    private Long demoGroupId;
+
+    @ApiModelProperty(value = "用户ID",required = false)
+    private Long userId;
+
+    @ApiModelProperty(value = "用户名称",required = false)
+    private String userName;
+
+    @ApiModelProperty(value = "用户头像",required = false)
+    private String avatar;
+
+    @ApiModelProperty(value = "简介",required = false)
+    private String introduction;
+
+    @ApiModelProperty(value = "授课次数",required = false)
+    private Integer numberOfClasses;
+
+    @ApiModelProperty(value = "科目名称列表,逗号分隔",required = false)
+    private String subjectList;
+
+    public Long getDemoGroupId() {
+        return demoGroupId;
+    }
+
+    public void setDemoGroupId(Long demoGroupId) {
+        this.demoGroupId = demoGroupId;
+    }
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getAvatar() {
+        return avatar;
+    }
+
+    public void setAvatar(String avatar) {
+        this.avatar = avatar;
+    }
+
+    public String getIntroduction() {
+        return introduction;
+    }
+
+    public void setIntroduction(String introduction) {
+        this.introduction = introduction;
+    }
+
+    public Integer getNumberOfClasses() {
+        return numberOfClasses;
+    }
+
+    public void setNumberOfClasses(Integer numberOfClasses) {
+        this.numberOfClasses = numberOfClasses;
+    }
+
+    public String getSubjectList() {
+        return subjectList;
+    }
+
+    public void setSubjectList(String subjectList) {
+        this.subjectList = subjectList;
+    }
+}

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentDemoGroupQueryInfo.java

@@ -0,0 +1,20 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.common.page.QueryInfo;
+
+/**
+ * @Author Joburgess
+ * @Date 2019/9/25
+ */
+public class StudentDemoGroupQueryInfo extends QueryInfo {
+
+    private String teacherName;
+
+    public String getTeacherName() {
+        return teacherName;
+    }
+
+    public void setTeacherName(String teacherName) {
+        this.teacherName = teacherName;
+    }
+}

+ 16 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/DemoGroupService.java

@@ -2,6 +2,8 @@ package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.dto.DemoGroupApplyDto;
 import com.ym.mec.biz.dal.entity.DemoGroup;
+import com.ym.mec.biz.dal.page.StudentDemoGroupQueryInfo;
+import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
 
 public interface DemoGroupService extends BaseService<Long, DemoGroup> {
@@ -13,4 +15,18 @@ public interface DemoGroupService extends BaseService<Long, DemoGroup> {
      */
     void demoGroupApply(DemoGroupApplyDto demoGroupApplyDto);
 
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/25
+     * 获取试听课列表
+     */
+    PageInfo queryStudentDemoGroups(StudentDemoGroupQueryInfo queryInfo);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/25
+     * 试听课订阅
+     */
+    void demoGroupSubscribe(Long demoGroupId);
+
 }

+ 56 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/DemoGroupServiceImpl.java

@@ -2,23 +2,29 @@ package com.ym.mec.biz.service.impl;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dao.ClassGroupDao;
-import com.ym.mec.biz.dal.dao.DemoGroupClassGroupMapperDao;
-import com.ym.mec.biz.dal.dao.DemoGroupCoursesPlanDao;
+import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.DemoGroupApplyDto;
 import com.ym.mec.biz.dal.dto.VipGroupApplyBaseInfoDto;
 import com.ym.mec.biz.dal.entity.ClassGroup;
+import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
 import com.ym.mec.biz.dal.entity.DemoGroupClassGroupMapper;
+import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
 import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
+import com.ym.mec.biz.dal.page.StudentDemoGroupQueryInfo;
+import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.util.collection.MapUtil;
+import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import com.ym.mec.biz.dal.dao.DemoGroupDao;
 import com.ym.mec.biz.dal.entity.DemoGroup;
 import com.ym.mec.biz.service.DemoGroupService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
 
 @Service
 public class DemoGroupServiceImpl extends BaseServiceImpl<Long, DemoGroup>  implements DemoGroupService {
@@ -31,6 +37,10 @@ public class DemoGroupServiceImpl extends BaseServiceImpl<Long, DemoGroup>  impl
 	private DemoGroupClassGroupMapperDao demoGroupClassGroupMapperDao;
 	@Autowired
 	private DemoGroupCoursesPlanDao demoGroupCoursesPlanDao;
+	@Autowired
+	private CourseScheduleDao courseScheduleDao;
+	@Autowired
+	private ClassGroupStudentMapperDao classGroupStudentMapperDao;
 
 	@Autowired
 	private SysUserFeignService sysUserFeignService;
@@ -40,6 +50,7 @@ public class DemoGroupServiceImpl extends BaseServiceImpl<Long, DemoGroup>  impl
 		return demoGroupDao;
 	}
 
+	@Transactional(rollbackFor = Exception.class)
 	@Override
 	public void demoGroupApply(DemoGroupApplyDto demoGroupApplyDto) {
 		SysUser user = sysUserFeignService.queryUserInfo();
@@ -57,6 +68,38 @@ public class DemoGroupServiceImpl extends BaseServiceImpl<Long, DemoGroup>  impl
 		demoGroupCoursesPlanDao.batchInsertByDates(demoGroupApplyDto.getCourseDates(),demoGroupApplyDto.getId());
 	}
 
+	@Override
+	public PageInfo queryStudentDemoGroups(StudentDemoGroupQueryInfo queryInfo) {
+		PageInfo pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+		Map<String, Object> params = new HashMap<String, Object>();
+		MapUtil.populateMap(params, queryInfo);
+
+		List dataList = null;
+		int count = demoGroupDao.countDemoGroupList(params);
+		if (count > 0) {
+			pageInfo.setTotal(count);
+			params.put("offset", pageInfo.getOffset());
+			dataList = demoGroupDao.findDemoGroupList(params);
+		}
+		if (count == 0) {
+			dataList = new ArrayList<>();
+		}
+		pageInfo.setRows(dataList);
+		return pageInfo;
+	}
+
+	@Transactional(rollbackFor = Exception.class)
+	@Override
+	public void demoGroupSubscribe(Long demoGroupId) {
+		SysUser user = sysUserFeignService.queryUserInfo();
+		ClassGroupStudentMapper classGroupStudentMapper=new ClassGroupStudentMapper();
+		classGroupStudentMapper.setClassGroupId(demoGroupDao.findClassGroupIDByDemoGroupId(demoGroupId));
+		classGroupStudentMapper.setUserId(user.getId());
+		classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
+		classGroupStudentMapperDao.insert(classGroupStudentMapper);
+		createCourseScheduleAndUpdateOrganId(demoGroupId);
+	}
+
 	/**
 	 * @Author: Joburgess
 	 * @Date: 2019/9/25
@@ -64,6 +107,14 @@ public class DemoGroupServiceImpl extends BaseServiceImpl<Long, DemoGroup>  impl
 	 */
 	public void createCourseScheduleAndUpdateOrganId(Long demoGroupId){
 		DemoGroup demoGroup=demoGroupDao.get(demoGroupId);
-
+		if(demoGroupDao.countDemoGroupStudents(demoGroupId)>0){
+			courseScheduleDao.batchAddCourseSchedules(demoGroupDao.createCourseScheduleByDemoGroup(demoGroup));
+		}
+		List<Integer> organIds = demoGroupDao.organIdListByDemoGroupId(demoGroup.getId());
+		organIds.add(demoGroupDao.getOrganIdByUserId(demoGroup.getUserId().longValue()));
+		HashSet<Integer> hashSet = new HashSet<>(organIds);
+		String organIdsString = StringUtils.join(hashSet, ",");
+		demoGroup.setOrganIdList(organIdsString);
+		demoGroupDao.update(demoGroup);
 	}
 }

+ 4 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/EmployeeServiceImpl.java

@@ -10,6 +10,7 @@ import java.util.Map;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.auth.api.enums.SysUserType;
 import com.ym.mec.auth.api.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.dao.TeacherDao;
 import com.ym.mec.biz.dal.entity.Teacher;
@@ -64,7 +65,9 @@ public class EmployeeServiceImpl extends BaseServiceImpl<Integer, Employee>  imp
 	public void add(Employee employee) throws Exception {
 		SysUser user = sysUserFeignService.getUserByMobile(employee.getPhone());
 		if(user != null){
-			throw new Exception("系统已存在该手机号的老师,请核查");
+			employee.setUserType(SysUserType.SYSTEM);
+			teacherDao.updateUser(employee);
+			return;
 		}
 		//保存用户表信息
 		sysUserFeignService.addUser(employee);

+ 88 - 0
mec-biz/src/main/resources/config/mybatis/DemoGroupMapper.xml

@@ -15,6 +15,16 @@
 		<result column="update_time_" property="updateTime" />
 		<result column="user_id_" property="userId" />
 	</resultMap>
+
+	<resultMap id="studentDemoGroupListDto" type="com.ym.mec.biz.dal.dto.StudentDemoGroupListDto">
+		<result property="demoGroupId" column="demo_group_id_"/>
+		<result property="userId" column="user_id_"/>
+		<result property="userName" column="username_"/>
+		<result property="avatar" column="avatar_"/>
+		<result property="introduction" column="introduction_"/>
+		<result property="numberOfClasses" column="number_of_classes_"/>
+		<result property="subjectList" column="subject_list_"/>
+	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
 	<select id="get" resultMap="DemoGroup" >
@@ -77,4 +87,82 @@ create_time_ = #{createTime},
 	<select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM demo_group
 	</select>
+
+	<select id="organIdListByDemoGroupId" resultType="int">
+		SELECT
+			su.organ_id_
+		FROM
+			demo_group_class_group_mapper dgcgm
+			LEFT JOIN class_group_student_mapper cgsm ON dgcgm.class_group_id_=cgsm.class_group_id_
+			LEFT JOIN sys_user su ON cgsm.user_id_=su.id_
+		WHERE dgcgm.demo_group_id_=#{demoGroupId}
+	</select>
+	<select id="getOrganIdByUserId" resultType="java.lang.Integer">
+		select organ_id_ from sys_user where id_=#{userId}
+	</select>
+	<select id="createCourseScheduleByDemoGroupId" parameterType="com.ym.mec.biz.dal.entity.DemoGroup" resultMap="com.ym.mec.biz.dal.entity.CourseSchedule.CourseSchedule">
+		SELECT
+			dgcgm.class_group_id_ class_group_id_,
+			'NOT_START' status_,
+			DATE_FORMAT(dgcp.courses_start_time_,'%Y-%m-%d') class_date_,
+			dgcp.courses_start_time_ start_class_time_,
+			DATE_ADD(dgcp.courses_start_time_,INTERVAL #{demoGroup.singleClassMinutes} MINUTE) end_class_time_,
+			#{demoGroup.userId} teacher_id_,
+			'ONLINE' teach_mode_
+		FROM
+			demo_group_courses_plan dgcp
+			LEFT JOIN demo_group_class_group_mapper dgcgm ON dgcp.demo_group_id_=dgcgm.demo_group_id_
+			WHERE dgcp.demo_group_id_=#{demoGroup.id} AND dgcp.courses_start_time_ &gt; NOW()
+	</select>
+	<select id="countDemoGroupStudents" resultType="java.lang.Integer">
+		SELECT
+			count(cgsm.user_id_)
+		FROM
+			demo_group_class_group_mapper dgcgm
+			LEFT JOIN class_group_student_mapper cgsm ON dgcgm.class_group_id_=cgsm.class_group_id_
+		WHERE dgcgm.demo_group_id_=#{demoGroupId}
+	</select>
+
+	<sql id="demoGroupQueryCondition">
+		<where>
+			<if test="teacherName!=null">
+				su.username like concat('%',#{teacherName},'%')
+			</if>
+		</where>
+	</sql>
+
+	<select id="findDemoGroupList" resultMap="studentDemoGroupListDto">
+		SELECT
+			dg.id_ demo_group_id_,
+			su.id_ user_id_,
+			su.username_,
+			su.avatar_,
+			COUNT(DISTINCT cs.id_) number_of_classes_,
+			GROUP_CONCAT(DISTINCT s.name_) subject_list_
+		FROM
+			demo_group dg
+			LEFT JOIN sys_user su ON dg.user_id_=su.id_
+			LEFT JOIN demo_group_class_group_mapper dgcgm ON dg.id_=dgcgm.demo_group_id_
+			LEFT JOIN class_group cg ON dgcgm.class_group_id_=cg.id_
+			LEFT JOIN `subject` s ON FIND_IN_SET(s.id_,cg.subject_id_list_)
+			LEFT JOIN course_schedule cs ON dgcgm.class_group_id_=cs.class_group_id_
+			<include refid="demoGroupQueryCondition"/>
+		GROUP BY dg.id_
+		ORDER BY dg.id_
+	</select>
+	<select id="countDemoGroupList" resultType="java.lang.Integer">
+		SELECT
+			count(*)
+		FROM
+			demo_group dg
+			LEFT JOIN sys_user su ON dg.user_id_=su.id_
+		<include refid="demoGroupQueryCondition"/>
+	</select>
+	<select id="findClassGroupIDByDemoGroupId" resultType="java.lang.Integer">
+		SELECT
+			class_group_id_
+		FROM
+			demo_group_class_group_mapper
+		WHERE demo_group_id_=#{demoGroupId}
+	</select>
 </mapper>

+ 10 - 9
mec-biz/src/main/resources/config/mybatis/EmployeeMapper.xml

@@ -8,7 +8,7 @@
 
 	<resultMap type="com.ym.mec.biz.dal.entity.Employee" id="Employee">
 		<result column="user_id_" property="userId" />
-		<result column="organ_id_list" property="organIdList" />
+		<result column="organ_id_list_" property="organIdList" />
 		<result column="job_nature_" property="jobNature" />
 		<result column="is_probation_period_" property="isProbationPeriod" />
 		<result column="education_background_" property="educationBackground" />
@@ -40,7 +40,7 @@
 		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
 		</selectKey>
 		-->
-		INSERT INTO employee (user_id_,organ_id_list,job_nature_,is_probation_period_,education_background_,graduate_school_,technical_titles_,entry_date_,certificate_type_,certificate_num_,update_time_,create_time_,introduction_,demission_date_) VALUES(#{userId},#{organIdList},#{jobNature},#{isProbationPeriod},#{educationBackground},#{graduateSchool},#{technicalTitles},#{entryDate},#{certificateType},#{certificateNum},#{updateTime},#{createTime},#{introduction},#{demissionDate})
+		INSERT INTO employee (user_id_,organ_id_list_,job_nature_,is_probation_period_,education_background_,graduate_school_,technical_titles_,entry_date_,certificate_type_,certificate_num_,update_time_,create_time_,introduction_,demission_date_) VALUES(#{userId},#{organIdList},#{jobNature},#{isProbationPeriod},#{educationBackground},#{graduateSchool},#{technicalTitles},#{entryDate},#{certificateType},#{certificateNum},#{updateTime},#{createTime},#{introduction},#{demissionDate})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -53,7 +53,7 @@
         graduate_school_ = #{graduateSchool},
         </if>
         <if test="organId != null">
-            organ_id_list = #{organIdList},
+            organ_id_list_ = #{organIdList},
         </if>
         <if test="introduction != null">
         introduction_ = #{introduction},
@@ -124,8 +124,8 @@
         <result property="jobNature" column="job_nature_" />
         <result property="entryDate" column="entry_date_" />
         <result property="demissionDate" column="demission_date_" />
-        <result property="organId" column="organ_id_" />
-        <result property="organName" column="organ_name_" />
+        <result property="organIdList" column="organ_id_list_" />
+        <result property="organNameList" column="organ_name_list_" />
     </resultMap>
 
     <sql id="queryCondition">
@@ -150,10 +150,10 @@
         su.username_,
         su.gender_,
         su.phone_,
-        sr.role_name_,
+        GROUP_CONCAT(DISTINCT sr.role_name_) role_name_,
         su.lock_flag_,
-        su.organ_id_,
-        o.name_ organ_name_,
+        e.organ_id_list_,
+        GROUP_CONCAT(DISTINCT o.name_) organ_name_list_,
         e.job_nature_,
         e.entry_date_,
         e.demission_date_
@@ -162,8 +162,9 @@
         LEFT JOIN employee e ON su.id_=e.user_id_
         LEFT JOIN sys_user_role sur ON su.id_=sur.user_id_
         LEFT JOIN sys_role sr ON sur.role_id_=sr.id_
-        LEFT JOIN organization o ON su.organ_id_=o.id_
+        LEFT JOIN organization o ON FIND_IN_SET(o.id_,e.organ_id_list_)
         <include refid="queryCondition"/>
+        GROUP BY su.id_
     </select>
 
     <select id="queryEmployByOrganIdCount" resultType="java.lang.Integer">

+ 37 - 0
mec-student/src/main/java/com/ym/mec/student/controller/StudentDemoGroupController.java

@@ -0,0 +1,37 @@
+package com.ym.mec.student.controller;
+
+import com.ym.mec.biz.dal.page.StudentDemoGroupQueryInfo;
+import com.ym.mec.biz.service.DemoGroupService;
+import com.ym.mec.common.controller.BaseController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Author Joburgess
+ * @Date 2019/9/25
+ */
+@Api(tags = "试听课-学生端")
+@RequestMapping("studentDemoGroup")
+@RestController
+public class StudentDemoGroupController extends BaseController {
+
+    @Autowired
+    private DemoGroupService demoGroupService;
+
+    @ApiOperation(value = "试听课列表获取")
+    @PostMapping("/queryStudentDemoGroups")
+    public Object queryStudentDemoGroups(StudentDemoGroupQueryInfo queryInfo){
+        return succeed(demoGroupService.queryStudentDemoGroups(queryInfo));
+    }
+
+    @ApiOperation(value = "试听课列表获取")
+    @PostMapping("/demoGroupSubscribe")
+    public Object demoGroupSubscribe(Long demoGroupId){
+        demoGroupService.demoGroupSubscribe(demoGroupId);
+        return succeed();
+    }
+}

+ 16 - 0
mec-web/src/test/java/com/ym/Test.java

@@ -2,11 +2,15 @@ package com.ym;
 
 import com.ym.mec.biz.dal.dto.ClassDateAdjustDto;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
+import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.BeanUtils;
 
 import java.io.File;
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
 
 /**
  * @Author Joburgess
@@ -34,4 +38,16 @@ public class Test {
         file.createNewFile();
     }
 
+    @org.junit.Test
+    public void test3(){
+        List<Integer> list=new ArrayList<>();
+        list.add(1);
+        list.add(2);
+        list.add(3);
+        list.add(1);
+        HashSet<Integer> hashSet=new HashSet<>(list);
+        String join = StringUtils.join(hashSet, ",");
+        System.out.println(join);
+    }
+
 }