瀏覽代碼

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

zouxuan 5 年之前
父節點
當前提交
f193bd89a4
共有 16 個文件被更改,包括 185 次插入95 次删除
  1. 9 4
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleEvaluateDao.java
  2. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ExtracurricularExercisesMessageDao.java
  3. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ExtraExerciseStudentsDto.java
  4. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ExtracurricularExercisesReply.java
  5. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentCourseHomework.java
  6. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/ExtraExercilseReplyQueryInfo.java
  7. 1 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseReviewServiceImpl.java
  8. 17 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesMessageServiceImpl.java
  9. 23 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesReplyServiceImpl.java
  10. 1 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesServiceImpl.java
  11. 9 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentCourseHomeworkServiceImpl.java
  12. 49 32
      mec-biz/src/main/resources/config/mybatis/CourseScheduleEvaluateMapper.xml
  13. 6 0
      mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesMessageMapper.xml
  14. 11 5
      mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesReplyMapper.xml
  15. 8 4
      mec-biz/src/main/resources/config/mybatis/StudentCourseHomeworkMapper.xml
  16. 8 46
      mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java

+ 9 - 4
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleEvaluateDao.java

@@ -119,10 +119,9 @@ public interface CourseScheduleEvaluateDao extends BaseDAO<Long, CourseScheduleE
     /**
      * 网管课体验人数
      *
-     * @param studentIds
      * @return
      */
-    List<Practice4OrganDto> getPracticeTryNums(@Param("studentIds") int[] studentIds);
+    List<Practice4OrganDto> getPracticeTryNums();
 
     /**
      * vip课体验人数
@@ -135,10 +134,9 @@ public interface CourseScheduleEvaluateDao extends BaseDAO<Long, CourseScheduleE
      * 网管课转化人数
      *
      * @param classDate
-     * @param studentIds
      * @return
      */
-    List<Practice4OrganDto> getPracticeBuyNums(@Param("classDate") Date classDate, @Param("endDate") Date endDate, @Param("studentIds") int[] studentIds);
+    List<Practice4OrganDto> getPracticeBuyNums(@Param("classDate") Date classDate, @Param("endDate") Date endDate);
 
     /**
      * VIP课转化人数
@@ -150,9 +148,16 @@ public interface CourseScheduleEvaluateDao extends BaseDAO<Long, CourseScheduleE
 
     /**
      * 网管课和vip课同事存在的人数
+     *
      * @param classDate
      * @param endDate
      * @return
      */
     List<Practice4OrganDto> getPracticeAndVipNums(@Param("classDate") Date classDate, @Param("endDate") Date endDate);
+
+    /**
+     * 禁止中vip和网管同时存在人数
+     * @return
+     */
+    List<Practice4OrganDto> getPracticeAndVipTryNums();
 }

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ExtracurricularExercisesMessageDao.java

@@ -3,6 +3,7 @@ package com.ym.mec.biz.dal.dao;
 import com.ym.mec.biz.dal.dto.StudentCourseHomeworkCommentDto;
 import com.ym.mec.biz.dal.entity.ExtracurricularExercisesMessage;
 import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 import java.util.Map;
@@ -12,4 +13,6 @@ public interface ExtracurricularExercisesMessageDao extends BaseDAO<Long, Extrac
     int countStudentExtraComments(Map<String, Object> params);
     List<StudentCourseHomeworkCommentDto> findStudentExtraComments(Map<String, Object> params);
 
+    List<ExtracurricularExercisesMessage> findReplyTeacherMessages(@Param("replyIds") List<Long> replyIds);
+
 }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ExtraExerciseStudentsDto.java

