Просмотр исходного кода

1.添加专辑分类相关接口

yuanliang 1 год назад
Родитель
Сommit
86664f48a8
19 измененных файлов с 1310 добавлено и 0 удалено
  1. 129 0
      cooleshow-app/src/main/java/com/yonge/cooleshow/admin/controller/TenantAlbumCategoryController.java
  2. 62 0
      cooleshow-app/src/main/java/com/yonge/cooleshow/admin/io/request/TenantAlbumCategoryDetailVo.java
  3. 90 0
      cooleshow-app/src/main/java/com/yonge/cooleshow/admin/io/request/TenantAlbumCategoryVo.java
  4. 29 0
      cooleshow-common/src/main/java/com/yonge/cooleshow/common/enums/ETenantAlbumCategoryType.java
  5. 130 0
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/TenantAlbumCategoryController.java
  6. 62 0
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/io/request/TenantAlbumCategoryDetailVo.java
  7. 90 0
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/io/request/TenantAlbumCategoryVo.java
  8. 58 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/TenantAlbumCategory.java
  9. 36 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/TenantAlbumCategoryDetail.java
  10. 27 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/mapper/TenantAlbumCategoryDetailMapper.java
  11. 27 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/mapper/TenantAlbumCategoryMapper.java
  12. 43 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/TenantAlbumCategoryDetailService.java
  13. 46 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/TenantAlbumCategoryService.java
  14. 66 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TenantAlbumCategoryDetailServiceImpl.java
  15. 191 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TenantAlbumCategoryServiceImpl.java
  16. 63 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/TenantAlbumCategoryDetailWrapper.java
  17. 106 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/TenantAlbumCategoryWrapper.java
  18. 20 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/TenantAlbumCategoryDetailMapper.xml
  19. 35 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/TenantAlbumCategoryMapper.xml

+ 129 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/admin/controller/TenantAlbumCategoryController.java

@@ -0,0 +1,129 @@
+package com.yonge.cooleshow.admin.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.microsvc.toolkit.common.response.paging.PageInfo;
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import com.microsvc.toolkit.common.response.template.R;
+import com.yonge.cooleshow.admin.io.request.TenantAlbumCategoryVo;
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.biz.dal.entity.TenantAlbumCategory;
+import com.yonge.cooleshow.biz.dal.service.SysUserService;
+import com.yonge.cooleshow.biz.dal.service.TenantAlbumCategoryService;
+import com.yonge.cooleshow.biz.dal.wrapper.TenantAlbumCategoryWrapper;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Validated
+@RestController
+@RequestMapping("${app-config.url.admin:}/tenantAlbumCategory")
+@Api(tags = "机构专辑分类")
+public class TenantAlbumCategoryController {
+
+    @Autowired
+    private TenantAlbumCategoryService tenantAlbumCategoryService;
+
+    @Resource
+    private SysUserFeignService sysUserFeignService;
+
+    @Autowired
+    private SysUserService sysUserService;
+
+    @ApiOperation(value = "详情", notes = "机构专辑分类-根据详情ID查询单条, 传入id")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "id", dataType = "long")
+    })
+    @PreAuthorize("@auditsvc.hasPermissions('tenantAlbumCategory/detail', {'BACKEND'})")
+    @GetMapping("/detail/{id}")
+    public R<TenantAlbumCategoryWrapper.TenantAlbumCategory> detail(@PathVariable("id") Long id) {
+        return R.from(tenantAlbumCategoryService.detail(id));
+    }
+
+    @ApiOperation(value = "查询分页", notes = "机构专辑分类- 传入 TenantAlbumCategoryVo.TenantAlbumCategoryQuery")
+    @PreAuthorize("@auditsvc.hasPermissions('tenantAlbumCategory/page', {'BACKEND'})")
+    @PostMapping("/page")
+    public R<PageInfo<TenantAlbumCategoryVo.TenantAlbumCategory>> page(@RequestBody TenantAlbumCategoryWrapper.TenantAlbumCategoryQuery query) {
+
+        // 查询数据
+        IPage<TenantAlbumCategory> pages = tenantAlbumCategoryService.selectPage(QueryInfo.getPage(query), query);
+        // 数据类型转换
+        List<TenantAlbumCategoryVo.TenantAlbumCategory> records = JSON.parseArray(JSON.toJSONString(pages.getRecords()),
+                TenantAlbumCategoryVo.TenantAlbumCategory.class);
+
+        if (CollectionUtils.isNotEmpty(records)) {
+            List<Long> updateUserIds =
+                    records.stream().map(TenantAlbumCategoryVo.TenantAlbumCategory::getUpdateBy).distinct().collect(Collectors.toList());
+            Map<Long, com.yonge.cooleshow.biz.dal.entity.SysUser> mapByIds = sysUserService.getMapByIds(updateUserIds);
+            records.forEach(next -> {
+                com.yonge.cooleshow.biz.dal.entity.SysUser sysUser = mapByIds.get(next.getUpdateBy());
+                next.setUpdateUserName(sysUser == null ? "" : sysUser.getUsername());
+            });
+        }
+
+        return R.from(QueryInfo.pageInfo(pages, records));
+    }
+
+    @ApiOperation(value = "新增", notes = "机构专辑分类- 传入 TenantAlbumCategoryVo.TenantAlbumCategory")
+    @PreAuthorize("@auditsvc.hasPermissions('tenantAlbumCategory/save', {'BACKEND'})")
+    @PostMapping("/save")
+    public R<JSONObject> add(@Validated @RequestBody TenantAlbumCategoryVo.TenantAlbumCategory tenantAlbumCategoryVo) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        // 新增数据
+        TenantAlbumCategoryWrapper.TenantAlbumCategory albumCategory =
+                JSON.parseObject(tenantAlbumCategoryVo.jsonString(),
+                        TenantAlbumCategoryWrapper.TenantAlbumCategory.class);
+        albumCategory.setCreateBy(sysUser.getId());
+        albumCategory.setUpdateBy(sysUser.getId());
+        tenantAlbumCategoryService.add(albumCategory);
+
+        return R.defaultR();
+    }
+
+    @ApiOperation(value = "修改", notes = "机构专辑分类- 传入 TenantAlbumCategoryVo.TenantAlbumCategory")
+    @PreAuthorize("@auditsvc.hasPermissions('tenantAlbumCategory/update', {'BACKEND'})")
+    @PostMapping("/update")
+    public R<JSONObject> update(@Validated @RequestBody TenantAlbumCategoryVo.TenantAlbumCategory tenantAlbumCategoryVo) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        // 更新数据
+        TenantAlbumCategoryWrapper.TenantAlbumCategory albumCategory =
+                JSON.parseObject(tenantAlbumCategoryVo.jsonString(),
+                        TenantAlbumCategoryWrapper.TenantAlbumCategory.class);
+        albumCategory.setUpdateBy(sysUser.getId());
+        tenantAlbumCategoryService.update(albumCategory);
+
+        return R.defaultR();
+    }
+
+    @ApiOperation(value = "删除", notes = "机构专辑分类- 传入id")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "id", dataType = "long")
+    })
+    @PreAuthorize("@auditsvc.hasPermissions('tenantAlbumCategory/remove', {'BACKEND'})")
+    @PostMapping("/remove")
+    public R<Boolean> remove(@RequestParam Long id) {
+
+        return R.from(tenantAlbumCategoryService.delete(id));
+    }
+}

