haonan 1 年之前
父節點
當前提交
f84fad0000
共有 16 個文件被更改,包括 499 次插入16 次删除
  1. 13 0
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/TenantInfoController.java
  2. 2 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/StudentDao.java
  3. 2 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/TeacherDao.java
  4. 5 2
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/mapper/TenantAlbumMusicMapper.java
  5. 2 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/TenantAlbumMusicService.java
  6. 9 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/TenantInfoService.java
  7. 21 3
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TenantAlbumMusicServiceImpl.java
  8. 54 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TenantInfoServiceImpl.java
  9. 130 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/TenantAlbumMusicWrapper.java
  10. 3 2
      cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicSheetMapper.xml
  11. 9 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/StudentMapper.xml
  12. 9 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/TeacherMapper.xml
  13. 51 5
      cooleshow-user/user-biz/src/main/resources/config/mybatis/TenantAlbumMusicMapper.xml
  14. 17 1
      cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/controller/TenantAlbumSheetController.java
  15. 106 0
      cooleshow-user/user-tenant/src/main/java/com/yonge/cooleshow/tenant/controller/TenantInfoController.java
  16. 66 0
      cooleshow-user/user-tenant/src/main/java/com/yonge/cooleshow/tenant/io/request/TenantInfoVo.java

+ 13 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/TenantInfoController.java

@@ -79,5 +79,18 @@ public class TenantInfoController extends BaseController {
         return succeed();
     }
 
+    /**
+     * 查询详情
+     *
+     * @param id
+     */
+    @PostMapping("/detail")
+    @ApiOperation(value = "查询详情", notes = "查询详情")
+    @PreAuthorize("@pcs.hasPermissions('tenantInfo/detail')")
+    public HttpResponseResult<TenantInfoWrapper.TenantInfo> detail(@RequestParam("id")Long id) {
+
+        TenantInfoWrapper.TenantInfo info = tenantInfoService.detailTenantInfo(id);
+        return succeed(info);
+    }
 
 }

+ 2 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/StudentDao.java

@@ -77,4 +77,6 @@ public interface StudentDao extends BaseMapper<Student> {
     int countStudentsWithTenant(Map<String, Object> params);
 
     List<TenantInfoWrapper.UserCount> countTeacherByTenantIds(@Param("tenantIdList") List<Long> tenantIdList);
+
+    Integer queryStudentCounts(@Param("id") Long id);
 }

+ 2 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/TeacherDao.java

@@ -113,4 +113,6 @@ public interface TeacherDao extends BaseMapper<Teacher> {
     List<StatGroupWrapper> selectTeacherStudentNumberStatInfo(@Param("teacherIds") List<Long> teacherIds);
 
     List<TenantInfoWrapper.UserCount> countTeacherByTenantIds(@Param("tenantIdList") List<Long> tenantIdList);
+
+    Integer queryTeacherCounts(@Param("id") Long id);
 }

+ 5 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/mapper/TenantAlbumMusicMapper.java

@@ -4,6 +4,8 @@ import java.util.List;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.biz.dal.entity.MusicSheet;
+import com.yonge.cooleshow.biz.dal.enums.SubjectTypeEnum;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 import com.yonge.cooleshow.biz.dal.entity.TenantAlbumMusic;
@@ -22,6 +24,7 @@ public interface TenantAlbumMusicMapper extends BaseMapper<TenantAlbumMusic> {
 	 * @param param TenantAlbumMusicWrapper.TenantAlbumMusicQuery
 	 * @return List<TenantAlbumMusicWrapper.TenantAlbumMusic>
 	 */
-	List<TenantAlbumMusic> selectPage(@Param("page") IPage<TenantAlbumMusic> page, @Param("param") TenantAlbumMusicWrapper.TenantAlbumMusicQuery param);
-	
+	List<TenantAlbumMusicWrapper.StudentTenantAlbumMusic> selectPage(@Param("page") IPage<TenantAlbumMusicWrapper.StudentTenantAlbumMusic> page, @Param("param") TenantAlbumMusicWrapper.StudentMusicSheetQuery param);
+
+	List<Long> selectMusicSheetIds(@Param("albumIds") List<Long> albumIds, @Param("subjectType") SubjectTypeEnum subjectType, @Param("type") String type, @Param("level") String level);
 }

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