@@ -22,10 +22,20 @@ public class ExtraExerciseStudentsDto extends ExtracurricularExercisesReply {
 
     private java.util.Date expireDate;
 
+    private Integer repliedTimely;
+
     private String statusStr;
     private String isRepliedStr;
     private String isViewStr;
 
+    public Integer getRepliedTimely() {
+        return repliedTimely;
+    }
+
+    public void setRepliedTimely(Integer repliedTimely) {
+        this.repliedTimely = repliedTimely;
+    }
+
     public String getStatusStr() {
         return statusStr;
     }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ExtracurricularExercisesReply.java

@@ -41,6 +41,8 @@ public class ExtracurricularExercisesReply {
 	
 	/** 是否回复 */
 	private Integer isReplied;
+
+	private Integer isRepliedTimely;
 	
 	/** 是否已查看 */
 	private Integer isView;
@@ -49,6 +51,14 @@ public class ExtracurricularExercisesReply {
 
 	private Date submitTime;
 
+	public Integer getIsRepliedTimely() {
+		return isRepliedTimely;
+	}
+
+	public void setIsRepliedTimely(Integer isRepliedTimely) {
+		this.isRepliedTimely = isRepliedTimely;
+	}
+
 	public Date getSubmitTime() {
 		return submitTime;
 	}

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentCourseHomework.java

@@ -84,9 +84,19 @@ public class StudentCourseHomework {
 	@ApiModelProperty(value = "是否已经回复",required = false)
 	private YesOrNoEnum isReplied;
 
+	private Integer isRepliedTimely;
+
 	@ApiModelProperty(value = "是否已查看")
 	private YesOrNoEnum isView;
 
+	public Integer getIsRepliedTimely() {
+		return isRepliedTimely;
+	}
+
+	public void setIsRepliedTimely(Integer isRepliedTimely) {
+		this.isRepliedTimely = isRepliedTimely;
+	}
+
 	public String getPhone() {
 		return phone;
 	}

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/ExtraExercilseReplyQueryInfo.java

@@ -23,6 +23,8 @@ public class ExtraExercilseReplyQueryInfo extends QueryInfo {
 	
 	/** 是否回复 */
 	private Integer isReplied;
+
+	private Integer isRepliedTimely;
 	
 	/** 是否已查看 */
 	private Integer isView;
@@ -37,6 +39,14 @@ public class ExtraExercilseReplyQueryInfo extends QueryInfo {
 
 	private Date expireEndDate;
 
+	public Integer getIsRepliedTimely() {
+		return isRepliedTimely;
+	}
+
+	public void setIsRepliedTimely(Integer isRepliedTimely) {
+		this.isRepliedTimely = isRepliedTimely;
+	}
+
 	public Date getExpireStartDate() {
 		return expireStartDate;
 	}

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

@@ -231,6 +231,7 @@ public class CourseReviewServiceImpl extends BaseServiceImpl<Integer, CourseSche
                         studentCourseHomework.setStatus(YesOrNoEnum.NO);
                         studentCourseHomework.setIsView(YesOrNoEnum.NO);
                         studentCourseHomework.setIsReplied(YesOrNoEnum.NO);
+                        studentCourseHomework.setIsRepliedTimely(0);
                         studentCourseHomeworkDao.insert(studentCourseHomework);
                     }else{
                         studentCourseHomework = studentCourseHomeworkDao.findByStudentAndCourseHomewok(existHomework.getId(), courseScheduleStudentPayment.getUserId());

+ 17 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesMessageServiceImpl.java

@@ -21,6 +21,7 @@ import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.collection.MapUtil;
+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;
@@ -63,9 +64,22 @@ public class ExtracurricularExercisesMessageServiceImpl extends BaseServiceImpl<
 		}
 		ExtracurricularExercises extracurricularExercises = extracurricularExercisesDao.get(extracurricularExercisesReply.getExtracurricularExercisesId());
 		if("TEACHER".equals(extracurricularExercisesMessage.getRole())){
-			if(extracurricularExercisesReply.getIsReplied()==0&&Objects.nonNull(extracurricularExercisesReply.getAttachments())){
-				extracurricularExercisesReply.setIsReplied(1);
-				extracurricularExercisesReplyDao.update(extracurricularExercisesReply);
+			if(Objects.nonNull(extracurricularExercisesReply.getAttachments())){
+				boolean change=false;
+				if(extracurricularExercisesReply.getIsRepliedTimely()!=Integer.valueOf(1)&&Objects.nonNull(extracurricularExercisesReply.getSubmitTime())){
+					int hours = DateUtil.hoursBetween(extracurricularExercisesReply.getSubmitTime(), new Date());
+					if(hours>=0&&hours<=12){
+						extracurricularExercisesReply.setIsRepliedTimely(1);
+						change=true;
+					}
+				}
+				if(extracurricularExercisesReply.getIsReplied()==0){
+					extracurricularExercisesReply.setIsReplied(1);
+					change=true;
+				}
+				if(change){
+					extracurricularExercisesReplyDao.update(extracurricularExercisesReply);
+				}
 			}
 
 			Map<Integer, String> userMap = new HashMap<>();

+ 23 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesReplyServiceImpl.java

@@ -40,6 +40,8 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
 	@Autowired
 	private ExtracurricularExercisesDao extracurricularExercisesDao;
 	@Autowired
+	private ExtracurricularExercisesMessageDao extracurricularExercisesMessageDao;
+	@Autowired
 	private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
 	@Autowired
 	private StudentExtracurricularExercisesSituationDao studentExtracurricularExercisesSituationDao;
@@ -168,11 +170,32 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
 			pageInfo.setTotal(count);
 			params.put("offset", pageInfo.getOffset());
 			dataList = extracurricularExercisesReplyDao.findExtraExercises(params);
+			List<Long> replyIds = dataList.stream().map(ExtraExerciseStudentsDto::getId).collect(Collectors.toList());
 			List<Integer> teacherIds = dataList.stream().map(ExtraExerciseStudentsDto::getTeacherId).collect(Collectors.toList());
 			List<SimpleUserDto> teachers = teacherDao.findSimpleTeachers(teacherIds);
 			Map<Integer, String> idNameMap = teachers.stream().collect(Collectors.toMap(SimpleUserDto::getUserId, SimpleUserDto::getUserName));
+			List<ExtracurricularExercisesMessage> replyTeacherMessages = extracurricularExercisesMessageDao.findReplyTeacherMessages(replyIds);
+			Map<Long, List<ExtracurricularExercisesMessage>> replyMessagesMap = replyTeacherMessages.stream().collect(Collectors.groupingBy(ExtracurricularExercisesMessage::getExtracurricularExercisesReplyId));
+			if(Objects.isNull(replyMessagesMap)){
+				replyMessagesMap=new HashMap<>();
+			}
 			for (ExtraExerciseStudentsDto extraExerciseStudentsDto : dataList) {
 				extraExerciseStudentsDto.setTeacherName(idNameMap.get(extraExerciseStudentsDto.getTeacherId()));
+				extraExerciseStudentsDto.setRepliedTimely(0);
+				List<ExtracurricularExercisesMessage> replyMessages = replyMessagesMap.get(extraExerciseStudentsDto.getId());
+				if(CollectionUtils.isEmpty(replyMessages)){
+					continue;
+				}
+				for (ExtracurricularExercisesMessage replyMessage : replyMessages) {
+					if(replyMessage.getCreateTime().before(extraExerciseStudentsDto.getSubmitTime())){
+						continue;
+					}
+					int h = DateUtil.hoursBetween(extraExerciseStudentsDto.getSubmitTime(), replyMessage.getCreateTime());
+					if(h<=12){
+						extraExerciseStudentsDto.setRepliedTimely(1);
+					}
+					break;
+				}
 			}
 		}
 		if (count == 0) {

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

@@ -75,6 +75,7 @@ public class ExtracurricularExercisesServiceImpl extends BaseServiceImpl<Long, E
 			studentExtraExercise.setStatus(0);
 			studentExtraExercise.setIsReplied(0);
 			studentExtraExercise.setIsView(0);
+			studentExtraExercise.setIsRepliedTimely(0);
 			extracurricularExercisesReplyDao.insert(studentExtraExercise);
 
 			String notifyUrl = "3?courseScheduleID=" + studentExtraExercise.getId() + "&studentCourseHomeworkId=" + studentExtraExercise.getId() + "&extra=1";

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

@@ -148,9 +148,17 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
         if (Objects.isNull(byStudentAndCourseHomewok)) {
             throw new BizException("作业记录不存在");
         }
-        if (byStudentAndCourseHomewok.getIsReplied() == YesOrNoEnum.YES) {
+
+        int hours = -1;
+        if(Objects.nonNull(byStudentAndCourseHomewok.getSubmitTime())){
+            hours = DateUtil.hoursBetween(byStudentAndCourseHomewok.getSubmitTime(), new Date());
+        }
+        if (byStudentAndCourseHomewok.getIsReplied() == YesOrNoEnum.YES && byStudentAndCourseHomewok.getIsRepliedTimely() == Integer.valueOf(1)) {
             return true;
         }
+        if(hours>=0&&hours<=12){
+            byStudentAndCourseHomewok.setIsRepliedTimely(1);
+        }
         CourseHomework byTeacherAndCourseHomewok = courseHomeworkDao.findByTeacherAndCourseHomewok(courseHomeworkId, teacherId);
         if (Objects.nonNull(byTeacherAndCourseHomewok)) {
             byStudentAndCourseHomewok.setIsReplied(YesOrNoEnum.YES);

+ 49 - 32
mec-biz/src/main/resources/config/mybatis/CourseScheduleEvaluateMapper.xml

@@ -331,45 +331,54 @@
     <select id="getPracticeTryNums" resultMap="practice4Organ">
         SELECT pg.organ_id_, count(distinct pg.student_id_) try_num_
         FROM practice_group pg
-        LEFT JOIN student s ON s.user_id_ = pg.student_id_
+                 LEFT JOIN student s ON s.user_id_ = pg.student_id_
         WHERE pg.group_status_ IN ('NORMAL', 'FINISH')
-        <if test="studentIds != null">
-            AND pg.student_id_ IN
-            <foreach collection="studentIds" item="studentId" open="(" separator="," close=")">
-                #{studentId}
-            </foreach>
-        </if>
-        AND pg.buy_months_ >=1
-        AND s.operating_tag_ = 0
+          AND pg.buy_months_ >= 1
+          AND s.operating_tag_ = 0
         GROUP BY pg.organ_id_
     </select>
 
     <!-- vip体验人数(禁止的) -->
     <select id="getVipTryNums" resultMap="practice4Organ">
-        SELECT vg.organ_id_, COUNT(DISTINCT cssp.user_id_) try_num_, GROUP_CONCAT(distinct cssp.user_id_) student_ids_
+        SELECT vg.organ_id_, COUNT(DISTINCT cssp.user_id_) try_num_
         FROM course_schedule_student_payment cssp
                  LEFT JOIN vip_group vg ON cssp.music_group_id_ = vg.id_ AND cssp.group_type_ = 'VIP'
                  LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_ AND cs.teach_mode_ = 'ONLINE'
                  LEFT JOIN student s ON s.user_id_ = cssp.user_id_
-        WHERE vg.organ_id_ >= 1
-          AND s.operating_tag_ = 0
+        WHERE cs.id_ >= 1
+          AND vg.id_ >= 1
           AND (cs.is_lock_ IS NULL OR cs.is_lock_ = 0)
-          AND cs.teach_mode_ = 'ONLINE'
+          AND s.operating_tag_ = 0
         GROUP BY vg.organ_id_
     </select>
 
+    <select id="getPracticeAndVipTryNums" resultMap="practice4Organ">
+        SELECT pg.organ_id_, COUNT(DISTINCT pg.student_id_) try_num_
+        FROM practice_group pg
+                 LEFT JOIN course_schedule_student_payment cssp
+                           ON cssp.user_id_ = pg.student_id_ AND cssp.group_type_ = 'VIP'
+                 LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_ AND cs.teach_mode_ = 'ONLINE'
+                 LEFT JOIN student s ON s.user_id_ = cssp.user_id_
+        WHERE pg.group_status_ IN ('NORMAL', 'FINISH')
+          AND pg.buy_months_ >= 1
+          AND cs.id_ >= 1
+          AND (cs.is_lock_ IS NULL OR cs.is_lock_ = 0)
+          AND s.operating_tag_ = 0
+        GROUP BY pg.organ_id_
+    </select>
+
     <select id="getVipBuyNums" resultMap="practice4Organ">
-        SELECT vg.organ_id_, COUNT(DISTINCT cssp.user_id_) vip_num_, GROUP_CONCAT(DISTINCT cssp.user_id_) student_ids_
+        SELECT vg.organ_id_, COUNT(DISTINCT cssp.user_id_) vip_num_
         FROM course_schedule_student_payment cssp
         LEFT JOIN vip_group vg ON cssp.music_group_id_ = vg.id_ AND cssp.group_type_ = 'VIP'
         LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_ AND cs.teach_mode_ = 'ONLINE'
-        WHERE vg.organ_id_ >= 1
+        WHERE vg.id_ >= 1
+        AND cs.id_ >=1
         AND CONCAT(cs.class_date_, ' ', cs.end_class_time_) >= #{classDate}
         <if test="endDate != null">
             <![CDATA[AND CONCAT(cs.class_date_, ' ', cs.end_class_time_) < #{endDate}]]>
         </if>
         AND (cs.is_lock_ IS NULL OR cs.is_lock_=0)
-        AND cs.teach_mode_ = 'ONLINE'
         GROUP BY vg.organ_id_
     </select>
 
@@ -378,30 +387,38 @@
         FROM course_schedule_student_payment cssp
         LEFT JOIN practice_group pg ON cssp.music_group_id_ = pg.id_ AND cssp.group_type_ = 'PRACTICE'
         LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_
-        WHERE pg.organ_id_ >= 1
+        WHERE pg.id_ >= 1
+        AND pg.group_status_ IN ('NORMAL', 'FINISH')
+        AND cs.id_ >=1
+        AND (cs.is_lock_ IS NULL OR cs.is_lock_=0)
         AND CONCAT(cs.class_date_, ' ', cs.end_class_time_) >= #{classDate}
         <if test="endDate != null">
             <![CDATA[AND CONCAT(cs.class_date_, ' ', cs.end_class_time_) < #{endDate}]]>
         </if>
-        <if test="studentIds != null">
-            AND cssp.user_id_ IN
-            <foreach collection="studentIds" item="studentId" open="(" separator="," close=")">
-                #{studentId}
-            </foreach>
-        </if>
         AND pg.buy_months_ >= 1
-        AND (cs.is_lock_ IS NULL OR cs.is_lock_=0)
         GROUP BY pg.organ_id_
     </select>
 
     <select id="getPracticeAndVipNums" resultMap="practice4Organ">
-        SELECT pg.organ_id_, COUNT(DISTINCT cssp.user_id_) practice_num_
-        FROM course_schedule_student_payment cssp
-                 LEFT JOIN course_schedule_student_payment cssp2
-                           ON cssp.user_id_ = cssp2.user_id_ AND cssp2.group_type_ = 'VIP'
-                 LEFT JOIN practice_group pg ON cssp.music_group_id_ = pg.id_ AND cssp.group_type_ = 'PRACTICE'
-                 LEFT JOIN course_schedule cs ON cs.id_ = cssp2.course_schedule_id_ AND cs.teach_mode_ = 'ONLINE'
-        WHERE cssp.group_type_ = 'PRACTICE'
-        GROUP by pg.organ_id_
+        SELECT pg.organ_id_,COUNT(DISTINCT pg.student_id_) practice_num_
+        FROM practice_group pg
+        LEFT JOIN course_schedule_student_payment vcssp ON vcssp.user_id_ = pg.student_id_ AND vcssp.group_type_='VIP'
+        LEFT JOIN course_schedule_student_payment pcssp ON pcssp.user_id_ = pg.student_id_ AND
+        pcssp.group_type_='PRACTICE'
+        LEFT JOIN course_schedule vcs ON vcs.id_=vcssp.course_schedule_id_ AND vcs.teach_mode_='ONLINE'
+        LEFT JOIN course_schedule pcs ON pcs.id_=pcssp.course_schedule_id_
+        WHERE pg.group_status_ IN ('NORMAL', 'FINISH')
+        AND vcs.id_ >=1
+        AND pcs.id_ >= 1
+        AND (vcs.is_lock_ IS NULL OR vcs.is_lock_=0)
+        AND (pcs.is_lock_ IS NULL OR pcs.is_lock_=0)
+        AND CONCAT(vcs.class_date_, ' ', vcs.end_class_time_) >= #{classDate}
+        AND CONCAT(pcs.class_date_, ' ', pcs.end_class_time_) >= #{classDate}
+        <if test="endDate != null">
+            <![CDATA[AND CONCAT(vcs.class_date_, ' ', vcs.end_class_time_) < #{endDate}
+            AND CONCAT(pcs.class_date_, ' ', pcs.end_class_time_) < #{endDate}]]>
+        </if>
+        AND pg.buy_months_ >= 1
+        GROUP BY pg.organ_id_
     </select>
 </mapper>

+ 6 - 0
mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesMessageMapper.xml

@@ -114,4 +114,10 @@
 		ORDER BY eem.id_ DESC
 		<include refid="global.limit"/>
 	</select>
+    <select id="findReplyTeacherMessages" resultMap="ExtracurricularExercisesMessage">
+		SELECT * FROM extracurricular_exercises_message WHERE role_='TEACHER' AND extracurricular_exercises_reply_id_ IN
+		<foreach collection="replyIds" item="replyId" open="(" close=")" separator=",">
+			#{replyId}
+		</foreach>
+	</select>
 </mapper>

+ 11 - 5
mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesReplyMapper.xml

@@ -18,6 +18,7 @@
 		<result column="remark_" property="remark" />
 		<result column="status_" property="status" />
 		<result column="is_replied_" property="isReplied" />
+		<result column="is_replied_timely_" property="isRepliedTimely" />
 		<result column="is_view_" property="isView" />
 		<result column="organ_name_" property="organName" />
 		<result column="submit_time_" property="submitTime" />
@@ -87,16 +88,15 @@
 		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
 		</selectKey>
 		-->
-		INSERT INTO extracurricular_exercises_reply (extracurricular_exercises_id_,user_id_,attachments_,create_time_,update_time_,remark_,status_,is_replied_,is_view_)
-		VALUES(#{extracurricularExercisesId},#{userId},#{attachments},NOW(),NOW(),#{remark},#{status},#{isReplied},#{isView})
+		INSERT INTO extracurricular_exercises_reply (extracurricular_exercises_id_,user_id_,attachments_,create_time_,update_time_,remark_,status_,is_replied_,is_view_,is_replied_timely_)
+		VALUES(#{extracurricularExercisesId},#{userId},#{attachments},NOW(),NOW(),#{remark},#{status},#{isReplied},#{isView},#{isRepliedTimely})
 	</insert>
 
-	<!-- 向数据库增加一条记录 -->
 	<insert id="batchInsert" parameterType="com.ym.mec.biz.dal.entity.ExtracurricularExercisesReply" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO extracurricular_exercises_reply (extracurricular_exercises_id_,user_id_,attachments_,create_time_,update_time_,remark_,status_,is_replied_,is_view_)
+		INSERT INTO extracurricular_exercises_reply (extracurricular_exercises_id_,user_id_,attachments_,create_time_,update_time_,remark_,status_,is_replied_,is_view_,is_replied_timely_)
 		VALUES
 		<foreach collection="replies" item="reply" separator=",">
-			(#{reply.extracurricularExercisesId},#{reply.userId},#{reply.attachments},NOW(),NOW(),#{reply.remark},#{reply.status},#{reply.isReplied},#{reply.isView})
+			(#{reply.extracurricularExercisesId},#{reply.userId},#{reply.attachments},NOW(),NOW(),#{reply.remark},#{reply.status},#{reply.isReplied},#{reply.isView},#{reply.isRepliedTimely})
 		</foreach>
 	</insert>
 
@@ -122,6 +122,9 @@
 			<if test="isReplied != null">
 			is_replied_ = #{isReplied},
 			</if>
+			<if test="isRepliedTimely != null">
+				is_replied_timely_ = #{isRepliedTimely},
+			</if>
 			<if test="extracurricularExercisesId != null">
 			extracurricular_exercises_id_ = #{extracurricularExercisesId},
 			</if>
@@ -273,6 +276,9 @@
 			<if test="expireStartDate != null and expireEndDate != null">
 				AND DATE_FORMAT(ee.expire_date_,"%Y%m%d") BETWEEN DATE_FORMAT(#{expireStartDate},"%Y%m%d") AND DATE_FORMAT(#{expireEndDate},"%Y%m%d")
 			</if>
+			<if test="isRepliedTimely!=null">
+				AND eer.is_replied_timely_=#{isRepliedTimely}
+			</if>
 		</where>
 	</sql>
 

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

@@ -21,6 +21,7 @@
         <result column="remark_" property="remark"/>
         <result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="is_replied_" property="isReplied" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="is_replied_timely_" property="isRepliedTimely" />
         <result column="is_view_" property="isView" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="submit_time_" property="submitTime"/>
     </resultMap>
@@ -66,17 +67,17 @@
         </selectKey>
         -->
         INSERT INTO student_course_homework
-        (user_id_,course_schedule_id_,course_homework_id_,attachments_,score_,create_time_,update_time_,remark_,status_,is_replied_,is_view_)
-        VALUES(#{userId},#{courseScheduleId},#{courseHomeworkId},#{attachments},#{score},now(),now(),#{remark},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{isReplied,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{isView,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
+        (user_id_,course_schedule_id_,course_homework_id_,attachments_,score_,create_time_,update_time_,remark_,status_,is_replied_,is_view_,is_replied_timely_)
+        VALUES(#{userId},#{courseScheduleId},#{courseHomeworkId},#{attachments},#{score},now(),now(),#{remark},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{isReplied,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{isView,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{isRepliedTimely})
     </insert>
 
     <insert id="batchInsertStudentCourseHomeworkRecord" parameterType="java.util.List" useGeneratedKeys="true"
             keyColumn="id_">
         INSERT INTO student_course_homework
-        (user_id_,course_schedule_id_,course_homework_id_,attachments_,score_,create_time_,update_time_,remark_,status_,is_replied_,is_view_)
+        (user_id_,course_schedule_id_,course_homework_id_,attachments_,score_,create_time_,update_time_,remark_,status_,is_replied_,is_view_,is_replied_timely_)
         VALUE
         <foreach collection="list" item="homework" separator=",">
-            (#{homework.userId},#{homework.courseScheduleId},#{homework.courseHomeworkId},#{homework.attachments},#{homework.score},now(),now(),#{homework.remark},#{homework.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{homework.isReplied,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{homework.isView,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
+            (#{homework.userId},#{homework.courseScheduleId},#{homework.courseHomeworkId},#{homework.attachments},#{homework.score},now(),now(),#{homework.remark},#{homework.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{homework.isReplied,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{homework.isView,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{homework.isRepliedTimely})
         </foreach>
     </insert>
 
@@ -112,6 +113,9 @@
             <if test="isReplied != null">
                 is_replied_ = #{isReplied,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>
+            <if test="isRepliedTimely != null">
+                is_replied_timely_ = #{isRepliedTimely},
+            </if>
             <if test="isView != null">
                 is_view_ = #{isView,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>

+ 8 - 46
mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java

@@ -497,31 +497,13 @@ public class StudentOrderController extends BaseController {
         List<Organization> organs = organizationDao.findAllOrgans();
         //除去禁止的体验人数
         List<Practice4OrganDto> organTryNums = courseScheduleEvaluateDao.getTryNums();
-        List<Practice4OrganDto> organPracticeTryNums = courseScheduleEvaluateDao.getPracticeTryNums(null);
+        List<Practice4OrganDto> organPracticeTryNums = courseScheduleEvaluateDao.getPracticeTryNums();
         List<Practice4OrganDto> organVipTryNums = courseScheduleEvaluateDao.getVipTryNums();
-        String studentIds = organVipTryNums.stream().map(Practice4OrganDto::getStudentIds).collect(Collectors.joining(","));
-        List<Practice4OrganDto> organPracticeAndVipTryNums = new ArrayList<>();
-        if(!studentIds.isEmpty()) {
-            String[] studentIdsArr = studentIds.split(",");
-            int[] userIds = new int[studentIdsArr.length];
-            for (int i = 0; i < studentIdsArr.length; i++) {
-                userIds[i] = Integer.parseInt(studentIdsArr[i]);
-            }
-            organPracticeAndVipTryNums = courseScheduleEvaluateDao.getPracticeTryNums(userIds);
-        }
-        List<Practice4OrganDto> practiceBuyNums = courseScheduleEvaluateDao.getPracticeBuyNums(nowDate, null, null);
+        List<Practice4OrganDto> organPracticeAndVipTryNums = courseScheduleEvaluateDao.getPracticeAndVipTryNums();
+        List<Practice4OrganDto> practiceBuyNums = courseScheduleEvaluateDao.getPracticeBuyNums(nowDate, null);
         List<Practice4OrganDto> vipBuyNums = courseScheduleEvaluateDao.getVipBuyNums(nowDate, null);
 
-        List<Practice4OrganDto> practiceAndVipBuyNums = new ArrayList<>();
-        studentIds = vipBuyNums.stream().filter(practice4OrganDto -> practice4OrganDto.getOrganId() != null).map(Practice4OrganDto::getStudentIds).collect(Collectors.joining(","));
-        if (!studentIds.isEmpty()) {
-            String[] studentIdsArr = studentIds.split(",");
-            int[] userIds = new int[studentIdsArr.length];
-            for (int i = 0; i < studentIdsArr.length; i++) {
-                userIds[i] = Integer.parseInt(studentIdsArr[i]);
-            }
-            practiceAndVipBuyNums = courseScheduleEvaluateDao.getPracticeBuyNums(nowDate, null, userIds);
-        }
+        List<Practice4OrganDto> practiceAndVipBuyNums = courseScheduleEvaluateDao.getPracticeAndVipNums(nowDate, null);
         Date startTime = DateUtil.getFirstDayOfMonth(nowDate);
         Date endTime = DateUtil.addMonths(startTime, 1);
 
@@ -534,35 +516,15 @@ public class StudentOrderController extends BaseController {
         List<PracticeGroupsDto> monthOrganRenewMoneys = courseScheduleEvaluateDao.getMonthOrganMoney(OrderTypeEnum.PRACTICE_GROUP_RENEW, startTime);
 
         //本月总人数
-        List<Practice4OrganDto> nowMonthPracticeBuyNums = courseScheduleEvaluateDao.getPracticeBuyNums(startTime, endTime, null);
+        List<Practice4OrganDto> nowMonthPracticeBuyNums = courseScheduleEvaluateDao.getPracticeBuyNums(startTime, endTime);
         List<Practice4OrganDto> nowMonthVipBuyNums = courseScheduleEvaluateDao.getVipBuyNums(startTime, endTime);
-        List<Practice4OrganDto> nowMonthPracticeAndVipBuyNums = new ArrayList<>();
-
-        studentIds = vipBuyNums.stream().filter(practice4OrganDto -> practice4OrganDto.getOrganId() != null).map(Practice4OrganDto::getStudentIds).collect(Collectors.joining(","));
-        if (!studentIds.isEmpty()) {
-            String[] studentIdsArr = studentIds.split(",");
-            int[] userIds = new int[studentIdsArr.length];
-            for (int i = 0; i < studentIdsArr.length; i++) {
-                userIds[i] = Integer.parseInt(studentIdsArr[i]);
-            }
-            nowMonthPracticeAndVipBuyNums = courseScheduleEvaluateDao.getPracticeBuyNums(startTime, endTime, userIds);
-        }
+        List<Practice4OrganDto> nowMonthPracticeAndVipBuyNums = courseScheduleEvaluateDao.getPracticeAndVipNums(startTime, endTime);
 
         //上月总人数
         Date lastMonthStartTime = DateUtil.addMonths(startTime, -1);
-        List<Practice4OrganDto> lastMonthPracticeBuyNums = courseScheduleEvaluateDao.getPracticeBuyNums(lastMonthStartTime, startTime, null);
+        List<Practice4OrganDto> lastMonthPracticeBuyNums = courseScheduleEvaluateDao.getPracticeBuyNums(lastMonthStartTime, startTime);
         List<Practice4OrganDto> lastMonthVipBuyNums = courseScheduleEvaluateDao.getVipBuyNums(lastMonthStartTime, startTime);
-        List<Practice4OrganDto> lastMonthPracticeAndVipBuyNums = new ArrayList<>();
-
-        studentIds = vipBuyNums.stream().filter(practice4OrganDto -> practice4OrganDto.getOrganId() != null).map(Practice4OrganDto::getStudentIds).collect(Collectors.joining(","));
-        if (!studentIds.isEmpty()) {
-            String[] studentIdsArr = studentIds.split(",");
-            int[] userIds = new int[studentIdsArr.length];
-            for (int i = 0; i < studentIdsArr.length; i++) {
-                userIds[i] = Integer.parseInt(studentIdsArr[i]);
-            }
-            lastMonthPracticeAndVipBuyNums = courseScheduleEvaluateDao.getPracticeBuyNums(lastMonthStartTime, startTime, userIds);
-        }
+        List<Practice4OrganDto> lastMonthPracticeAndVipBuyNums = courseScheduleEvaluateDao.getPracticeAndVipNums(lastMonthStartTime, startTime);
 
         List<Practice4OrganDto> practice4Organs = new ArrayList<>();
         for (Organization organ : organs) {