+ 62 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/admin/io/request/TenantAlbumCategoryDetailVo.java

@@ -0,0 +1,62 @@
+package com.yonge.cooleshow.admin.io.request;
+
+import com.alibaba.fastjson.JSON;
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import lombok.Data;
+
+/**
+ * 机构专辑分类详情
+ * 2023-10-10 10:17:38
+ */
+@ApiModel(value = "TenantAlbumCategoryDetailVo对象", description = "机构专辑分类详情查询视图对象")
+public class TenantAlbumCategoryDetailVo {
+
+    @Data
+    @ApiModel(" TenantAlbumCategoryDetailQuery-机构专辑分类详情")
+    public static class TenantAlbumCategoryDetailQuery implements QueryInfo {
+
+        @ApiModelProperty("当前页")
+        private Integer page;
+
+        @ApiModelProperty("分页行数")
+        private Integer rows;
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static TenantAlbumCategoryDetailQuery from(String json) {
+            return JSON.parseObject(json, TenantAlbumCategoryDetailQuery.class);
+        }
+    }
+
+    @Data
+    @ApiModel(" TenantAlbumCategoryDetail-机构专辑分类详情")
+    public static class TenantAlbumCategoryDetail {
+
+
+        @ApiModelProperty("主键ID")
+        private Long id;
+
+
+        @ApiModelProperty("机构专辑分类ID")
+        private Long tenantAlbumCategoryId;
+
+
+        @ApiModelProperty("级别/类别")
+        private String value;
+
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static TenantAlbumCategoryDetail from(String json) {
+            return JSON.parseObject(json, TenantAlbumCategoryDetail.class);
+        }
+    }
+
+}

+ 90 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/admin/io/request/TenantAlbumCategoryVo.java

@@ -0,0 +1,90 @@
+package com.yonge.cooleshow.admin.io.request;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import com.yonge.cooleshow.biz.dal.entity.TenantAlbumCategoryDetail;
+import com.yonge.cooleshow.biz.dal.wrapper.TenantAlbumCategoryDetailWrapper;
+import com.yonge.cooleshow.common.enums.ETenantAlbumCategoryType;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import lombok.Data;
+
+/**
+ * 机构专辑分类
+ * 2023-10-10 09:48:46
+ */
+@ApiModel(value = "TenantAlbumCategoryVo对象", description = "机构专辑分类查询视图对象")
+public class TenantAlbumCategoryVo {
+
+    @Data
+    @ApiModel(" TenantAlbumCategoryQuery-机构专辑分类")
+    public static class TenantAlbumCategoryQuery implements QueryInfo {
+
+        @ApiModelProperty("当前页")
+        private Integer page;
+
+        @ApiModelProperty("分页行数")
+        private Integer rows;
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static TenantAlbumCategoryQuery from(String json) {
+            return JSON.parseObject(json, TenantAlbumCategoryQuery.class);
+        }
+    }
+
+    @Data
+    @ApiModel(" TenantAlbumCategory-机构专辑分类")
+    public static class TenantAlbumCategory {
+
+
+        @ApiModelProperty("主键ID")
+        private Long id;
+
+
+        @ApiModelProperty("专辑分类名称")
+        private String name;
+
+        @ApiModelProperty("创建人")
+        private Long createBy;
+
+        @ApiModelProperty("创建时间")
+        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+        private Date createTime;
+
+        @ApiModelProperty("修改人")
+        private Long updateBy;
+
+        @ApiModelProperty("修改人")
+        private String updateUserName;
+
+        @ApiModelProperty("更新时间")
+        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+        private Date updateTime;
+
+
+        @ApiModelProperty("专辑分类类别,CATEGORY_TYPE:类型,CATEGORY_LEVEL:级别")
+        private ETenantAlbumCategoryType categoryType;
+
+        @ApiModelProperty("专辑分类级别/类别值")
+        private List<TenantAlbumCategoryDetail> values = new ArrayList<>();
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static TenantAlbumCategory from(String json) {
+            return JSON.parseObject(json, TenantAlbumCategory.class);
+        }
+    }
+
+}

+ 29 - 0
cooleshow-common/src/main/java/com/yonge/cooleshow/common/enums/ETenantAlbumCategoryType.java