@@ -2,6 +2,7 @@ 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.entity.MusicSheet;
 import com.yonge.cooleshow.biz.dal.wrapper.TenantAlbumMusicWrapper;
 import com.yonge.cooleshow.biz.dal.entity.TenantAlbumMusic;
 
@@ -24,7 +25,7 @@ public interface TenantAlbumMusicService extends IService<TenantAlbumMusic>  {
      * @param query TenantAlbumMusicWrapper.TenantAlbumMusicQuery
      * @return IPage<TenantAlbumMusic>
      */
-    IPage<TenantAlbumMusic> selectPage(IPage<TenantAlbumMusic> page, TenantAlbumMusicWrapper.TenantAlbumMusicQuery query);
+    IPage<TenantAlbumMusicWrapper.StudentTenantAlbumMusic> selectPage(IPage<TenantAlbumMusicWrapper.StudentTenantAlbumMusic> page, TenantAlbumMusicWrapper.StudentTenantAlbumMusicQuery query);
 	
     /**
      * 添加

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

@@ -20,7 +20,15 @@ public interface TenantInfoService extends IService<TenantInfo>  {
      * @param id 详情ID
      * @return TenantInfo
      */
-	TenantInfo detail(Long id);
+    TenantInfo detail(Long id);
+
+    /**
+     * 查询机构详情
+     * @param id 详情ID
+     * @return TenantInfo
+     */
+    TenantInfoWrapper.TenantInfo detailTenantInfo(Long id);
+
 
     /**
      * 分页查询

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

@@ -7,6 +7,7 @@ import com.yonge.cooleshow.biz.dal.entity.MusicSheet;
 import com.yonge.cooleshow.biz.dal.entity.MusicTag;
 import com.yonge.cooleshow.biz.dal.entity.Subject;
 import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
+import com.yonge.cooleshow.biz.dal.enums.SubjectTypeEnum;
 import com.yonge.cooleshow.biz.dal.service.*;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -46,6 +47,9 @@ public class TenantAlbumMusicServiceImpl extends ServiceImpl<TenantAlbumMusicMap
     @Autowired
     private MusicTagService musicTagService;
 
+    @Autowired
+    private TenantAlbumMusicMapper tenantAlbumMusicMapper;
+
     /**
      * 查询详情
      * @param id 详情ID
@@ -64,9 +68,23 @@ public class TenantAlbumMusicServiceImpl extends ServiceImpl<TenantAlbumMusicMap
      * @return IPage<TenantAlbumMusic>
      */
     @Override
-    public IPage<TenantAlbumMusic> selectPage(IPage<TenantAlbumMusic> page, TenantAlbumMusicWrapper.TenantAlbumMusicQuery query) {
-        
-        return page.setRecords(baseMapper.selectPage(page, query));
+    public IPage<TenantAlbumMusicWrapper.StudentTenantAlbumMusic> selectPage(IPage<TenantAlbumMusicWrapper.StudentTenantAlbumMusic> page, TenantAlbumMusicWrapper.StudentTenantAlbumMusicQuery query) {
+        List<Long> albumIds = query.getAlbumIds();
+        SubjectTypeEnum subjectType = query.getSubjectType();
+        String type = query.getType();
+        String level = query.getLevel();
+
+        List<Long> musicSheetIds = tenantAlbumMusicMapper.selectMusicSheetIds(albumIds, subjectType, type, level);
+
+        TenantAlbumMusicWrapper.StudentMusicSheetQuery musicSheetQuery = new TenantAlbumMusicWrapper.StudentMusicSheetQuery();
+        musicSheetQuery.setMusicSheetIds(musicSheetIds);
+        musicSheetQuery.setMusicTagId(query.getMusicTagId());
+        musicSheetQuery.setSubjectId(query.getSubjectId());
+        List<TenantAlbumMusicWrapper.StudentTenantAlbumMusic> musicSheets = tenantAlbumMusicMapper.selectPage(page, musicSheetQuery);
+
+
+
+        return page.setRecords(baseMapper.selectPage(page, musicSheetQuery));
     }
 
     /**

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

@@ -1,5 +1,6 @@
 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.core.toolkit.Wrappers;
@@ -20,6 +21,7 @@ import com.yonge.cooleshow.biz.dal.mapper.TenantStaffMapper;
 import com.yonge.cooleshow.biz.dal.service.SysAreaService;
 import com.yonge.cooleshow.biz.dal.service.SysConfigService;
 import com.yonge.cooleshow.biz.dal.service.TenantInfoService;
+import com.yonge.cooleshow.biz.dal.wrapper.TenantAlbumWrapper;
 import com.yonge.cooleshow.biz.dal.wrapper.TenantInfoWrapper;
 import com.yonge.cooleshow.common.constant.SysConfigConstant;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
@@ -91,10 +93,62 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoMapper, TenantI
         if (id == null || id == -1) {
             return null;
         }
+
         TenantInfo info = baseMapper.selectById(id);
         return info;
     }
 
+
+    /**
+     * 查询机构详情
+     *
+     * @param id 详情ID
+     * @return TenantInfo
+     */
+    @Override
+    public TenantInfoWrapper.TenantInfo detailTenantInfo(Long id) {
+        if (id == null || id == -1) {
+            return null;
+        }
+        TenantInfo info = baseMapper.selectById(id);
+        TenantInfoWrapper.TenantInfo tenantInfo = JSON.parseObject(JSON.toJSONString(info), TenantInfoWrapper.TenantInfo.class);
+
+        //查询对应老师数量
+        Integer teacherCounts = teacherDao.queryTeacherCounts(id);
+
+        //查询对应学生数量
+        Integer studentCounts = studentDao.queryStudentCounts(id);
+
+
+        tenantInfo.setTeacherCounts(teacherCounts);
+        tenantInfo.setStudentCounts(studentCounts);
+
+        //获取省市区信息
+        Set<Integer> codes = new HashSet<>();
+        codes.add(tenantInfo.getCityCode());
+        codes.add(tenantInfo.getProvinceCode());
+        codes.add(tenantInfo.getRegionCode());
+
+        //将地区码转化为对应的地名
+        List<Integer> areaCodeList = new ArrayList<>();
+        areaCodeList.addAll(codes);
+
+        Map<Integer, String> codeNameMap = new HashMap<>();
+
+        if (!CollectionUtils.isEmpty(areaCodeList)) {
+            List<SysArea> sysAreaList = sysAreaService.queryByCodes(areaCodeList);
+            codeNameMap = sysAreaList.stream().collect(Collectors.toMap(SysArea::getCode,
+                    SysArea::getName));
+        }
+
+        tenantInfo.setProvinceName(codeNameMap.get(tenantInfo.getProvinceCode()));
+        tenantInfo.setCityName(codeNameMap.get(tenantInfo.getCityCode()));
+        tenantInfo.setRegionName(codeNameMap.get(tenantInfo.getRegionCode()));
+
+
+        return tenantInfo;
+    }
+
     /**
      * 分页查询
      *

+ 130 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/TenantAlbumMusicWrapper.java

@@ -1,6 +1,7 @@
 package com.yonge.cooleshow.biz.dal.wrapper;
 
 import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.microsvc.toolkit.common.response.paging.QueryInfo;
 import com.yonge.cooleshow.biz.dal.entity.MusicTag;
 import com.yonge.cooleshow.biz.dal.entity.Subject;
@@ -17,6 +18,9 @@ import lombok.Data;
 import lombok.NoArgsConstructor;
 import org.apache.commons.lang3.StringUtils;
 
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.Size;
+
 /**
  * 机构专辑曲目
  * 2023-07-21 17:32:49
@@ -111,4 +115,129 @@ public class TenantAlbumMusicWrapper {
             return JSON.parseObject(json, TenantAlbumMusic.class);
         }
     }
-}
+
+
+
+
+    @Data
+    @Builder
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @ApiModel(" TenantAlbumMusicQuery-学生端专辑曲目分页查询")
+    public static class StudentTenantAlbumMusicQuery implements QueryInfo {
+
+        @ApiModelProperty("当前页")
+        private Integer page;
+
+        @ApiModelProperty("分页行数")
+        private Integer rows;
+
+        @ApiModelProperty("关键字匹配")
+        private String keyword;
+
+        @ApiModelProperty(value = "专辑", hidden = true)
+        private List<Long> albumIds;
+
+        @ApiModelProperty("声部分类(ENSEMBLE, MUSIC, SUBJECT)")
+        private SubjectTypeEnum subjectType;
+
+        @ApiModelProperty("声部id")
+        private Long subjectId;
+
+        @ApiModelProperty("级别")
+        private String level;
+
+        @ApiModelProperty("类型")
+        private String type;
+
+        @ApiModelProperty("标签")
+        private Long musicTagId;
+
+        public String getKeyword() {
+            return Optional.ofNullable(keyword).filter(StringUtils::isNotBlank).orElse(null);
+        }
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static TenantAlbumMusicQuery from(String json) {
+            return JSON.parseObject(json, TenantAlbumMusicQuery.class);
+        }
+
+
+    }
+        @Data
+        @Builder
+        @NoArgsConstructor
+        @AllArgsConstructor
+        @ApiModel(" TenantAlbumMusic-学生端专辑曲目返回")
+        public static class StudentTenantAlbumMusic implements QueryInfo {
+
+            @ApiModelProperty(value = "曲谱名称")
+            private String musicSheetName;
+
+            @ApiModelProperty(value = "封面图")
+            private String titleImg;  //曲谱名称
+
+            @ApiModelProperty(value = "曲谱来源(平台用户ID或者是老师ID)")
+            private Long userId;  //曲谱来源(平台用户ID或者是老师ID)
+
+            @ApiModelProperty(value = "艺术家")
+            private String composer;  //音乐家
+
+            @ApiModelProperty(value = "曲谱声部(适用的乐器,可能是多个,用逗号分隔)")
+            private String musicSubject;  //曲谱声部(适用的乐器,可能是多个,用逗号分隔)
+
+            @ApiModelProperty(value = "曲谱声部名称(适用的乐器,可能是多个,用逗号分隔)")
+            private String musicSubjectName;  //曲谱声部名称(适用的乐器,可能是多个,用逗号分隔)
+
+            @ApiModelProperty(value = "上传人")
+            private String userName;
+
+            public String jsonString() {
+                return JSON.toJSONString(this);
+            }
+
+            public static TenantAlbumMusic from(String json) {
+                return JSON.parseObject(json, TenantAlbumMusic.class);
+            }
+
+        }
+
+
+    @Data
+    @Builder
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @ApiModel(" StudentMusicSheetQuery-学生端专辑曲目分页")
+    public static class StudentMusicSheetQuery implements QueryInfo {
+
+        @ApiModelProperty("当前页")
+        private Integer page;
+
+        @ApiModelProperty("分页行数")
+        private Integer rows;
+
+        @ApiModelProperty("曲谱表ids")
+        private List<Long> musicSheetIds;
+
+        @ApiModelProperty("标签")
+        private Long musicTagId;
+
+        @ApiModelProperty("声部id")
+        private Long subjectId;
+
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static StudentMusicSheetQuery from(String json) {
+            return JSON.parseObject(json, StudentMusicSheetQuery.class);
+        }
+
+    }
+
+
+    }

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

@@ -145,9 +145,10 @@
             or t.music_subject_ is null or t.music_subject_ = ''
             )
         </if>
-        <if test="param.musicSheetIdlist != null">
+        <if test="param.musicSheetIdlist != null and param.musicSheetIdlist.size() != 0">
+            and id_ in
             <foreach collection="param.musicSheetIdlist" separator="," item="item" open="(" close=")">
-                #{item}
+                 #{item}
             </foreach>
         </if>
         <if test="param.state != null">

+ 9 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -324,6 +324,15 @@
             #{item}
         </foreach>
         group by tenant_id_
+    </select>
+    <select id="queryStudentCounts" resultType="java.lang.Integer">
+        select count(tenant_id_)
+        from student
+        <where>
+            <if test="id != null">
+                and  tenant_id_ = #{id}
+            </if>
+        </where>
 
     </select>
 </mapper>

+ 9 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/TeacherMapper.xml

@@ -376,5 +376,14 @@
         </foreach>
         group by tenant_id_
     </select>
+    <select id="queryTeacherCounts" resultType="java.lang.Integer">
+        select count(tenant_id_)
+        from teacher
+        <where>
+            <if test="id != null">
+              and   tenant_id_ = #{id}
+            </if>
+        </where>
+    </select>
     <!--老师学生人数统计-->
 </mapper>

+ 51 - 5
cooleshow-user/user-biz/src/main/resources/config/mybatis/TenantAlbumMusicMapper.xml

@@ -17,10 +17,56 @@
         , t.create_time_ AS createTime
         </sql> 
     
-    <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.entity.TenantAlbumMusic">
-		SELECT         
-        	<include refid="baseColumns" />
-		FROM tenant_album_music t
+    <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.wrapper.TenantAlbumMusicWrapper$StudentTenantAlbumMusic">
+		SELECT
+        m.music_sheet_name_ as musicSheetName,
+        m.composer_ as composer,
+        m.user_id_ as userId,
+        m.music_subject_ as musicSubject,
+        m.title_img_ as titleImg,
+        u.username_ as userName,
+        s.name_ as musicSubjectName
+		FROM music_sheet m
+        left join  subject s on s.id_ = m.music_subject_
+        left join sys_user u on m.user_id_ = u.id_
+        <where>
+            <if test="param.musicTagId != null ">
+                and m.music_tag_ = #{param.musicTagId}
+            </if>
+            <if test="param.subjectId != null" >
+                and m.music_subject_ = #{param.subjectId}
+            </if>
+            <if test="param.musicSheetIds != null and param.musicSheetIds.size != 0">
+                and m.id_ in
+                <foreach collection="param.musicSheetIds" item="item" separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+        </where>
 	</select>
-    
+    <select id="selectMusicSheetIds" resultType="java.lang.Long">
+        select
+        t.music_sheet_id_
+        FROM tenant_album_music t
+        <where>
+           <if test="level != null and level != ''">
+              and  t.level_ = #{level}
+           </if>
+            <if test="type != null and type != ''">
+              and t.type_ = #{type}
+            </if>
+            <if test="subjectType != null and subjectType != ''">
+              and  t.subject_type_ = #{subjectType}
+            </if>
+            <if test="albumIds != null and albumIds.size != 0">
+              and  t.tenant_album_id_ in
+                <foreach collection="albumIds" item="item" separator="," open="(" close=")">
+                #{item}
+            </foreach>
+            </if>
+        </where>
+
+
+    </select>
+
 </mapper>

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

@@ -1,12 +1,14 @@
 package com.yonge.cooleshow.student.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
 import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
 import com.yonge.cooleshow.auth.api.entity.SysUser;
 import com.yonge.cooleshow.biz.dal.dto.search.MusicAlbumDetailSearch;
 import com.yonge.cooleshow.biz.dal.dto.search.MusicAlbumSearch;
 import com.yonge.cooleshow.biz.dal.dto.search.StudentMusicAlbumSearch;
 import com.yonge.cooleshow.biz.dal.dto.search.TeacherStyleSearch;
+import com.yonge.cooleshow.biz.dal.entity.MusicSheet;
 import com.yonge.cooleshow.biz.dal.entity.Student;
 import com.yonge.cooleshow.biz.dal.entity.TenantAlbumMusic;
 import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
@@ -20,11 +22,11 @@ import com.yonge.cooleshow.biz.dal.vo.AlbumDetailVo;
 import com.yonge.cooleshow.biz.dal.vo.MusicAlbumVo;
 import com.yonge.cooleshow.biz.dal.vo.TeacherStyleVideoVo;
 import com.yonge.cooleshow.biz.dal.wrapper.TenantAlbumMusicWrapper;
+import com.yonge.cooleshow.biz.dal.wrapper.TenantInfoWrapper;
 import com.yonge.cooleshow.common.controller.BaseController;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
 import com.yonge.cooleshow.common.enums.YesOrNoEnum;
 import com.yonge.toolset.base.page.PageInfo;
-import com.yonge.toolset.base.page.QueryInfo;
 import com.yonge.toolset.mybatis.support.PageUtil;
 import io.swagger.annotations.*;
 import org.apache.commons.lang3.StringUtils;
@@ -69,4 +71,18 @@ public class TenantAlbumSheetController extends BaseController {
         return succeed(tenantAlbumMusicService.getTenantAlbumMusicQuery(query));
     }
 
+
+
+    @ApiOperation(value = "分页查询")
+    @PostMapping("/page")
+    public HttpResponseResult<PageInfo<TenantAlbumMusicWrapper.StudentTenantAlbumMusic>> page(@RequestBody TenantAlbumMusicWrapper.StudentTenantAlbumMusicQuery query) {
+        SysUser user = sysUserFeignService.queryUserInfo();
+        if (user == null || null == user.getId()) {
+            return failed(HttpStatus.FORBIDDEN, "请登录");
+        }
+        IPage<TenantAlbumMusicWrapper.StudentTenantAlbumMusic> page = tenantAlbumMusicService.selectPage(QueryInfo.getPage(query), query);
+        return succeed((PageUtil.pageInfo(page)));
+    }
+
+
 }

+ 106 - 0
cooleshow-user/user-tenant/src/main/java/com/yonge/cooleshow/tenant/controller/TenantInfoController.java

@@ -0,0 +1,106 @@
+package com.yonge.cooleshow.tenant.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.biz.dal.entity.TenantInfo;
+import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
+import com.yonge.cooleshow.biz.dal.service.SmsCodeService;
+import com.yonge.cooleshow.biz.dal.service.TenantInfoService;
+import com.yonge.cooleshow.biz.dal.wrapper.TenantInfoWrapper;
+import com.yonge.cooleshow.common.controller.BaseController;
+import com.yonge.cooleshow.common.entity.HttpResponseResult;
+import com.yonge.cooleshow.common.security.SecurityConstants;
+import com.yonge.cooleshow.tenant.io.request.TenantInfoVo;
+import com.yonge.toolset.base.exception.BizException;
+import com.yonge.toolset.base.page.PageInfo;
+import com.yonge.toolset.base.util.StringUtil;
+import com.yonge.toolset.mybatis.support.PageUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.annotations.Param;
+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.*;
+
+import javax.validation.Valid;
+
+/**
+ * @Author:haonan
+ * @Date:2023/7/24 9:57
+ * @Filename:TenantInfoController
+ */
+@RestController
+@RequestMapping("/tenantInfoUpdate")
+@Api(value = "机构信息修改", tags = "机构信息修改")
+public class TenantInfoController extends BaseController {
+
+    @Autowired
+    TenantInfoService tenantInfoService;
+
+    @Autowired
+    SysUserFeignService sysUserFeignService;
+
+    @Autowired
+    private SmsCodeService smsCodeService;
+
+    @ApiOperation(value = "发送登录短信验证码")
+    @ApiImplicitParams({  @ApiImplicitParam(name = "mobile", value = "手机号", required = true, dataType = "String"),
+            @ApiImplicitParam(name = "type", value = "类型(PASSWD:修改密码,LOGIN:登录或注册,BANK:绑定银行卡,PHONE:修改手机号)", required = true, dataType = "String") })
+    @PostMapping(value = "/sendSmsCode")
+    public Object sendLoginVerifyCode(String mobile,String type) throws Exception {
+        smsCodeService.sendValidCode(mobile, type, ClientEnum.SYSTEM);
+        return succeed();
+    }
+
+    @ApiOperation(value = "校验短信验证码")
+    @ApiImplicitParams({ @ApiImplicitParam(name = "phone", value = "手机号", required = true, dataType = "String"),
+            @ApiImplicitParam(name = "code", value = "短信验证码", required = true, dataType = "String"),
+            @ApiImplicitParam(name = "type", value = "类型(PASSWD:修改密码,LOGIN:登录或注册,BANK:绑定银行卡,PHONE:修改手机号)", required = true, dataType = "String") })
+    @PostMapping(value = "/verifySmsCode")
+    public Object verifySmsCode(String phone,String code,String type) {
+        if(StringUtils.isEmpty(phone) || StringUtils.isEmpty(code)){
+            return failed(SecurityConstants.PARAM_VERIFY_EXCEPTION);
+        }
+        if(smsCodeService.verifyValidCode(phone,code,type)){
+            return succeed();
+        }
+        return failed("验证码校验失败");
+    }
+
+
+
+    /**
+     * 修改数据
+     */
+    @PostMapping("/update")
+    @ApiOperation(value = "修改机构信息", notes = "传入TenantInfo")
+    @PreAuthorize("@pcs.hasPermissions('tenantInfoUpdate/update')")
+    public HttpResponseResult<Boolean> updateTenantInfo(@Valid @RequestBody TenantInfoVo.TenantInfo info) {
+
+        return succeed(tenantInfoService.update(JSON.parseObject(info.jsonString(), TenantInfo.class)));
+
+    }
+
+    /**
+     * 查询详细
+     */
+    @PostMapping("/detail")
+    @ApiOperation(value = "查询详细", notes = "查询详细")
+    @PreAuthorize("@pcs.hasPermissions('tenantInfoUpdate/detail')")
+    public HttpResponseResult<TenantInfoWrapper.TenantInfo> detail(@RequestParam("id")Long id) {
+        TenantInfoWrapper.TenantInfo info = tenantInfoService.detailTenantInfo(id);
+
+        return succeed(info);
+
+    }
+
+
+
+
+}

+ 66 - 0
cooleshow-user/user-tenant/src/main/java/com/yonge/cooleshow/tenant/io/request/TenantInfoVo.java

@@ -0,0 +1,66 @@
+package com.yonge.cooleshow.tenant.io.request;
+
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.hibernate.validator.constraints.Length;
+
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+
+/**
+ * 机构表
+ * 2023-08-01 11:19:12
+ */
+@ApiModel(value = "TenantInfoVo对象", description = "机构表查询视图对象")
+public class TenantInfoVo {
+
+    @Data
+    @ApiModel(" TenantInfo-机构表")
+    public static class TenantInfo {
+
+        @ApiModelProperty("主键ID")
+        private Long id;
+
+        @ApiModelProperty("名称")
+        @NotNull
+        private String name;
+
+        @ApiModelProperty("logo")
+        private String logo;
+
+        @ApiModelProperty("简介")
+        private String briefIntroduction;
+
+        @ApiModelProperty("省份编码")
+        @NotNull
+        private Integer provinceCode;
+
+        @ApiModelProperty("城市编码")
+        @NotNull
+        private Integer cityCode;
+
+        @ApiModelProperty("地区/街道")
+        @NotNull
+        private Integer regionCode;
+
+        @ApiModelProperty("联系人")
+        @Length(min = 1, max = 8, message = "联系人字符最大8位")
+        private String username;
+
+        @ApiModelProperty("手机号")
+        @NotNull
+        @Pattern(regexp = "^1\\d{10}$", message = "手机号码格式错误")
+        private String phone;
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static TenantInfo from(String json) {
+            return JSON.parseObject(json, TenantInfo.class);
+        }
+    }
+
+}