Jelajahi Sumber

Merge branch 'master' of http://git.dayaedu.com/yonge/mec into Joburgess

zouxuan 5 tahun lalu
induk
melakukan
49313aa68c

+ 32 - 0
cms/src/main/java/com/ym/mec/cms/dal/entity/SysNewsInformation.java

@@ -23,6 +23,10 @@ public class SysNewsInformation {
 	@ApiModelProperty(value = "封面图片", required = false)
 	private String coverImage;
 
+	/** 视频封面图片 */
+	@ApiModelProperty(value = "视频封面图片", required = false)
+	private String videoCoverImage;
+
 	/** 类型 */
 	@ApiModelProperty(value = "类型,1精彩活动,2热门资讯,3banner类型", required = true)
 	private Integer type;
@@ -56,6 +60,10 @@ public class SysNewsInformation {
 
 	private Integer tenantId;
 
+	private String attribute1;
+	
+	private String attribute2;
+
 	public String getLinkUrl() {
 		return linkUrl;
 	}
@@ -112,6 +120,14 @@ public class SysNewsInformation {
 		return this.coverImage;
 	}
 
+	public String getVideoCoverImage() {
+		return videoCoverImage;
+	}
+
+	public void setVideoCoverImage(String videoCoverImage) {
+		this.videoCoverImage = videoCoverImage;
+	}
+
 	public void setType(Integer type) {
 		this.type = type;
 	}
@@ -176,6 +192,22 @@ public class SysNewsInformation {
 		this.subType = subType;
 	}
 
+	public String getAttribute1() {
+		return attribute1;
+	}
+
+	public void setAttribute1(String attribute1) {
+		this.attribute1 = attribute1;
+	}
+
+	public String getAttribute2() {
+		return attribute2;
+	}
+
+	public void setAttribute2(String attribute2) {
+		this.attribute2 = attribute2;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 14 - 2
cms/src/main/resources/config/mybatis/SysNewsInformationMapper.xml

@@ -11,6 +11,7 @@
 		<result column="title_" property="title" />
 		<result column="content_" property="content" />
 		<result column="cover_image_" property="coverImage" />
+		<result column="video_cover_image_" property="videoCoverImage" />
 		<result column="link_url_" property="linkUrl"/>
 		<result column="type_" property="type"/>
 		<result column="sub_type_" property="subType"/>
@@ -22,6 +23,8 @@
 		<result column="order_" property="order" />
 		<result column="memo_" property="memo" />
 		<result column="tenant_id_" property="tenantId" />
+		<result column="attribute1_" property="attribute1" />
+		<result column="attribute2_" property="attribute2" />
 	</resultMap>
 	
 	<sql id="queryCondition">
@@ -60,8 +63,8 @@
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.cms.dal.entity.SysNewsInformation" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO sys_news_information (id_,title_,content_,cover_image_,type_,sub_type_,status_,create_time_,update_time_,link_url_,href_target_,order_,del_flag_,memo_,tenant_id_)
-		VALUES(#{id},#{title},#{content},#{coverImage},#{type},#{subType},#{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},now(),now(),#{linkUrl},#{hrefTarget},#{order},0,#{memo},#{tenantId})
+		INSERT INTO sys_news_information (id_,title_,content_,cover_image_,video_cover_image_,type_,sub_type_,status_,create_time_,update_time_,link_url_,href_target_,order_,del_flag_,memo_,tenant_id_,attribute1_,attribute2_)
+		VALUES(#{id},#{title},#{content},#{coverImage},#{videoCoverImage},#{type},#{subType},#{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},now(),now(),#{linkUrl},#{hrefTarget},#{order},0,#{memo},#{tenantId},#{attribute1},#{attribute2})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -86,6 +89,9 @@
 			<if test="coverImage != null">
 				cover_image_ = #{coverImage},
 			</if>
+			<if test="videoCoverImage != null">
+				video_cover_image_ = #{videoCoverImage},
+			</if>
 			<if test="type != null">
 				type_ = #{type},
 			</if>
@@ -107,6 +113,12 @@
 			<if test="delFlag != null">
 				del_flag_ = #{delFlag},
 			</if>
+			<if test="attribute1 != null">
+				attribute1_ = #{attribute1},
+			</if>
+			<if test="attribute2 != null">
+				attribute2_ = #{attribute2},
+			</if>
 		</set>
 		WHERE id_ = #{id}
 	</update>

+ 17 - 8
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupDao.java

@@ -1,19 +1,28 @@
 package com.ym.mec.biz.dal.dao;
 
-import com.ym.mec.biz.dal.dto.*;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.ibatis.annotations.Param;
+
+import com.ym.mec.biz.dal.dto.ClassGroupTeachersDto;
+import com.ym.mec.biz.dal.dto.ConditionDto;
+import com.ym.mec.biz.dal.dto.CourseListDto;
+import com.ym.mec.biz.dal.dto.HighClassGroupDto;
+import com.ym.mec.biz.dal.dto.MusicGroupClassGroupDto;
+import com.ym.mec.biz.dal.dto.MusicGroupCourseScheduleDto;
+import com.ym.mec.biz.dal.dto.StudentPayInfoDto;
+import com.ym.mec.biz.dal.dto.SuperClassGroupDto;
+import com.ym.mec.biz.dal.dto.TeacherClassGroupDto;
+import com.ym.mec.biz.dal.dto.TeacherMusicClassInfoDto;
 import com.ym.mec.biz.dal.entity.ClassGroup;
-import com.ym.mec.biz.dal.entity.CoursesGroup;
 import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.entity.ImGroupModel;
 import com.ym.mec.common.entity.ImUserModel;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
 
 public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
 
@@ -242,7 +251,7 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
      * @params [classGroupId]
      * @describe 锁定班级信息
      */
-    ClassGroup lockClassGroup(Long classGroupId);
+    ClassGroup lockClassGroup(Integer classGroupId);
 
     /**
      * 获取当前班级列表老师数量

+ 4 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupService.java

@@ -192,7 +192,9 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
      * @return boolean
      * @describe 跟新班级人数
      */
-    boolean updateClassStudentNum(Long classGroupId,Integer num);
+    boolean updateClassStudentNum(Integer classGroupId,Integer num);
+
+    boolean updateClassStudentNum(Integer classGroupId);
 
     /**
      * 删除单技班级
@@ -372,7 +374,7 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
      */
     List<ClassGroup> findByClassGroupIds(List<Integer> classGroupIds);
 
-    boolean updateTotalClassTimes(Long classGroupId, Integer num);
+    boolean updateTotalClassTimes(Integer classGroupId, Integer num);
 
     /**
      * @describe 跟新班级相关信息

+ 24 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -25,6 +25,7 @@ import com.ym.mec.jiari.JiaRiFeignService;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateConvertor;
 import com.ym.mec.util.date.DateUtil;
+
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -825,14 +826,15 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             }
             if (ClassGroupTypeEnum.VIP == e.getType()) {
                 e.setStudentNames(vipStuNames.get(e.getVipId()));
-                if (e.getOffLineClassesNum() > 0 && e.getOffLineClassesNum() <= 0) {
+                //1:线上;2:线下;3:线上+线下
+                if (e.getOnlineClassesNum() > 0 && e.getOffLineClassesNum() <= 0) {
                     e.setClassMode(1);
-                } else if (e.getOffLineClassesNum() > 0 && e.getOffLineClassesNum() > 0) {
+                } else if (e.getOnlineClassesNum() > 0 && e.getOffLineClassesNum() > 0) {
                     e.setClassMode(3);
                 } else if (e.getOnlineClassesNum() <= 0 && e.getOffLineClassesNum() > 0) {
                     e.setClassMode(2);
                 } else {
-                    e.setClassMode(1);
+                    e.setClassMode(0);
                 }
             }
         }
@@ -1187,7 +1189,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             if (teacherClassGroupDto.getType() == ClassGroupTypeEnum.VIP) {
                 String[] studentNums = classGroupStudentMapperDao.findStudentNumByClassGroupId(teacherClassGroupDto.getClassGroupId());
                 teacherClassGroupDto.setStudentNames(StringUtils.join(studentNums, ","));
-                if (teacherClassGroupDto.getOffLineClassesNum() > 0 && teacherClassGroupDto.getOffLineClassesNum() <= 0) {
+                if (teacherClassGroupDto.getOnlineClassesNum() > 0 && teacherClassGroupDto.getOffLineClassesNum() <= 0) {
                     teacherClassGroupDto.setClassMode(1);
                 } else if (teacherClassGroupDto.getOnlineClassesNum() > 0 && teacherClassGroupDto.getOffLineClassesNum() > 0) {
                     teacherClassGroupDto.setClassMode(3);
@@ -1264,7 +1266,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
     @Override
     @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
-    public boolean updateClassStudentNum(Long classGroupId, Integer num) {
+    public boolean updateClassStudentNum(Integer classGroupId, Integer num) {
         ClassGroup classGroup = classGroupDao.lockClassGroup(classGroupId);
         if (Objects.isNull(classGroup)) {
             throw new BizException("班级不存在");
@@ -1278,6 +1280,21 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     }
 
     @Override
+	public boolean updateClassStudentNum(Integer classGroupId) {
+    	ClassGroup classGroup = classGroupDao.lockClassGroup(classGroupId);
+        if (Objects.isNull(classGroup)) {
+            throw new BizException("班级不存在");
+        }
+        Integer num = classGroupStudentMapperDao.countClassGroupStudentNum(classGroupId);
+        classGroup.setStudentNum(num);
+        classGroup.setUpdateTime(new Date());
+
+        classGroupDao.update(classGroup);
+
+        return true;
+	}
+
+	@Override
     public TeacherClassHeadInfo findTeacherClassGroupInfo(Integer classGroupId) {
         if (Objects.isNull(classGroupId)) {
             throw new BizException("请指定班级");
@@ -1772,7 +1789,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             }
         }
 
-        classGroupService.updateTotalClassTimes(classGroup.getId().longValue(), courseTimes);
+        classGroupService.updateTotalClassTimes(classGroup.getId(), courseTimes);
 
         MusicGroup musicGroup = musicGroupDao.get(classGroup.getMusicGroupId());
 
@@ -2655,7 +2672,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
     @Override
     @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
-    public boolean updateTotalClassTimes(Long classGroupId, Integer num) {
+    public boolean updateTotalClassTimes(Integer classGroupId, Integer num) {
         ClassGroup classGroup = classGroupDao.lockClassGroup(classGroupId);
         if (Objects.isNull(classGroup)) {
             throw new BizException("班级不存在");

+ 37 - 15
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupStudentMapperServiceImpl.java

@@ -1,17 +1,47 @@
 package com.ym.mec.biz.service.impl;
 
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
 import com.alibaba.fastjson.JSON;
 import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
 import com.ym.mec.biz.dal.dao.CourseScheduleTeacherSalaryDao;
 import com.ym.mec.biz.dal.dao.StudentDao;
-import com.ym.mec.biz.dal.dao.TeacherAttendanceDao;
 import com.ym.mec.biz.dal.dto.ClassGroupStudentInfoDto;
-import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.entity.ClassGroup;
+import com.ym.mec.biz.dal.entity.ClassGroupRelation;
+import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
+import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
+import com.ym.mec.biz.dal.entity.CourseSchedule;
+import com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment;
+import com.ym.mec.biz.dal.entity.CourseScheduleTeacherSalary;
+import com.ym.mec.biz.dal.entity.StudentRegistration;
+import com.ym.mec.biz.dal.entity.TeacherDefaultMusicGroupSalary;
 import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
 import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
-import com.ym.mec.biz.service.*;
+import com.ym.mec.biz.service.ClassGroupRelationService;
+import com.ym.mec.biz.service.ClassGroupService;
+import com.ym.mec.biz.service.ClassGroupStudentMapperService;
+import com.ym.mec.biz.service.ClassGroupTeacherMapperService;
+import com.ym.mec.biz.service.CourseScheduleService;
+import com.ym.mec.biz.service.CourseScheduleStudentPaymentService;
+import com.ym.mec.biz.service.CourseScheduleTeacherSalaryService;
+import com.ym.mec.biz.service.StudentRegistrationService;
+import com.ym.mec.biz.service.TeacherDefaultMusicGroupSalaryService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.entity.ImGroupMember;
 import com.ym.mec.common.entity.ImGroupModel;
@@ -19,14 +49,6 @@ import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.im.ImFeignService;
 import com.ym.mec.util.http.HttpUtil;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.io.IOException;
-import java.math.BigDecimal;
-import java.util.*;
-import java.util.stream.Collectors;
 
 @Service
 public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, ClassGroupStudentMapper> implements ClassGroupStudentMapperService {
@@ -92,7 +114,7 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
         }
 
         //2、班级人数调整
-        classGroupService.updateClassStudentNum(classGroupId.longValue(), -1);
+        classGroupService.updateClassStudentNum(classGroupId);
 
         //3、删除学生对应班级的课程
         List<CourseSchedule> courseScheduleList = courseScheduleService.findNoStartCoursesByClassGroupId(classGroupId);
@@ -158,8 +180,8 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
         classStudentMapper.setClassGroupId(classGroupId);
         update(classStudentMapper);
         //班级人数调整
-        classGroupService.updateClassStudentNum(oldClassGroupId.longValue(), -1);
-        classGroupService.updateClassStudentNum(classGroupId.longValue(), 1);
+        classGroupService.updateClassStudentNum(oldClassGroupId);
+        classGroupService.updateClassStudentNum(classGroupId, 1);
 
         //2、删除学生对应原班级未开始课程
         List<CourseSchedule> courseScheduleList = courseScheduleService.findNoStartCoursesByClassGroupId(oldClassGroupId);
@@ -242,7 +264,7 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
         }
 
         //2、班级人数调整
-        classGroupService.updateClassStudentNum(classGroupId.longValue(), userIdStrSet.size());
+        classGroupService.updateClassStudentNum(classGroupId, userIdStrSet.size());
 
         //3、学生加入新班级未开始课程
         List<CourseSchedule> courseScheduleList = courseScheduleService.findNoStartCoursesByClassGroupId(classGroupId);

+ 3 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -1295,7 +1295,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
 		ClassGroup classGroup =classGroupDao.findByMusicGroupAndType(vipGroupBuyParams.getVipGroupId().toString(),ClassGroupTypeEnum.VIP.getCode());
 
-		classGroup= classGroupDao.lockClassGroup(classGroup.getId().longValue());
+		classGroup= classGroupDao.lockClassGroup(classGroup.getId());
 
 		if(Objects.isNull(classGroup)){
 			throw new BizException("课程信息错误");
@@ -3008,6 +3008,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 							&& vipGroup.getPaymentExpireDate().after(now)
 							&& VipGroupStatusEnum.NOT_START.equals(vipGroup.getStatus())) {
 						vipGroup.setStatus(VipGroupStatusEnum.APPLYING);
+					}else{
+						continue;
 					}
 					VipGroup vipGroup1 = new VipGroup();
 					vipGroup1.setId(vipGroup.getId());

+ 19 - 17
mec-student/src/main/java/com/ym/mec/student/controller/ClassGroupController.java

@@ -1,5 +1,23 @@
 package com.ym.mec.student.controller;
 
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
+import org.springframework.beans.factory.annotation.Autowired;
+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.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.ClassGroupDao;
@@ -12,26 +30,10 @@ import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
-import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
 import com.ym.mec.biz.service.ClassGroupService;
 import com.ym.mec.biz.service.StudentRegistrationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-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 javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
 
 @RequestMapping("classGroup")
 @Api(tags = "班级服务")
@@ -57,7 +59,7 @@ public class ClassGroupController extends BaseController {
     @ApiImplicitParams({@ApiImplicitParam(name = "classGroupId", value = "班级id", required = true, dataType = "int")})
     public HttpResponseResult highReg(Integer classGroupId) {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
-        ClassGroup classGroup = classGroupDao.lockClassGroup(classGroupId.longValue());
+        ClassGroup classGroup = classGroupDao.lockClassGroup(classGroupId);
         if (classGroup == null || (!classGroup.getType().equals(ClassGroupTypeEnum.HIGH) && !classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE)) || classGroup.getDelFlag().equals(1)) {
             return failed("报名的班级不存在");
         }