@@ -0,0 +1,29 @@
+package com.yonge.cooleshow.common.enums;
+
+import com.baomidou.mybatisplus.annotation.EnumValue;
+import com.yonge.toolset.base.enums.BaseEnum;
+
+public enum ETenantAlbumCategoryType implements BaseEnum<String, ETenantAlbumCategoryType> {
+
+    CATEGORY_TYPE("类型"),
+    CATEGORY_LEVEL("级别"),
+    ;
+
+    @EnumValue
+    private String code;
+    private String msg;
+
+    ETenantAlbumCategoryType(String msg) {
+        this.code = this.name();
+        this.msg = msg;
+    }
+
+    @Override
+    public String getCode() {
+        return this.code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+}

+ 130 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/TenantAlbumCategoryController.java

@@ -0,0 +1,130 @@
+package com.yonge.cooleshow.admin.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.microsvc.toolkit.common.response.paging.PageInfo;
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import com.microsvc.toolkit.common.response.template.R;
+import com.yonge.cooleshow.admin.io.request.TenantAlbumCategoryVo;
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.biz.dal.entity.TenantAlbumCategory;
+import com.yonge.cooleshow.biz.dal.mapper.SysUserMapper;
+import com.yonge.cooleshow.biz.dal.service.SysUserService;
+import com.yonge.cooleshow.biz.dal.service.TenantAlbumCategoryService;
+import com.yonge.cooleshow.biz.dal.wrapper.TenantAlbumCategoryWrapper;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Validated
+@RestController
+@RequestMapping("/tenantAlbumCategory")
+@Api(tags = "机构专辑分类")
+public class TenantAlbumCategoryController {
+
+    @Autowired
+    private TenantAlbumCategoryService tenantAlbumCategoryService;
+
+    @Resource
+    private SysUserFeignService sysUserFeignService;
+
+    @Autowired
+    private SysUserService sysUserService;
+
+    @ApiOperation(value = "详情", notes = "机构专辑分类-根据详情ID查询单条, 传入id")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "id", dataType = "long")
+    })
+    @PreAuthorize("@auditsvc.hasPermissions('tenantAlbumCategory/detail', {'BACKEND'})")
+    @GetMapping("/detail/{id}")
+    public R<TenantAlbumCategoryWrapper.TenantAlbumCategory> detail(@PathVariable("id") Long id) {
+        return R.from(tenantAlbumCategoryService.detail(id));
+    }
+
+    @ApiOperation(value = "查询分页", notes = "机构专辑分类- 传入 TenantAlbumCategoryVo.TenantAlbumCategoryQuery")
+    @PreAuthorize("@auditsvc.hasPermissions('tenantAlbumCategory/page', {'BACKEND'})")
+    @PostMapping("/page")
+    public R<PageInfo<TenantAlbumCategoryVo.TenantAlbumCategory>> page(@RequestBody TenantAlbumCategoryWrapper.TenantAlbumCategoryQuery query) {
+
+        // 查询数据
+        IPage<TenantAlbumCategory> pages = tenantAlbumCategoryService.selectPage(QueryInfo.getPage(query), query);
+        // 数据类型转换
+        List<TenantAlbumCategoryVo.TenantAlbumCategory> records = JSON.parseArray(JSON.toJSONString(pages.getRecords()),
+                TenantAlbumCategoryVo.TenantAlbumCategory.class);
+
+        if (CollectionUtils.isNotEmpty(records)) {
+            List<Long> updateUserIds =
+                    records.stream().map(TenantAlbumCategoryVo.TenantAlbumCategory::getUpdateBy).distinct().collect(Collectors.toList());
+            Map<Long, com.yonge.cooleshow.biz.dal.entity.SysUser> mapByIds = sysUserService.getMapByIds(updateUserIds);
+            records.forEach(next -> {
+                com.yonge.cooleshow.biz.dal.entity.SysUser sysUser = mapByIds.get(next.getUpdateBy());
+                next.setUpdateUserName(sysUser == null ? "" : sysUser.getUsername());
+            });
+        }
+
+        return R.from(QueryInfo.pageInfo(pages, records));
+    }
+
+    @ApiOperation(value = "新增", notes = "机构专辑分类- 传入 TenantAlbumCategoryVo.TenantAlbumCategory")
+    @PreAuthorize("@auditsvc.hasPermissions('tenantAlbumCategory/save', {'BACKEND'})")
+    @PostMapping("/save")
+    public R<JSONObject> add(@Validated @RequestBody TenantAlbumCategoryVo.TenantAlbumCategory tenantAlbumCategoryVo) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        // 新增数据
+        TenantAlbumCategoryWrapper.TenantAlbumCategory albumCategory =
+                JSON.parseObject(tenantAlbumCategoryVo.jsonString(),
+                        TenantAlbumCategoryWrapper.TenantAlbumCategory.class);
+        albumCategory.setCreateBy(sysUser.getId());
+        albumCategory.setUpdateBy(sysUser.getId());
+        tenantAlbumCategoryService.add(albumCategory);
+
+        return R.defaultR();
+    }
+
+    @ApiOperation(value = "修改", notes = "机构专辑分类- 传入 TenantAlbumCategoryVo.TenantAlbumCategory")
+    @PreAuthorize("@auditsvc.hasPermissions('tenantAlbumCategory/update', {'BACKEND'})")
+    @PostMapping("/update")
+    public R<JSONObject> update(@Validated @RequestBody TenantAlbumCategoryVo.TenantAlbumCategory tenantAlbumCategoryVo) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        // 更新数据
+        TenantAlbumCategoryWrapper.TenantAlbumCategory albumCategory =
+                JSON.parseObject(tenantAlbumCategoryVo.jsonString(),
+                        TenantAlbumCategoryWrapper.TenantAlbumCategory.class);
+        albumCategory.setUpdateBy(sysUser.getId());
+        tenantAlbumCategoryService.update(albumCategory);
+
+        return R.defaultR();
+    }
+
+    @ApiOperation(value = "删除", notes = "机构专辑分类- 传入id")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "id", dataType = "long")
+    })
+    @PreAuthorize("@auditsvc.hasPermissions('tenantAlbumCategory/remove', {'BACKEND'})")
+    @PostMapping("/remove")
+    public R<Boolean> remove(@RequestParam Long id) {
+
+        return R.from(tenantAlbumCategoryService.delete(id));
+    }
+}

