瀏覽代碼

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

zouxuan 5 年之前
父節點
當前提交
25ad2d980c

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

@@ -86,6 +86,9 @@ public class TeacherClassGroupDto {
     @ApiModelProperty(value = "是否已有报告")
     private Boolean hasReport=false;
 
+    @ApiModelProperty(value = "购买月数")
+    private Integer buyMonths;
+
     public Date getCourseStartDate() {
         return courseStartDate;
     }
@@ -285,4 +288,12 @@ public class TeacherClassGroupDto {
     public void setHasReport(Boolean hasReport) {
         this.hasReport = hasReport;
     }
+
+    public Integer getBuyMonths() {
+        return buyMonths;
+    }
+
+    public void setBuyMonths(Integer buyMonths) {
+        this.buyMonths = buyMonths;
+    }
 }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/CourseReviewQueryInfo.java

@@ -50,6 +50,9 @@ public class CourseReviewQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "是否到课",required = false)
     private Integer hasArrived;
 
+    @ApiModelProperty(value = "作业是否回复",required = false)
+    private Integer homeWorkReplied;
+
     public Integer getTeacherId() {
         return teacherId;
     }
@@ -163,4 +166,12 @@ public class CourseReviewQueryInfo extends QueryInfo {
     public void setHasArrived(Integer hasArrived) {
         this.hasArrived = hasArrived;
     }
+
+    public Integer getHomeWorkReplied() {
+        return homeWorkReplied;
+    }
+
+    public void setHomeWorkReplied(Integer homeWorkReplied) {
+        this.homeWorkReplied = homeWorkReplied;
+    }
 }

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

@@ -1078,7 +1078,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                     }else {
                         teacherClassGroupDto.setStudyReportUrl(studyReportUrl + teacherClassGroupDto.getClassGroupId());
                     }
-                }else if(classGroupNoStartClassTimes.intValue()==0 && classGroupTeacherMap.get(teacherClassGroupDto.getClassGroupId().intValue()).equals(user.getId())){
+                }else if(teacherClassGroupDto.getBuyMonths() == null && classGroupNoStartClassTimes.intValue()==0 && classGroupTeacherMap.get(teacherClassGroupDto.getClassGroupId().intValue()).equals(user.getId())){
                    String studyReportUrl = sysConfigDao.findConfigValue(SysConfigService.TEACHER_STUDY_REPORT_URL);
                    teacherClassGroupDto.setStudyReportUrl(studyReportUrl+teacherClassGroupDto.getClassGroupId());
                }

+ 9 - 9
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java

@@ -141,10 +141,10 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
     private static List<String> applyDayTimes = new ArrayList<>();
 
     static {
-        applyStartDay = DateUtil.stringToDate("2020-02-08 00:00:00");
-        activityStartDate = DateUtil.stringToDate("2020-02-09 00:00:00");
-        activityEndDate = DateUtil.stringToDate("2020-03-25 00:00:00");
-        courseExpireDate = DateUtil.stringToDate("2020-04-01 00:00:00");
+        applyStartDay = DateUtil.stringToDate("2020-03-25 00:00:00");
+        activityStartDate = DateUtil.stringToDate("2020-03-25 00:00:00");
+        activityEndDate = DateUtil.stringToDate("2020-05-25 00:00:00");
+        courseExpireDate = DateUtil.stringToDate("2020-06-01 00:00:00");
 
         schoolSubjectTeachersMap = new HashMap<>();
         Map<Integer, List<Integer>> subjectTeachersMap1 = new HashMap<>();
@@ -945,7 +945,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         calendar.set(Calendar.MILLISECOND, 0);
         calendar.add(Calendar.DATE, 1);
         Date applyStartDate = calendar.getTime();
-        Date applyEndDate = DateUtil.stringToDate("2020-03-24", "yyyy-MM-dd");
+        Date applyEndDate = DateUtil.stringToDate("2020-05-24", "yyyy-MM-dd");
         Date firstMonday = DateUtil.getWeekDayWithDate(applyStartDate, Calendar.MONDAY);
         Date secondSunday = DateUtil.getWeekDayWithDate(applyEndDate, Calendar.SUNDAY);
 
@@ -1642,13 +1642,13 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         if (practiceGroup.getFirstCourseTime().before(activityStartDate)
                 || practiceGroup.getFirstCourseTime().after(activityEndDate)) {
             result.put("status", "APPLY_DATE_OVERFLOW");
-            result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-3-31之前),请重试。");
+            result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-5-31之前),请重试。");
             return result;
         }
         if (practiceGroup.getSecondCourseTime().before(activityStartDate)
                 || practiceGroup.getSecondCourseTime().after(activityEndDate)) {
             result.put("status", "APPLY_DATE_OVERFLOW");
-            result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-3-31之前),请重试。");
+            result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-5-31之前),请重试。");
             return result;
         }
         if (DateUtil.isSameDay(practiceGroup.getFirstCourseTime(), practiceGroup.getSecondCourseTime())) {
@@ -1702,13 +1702,13 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         if (allCourseDates.get(2).before(activityStartDate)
                 || allCourseDates.get(2).after(courseExpireDate)) {
             result.put("status", "APPLY_DATE_OVERFLOW");
-            result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-3-31之前),请重试。");
+            result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-5-31之前),请重试。");
             return result;
         }
         if (allCourseDates.get(3).before(activityStartDate)
                 || allCourseDates.get(3).after(courseExpireDate)) {
             result.put("status", "APPLY_DATE_OVERFLOW");
-            result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-3-31之前),请重试。");
+            result.put("info", "预约失败,网管课的时间超出活动时间范围(2020-5-31之前),请重试。");
             return result;
         }
         allCourseDates.sort(Comparator.comparing(Date::getTime));

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java

