Browse Source

1、课表organ_id_字段初始化;
2、课表列表去除团体名和班级名,搜索更改为按团体编号/课程编号/课程名搜索
3、修复对外课程无部门编号
4、节假日获取方式调整
5、线上乐团课创建

Joe 5 years ago
parent
commit
e0b6f242f3

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

@@ -1586,6 +1586,10 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                     //线上小班课
                     if(classGroup4MixDto.getCourseType().equals(CourseSchedule.CourseScheduleType.HIGH_ONLINE)){
                         Integer studentNum = classGroupStudentMapperDao.countClassGroupNormalStudentNum(classGroupTeacherMapper.getClassGroupId());
+                        if (studentNum < 3 || studentNum > 5) {
+                            String numWaring = studentNum < 3 ? "人数不能小于3," : "人数不能大于5,";
+                            throw new BizException(classGroup.getName() + numWaring + "请调整");
+                        }
                         salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum.toString());
                     }
 
@@ -1876,6 +1880,10 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                     //线上小班课
                     if(classGroup4MixDto.getCourseType().equals(CourseSchedule.CourseScheduleType.HIGH_ONLINE)){
                         Integer studentNum = classGroupStudentMapperDao.countClassGroupNormalStudentNum(classGroupTeacherMapper.getClassGroupId());
+                        if (studentNum < 3 || studentNum > 5) {
+                            String numWaring = studentNum < 3 ? "人数不能小于3," : "人数不能大于5,";
+                            throw new BizException(classGroup.getName() + numWaring + "请调整");
+                        }
                         salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum.toString());
                     }
 
@@ -2138,6 +2146,10 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                     //线上小班课
                     if(classGroup4MixDto.getCourseType().equals(CourseSchedule.CourseScheduleType.HIGH_ONLINE)){
                         Integer studentNum = classGroupStudentMapperDao.countClassGroupNormalStudentNum(classGroupTeacherMapper.getClassGroupId());
+                        if (studentNum < 3 || studentNum > 5) {
+                            String numWaring = studentNum < 3 ? "人数不能小于3," : "人数不能大于5,";
+                            throw new BizException(classGroup.getName() + numWaring + "请调整");
+                        }
                         salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum.toString());
                     }
 

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupTeacherMapperServiceImpl.java

@@ -358,6 +358,11 @@ public class ClassGroupTeacherMapperServiceImpl extends BaseServiceImpl<Long, Cl
                 //线上小班课
                 if (classGroupNoStartCourseSchedule.getType().equals(CourseSchedule.CourseScheduleType.HIGH_ONLINE)) {
                     Integer studentNum = classGroupStudentMapperDao.countClassGroupNormalStudentNum(classGroupTeacherMapper.getClassGroupId());
+                    if (studentNum < 3 || studentNum > 5) {
+                        ClassGroup classGroup = classGroupService.get(classGroupTeacherMapper.getClassGroupId());
+                        String numWaring = studentNum < 3 ? "人数不能小于3," : "人数不能大于5,";
+                        throw new BizException(classGroup.getName() + numWaring + "请调整");
+                    }
                     salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum.toString());
                 }
 
@@ -565,6 +570,11 @@ public class ClassGroupTeacherMapperServiceImpl extends BaseServiceImpl<Long, Cl
         //线上小班课
         if (courseSchedule.getType().equals(CourseSchedule.CourseScheduleType.HIGH_ONLINE)) {
             Integer studentNum = classGroupStudentMapperDao.countClassGroupNormalStudentNum(courseSchedule.getClassGroupId());
+            if (studentNum < 3 || studentNum > 5) {
+                ClassGroup classGroup = classGroupService.get(courseSchedule.getClassGroupId());
+                String numWaring = studentNum < 3 ? "人数不能小于3," : "人数不能大于5,";
+                throw new BizException(classGroup.getName() + numWaring + "请调整");
+            }
             teacherSalary = JSON.parseObject(teacherDefaultMusicGroupSalaryWithTeacherId.getSalaryRuleJson()).getBigDecimal(studentNum.toString());
         }
 

+ 12 - 1
mec-biz/src/main/resources/config/mybatis/SysUserCoursesAccountDetailMapper.xml

@@ -97,14 +97,25 @@
 	<delete id="delete" >
 		DELETE FROM sys_user_courses_account_detail WHERE id_ = #{id} 
 	</delete>
+
+	<sql id="queryPageCondition">
+		<where>
+			<if test="userId!=null">
+				user_id_=#{userId}
+			</if>
+		</where>
+	</sql>
 	
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="SysUserCoursesAccountDetail" parameterType="map">
-		SELECT * FROM sys_user_courses_account_detail ORDER BY id_ <include refid="global.limit"/>
+		SELECT * FROM sys_user_courses_account_detail
+		<include refid="queryPageCondition" />
+		ORDER BY id_ <include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM sys_user_courses_account_detail
+		<include refid="queryPageCondition" />
 	</select>
 </mapper>

+ 33 - 0
mec-web/src/main/java/com/ym/mec/web/controller/SysUserCoursesAccountDetailController.java

@@ -0,0 +1,33 @@
+package com.ym.mec.web.controller;
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dto.CashAccountDetail;
+import com.ym.mec.biz.service.SysUserCoursesAccountDetailService;
+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.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RequestMapping("userCoursesAccount")
+@Api(tags = "用户课程余额服务")
+@RestController
+public class SysUserCoursesAccountDetailController extends BaseController {
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private SysUserCoursesAccountDetailService sysUserCoursesAccountDetailService;
+
+    @ApiOperation(value = "分页查询用户交易明细")
+    @GetMapping("userCashAccountDetail/queryPage")
+    public Object queryPage(CashAccountDetail queryInfo) {
+        SysUser user = sysUserFeignService.queryUserInfo();
+        if(user == null || user.getId() != null){
+            return failed("请重新登录");
+        }
+        return succeed(sysUserCoursesAccountDetailService.queryPage(queryInfo));
+    }
+}