liujunchi 2 yıl önce
ebeveyn
işleme
ffb5765b95

+ 9 - 2
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/controller/NewsController.java

@@ -113,7 +113,7 @@ public class NewsController extends BaseController {
 				}
 			}
 		}
-		if(newsInfo.getType() == 4 ||newsInfo.getType() == 5) {
+		if(newsInfo.getType() == 4 ||newsInfo.getType() == 5||newsInfo.getType() == 7) {
 			if (StringUtil.isEmpty(newsInfo.getClientType() )) {
 				return failed("平台不能为空");
 			}
@@ -133,7 +133,7 @@ public class NewsController extends BaseController {
 			}
 		}
 		// 2 3 4
-		if (newsInfo.getType() == 2 ||newsInfo.getType() == 3 ||newsInfo.getType() == 4 ) {
+		if (newsInfo.getType() == 2 ||newsInfo.getType() == 3 ||newsInfo.getType() == 4||newsInfo.getType() == 7 ) {
 			if (newsInfo.getOnlineTime() == null || newsInfo.getOfflineTime() == null) {
 				return failed("生效时间不能为空");
 			}
@@ -273,6 +273,13 @@ public class NewsController extends BaseController {
 		params = new HashMap<>();
 		MapUtil.populateMap(params, queryInfo);
 		appHomeDto.setBanner(sysNewsInformationService.selectPage(queryInfo).getRows());
+
+		// 悬浮框
+		queryInfo.setType(7);
+		params = new HashMap<>();
+		MapUtil.populateMap(params, queryInfo);
+		appHomeDto.setSuspension(sysNewsInformationService.selectPage(queryInfo).getRows());
+
 		// 闪页
 		queryInfo.setType(3);
 		params = new HashMap<>();

+ 1 - 1
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/controller/queryinfo/NewsInformationQueryInfo.java

@@ -10,7 +10,7 @@ import java.util.List;
 
 public class NewsInformationQueryInfo extends QueryInfo {
 
-	@ApiModelProperty(value = "类型,1热门资讯,2开屏广告,3闪页管理,4轮播图管理 5按钮管理 6 乐理章节", required = true)
+	@ApiModelProperty(value = "类型,1热门资讯,2开屏广告,3闪页管理,4轮播图管理 5按钮管理 6 乐理章节 7 悬浮窗设置 ", required = true)
 	@NotNull(message = "类型不能为空")
 	private Integer type;
 

+ 1 - 1
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/entity/SysNewsInformation.java

@@ -35,7 +35,7 @@ public class SysNewsInformation {
 	private String videoCoverImage;
 
 	/** 类型 */
-	@ApiModelProperty(value = "类型,1热门资讯,2开屏广告,3闪页管理,4轮播图管理 5app按钮管理 6:乐理章节", required = true)
+	@ApiModelProperty(value = "类型,1热门资讯,2开屏广告,3闪页管理,4轮播图管理 5app按钮管理 6:乐理章节 7 悬浮窗设置", required = true)
 	@NotNull(message = "类型不能为空")
 	private Integer type;
 	

+ 12 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dto/AppHomeDto.java

@@ -21,12 +21,24 @@ public class AppHomeDto {
     @ApiModelProperty("banner")
     private List<SysNewsInformationDto> banner;
 
+
+    @ApiModelProperty("悬浮框")
+    private List<SysNewsInformationDto> suspension;
+
     @ApiModelProperty("闪页")
     private List<SysNewsInformationDto> flashPage;
 
     @ApiModelProperty("app按钮")
     private List<SysNewsInformationDto> appMenu;
 
+    public List<SysNewsInformationDto> getSuspension() {
+        return suspension;
+    }
+
+    public void setSuspension(List<SysNewsInformationDto> suspension) {
+        this.suspension = suspension;
+    }
+
     public List<SysNewsInformationDto> getInformation() {
         return information;
     }

+ 1 - 1
cooleshow-cms/src/main/resources/config/mybatis/SysNewsInformationMapper.xml

@@ -69,7 +69,7 @@
 						and if(sni.online_time_ is not null,sni.online_time_ &lt;= now(),1=1)
 						and if(sni.offline_time_ is not null,sni.offline_time_ &gt;= now(),1=1)
 					</if>
-					<if test="type == 4 or type == 5">
+					<if test="type == 4 or type == 5  or type == 7">
 						<choose>
 							<when test="platformType == 'WEBSITE'">
 								and sni.client_type_ = #{platformType}

+ 18 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/MusicTagController.java

@@ -1,6 +1,7 @@
 package com.yonge.cooleshow.admin.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.biz.dal.dto.AdjustModel;
 import com.yonge.cooleshow.biz.dal.dto.MusicTagSaveDto;
 import com.yonge.cooleshow.biz.dal.dto.search.MusicTagSearch;
 import com.yonge.cooleshow.biz.dal.entity.MusicTag;
@@ -108,4 +109,21 @@ public class MusicTagController extends BaseController {
 		}
 		return status(musicTagService.state(id));
 	}
+
+
+	/**
+	 * 设置排序值 和加精
+	 */
+	@PostMapping("/adjust")
+	@ApiOperation(value = "标签调整设置")
+	public HttpResponseResult<Boolean> adjust(@RequestBody @Valid AdjustModel model) {
+
+		MusicTag musicTag = new MusicTag();
+		musicTag.setId(model.getId());
+		musicTag.setSortNumber(model.getSort());
+
+		musicTagService.updateById(musicTag);
+
+		return succeed();
+	}
 }

+ 12 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/MusicTag.java

@@ -39,6 +39,11 @@ public class MusicTag implements Serializable {
     @ApiModelProperty("标签类型 MUSIC:曲目 ALBUM:专辑")
     private String type;
 
+
+    @TableField(value = "sort_number_")
+    @ApiModelProperty("标签排序")
+    private Integer sortNumber;
+
 	@TableField(value = "del_flag_")
     @ApiModelProperty(value = "假删标识(0:正常,1:删除)")
     private Boolean delFlag= false;
@@ -63,6 +68,13 @@ public class MusicTag implements Serializable {
     @ApiModelProperty(value = "更新人(后台平台用户)")
     private Long updateBy;  //更新人(老师或者是后台平台用户)
 
+    public Integer getSortNumber() {
+        return sortNumber;
+    }
+
+    public void setSortNumber(Integer sortNumber) {
+        this.sortNumber = sortNumber;
+    }
 
     public String getType() {
         return type;

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

@@ -284,10 +284,6 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
         } else {
             detail.setPlay(YesOrNoEnum.YES);
         }
-        if (ClientEnum.STUDENT.getCode().equals(userType.getCode())) {
-            // 学生进入小酷Ai练习,添加一条练习记录
-            musicSheetPracticeRecordService.addRecord(id, sysUser.getId());
-        }
         return detail;
     }
 

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

@@ -56,7 +56,7 @@ public class MusicTagServiceImpl extends ServiceImpl<MusicTagDao, MusicTag> impl
 
          // 根据父级id, 将子集分类
          Map<String, List<MusicTagVo>> musicTagMap = musicTagVoList.stream()
-                                                                   .collect(Collectors.groupingBy( vo -> vo.getParentTagId().toString()));
+                                                                   .collect(Collectors.groupingBy( vo -> vo.getId().toString()));
          musicTagVoIPage.getRecords()
                         .forEach(musicTagVo -> {
                             List<MusicTagVo> childrenList = musicTagMap.get(musicTagVo.getId().toString());
@@ -117,7 +117,7 @@ public class MusicTagServiceImpl extends ServiceImpl<MusicTagDao, MusicTag> impl
         }
         MusicTag musicTag = new MusicTag();
         musicTag.setId(musicTagId);
-        musicTag.setState(YesOrNoEnum.YES);
+        musicTag.setState(tag.getState().equals(YesOrNoEnum.YES)?YesOrNoEnum.NO:YesOrNoEnum.YES);
         return this.updateById(musicTag);
 
     }
@@ -204,6 +204,7 @@ public class MusicTagServiceImpl extends ServiceImpl<MusicTagDao, MusicTag> impl
                 .eq(MusicTag::getDelFlag,YesOrNoEnum.NO.getCode())
                 .eq(MusicTag::getState,YesOrNoEnum.YES.getCode())
                 .eq(MusicTag::getType,type)
+                .orderByDesc(MusicTag::getSortNumber)
                 .list();
         if (list == null) {
             return new ArrayList<>();

+ 1 - 1
cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicSheetMapper.xml

@@ -410,7 +410,7 @@
         where find_in_set(mt.id_,t.music_tag_) and mt.del_flag_ = 0  and mt.state_ = 1) as musicTagNames
         ,(select group_concat(s.name_) from subject s where find_in_set(s.id_,t.music_subject_) ) as subjectNames
         ,if(mf.id_ is not null,1,0) as favorite
-        from music_sheet_practice_record mspr
+        from sys_music_compare_record mspr
         left join music_sheet t on mspr.music_sheet_id_ = t.id_
         left join sys_user su on t.create_by_ = su.id_
         left join music_favorite mf on (t.id_ = mf.music_sheet_id_ and mspr.user_id_ = mf.user_id_ <if test="param.clientType != null"> AND mf.client_type_ = #{param.clientType}</if> )

+ 1 - 1
cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicSheetPracticeRecordMapper.xml

@@ -19,7 +19,7 @@
 	<select id="selectPracticeMusicIdPage" resultType="java.lang.Long">
         select t.id_ from  (select
         max(mspr.id_) as id_
-        from music_sheet_practice_record mspr
+        from sys_music_compare_record mspr
         left join music_sheet ms on mspr.music_sheet_id_ = ms.id_
         <where>
             <if test="param.auditStatus !=null">

+ 3 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicTagMapper.xml

@@ -6,6 +6,7 @@
         <result column="parent_tag_id_" property="parentTagId" />
         <result column="name_" property="name" />
         <result column="state_" property="state" />
+        <result column="sort_number_" property="sortNumber" />
         <result column="type_" property="type" />
         <result column="del_flag_" property="delFlag" />
         <result column="create_time_" property="createTime" />
@@ -21,6 +22,7 @@
         , t.name_ as name
         , t.state_ as state
         , t.type_ as type
+        , t.sort_number_ as sortNumber
         , t.del_flag_ as delFlag
         , t.create_time_ as createTime
         , t.update_time_ as updateTime
@@ -59,6 +61,7 @@
                     )
             </if>
         </where>
+        order by  t.sort_number_ desc
 	</select>
 
 	<select id="getChildren" resultType="com.yonge.cooleshow.biz.dal.vo.MusicTagVo">

+ 1 - 1
cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/config/ResourceServerConfig.java

@@ -28,7 +28,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
                 .authorizeRequests()
                 .antMatchers("/task/**")
                 .hasIpAddress("0.0.0.0/0")
-                .antMatchers("/wechat/*", "/v2/api-docs", "/code/*","/open/**")
+                .antMatchers("/wechat/*", "/v2/api-docs", "/code/*","/open/**","/sysMusicRecord/getLastEvaluationMusicalNotesPlayStats","/music/sheet/detail/**")
                 .permitAll().anyRequest().authenticated().and().httpBasic();
     }
 

+ 1 - 1
cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/controller/MusicSheetController.java

@@ -79,7 +79,7 @@ public class MusicSheetController extends BaseController {
     public HttpResponseResult<MusicSheetDetailVo> detail(@ApiParam(value = "曲谱编号", required = true) @PathVariable("id") Long id) {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         if (sysUser == null  || sysUser.getId() == null) {
-            return failed("用户信息获取失败");
+            sysUser = null;
         }
         return succeed(musicSheetService.detail(id, sysUser, ClientEnum.STUDENT));
     }