+ 62 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/io/request/TenantAlbumCategoryDetailVo.java

@@ -0,0 +1,62 @@
+package com.yonge.cooleshow.admin.io.request;
+
+import com.alibaba.fastjson.JSON;
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import lombok.Data;
+
+/**
+ * 机构专辑分类详情
+ * 2023-10-10 10:17:38
+ */
+@ApiModel(value = "TenantAlbumCategoryDetailVo对象", description = "机构专辑分类详情查询视图对象")
+public class TenantAlbumCategoryDetailVo {
+
+    @Data
+    @ApiModel(" TenantAlbumCategoryDetailQuery-机构专辑分类详情")
+    public static class TenantAlbumCategoryDetailQuery implements QueryInfo {
+
+        @ApiModelProperty("当前页")
+        private Integer page;
+
+        @ApiModelProperty("分页行数")
+        private Integer rows;
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static TenantAlbumCategoryDetailQuery from(String json) {
+            return JSON.parseObject(json, TenantAlbumCategoryDetailQuery.class);
+        }
+    }
+
+    @Data
+    @ApiModel(" TenantAlbumCategoryDetail-机构专辑分类详情")
+    public static class TenantAlbumCategoryDetail {
+
+
+        @ApiModelProperty("主键ID")
+        private Long id;
+
+
+        @ApiModelProperty("机构专辑分类ID")
+        private Long tenantAlbumCategoryId;
+
+
+        @ApiModelProperty("级别/类别")
+        private String value;
+
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static TenantAlbumCategoryDetail from(String json) {
+            return JSON.parseObject(json, TenantAlbumCategoryDetail.class);
+        }
+    }
+
+}

+ 90 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/io/request/TenantAlbumCategoryVo.java

@@ -0,0 +1,90 @@
+package com.yonge.cooleshow.admin.io.request;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import com.yonge.cooleshow.biz.dal.entity.TenantAlbumCategoryDetail;
+import com.yonge.cooleshow.biz.dal.wrapper.TenantAlbumCategoryDetailWrapper;
+import com.yonge.cooleshow.common.enums.ETenantAlbumCategoryType;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import lombok.Data;
+
+/**
+ * 机构专辑分类
+ * 2023-10-10 09:48:46
+ */
+@ApiModel(value = "TenantAlbumCategoryVo对象", description = "机构专辑分类查询视图对象")
+public class TenantAlbumCategoryVo {
+
+    @Data
+    @ApiModel(" TenantAlbumCategoryQuery-机构专辑分类")
+    public static class TenantAlbumCategoryQuery implements QueryInfo {
+
+        @ApiModelProperty("当前页")
+        private Integer page;
+
+        @ApiModelProperty("分页行数")
+        private Integer rows;
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static TenantAlbumCategoryQuery from(String json) {
+            return JSON.parseObject(json, TenantAlbumCategoryQuery.class);
+        }
+    }
+
+    @Data
+    @ApiModel(" TenantAlbumCategory-机构专辑分类")
+    public static class TenantAlbumCategory {
+
+
+        @ApiModelProperty("主键ID")
+        private Long id;
+
+
+        @ApiModelProperty("专辑分类名称")
+        private String name;
+
+        @ApiModelProperty("创建人")
+        private Long createBy;
+
+        @ApiModelProperty("创建时间")
+        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+        private Date createTime;
+
+        @ApiModelProperty("修改人")
+        private Long updateBy;
+
+        @ApiModelProperty("修改人")
+        private String updateUserName;
+
+        @ApiModelProperty("更新时间")
+        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+        private Date updateTime;
+
+
+        @ApiModelProperty("专辑分类类别,CATEGORY_TYPE:类型,CATEGORY_LEVEL:级别")
+        private ETenantAlbumCategoryType categoryType;
+
+        @ApiModelProperty("专辑分类级别/类别值")
+        private List<TenantAlbumCategoryDetail> values = new ArrayList<>();
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static TenantAlbumCategory from(String json) {
+            return JSON.parseObject(json, TenantAlbumCategory.class);
+        }
+    }
+
+}

+ 58 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/TenantAlbumCategory.java

@@ -0,0 +1,58 @@
+package com.yonge.cooleshow.biz.dal.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.yonge.cooleshow.common.enums.ETenantAlbumCategoryType;
+import lombok.Data;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * 机构专辑分类
+ * 2023-10-10 09:48:46
+ */
+@Data
+@ApiModel(" TenantAlbumCategory-机构专辑分类")
+@TableName("tenant_album_category")
+public class TenantAlbumCategory implements Serializable {
+
+    @ApiModelProperty("主键ID")
+    @TableId(value = "id_", type = IdType.AUTO)
+    private Long id;
+
+    @ApiModelProperty("专辑分类名称")
+    @TableField(value = "name_")
+    private String name;
+
+    @ApiModelProperty("专辑分类类别")
+    @TableField(value = "category_type_")
+    private ETenantAlbumCategoryType categoryType;
+
+    @ApiModelProperty("删除标记")
+    @TableField(value = "del_flag_")
+    private Boolean delFlag;
+
+    @ApiModelProperty("创建人")
+    @TableField(value = "create_by_")
+    private Long createBy;
+
+    @ApiModelProperty("创建时间")
+    @TableField(value = "create_time_")
+    private Date createTime;
+
+    @ApiModelProperty("修改人")
+    @TableField(value = "update_by_")
+    private Long updateBy;
+
+    @ApiModelProperty("更新时间")
+    @TableField(value = "update_time_")
+    private Date updateTime;
+
+}

+ 36 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/TenantAlbumCategoryDetail.java

