Bladeren bron

Merge branch 'feature/1022_vip' of http://git.dayaedu.com/yonge/mec into test

zouxuan 6 dagen geleden
bovenliggende
commit
7c6f650aa9

+ 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;
         }

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

@@ -1593,10 +1593,10 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
         studentMemberUpdateLog.setBuyType(param.getType());
         //保存学员会员时间
         studentMemberTimeService.saveToStudentMemberUpdateLog(studentMemberUpdateLog);
-        studentDao.updateCloudTeacherEndTime(userId);
         studentMemberUpdateLog.setName(memberRankSettingService.queryMemberName(param.getMemberRankId()));
         //添加修改日志
         studentMemberUpdateLogDao.insert(studentMemberUpdateLog);
+        studentDao.updateCloudTeacherEndTime(userId);
         if(param.getPushFlag()){
             //推送消息
             //您获得/扣减了XXXX{数量+周期}的XXXX{学练宝版本},原因:XXXXX{添加/扣减原因}

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

@@ -2997,7 +2997,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
                 Map<Integer, String> map = new HashMap<>(1);
                 map.put(userId, userId.toString());
-                String baseApiUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
+                String baseApiUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL_MDAYA);
 
                 String pushUrl = baseApiUrl + "/#/myOrder";
                 sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG,

+ 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>