Joburgess 5 年之前
父节点
当前提交
1f03b49304

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

@@ -235,4 +235,13 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
      */
     List<Map<Integer, Integer>> countTeacherNums(@Param("classGroupIds") String classGroupIds);
 
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/10/17
+     * @params [teacherId]
+     * @return java.util.List<com.ym.mec.biz.dal.dto.TeacherClassGroupDto>
+     * @describe 获取老师乐团班级
+     */
+    List<TeacherClassGroupDto> findTeacherMusicClassGroup(@Param("teacherId") Long teacherId);
+
 }

+ 12 - 4
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupStudentMapperDao.java

@@ -1,11 +1,10 @@
 package com.ym.mec.biz.dal.dao;
 
-import java.util.List;
-
-import org.apache.ibatis.annotations.Param;
-
 import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
 import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStudentMapper> {
 
@@ -37,4 +36,13 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
 	 * @param classGroupId
 	 */
 	void deleteByClassId(Integer classGroupId);
+
+	/**
+	 * @Author: Joburgess
+	 * @Date: 2019/10/17
+	 * @params [classGroupId, userId]
+	 * @return int
+	 * @describe 删除班级上的指定学生
+	 */
+	int deleteStudentByClassGroupId(@Param("classGroupId") Long classGroupId,@Param("userId") Long userId);
 }

+ 142 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherClassGroupDto.java

@@ -0,0 +1,142 @@
+package com.ym.mec.biz.dal.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author Joburgess
+ * @Date 2019/10/17
+ */
+public class TeacherClassGroupDto {
+
+    @ApiModelProperty(value = "班级编号")
+    private Long classGroupId;
+
+    @ApiModelProperty(value = "班级名称")
+    private String classGroupName;
+
+    @ApiModelProperty(value = "学生数量")
+    private Integer studentNum;
+
+    @ApiModelProperty(value = "当前课时")
+    private Integer currentClassTimes;
+
+    @ApiModelProperty(value = "课程总数")
+    private Integer totalClassTimes;
+
+    @ApiModelProperty(value = "乐团编号")
+    private Long musicGroupId;
+
+    @ApiModelProperty(value = "乐团名称")
+    private String musicGroupName;
+
+    @ApiModelProperty(value = "学校编号")
+    private Long schoolId;
+
+    @ApiModelProperty(value = "学校名称")
+    private String schoolName;
+
+    @ApiModelProperty(value = "科目编号列表")
+    private String subjectIdList;
+
+    @ApiModelProperty(value = "科目名称")
+    private String subjectNames;
+
+    @ApiModelProperty(value = "连续3节课未签到人数")
+    private Integer threeClassNoAttendanceStudentNum;
+
+    public String getSubjectIdList() {
+        return subjectIdList;
+    }
+
+    public void setSubjectIdList(String subjectIdList) {
+        this.subjectIdList = subjectIdList;
+    }
+
+    public Long getClassGroupId() {
+        return classGroupId;
+    }
+
+    public void setClassGroupId(Long classGroupId) {
+        this.classGroupId = classGroupId;
+    }
+
+    public String getClassGroupName() {
+        return classGroupName;
+    }
+
+    public void setClassGroupName(String classGroupName) {
+        this.classGroupName = classGroupName;
+    }
+
+    public Integer getStudentNum() {
+        return studentNum;
+    }
+
+    public void setStudentNum(Integer studentNum) {
+        this.studentNum = studentNum;
+    }
+
+    public Integer getCurrentClassTimes() {
+        return currentClassTimes;
+    }
+
+    public void setCurrentClassTimes(Integer currentClassTimes) {
+        this.currentClassTimes = currentClassTimes;
+    }
+
+    public Integer getTotalClassTimes() {
+        return totalClassTimes;
+    }
+
+    public void setTotalClassTimes(Integer totalClassTimes) {
+        this.totalClassTimes = totalClassTimes;
+    }
+
+    public Long getMusicGroupId() {
+        return musicGroupId;
+    }
+
+    public void setMusicGroupId(Long musicGroupId) {
+        this.musicGroupId = musicGroupId;
+    }
+
+    public String getMusicGroupName() {
+        return musicGroupName;
+    }
+
+    public void setMusicGroupName(String musicGroupName) {
+        this.musicGroupName = musicGroupName;
+    }
+
+    public Long getSchoolId() {
+        return schoolId;
+    }
+
+    public void setSchoolId(Long schoolId) {
+        this.schoolId = schoolId;
+    }
+
+    public String getSchoolName() {
+        return schoolName;
+    }
+
+    public void setSchoolName(String schoolName) {
+        this.schoolName = schoolName;
+    }
+
+    public String getSubjectNames() {
+        return subjectNames;
+    }
+
+    public void setSubjectNames(String subjectNames) {
+        this.subjectNames = subjectNames;
+    }
+
+    public Integer getThreeClassNoAttendanceStudentNum() {
+        return threeClassNoAttendanceStudentNum;
+    }
+
+    public void setThreeClassNoAttendanceStudentNum(Integer threeClassNoAttendanceStudentNum) {
+        this.threeClassNoAttendanceStudentNum = threeClassNoAttendanceStudentNum;
+    }
+}

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupService.java

