فهرست منبع

Merge remote-tracking branch 'origin/master'

周箭河 5 سال پیش
والد
کامیت
3654c2ba31

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

@@ -369,4 +369,13 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
      * @return
      */
     List<ClassGroupTeachersDto> findClassGroupByMixClassGroupId(@Param("mixClassGroupId") Integer mixClassGroupId);
-}
+
+    /**
+     * @describe 根据班级编号列表获取班级名称列表
+     * @author Joburgess
+     * @date 2019/10/31
+     * @param classGroups: 班级编号列表
+     * @return java.util.List<java.lang.String>
+     */
+    List<String> findClassGroupNamesByClassGroups(@Param("classGroups") List<Integer> classGroups);
+}

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

@@ -62,6 +62,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 	private CourseScheduleStudentPaymentService courseScheduleStudentPaymentService;
 	@Autowired
 	private ClassGroupService classGroupService;
+	@Autowired
+	private ClassGroupDao classGroupDao;
 
 	@Override
 	public BaseDAO<Long, CourseSchedule> getDAO() {
@@ -311,6 +313,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
             className.append("-");
             className.append(courseSchedule.getType().getMsg());
             courseSchedule.setName(className.toString());
+            courseSchedule.setStatus(CourseStatusEnum.NOT_START);
         });
     }
 
@@ -706,11 +709,22 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		}
 		List<Map<Integer, Long>> maps = courseScheduleDao.countClassCourseNumByMusicGroup(musicGroupId);
 		Map<Integer,Long> classCourseNumMap = MapUtil.convertMybatisMap(maps);
-		for (Integer key:classCourseNumMap.keySet()){
-			if(classCourseNumMap.get(key)<=0){
-				throw new BizException("存在未排课的班级");
-			}
-		}
+		List<Integer> collect = classCourseNumMap
+								.entrySet()
+								.stream()
+								.filter(integerLongEntry -> integerLongEntry.getValue() <= 0)
+								.map(Map.Entry::getKey)
+								.collect(Collectors.toList());
+		if(!CollectionUtils.isEmpty(collect)){
+			List<String> classGroupNamesByClassGroups = classGroupDao.findClassGroupNamesByClassGroups(collect);
+			String classNamesStr=StringUtils.join(classGroupNamesByClassGroups,",");
+			throw new BizException(classNamesStr+"班级未排课");
+		}
+//		for (Integer key:classCourseNumMap.keySet()){
+//			if(classCourseNumMap.get(key)<=0){
+//				throw new BizException("存在未排课的班级");
+//			}
+//		}
 	}
 
 	@Override

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

@@ -263,7 +263,20 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			throw new BizException("请指定vip课");
 		}
 		VipGroup oldVipGroupInfo = vipGroupDao.get(vipGroupUpdateInfo.getId());
+		if(Objects.isNull(oldVipGroupInfo)){
+			throw new BizException("指定的vip课不存在");
+		}
+		Date now=new Date();
+		//更新vip课
+		vipGroupUpdateInfo.setUpdateTime(now);
+		vipGroupDao.update(vipGroupUpdateInfo);
 
+		//课程调整
+		List<CourseSchedule> courseSchedules = vipGroupApplyInfo.getCourseSchedules();
+		if(CollectionUtils.isEmpty(courseSchedules)){
+			return;
+		}
+		
 	}
 
 	@Override

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

@@ -654,4 +654,15 @@
         (SELECT sub_class_group_id_ FROM class_group_relation
         WHERE class_group_id_ = #{mixClassGroupId}) AND del_flag_ = 0
     </select>
+    <select id="findClassGroupNamesByClassGroups" resultType="string">
+        SELECT
+            name_
+        FROM
+            class_group
+        WHERE
+            id_ IN
+            <foreach collection="classGroups" open="(" close=")" item="classGroupId" separator=",">
+                #{classGroupId}
+            </foreach>
+    </select>
 </mapper>

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

@@ -223,16 +223,16 @@
                 total_price_ = #{totalPrice},
             </if>
             <if test="giveTeachMode!=null">
-                give_teach_mode_=#{giveTeachMode}
+                give_teach_mode_=#{giveTeachMode},
             </if>
             <if test="organId!=null">
-                organ_id_=#{organId}
+                organ_id_=#{organId},
             </if>
             <if test="stopReason!=null">
-                stop_reason_=#{stopReason}
+                stop_reason_=#{stopReason},
             </if>
             <if test="auditStatus">
-                audit_status_=#{auditStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+                audit_status_=#{auditStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>
         </set>
         WHERE id_ = #{id}

+ 11 - 18
mec-student/src/main/java/com/ym/mec/student/controller/StudentCourseScheduleController.java

@@ -1,20 +1,5 @@
 package com.ym.mec.student.controller;
 
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiModelProperty;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-
-import java.util.Date;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-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.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
@@ -22,6 +7,14 @@ import com.ym.mec.biz.dal.page.StudentCourseScheduleRecordQueryInfo;
 import com.ym.mec.biz.service.CourseScheduleService;
 import com.ym.mec.biz.service.StudentAttendanceService;
 import com.ym.mec.common.controller.BaseController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
 
 /**
  * @Author Joburgess
@@ -60,16 +53,16 @@ public class StudentCourseScheduleController extends BaseController {
 		return succeed(scheduleService.findStudentCourseScheduleRecords(queryInfo));
 	}
 
-	@ApiModelProperty(value = "课程投诉")
+	@ApiOperation(value = "课程投诉")
 	@PostMapping("/courseScheduleCommplaint")
 	public Object courseScheduleCommplaint(CourseScheduleComplaints courseScheduleComplaints) {
 		scheduleService.courseScheduleCommplaint(courseScheduleComplaints);
 		return succeed();
 	}
 
-	@ApiModelProperty(value = "请假")
+	@ApiOperation(value = "请假")
 	@PostMapping("/leave")
-	public Object leave(long courseScheduleId, String reason) {
+	public Object leave(Long courseScheduleId, String reason) {
 		SysUser user = sysUserFeignService.queryUserInfo();
 		if (user == null) {
 			return failed(HttpStatus.FORBIDDEN, "请登录");

+ 1 - 1
mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherCourseScheduleController.java

@@ -110,7 +110,7 @@ public class TeacherCourseScheduleController extends BaseController {
     }
 
     @ApiOperation(value = "课时交换")
-    @GetMapping(value = "/courseSwap",consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+    @PostMapping(value = "/courseSwap",consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
     public Object courseSwap(Long courseScheduleId1,Long courseScheduleId2){
         if(Objects.isNull(courseScheduleId1)||Objects.isNull(courseScheduleId2)){
             return failed(HttpStatus.FORBIDDEN, "请指定课程!");