@@ -0,0 +1,36 @@
+package com.yonge.cooleshow.biz.dal.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import lombok.Data;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+
+/**
+ * 机构专辑分类详情
+ * 2023-10-10 10:17:38
+ */
+@Data
+@ApiModel(" TenantAlbumCategoryDetail-机构专辑分类详情")
+@TableName("tenant_album_category_detail")
+public class TenantAlbumCategoryDetail implements Serializable {
+
+    @ApiModelProperty("主键ID")
+    @TableId(value = "id_", type = IdType.AUTO)
+    private Long id;
+
+    @ApiModelProperty("机构专辑分类ID")
+    @TableField(value = "tenant_album_category_id_")
+    private Long tenantAlbumCategoryId;
+
+    @ApiModelProperty("级别/类别")
+    @TableField(value = "value_")
+    private String value;
+
+}

+ 27 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/mapper/TenantAlbumCategoryDetailMapper.java

@@ -0,0 +1,27 @@
+package com.yonge.cooleshow.biz.dal.mapper;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import com.yonge.cooleshow.biz.dal.entity.TenantAlbumCategoryDetail;
+import com.yonge.cooleshow.biz.dal.wrapper.TenantAlbumCategoryDetailWrapper;
+
+/**
+ * 机构专辑分类详情
+ * 2023-10-10 10:17:38
+ */
+@Repository
+public interface TenantAlbumCategoryDetailMapper extends BaseMapper<TenantAlbumCategoryDetail> {
+
+    /**
+     * 分页查询
+     * @param page IPage<TenantAlbumCategoryDetailWrapper.TenantAlbumCategoryDetail>
+     * @param param TenantAlbumCategoryDetailWrapper.TenantAlbumCategoryDetailQuery
+     * @return List<TenantAlbumCategoryDetailWrapper.TenantAlbumCategoryDetail>
+     */
+    List<TenantAlbumCategoryDetail> selectPage(@Param("page") IPage<TenantAlbumCategoryDetail> page, @Param("param") TenantAlbumCategoryDetailWrapper.TenantAlbumCategoryDetailQuery param);
+
+}

+ 27 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/mapper/TenantAlbumCategoryMapper.java

@@ -0,0 +1,27 @@
+package com.yonge.cooleshow.biz.dal.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.biz.dal.entity.TenantAlbumCategory;
+import com.yonge.cooleshow.biz.dal.wrapper.TenantAlbumCategoryWrapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * 机构专辑分类
+ * 2023-10-10 09:48:46
+ */
+@Repository
+public interface TenantAlbumCategoryMapper extends BaseMapper<TenantAlbumCategory> {
+
+    /**
+     * 分页查询
+     * @param page IPage<TenantAlbumCategoryWrapper.TenantAlbumCategory>
+     * @param param TenantAlbumCategoryWrapper.TenantAlbumCategoryQuery
+     * @return List<TenantAlbumCategoryWrapper.TenantAlbumCategory>
+     */
+    List<TenantAlbumCategory> selectPage(@Param("page") IPage<TenantAlbumCategory> page, @Param("param") TenantAlbumCategoryWrapper.TenantAlbumCategoryQuery param);
+
+}

+ 43 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/TenantAlbumCategoryDetailService.java

@@ -0,0 +1,43 @@
+package com.yonge.cooleshow.biz.dal.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yonge.cooleshow.biz.dal.wrapper.TenantAlbumCategoryDetailWrapper;
+import com.yonge.cooleshow.biz.dal.entity.TenantAlbumCategoryDetail;
+
+/**
+ * 机构专辑分类详情
+ * 2023-10-10 10:17:38
+ */
+public interface TenantAlbumCategoryDetailService extends IService<TenantAlbumCategoryDetail>  {
+
+    /**
+     * 查询详情
+     * @param id 详情ID
+     * @return TenantAlbumCategoryDetail
+     */
+    TenantAlbumCategoryDetail detail(Long id);
+
+    /**
+     * 分页查询
+     * @param page IPage<TenantAlbumCategoryDetail>
+     * @param query TenantAlbumCategoryDetailWrapper.TenantAlbumCategoryDetailQuery
+     * @return IPage<TenantAlbumCategoryDetail>
+     */
+    IPage<TenantAlbumCategoryDetail> selectPage(IPage<TenantAlbumCategoryDetail> page, TenantAlbumCategoryDetailWrapper.TenantAlbumCategoryDetailQuery query);
+
+    /**
+     * 添加
+     * @param tenantAlbumCategoryDetail TenantAlbumCategoryDetailWrapper.TenantAlbumCategoryDetail
+     * @return Boolean
+     */
+    Boolean add(TenantAlbumCategoryDetailWrapper.TenantAlbumCategoryDetail tenantAlbumCategoryDetail);
+
+    /**
+     * 更新
+     * @param tenantAlbumCategoryDetail TenantAlbumCategoryDetailWrapper.TenantAlbumCategoryDetail
+     * @return Boolean
+     */
+    Boolean update(TenantAlbumCategoryDetailWrapper.TenantAlbumCategoryDetail tenantAlbumCategoryDetail);
+
+}

+ 46 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/TenantAlbumCategoryService.java

@@ -0,0 +1,46 @@
+package com.yonge.cooleshow.biz.dal.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.microsvc.toolkit.common.response.ParamResponse;
+import com.yonge.cooleshow.biz.dal.wrapper.TenantAlbumCategoryWrapper;
+import com.yonge.cooleshow.biz.dal.entity.TenantAlbumCategory;
+
+/**
+ * 机构专辑分类
+ * 2023-10-10 09:48:46
+ */
+public interface TenantAlbumCategoryService extends IService<TenantAlbumCategory>  {
+
+    /**
+     * 查询详情
+     * @param id 详情ID
+     * @return TenantAlbumCategory
+     */
+    TenantAlbumCategoryWrapper.TenantAlbumCategory detail(Long id);
+
+    /**
+     * 分页查询
+     * @param page IPage<TenantAlbumCategory>
+     * @param query TenantAlbumCategoryWrapper.TenantAlbumCategoryQuery
+     * @return IPage<TenantAlbumCategory>
+     */
+    IPage<TenantAlbumCategory> selectPage(IPage<TenantAlbumCategory> page,
+                                                                     TenantAlbumCategoryWrapper.TenantAlbumCategoryQuery query);
+
+    /**
+     * 添加
+     * @param tenantAlbumCategory TenantAlbumCategoryWrapper.TenantAlbumCategory
+     * @return Boolean
+     */
+    Boolean add(TenantAlbumCategoryWrapper.TenantAlbumCategory tenantAlbumCategory);
+
+    /**
+     * 更新
+     * @param tenantAlbumCategory TenantAlbumCategoryWrapper.TenantAlbumCategory
+     * @return Boolean
+     */
+    Boolean update(TenantAlbumCategoryWrapper.TenantAlbumCategory tenantAlbumCategory);
+
+    Boolean delete(Long id);
+}

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