@@ -200,4 +200,13 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
      * @param musicGroupId
      */
     void addMusicGroupTeam(Integer teacherId, String musicGroupId) throws Exception;
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/10/17
+     * @params []
+     * @return java.util.List<com.ym.mec.biz.dal.dto.TeacherClassGroupDto>
+     * @describe 获取老师所在班级列表
+     */
+    List<TeacherClassGroupDto> findTeacherClassGroups();
 }

+ 17 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -1,5 +1,7 @@
 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.*;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
@@ -58,6 +60,8 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     private ClassGroupTeacherSalaryService classGroupTeacherSalaryService;
     @Autowired
     private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
 
     @Override
     public BaseDAO<Integer, ClassGroup> getDAO() {
@@ -473,6 +477,19 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     }
 
     @Override
+    public List<TeacherClassGroupDto> findTeacherClassGroups() {
+        SysUser user = sysUserFeignService.queryUserInfo();
+        if(Objects.isNull(user)){
+            throw new BizException("请登录");
+        }
+
+        List<TeacherClassGroupDto> teacherMusicClassGroup = classGroupDao.findTeacherMusicClassGroup(user.getId().longValue());
+
+
+        return null;
+    }
+
+    @Override
     @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
     public boolean updateClassStudentNum(Long classGroupId, Integer num) {
         ClassGroup classGroup=classGroupDao.lockClassGroup(classGroupId);

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

@@ -24,6 +24,7 @@ import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
+import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.time.DateUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -461,6 +462,22 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 	public void courseScheduleCommplaint(CourseScheduleComplaints courseScheduleComplaints) {
 		SysUser user = sysUserFeignService.queryUserInfo();
 
+		if(Objects.isNull(user)){
+			throw new BizException("请登录");
+		}
+
+		if(Objects.isNull(courseScheduleComplaints.getCourseScheduleId())){
+			throw new BizException("请指定需要投诉的课程");
+		}
+
+		if(StringUtils.isBlank(courseScheduleComplaints.getReason())){
+			throw new BizException("请说明投诉原因");
+		}
+
+		if(StringUtils.length(courseScheduleComplaints.getReason())>150){
+			throw new BizException("字符长度超限");
+		}
+
 		courseScheduleComplaints.setUserId(user.getId());
 
 		CourseScheduleComplaints byUserAndCourse = courseScheduleComplaintsDao.findByUserAndCourse(courseScheduleComplaints.getUserId().longValue(), courseScheduleComplaints.getCourseScheduleId());

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java

@@ -39,6 +39,8 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
 	private SysUserCashAccountService sysUserCashAccountService;
 	@Autowired
 	private SysUserCashAccountDetailService sysUserCashAccountDetailService;
+	@Autowired
+	private StudentPaymentOrderDao studentPaymentOrderDao;
 
 	private static final Logger LOGGER = LoggerFactory
 			.getLogger(CourseScheduleTeacherSalaryServiceImpl.class);
@@ -235,6 +237,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
 				sysUserCashAccountService.updateBalance(studentPayment.getUserId(),returnPrice);
 				SysUserCashAccount studentCashAccount = sysUserCashAccountService.get(studentPayment.getUserId().intValue());
 				SysUserCashAccountDetail studentAccountDetail=new SysUserCashAccountDetail();
+//				studentAccountDetail.setTransNo(studentPayment.getT());
 				studentAccountDetail.setUserId(studentPayment.getUserId());
 				studentAccountDetail.setType(PlatformCashAccountDetailTypeEnum.REFUNDS);
 				studentAccountDetail.setStatus(DealStatusEnum.SUCCESS);

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

@@ -81,6 +81,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 	private CourseScheduleStudentPaymentService courseScheduleStudentPaymentService;
 	@Autowired
 	private PayService payService;
+	@Autowired
+	private ClassGroupStudentMapperDao classGroupStudentMapperDao;
 
 	@Override
 	public BaseDAO<Long, VipGroup> getDAO() {
@@ -596,7 +598,14 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
     	if(Objects.isNull(studentApplyRefunds.getId())){
     		throw new BizException("请指定退费订单!");
 		}
+
 		StudentApplyRefunds oldStudentApplyRefunds=studentApplyRefundsDao.get(studentApplyRefunds.getId());
+
+		StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDao.get(oldStudentApplyRefunds.getOrigPaymentOrderId());
+		if(null==studentPaymentOrder){
+			throw new BizException("未找到原订单信息!");
+		}
+
 		oldStudentApplyRefunds.setStatus(studentApplyRefunds.getStatus());
 		if(null==studentApplyRefunds.getActualAmount()){
 			oldStudentApplyRefunds.setActualAmount(oldStudentApplyRefunds.getExpectAmount());
@@ -617,6 +626,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 				sysUserCashAccountDetail.setBalance(sysUserCashAccount.getBalance());
 				sysUserCashAccountDetail.setAttribute(oldStudentApplyRefunds.getId().toString());
 				sysUserCashAccountDetailDao.insert(sysUserCashAccountDetail);
+
+				classGroupStudentMapperDao.deleteStudentByClassGroupId(studentPaymentOrder.getClassGroupId().longValue(),
+						studentPaymentOrder.getUserId().longValue());
 				break;
 			case REJECT:
 

+ 33 - 0
mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml

@@ -449,6 +449,39 @@
             WHERE cg.id_=#{classGroupId} FOR UPDATE
     </select>
 
+    <resultMap id="TeacherClassGroupDto" type="com.ym.mec.biz.dal.dto.TeacherClassGroupDto">
+        <result property="classGroupId" column="class_group_id_"/>
+        <result property="classGroupName" column="class_group_name_"/>
+        <result property="studentNum" column="student_num_"/>
+        <result property="currentClassTimes" column="current_class_times_"/>
+        <result property="totalClassTimes" column="total_class_times_"/>
+        <result property="musicGroupId" column="music_group_id_"/>
+        <result property="musicGroupName" column="music_group_name_"/>
+        <result property="schoolId" column="school_id_"/>
+        <result property="schoolName" column="school_name_"/>
+        <result property="subjectIdList" column="subject_id_list_"/>
+    </resultMap>
+
+    <select id="findTeacherMusicClassGroup" resultType="com.ym.mec.biz.dal.dto.TeacherClassGroupDto">
+        SELECT
+            cg.id_ class_group_id_,
+            cg.name_ class_group_name_,
+            cg.student_num_,
+            cg.current_class_times_,
+            cg.total_class_times_,
+            cg.subject_id_list_,
+            mg.id_ music_group_id_,
+            mg.name_ music_group_name_,
+            s.id_ school_id_,
+            s.name_ school_name_
+        FROM
+            class_group_teacher_mapper cgtm
+            LEFT JOIN class_group cg ON cgtm.class_group_id_=cg.id_
+            LEFT JOIN music_group mg ON cg.music_group_id_=mg.id_
+            LEFT JOIN school s ON mg.school_id_=s.id_
+        WHERE cgtm.user_id_=#{teacherId} AND cg.type_!="VIP" AND cg.type_!="DEMO"
+    </select>
+
     <!-- 增加实际学生人数 -->
     <update id="addStudentNum" parameterType="com.ym.mec.biz.dal.entity.ClassGroup">
         UPDATE class_group SET student_num_ = student_num_+1,update_time_=#{updateTime} WHERE id_ = #{id} AND

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

@@ -83,4 +83,8 @@
     <delete id="deleteStudentByMusicGroupId" parameterType="map">
         DELETE FROM class_group_student_mapper WHERE class_group_id_ in (select id_ from class_group where music_group_id_ = #{musicGroupId}) and user_id_ = #{userId}
     </delete>
+
+    <delete id="deleteStudentByClassGroupId">
+        DELETE FROM class_group_student_mapper WHERE class_group_id_=#{classGroupId} AND user_id_=#{userId}
+    </delete>
 </mapper>