zouxuan hace 6 días
padre
commit
99bb3e4dfe

+ 0 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CloudTeacherOrderDao.java

@@ -133,8 +133,6 @@ public interface CloudTeacherOrderDao extends BaseDAO<Long, CloudTeacherOrder> {
 
     int countByMemberRankSettingId(@Param("memberRankSettingId") List<Integer> memberRankSettingId);
 
-    Date getActivationMaxTime(@Param("studentId") Integer studentId, @Param("level") Integer level);
-
     List<Integer> getActivationVipIds(Integer userId);
 
     List<CloudTeacherOrder> queryByUserIds(@Param("userIds") List<Integer> userIds, @Param("status") Integer status);

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

@@ -6,6 +6,7 @@ import com.ym.mec.biz.dal.entity.StudentMemberUpdateLog;
 import com.ym.mec.biz.dal.wrapper.StudentMemberUpdateLogWrapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -19,5 +20,7 @@ public interface StudentMemberUpdateLogDao extends BaseMapper<StudentMemberUpdat
    int insertBatch(@Param("entities") List<StudentMemberUpdateLog> entities);
 
     IPage<StudentMemberUpdateLogWrapper.StudentMemberUpdateLog> selectPage(@Param("page") IPage<StudentMemberUpdateLogWrapper.StudentMemberUpdateLog> page, @Param("param") StudentMemberUpdateLogWrapper.StudentMemberUpdateLogQuery query);
+
+    Date getActivationMaxTime(@Param("studentId") Integer studentId, @Param("level") Integer level);
 }
 

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

@@ -352,7 +352,7 @@ public class CloudTeacherOrderServiceImpl extends BaseServiceImpl<Long, CloudTea
     @Transactional(rollbackFor = Exception.class)
     public void activationMember(Date now,CloudTeacherOrder cloudTeacherOrder){
         //获取已激活的云教练最大时间
-        Date maxTime = cloudTeacherOrderDao.getActivationMaxTime(cloudTeacherOrder.getStudentId(),cloudTeacherOrder.getLevel());
+        Date maxTime = studentMemberUpdateLogService.getDao().getActivationMaxTime(cloudTeacherOrder.getStudentId(),cloudTeacherOrder.getLevel());
         if (maxTime != null && maxTime.compareTo(now) > 0) {
             now = maxTime;
         }

+ 0 - 3
mec-biz/src/main/resources/config/mybatis/CloudTeacherOrderMapper.xml

@@ -634,9 +634,6 @@
             #{item}
         </foreach>
     </select>
-    <select id="getActivationMaxTime" resultType="java.util.Date">
-        select max(end_time_) from cloud_teacher_order where student_id_ = #{studentId} and level_ = #{level} and status_ = 2
-    </select>
     <select id="queryByUserIds" resultType="com.ym.mec.biz.dal.entity.CloudTeacherOrder">
         select * from cloud_teacher_order where student_id_ in
         <foreach collection="userIds" item="userId" separator="," open="(" close=")">

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/StudentMemberUpdateLogMapper.xml

@@ -34,4 +34,7 @@
 
         order by t.create_time_ desc
     </select>
+    <select id="getActivationMaxTime" resultType="java.util.Date">
+        select new_end_time_ from student_member_update_log where student_id_ = #{studentId} and level_ = #{level} order by id_ desc limit 1
+    </select>
 </mapper>