@@ -0,0 +1,66 @@
+package com.yonge.cooleshow.biz.dal.service.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import org.springframework.beans.BeanUtils;
+import lombok.extern.slf4j.Slf4j;
+import com.yonge.cooleshow.biz.dal.entity.TenantAlbumCategoryDetail;
+import com.yonge.cooleshow.biz.dal.wrapper.TenantAlbumCategoryDetailWrapper;
+import com.yonge.cooleshow.biz.dal.mapper.TenantAlbumCategoryDetailMapper;
+import com.yonge.cooleshow.biz.dal.service.TenantAlbumCategoryDetailService;
+
+/**
+ * 机构专辑分类详情
+ * 2023-10-10 10:17:38
+ */
+@Slf4j
+@Service
+public class TenantAlbumCategoryDetailServiceImpl extends ServiceImpl<TenantAlbumCategoryDetailMapper, TenantAlbumCategoryDetail> implements TenantAlbumCategoryDetailService {
+
+    /**
+     * 查询详情
+     * @param id 详情ID
+     * @return TenantAlbumCategoryDetail
+     */
+    @Override
+    public TenantAlbumCategoryDetail detail(Long id) {
+
+        return baseMapper.selectById(id);
+    }
+
+    /**
+     * 分页查询
+     * @param page IPage<TenantAlbumCategoryDetail>
+     * @param query TenantAlbumCategoryDetailWrapper.TenantAlbumCategoryDetailQuery
+     * @return IPage<TenantAlbumCategoryDetail>
+     */
+    @Override
+    public IPage<TenantAlbumCategoryDetail> selectPage(IPage<TenantAlbumCategoryDetail> page, TenantAlbumCategoryDetailWrapper.TenantAlbumCategoryDetailQuery query) {
+
+        return page.setRecords(baseMapper.selectPage(page, query));
+    }
+
+    /**
+     * 添加
+     * @param tenantAlbumCategoryDetail TenantAlbumCategoryDetailWrapper.TenantAlbumCategoryDetail
+     * @return Boolean
+     */
+    @Override
+    public Boolean add(TenantAlbumCategoryDetailWrapper.TenantAlbumCategoryDetail tenantAlbumCategoryDetail) {
+
+        return this.save(JSON.parseObject(tenantAlbumCategoryDetail.jsonString(), TenantAlbumCategoryDetail.class));
+    }
+
+    /**
+     * 更新
+     * @param tenantAlbumCategoryDetail TenantAlbumCategoryDetailWrapper.TenantAlbumCategoryDetail
+     * @return Boolean
+     */
+    @Override
+    public Boolean update(TenantAlbumCategoryDetailWrapper.TenantAlbumCategoryDetail tenantAlbumCategoryDetail){
+
+        return this.updateById(JSON.parseObject(tenantAlbumCategoryDetail.jsonString(), TenantAlbumCategoryDetail.class));
+    }
+}

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

