Explorar el Código

曲目置顶数

liujunchi hace 2 años
padre
commit
469007e7f3

+ 5 - 0
cooleshow-common/src/main/java/com/yonge/cooleshow/common/constant/SysConfigConstant.java

@@ -319,4 +319,9 @@ public interface SysConfigConstant {
      */
     String MALL_ACCOUNT_PERIOD = "mall_account_period";
 
+    /**
+     * 曲目置顶数
+     */
+    String MUSIC_SHEET_TOP_NUM = "music_sheet_top_num";
+
 }

+ 6 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/MusicSheetServiceImpl.java

@@ -1245,8 +1245,12 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
 		for (String subjectId : subjectIdsStr.split(",")) {
 			Integer count = this.lambdaQuery().eq(MusicSheet::getDelFlag, YesOrNoEnum.NO).eq(MusicSheet::getTopFlag, YesOrNoEnum.YES)
 					.eq(MusicSheet::getState, YesOrNoEnum.YES).apply(!subjectId.isEmpty(), "FIND_IN_SET ('" + subjectId + "',music_subject_)").count();
-			if (count >= 20) {
-				throw new BizException("首页推荐数量达到[20]上限,请先取消其他曲谱推荐");
+            String topNum = sysConfigService.findConfigValue(SysConfigConstant.MUSIC_SHEET_TOP_NUM);
+            if (StringUtil.isEmpty(topNum)) {
+                throw new BizException("获取置顶配置失败");
+            }
+            if (count >= Integer.parseInt(topNum)) {
+				throw new BizException("首页推荐数量达到[" +topNum+"]上限,请先取消其他曲谱推荐");
 			}
 		}
         musicSheet.setTopFlag(YesOrNoEnum.YES);