liujc 7 months ago
parent
commit
281d7def94

+ 6 - 3
cooleshow-app/src/main/java/com/yonge/cooleshow/admin/controller/TenantMusicSheetApplicationExtendController.java

@@ -12,6 +12,7 @@ import com.microsvc.toolkit.config.jwt.utils.JwtUserInfo;
 import com.yonge.cooleshow.biz.dal.enums.SubjectTypeEnum;
 import com.yonge.cooleshow.biz.dal.service.MusicSheetService;
 import com.yonge.cooleshow.biz.dal.service.SysConfigService;
+import com.yonge.cooleshow.biz.dal.wrapper.MusicSheetWrapper;
 import com.yonge.cooleshow.common.constant.SysConfigConstant;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -48,7 +49,7 @@ public class TenantMusicSheetApplicationExtendController {
 
     @PreAuthorize("@pcs.hasPermissions('tenantMusicSheetApplicationExtend/pageByApplication')")
     @PostMapping({"/pageByApplication"})
-    public R<PageInfo<CbsMusicSheetWrapper.MusicSheetApplication>> musicSheetPageByApplication(@RequestBody CbsMusicSheetWrapper.MusicSheetApplicationQuery var1){
+    public R<PageInfo<MusicSheetWrapper.MusicSheetApplication>> musicSheetPageByApplication(@RequestBody CbsMusicSheetWrapper.MusicSheetApplicationQuery var1){
 
         return R.from(musicSheetService.tenantPage(var1));
     }
@@ -56,14 +57,16 @@ public class TenantMusicSheetApplicationExtendController {
 
     @PreAuthorize("@pcs.hasPermissions('tenantMusicSheetApplicationExtend/page')")
     @PostMapping({"/page"})
-    public R<PageInfo<CbsMusicSheetWrapper.MusicSheet>> musicSheetPage(@RequestBody CbsMusicSheetWrapper.MusicSheetQuery var1){
+    public R<PageInfo<MusicSheetWrapper.CbsMusicSheet>> musicSheetPage(@RequestBody CbsMusicSheetWrapper.MusicSheetQuery var1){
 
         String cbsTenantAppId = sysConfigService.findConfigValue(SysConfigConstant.CBS_TENANT_APP_ID);
         // 更新数据
         var1.setAddAppId(Long.parseLong(cbsTenantAppId));
         try {
+            PageInfo<CbsMusicSheetWrapper.MusicSheet> musicSheetPageInfo = this.musicFeignClientService.musicSheetPage(var1).feignData();
+            PageInfo<MusicSheetWrapper.CbsMusicSheet> convert = musicSheetPageInfo.convert(o -> JSONObject.parseObject(JSONObject.toJSONString(o), MusicSheetWrapper.CbsMusicSheet.class));
 
-            return R.from(this.musicFeignClientService.musicSheetPage(var1).feignData());
+            return R.from(convert);
         }catch (Exception e) {
             log.error("查询曲目应用拓展表异常", e);
             if(e instanceof BizException) {

+ 1 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/MusicSheetService.java

@@ -418,5 +418,5 @@ public interface MusicSheetService extends IService<MusicSheet> {
 
     IPage<MusicSheetVo> queryTenantRelatedList(IPage<Object> page, MusicSheetRelatedQueryInfo queryInfo);
 
-    com.microsvc.toolkit.common.response.paging.PageInfo<CbsMusicSheetWrapper.MusicSheetApplication> tenantPage(CbsMusicSheetWrapper.MusicSheetApplicationQuery query);
+    com.microsvc.toolkit.common.response.paging.PageInfo<MusicSheetWrapper.MusicSheetApplication> tenantPage(CbsMusicSheetWrapper.MusicSheetApplicationQuery query);
 }

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

@@ -2375,14 +2375,16 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
     }
 
     @Override
-    public PageInfo<CbsMusicSheetWrapper.MusicSheetApplication> tenantPage(CbsMusicSheetWrapper.MusicSheetApplicationQuery query) {
+    public PageInfo<MusicSheetWrapper.MusicSheetApplication> tenantPage(CbsMusicSheetWrapper.MusicSheetApplicationQuery query) {
         String cbsTenantAppId = sysConfigService.findConfigValue(SysConfigConstant.CBS_TENANT_APP_ID);
         query.setApplicationId(Long.parseLong(cbsTenantAppId));
         try {
             PageInfo<CbsMusicSheetWrapper.MusicSheetApplication> feignedData = this.musicFeignClientService.musicSheetPageByApplication(query).feignData();
-            List<CbsMusicSheetWrapper.MusicSheetApplication> rows = feignedData.getRows();
+            PageInfo<MusicSheetWrapper.MusicSheetApplication> convert = feignedData.convert(o -> JSON.parseObject(JSON.toJSONString(o),MusicSheetWrapper.MusicSheetApplication.class));
+
+            List<MusicSheetWrapper.MusicSheetApplication> rows = convert.getRows();
             if (CollectionUtils.isEmpty(rows)) {
-                return feignedData;
+                return convert;
             }
             // 查询曲目对应的业务ID
             List<Long> cbsMusicSheetIds = rows.stream().map(CbsMusicSheetWrapper.MusicSheetApplication::getId).collect(Collectors.toList());
@@ -2397,8 +2399,8 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
             }).filter(Objects::nonNull).collect(Collectors.toList());
 
 
-            feignedData.setRows(rows);
-            return feignedData;
+            convert.setRows(rows);
+            return convert;
         } catch (Exception e) {
             log.error("查询曲目应用拓展表异常", e);
             if(e instanceof com.microsvc.toolkit.common.webportal.exception.BizException) {

+ 14 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/MusicSheetWrapper.java

@@ -1,6 +1,8 @@
 package com.yonge.cooleshow.biz.dal.wrapper;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.annotation.JSONField;
+import com.alibaba.fastjson.serializer.ToStringSerializer;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -906,4 +908,16 @@ public class MusicSheetWrapper {
         private List<Long> excludeMusicIds;
 
     }
+
+    @Data
+    public static class MusicSheetApplication extends CbsMusicSheetWrapper.MusicSheetApplication{
+        @ApiModelProperty("主键")
+        @JSONField(serializeUsing = ToStringSerializer.class)
+        private Long id;
+
+        @ApiModelProperty("分类ID")
+        @JSONField(serializeUsing = ToStringSerializer.class)
+        private Long musicSheetCategoryId;
+
+    }
 }