@@ -201,7 +201,7 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
             musicGroupService.renewForCallback(order);
         } else if (order.getType().equals(OrderTypeEnum.SPORADIC) || order.getType().equals(OrderTypeEnum.LUCK)) {
             sporadicChargeInfoService.renewForCallback(order);
-        } else if (order.getType().equals(OrderTypeEnum.PRACTICE_GROUP_BUY)) {
+        } else if (order.getType().equals(OrderTypeEnum.PRACTICE_GROUP_BUY) || order.getType().equals(OrderTypeEnum.PRACTICE_GROUP_RENEW)) {
             practiceGroupService.orderCallback(order);
         }
     }
@@ -234,7 +234,7 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
                     musicGroupService.renewForCallback(order);
                 } else if (order.getType().equals(OrderTypeEnum.SPORADIC) || order.getType().equals(OrderTypeEnum.LUCK)) {
                     sporadicChargeInfoService.renewForCallback(order);
-                } else if (order.getType().equals(OrderTypeEnum.PRACTICE_GROUP_BUY)) {
+                } else if (order.getType().equals(OrderTypeEnum.PRACTICE_GROUP_BUY) || order.getType().equals(OrderTypeEnum.PRACTICE_GROUP_RENEW)) {
                     practiceGroupService.orderCallback(order);
                 }
             } catch (Exception e) {

+ 3 - 1
mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml

@@ -493,6 +493,7 @@
         <result property="type" column="type_"/>
         <result property="courseStartDate" column="courses_start_date_"/>
         <result property="classMode" column="class_mode_"/>
+        <result property="buyMonths" column="buy_months_"/>
     </resultMap>
 
     <select id="findTeacherMusicClassGroup" resultMap="TeacherClassGroupDto">
@@ -537,7 +538,8 @@
             cg.total_class_times_,
             pg.id_ music_group_id_,
             pg.name_ music_group_name_,
-						1 class_mode_
+						1 class_mode_,
+            pg.buy_months_
         FROM
             practice_group pg
             LEFT JOIN class_group cg ON pg.id_=cg.music_group_id_ AND cg.group_type_='PRACTICE'

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

@@ -183,7 +183,7 @@
 			cg.total_class_times_,
 			cg.current_class_times_,
 			cg.music_group_id_,
-			mg.name_ music_group_name_
+			IF(cs.group_type_='MUSIC',mg.name_,NULL) music_group_name_
 		FROM
 			course_homework ch
 			LEFT JOIN course_schedule cs ON ch.course_schedule_id_=cs.id_

+ 11 - 8
mec-biz/src/main/resources/config/mybatis/CourseScheduleReviewMapper.xml

@@ -219,6 +219,12 @@
             <if test='hasArrived !=null and hasArrived=="0"'>
                 AND sa.id_ IS NULL
             </if>
+            <if test='homeWorkReplied !=null and homeWorkReplied =="1"'>
+                AND sch.is_replied_ > 0
+            </if>
+            <if test='homeWorkReplied !=null and homeWorkReplied =="0"'>
+                AND (sch.is_replied_ = 0 OR sch.is_replied_ IS NULL)
+            </if>
         </where>
     </sql>
 
@@ -228,10 +234,8 @@
         teacher_name_,edsu.real_name_
         edu_teacher_name_,pg.buy_months_,csr.id_ review_id_, csc.score_
         student_review_,csr.hand_homework_,csr.course_review_,pg.student_id_,csr.teaching_material_,csr.pronunciation_,csr.tempo_,
-        csr.music_theory_,csr.song_,csr.memo_,csr.create_time_,csr.has_liaison_,csr.create_time_,csr.update_time_,sa.id_ attendance_id_
-        <if test='isExport !=null and isExport=="1"'>
-            ,sch.is_replied_ home_work_replied_
-        </if>
+        csr.music_theory_,csr.song_,csr.memo_,csr.create_time_,csr.has_liaison_,csr.create_time_,csr.update_time_,sa.id_
+        attendance_id_,sch.is_replied_ home_work_replied_
         FROM course_schedule cs
         LEFT JOIN practice_group pg ON cs.music_group_id_ = pg.id_
         LEFT JOIN sys_user su ON cs.actual_teacher_id_ = su.id_
@@ -239,9 +243,7 @@
         LEFT JOIN course_schedule_review csr on cs.id_ = csr.course_schedule_id_
         LEFT JOIN course_schedule_complaints csc on csc.course_schedule_id_ = cs.id_
         LEFT JOIN student_attendance sa on sa.course_schedule_id_ = cs.id_
-        <if test='isExport !=null and isExport=="1"'>
-            LEFT JOIN student_course_homework sch on cs.id_ = sch.course_schedule_id_
-        </if>
+        LEFT JOIN student_course_homework sch on cs.id_ = sch.course_schedule_id_
         <include refid="practiceGroupReviewsQueryCondition"/>
         ORDER BY cs.class_date_ DESC
         <include refid="global.limit"/>
@@ -253,6 +255,7 @@
         LEFT JOIN course_schedule_review csr on cs.id_ = csr.course_schedule_id_
         LEFT JOIN course_schedule_complaints csc on csc.course_schedule_id_ = cs.id_
         LEFT JOIN student_attendance sa on sa.course_schedule_id_ = cs.id_
+        LEFT JOIN student_course_homework sch on cs.id_ = sch.course_schedule_id_
         <include refid="practiceGroupReviewsQueryCondition"/>
     </select>
 
@@ -338,7 +341,7 @@
         FROM course_schedule
         WHERE class_group_id_ = #{classGroupId}
           AND status_ = 'OVER'
-        ORDER BY class_date_ DESC,start_class_time_ DESC
+        ORDER BY class_date_ DESC, start_class_time_ DESC
     </select>
 
     <select id="findByCourseScheduleId" resultMap="CourseScheduleReview">

+ 2 - 1
mec-biz/src/main/resources/config/mybatis/PracticeGroupMapper.xml

@@ -150,7 +150,8 @@
         FROM practice_group
         WHERE student_id_ = #{userId}
           AND group_status_ = 'NORMAL'
-          AND buy_months_ IS NULL;
+          AND buy_months_ IS NULL
+          AND create_time_ > '2020-01-25'
     </select>
     <select id="countPracticeGroupByOrgan" resultType="java.lang.Integer">
         SELECT count(*) FROM practice_group pg

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

@@ -168,7 +168,7 @@
         SELECT
             sch.id_,
             ch.*,
-            mg.name_ music_group_name_,
+            IF(cs.group_type_='MUSIC',mg.name_,NULL) music_group_name_,
             cg.name_ class_group_name_,
             CONCAT( class_date_, ' ', start_class_time_ ) start_class_time_,
             ch.expiry_date_,

+ 5 - 0
mec-student/src/main/java/com/ym/mec/student/controller/PracticeGroupController.java

@@ -53,6 +53,8 @@ public class PracticeGroupController extends BaseController {
     @Autowired
     private CourseScheduleEvaluateDao courseScheduleEvaluateDao;
 
+    private static final Set<Integer> ENABLE_APPLY_ORGANIDS = new HashSet<>(Arrays.asList(new Integer[]{1, 43, 47}));
+
     @ApiOperation("获取学生的陪练课")
     @GetMapping(value = "/findUserPracticeCourses")
     public Object findUserPracticeCourses(){
@@ -135,6 +137,9 @@ public class PracticeGroupController extends BaseController {
         if(excludeOrganIds.contains(sysUser.getOrganId())){
             throw new BizException("请联系老师确认您的所属分部");
         }
+        if(!ENABLE_APPLY_ORGANIDS.contains(sysUser.getOrganId())){
+            throw new BizException("所在城市暂不参与此活动");
+        }
         practiceGroup.setStudentId(sysUser.getId());
         return succeed(practiceGroupService.practiceApply(practiceGroup));
     }