浏览代码

1、陪练课调整
2、付费陪练课

Joburgess 5 年之前
父节点
当前提交
2159a15240

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/PracticeGroupDao.java

@@ -128,4 +128,13 @@ public interface PracticeGroupDao extends com.ym.mec.common.dal.BaseDAO<Long, Pr
      */
     List<PracticeGroup> findHistoryPracticeGroups();
 
+    /**
+     * @describe
+     * @author Joburgess
+     * @date 2020/2/24
+     * @param groupId:
+     * @return com.ym.mec.biz.dal.entity.PracticeGroup
+     */
+    PracticeGroup lockPracticeGroup(@Param("groupId") Integer groupId);
+
 }

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

@@ -3158,7 +3158,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         if(Objects.isNull(practiceGroupId)){
             throw new BizException("请指定需要重新支付的课程组");
         }
-        PracticeGroup practiceGroup = practiceGroupDao.get(practiceGroupId.longValue());
+        PracticeGroup practiceGroup = practiceGroupDao.lockPracticeGroup(practiceGroupId);
         if(Objects.isNull(practiceGroup)){
             throw new BizException("此课程组已过期,请重新购买");
         }

+ 5 - 0
mec-biz/src/main/resources/config/mybatis/PracticeGroupMapper.xml

@@ -179,4 +179,9 @@
 			</if>
 		</where>
 	</sql>
+
+	<!-- 根据主键查询一条记录 -->
+	<select id="lockPracticeGroup" resultMap="PracticeGroup">
+		SELECT * FROM practice_group WHERE id_ = #{id} FOR UPDATE
+	</select>
 </mapper>