@@ -0,0 +1,191 @@
+package com.yonge.cooleshow.biz.dal.service.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yonge.cooleshow.biz.dal.entity.TenantAlbumCategory;
+import com.yonge.cooleshow.biz.dal.entity.TenantAlbumCategoryDetail;
+import com.yonge.cooleshow.biz.dal.entity.TenantAlbumMusic;
+import com.yonge.cooleshow.biz.dal.mapper.TenantAlbumCategoryMapper;
+import com.yonge.cooleshow.biz.dal.mapper.TenantAlbumMusicMapper;
+import com.yonge.cooleshow.biz.dal.service.TenantAlbumCategoryDetailService;
+import com.yonge.cooleshow.biz.dal.service.TenantAlbumCategoryService;
+import com.yonge.cooleshow.biz.dal.wrapper.TenantAlbumCategoryWrapper;
+import com.yonge.cooleshow.common.enums.ETenantAlbumCategoryType;
+import com.yonge.toolset.base.exception.BizException;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/**
+ * 机构专辑分类
+ * 2023-10-10 09:48:46
+ */
+@Slf4j
+@Service
+public class TenantAlbumCategoryServiceImpl extends ServiceImpl<TenantAlbumCategoryMapper, TenantAlbumCategory> implements TenantAlbumCategoryService {
+
+    @Autowired
+    private TenantAlbumCategoryDetailService tenantAlbumCategoryDetailService;
+    @Autowired
+    private TenantAlbumMusicMapper tenantAlbumMusicMapper;
+
+    /**
+     * 查询详情
+     *
+     * @param id 详情ID
+     * @return TenantAlbumCategory
+     */
+    @Override
+    public TenantAlbumCategoryWrapper.TenantAlbumCategory detail(Long id) {
+        TenantAlbumCategory albumCategory = baseMapper.selectById(id);
+        if (albumCategory == null) {
+            throw new BizException("专辑分类不存在");
+        }
+        TenantAlbumCategoryWrapper.TenantAlbumCategory tenantAlbumCategory =
+                TenantAlbumCategoryWrapper.TenantAlbumCategory.from(JSON.toJSONString(albumCategory));
+
+        List<TenantAlbumCategoryDetail> list = tenantAlbumCategoryDetailService.lambdaQuery()
+                .eq(TenantAlbumCategoryDetail::getTenantAlbumCategoryId, id)
+                .list();
+        tenantAlbumCategory.setValues(list);
+        return tenantAlbumCategory;
+    }
+
+    /**
+     * 分页查询
+     *
+     * @param page  IPage<TenantAlbumCategory>
+     * @param query TenantAlbumCategoryWrapper.TenantAlbumCategoryQuery
+     * @return IPage<TenantAlbumCategory>
+     */
+    @Override
+    public IPage<TenantAlbumCategory> selectPage(IPage<TenantAlbumCategory> page,
+                                                 TenantAlbumCategoryWrapper.TenantAlbumCategoryQuery query) {
+
+        return page.setRecords(baseMapper.selectPage(page, query));
+    }
+
+    /**
+     * 添加
+     *
+     * @param tenantAlbumCategory TenantAlbumCategoryWrapper.TenantAlbumCategory
+     * @return Boolean
+     */
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public Boolean add(TenantAlbumCategoryWrapper.TenantAlbumCategory tenantAlbumCategory) {
+        Integer count = this.lambdaQuery()
+                .eq(TenantAlbumCategory::getName, tenantAlbumCategory.getName())
+                .eq(TenantAlbumCategory::getCategoryType, tenantAlbumCategory.getCategoryType())
+                .eq(TenantAlbumCategory::getDelFlag, 0)
+                .count();
+        if (count > 0) {
+            throw new BizException("专辑分类名称已存在");
+        }
+
+        TenantAlbumCategory albumCategory = JSON.parseObject(tenantAlbumCategory.jsonString(),
+                TenantAlbumCategory.class);
+        this.save(albumCategory);
+        List<TenantAlbumCategoryDetail> values = tenantAlbumCategory.getValues();
+        if (!values.isEmpty()) {
+            values.forEach(next -> next.setTenantAlbumCategoryId(albumCategory.getId()));
+            tenantAlbumCategoryDetailService.saveBatch(values);
+        }
+        return true;
+    }
+
+    /**
+     * 更新
+     *
+     * @param tenantAlbumCategory TenantAlbumCategoryWrapper.TenantAlbumCategory
+     * @return Boolean
+     */
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public Boolean update(TenantAlbumCategoryWrapper.TenantAlbumCategory tenantAlbumCategory) {
+
+        Integer count = this.lambdaQuery()
+                .eq(TenantAlbumCategory::getName, tenantAlbumCategory.getName())
+                .eq(TenantAlbumCategory::getCategoryType, tenantAlbumCategory.getCategoryType())
+                .eq(TenantAlbumCategory::getDelFlag, 0)
+                .ne(TenantAlbumCategory::getId, tenantAlbumCategory.getId())
+                .count();
+        if (count > 0) {
+            throw new BizException("专辑分类名称已存在");
+        }
+
+        // 校验是否存在引用删除
+        List<TenantAlbumCategoryDetail> detailList = tenantAlbumCategoryDetailService.lambdaQuery()
+                .eq(TenantAlbumCategoryDetail::getTenantAlbumCategoryId, tenantAlbumCategory.getId())
+                .list();
+
+        List<TenantAlbumCategoryDetail> values = tenantAlbumCategory.getValues();
+        List<Long> newUpdateIds = values.stream().map(TenantAlbumCategoryDetail::getId).filter(Objects::nonNull)
+                .collect(Collectors.toList());
+
+        List<TenantAlbumCategoryDetail> removeDetailIdList =
+                detailList.stream().filter(next -> !newUpdateIds.contains(next.getId())).collect(Collectors.toList());
+        if (!removeDetailIdList.isEmpty()) {
+            TenantAlbumCategory albumCategory = this.getById(tenantAlbumCategory.getId());
+            checkTenantAlbumCategoryDetailUsed(albumCategory.getCategoryType(), removeDetailIdList);
+        }
+
+        tenantAlbumCategoryDetailService.lambdaUpdate()
+                .eq(TenantAlbumCategoryDetail::getTenantAlbumCategoryId, tenantAlbumCategory.getId())
+                .remove();
+        this.updateById(JSON.parseObject(tenantAlbumCategory.jsonString(), TenantAlbumCategory.class));
+        if (!values.isEmpty()) {
+            values.forEach(next -> next.setTenantAlbumCategoryId(tenantAlbumCategory.getId()));
+            tenantAlbumCategoryDetailService.saveBatch(values);
+        }
+        return true;
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public Boolean delete(Long id) {
+        TenantAlbumCategory albumCategory = this.getById(id);
+        if (albumCategory == null) {
+            throw new BizException("删除的数据不存在");
+        }
+        List<TenantAlbumCategoryDetail> list = tenantAlbumCategoryDetailService.lambdaQuery()
+                .eq(TenantAlbumCategoryDetail::getTenantAlbumCategoryId, albumCategory.getId())
+                .list();
+        checkTenantAlbumCategoryDetailUsed(albumCategory.getCategoryType(), list);
+
+        tenantAlbumCategoryDetailService.lambdaUpdate()
+                .eq(TenantAlbumCategoryDetail::getTenantAlbumCategoryId, id)
+                .remove();
+        this.removeById(id);
+        return null;
+    }
+
+    /**
+     * 校验专辑分类中的值是否有被应用
+     */
+    private void checkTenantAlbumCategoryDetailUsed(ETenantAlbumCategoryType categoryType,
+                                                    List<TenantAlbumCategoryDetail> list) {
+        if (list.isEmpty()) {
+            return;
+        }
+        List<String> idStrList = list.stream().map(next -> next.getId().toString()).collect(Collectors.toList());
+        QueryWrapper<TenantAlbumMusic> queryWrapper = new QueryWrapper<>();
+        queryWrapper.lambda()
+                .in(ETenantAlbumCategoryType.CATEGORY_TYPE.equals(categoryType),
+                        TenantAlbumMusic::getType, idStrList)
+                .in(ETenantAlbumCategoryType.CATEGORY_LEVEL.equals(categoryType),
+                        TenantAlbumMusic::getType, idStrList);
+        Integer useCount = tenantAlbumMusicMapper.selectCount(queryWrapper);
+        // 删除的ID被应用的数量大于0
+        if (useCount > 0) {
+            throw new BizException("专辑分类存在" + (ETenantAlbumCategoryType.CATEGORY_TYPE.equals(categoryType) ? "类型" : "级别") + "引用");
+        }
+    }
+}

+ 63 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/TenantAlbumCategoryDetailWrapper.java

@@ -0,0 +1,63 @@
+package com.yonge.cooleshow.biz.dal.wrapper;
+
+import com.alibaba.fastjson.JSON;
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Optional;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * 机构专辑分类详情
+ * 2023-10-10 10:17:38
+ */
+@ApiModel(value = "TenantAlbumCategoryDetailWrapper对象", description = "机构专辑分类详情查询对象")
+public class TenantAlbumCategoryDetailWrapper {
+
+    @Data
+    @Builder
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @ApiModel(" TenantAlbumCategoryDetailQuery-机构专辑分类详情")
+    public static class TenantAlbumCategoryDetailQuery implements QueryInfo {
+
+        @ApiModelProperty("当前页")
+        private Integer page;
+
+        @ApiModelProperty("分页行数")
+        private Integer rows;
+
+        @ApiModelProperty("关键字匹配")
+        private String keyword;
+
+        public String getKeyword() {
+            return Optional.ofNullable(keyword).filter(StringUtils::isNotBlank).orElse(null);
+        }
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static TenantAlbumCategoryDetailQuery from(String json) {
+            return JSON.parseObject(json, TenantAlbumCategoryDetailQuery.class);
+        }
+    }
+
+    @ApiModel(" TenantAlbumCategoryDetail-机构专辑分类详情")
+    public static class TenantAlbumCategoryDetail {
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static TenantAlbumCategoryDetail from(String json) {
+            return JSON.parseObject(json, TenantAlbumCategoryDetail.class);
+        }
+    }
+
+}

+ 106 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/TenantAlbumCategoryWrapper.java

@@ -0,0 +1,106 @@
+package com.yonge.cooleshow.biz.dal.wrapper;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import com.yonge.cooleshow.biz.dal.entity.TenantAlbumCategoryDetail;
+import com.yonge.cooleshow.common.enums.ETenantAlbumCategoryType;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Optional;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * 机构专辑分类
+ * 2023-10-10 09:48:46
+ */
+@ApiModel(value = "TenantAlbumCategoryWrapper对象", description = "机构专辑分类查询对象")
+public class TenantAlbumCategoryWrapper {
+
+    @Data
+    @Builder
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @ApiModel(" TenantAlbumCategoryQuery-机构专辑分类")
+    public static class TenantAlbumCategoryQuery implements QueryInfo {
+
+        @ApiModelProperty("当前页")
+        private Integer page;
+
+        @ApiModelProperty("分页行数")
+        private Integer rows;
+
+        @ApiModelProperty("关键字匹配")
+        private String keyword;
+
+        @ApiModelProperty("分类类别")
+        private ETenantAlbumCategoryType categoryType;
+
+        public String getKeyword() {
+            return Optional.ofNullable(keyword).filter(StringUtils::isNotBlank).orElse(null);
+        }
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static TenantAlbumCategoryQuery from(String json) {
+            return JSON.parseObject(json, TenantAlbumCategoryQuery.class);
+        }
+    }
+
+    @Data
+    @ApiModel(" TenantAlbumCategory-机构专辑分类")
+    public static class TenantAlbumCategory {
+
+        @ApiModelProperty("主键ID")
+        private Long id;
+
+        @ApiModelProperty("专辑分类名称")
+        @NotNull(message = "专辑分类名称不能为空")
+        private String name;
+
+        @ApiModelProperty("专辑分类类别")
+        private ETenantAlbumCategoryType categoryType;
+
+        @ApiModelProperty("删除标记")
+        private Boolean delFlag;
+
+        @ApiModelProperty("创建人")
+        private Long createBy;
+
+        @ApiModelProperty("创建时间")
+        private Date createTime;
+
+        @ApiModelProperty("修改人")
+        private Long updateBy;
+
+        @ApiModelProperty("更新时间")
+        private Date updateTime;
+
+        @ApiModelProperty("专辑分类级别/类别值")
+        private List<TenantAlbumCategoryDetail> values = new ArrayList<>();
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static TenantAlbumCategory from(String json) {
+            return JSON.parseObject(json, TenantAlbumCategory.class);
+        }
+    }
+
+}

+ 20 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/TenantAlbumCategoryDetailMapper.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE  mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.yonge.cooleshow.biz.dal.mapper.TenantAlbumCategoryDetailMapper">
+
+
+
+    <!-- 表字段 -->
+    <sql id="baseColumns">
+        t.id_ AS id
+        , t.tenant_album_category_id_ AS tenantAlbumCategoryId
+        , t.value_ AS value
+    </sql>
+
+    <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.entity.TenantAlbumCategoryDetail">
+        SELECT
+        <include refid="baseColumns" />
+        FROM tenant_album_category_detail t
+    </select>
+
+</mapper>

+ 35 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/TenantAlbumCategoryMapper.xml

@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE  mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.yonge.cooleshow.biz.dal.mapper.TenantAlbumCategoryMapper">
+
+
+
+    <!-- 表字段 -->
+    <sql id="baseColumns">
+        t.id_ AS id
+        , t.name_ AS name
+        , t.category_type_ AS categoryType
+        , t.del_flag_ AS delFlag
+        , t.create_by_ AS createBy
+        , t.create_time_ AS createTime
+        , t.update_by_ AS updateBy
+        , t.update_time_ AS updateTime
+    </sql>
+
+    <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.entity.TenantAlbumCategory">
+        SELECT
+        <include refid="baseColumns" />
+        FROM tenant_album_category t
+        <where>
+            t.del_flag_ = 0
+            <if test="param.keyword != null and param.keyword.trim() != ''">
+                AND t.name_ LIKE concat('%',#{param.keyword},'%')
+            </if>
+            <if test="param.categoryType != null">
+                AND t.category_type_ = #{param.categoryType}
+            </if>
+        </where>
+
+    </select>
+
+</mapper>