浏览代码

管乐迷曲目来源内容平台

zouxuan 1 年之前
父节点
当前提交
63d83f946b

+ 7 - 12
mec-application/src/main/java/com/ym/mec/teacher/controller/SysMusicScoreController.java

@@ -1,30 +1,29 @@
 package com.ym.mec.teacher.controller;
 package com.ym.mec.teacher.controller;
 
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.MusicScoreDto;
 import com.ym.mec.biz.dal.dto.MusicScoreDto;
 import com.ym.mec.biz.dal.entity.SysMusicScore;
 import com.ym.mec.biz.dal.entity.SysMusicScore;
 import com.ym.mec.biz.dal.enums.ClientTypeEnum;
 import com.ym.mec.biz.dal.enums.ClientTypeEnum;
 import com.ym.mec.biz.dal.enums.ExamSongTypeEnum;
 import com.ym.mec.biz.dal.enums.ExamSongTypeEnum;
 import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
 import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
 import com.ym.mec.biz.service.SysMusicScoreService;
 import com.ym.mec.biz.service.SysMusicScoreService;
+import com.ym.mec.biz.service.SysUserService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.controller.BaseController;
-import com.ym.mec.common.exception.BizException;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
+import javax.annotation.Resource;
+
 @RequestMapping("${app-config.url.teacher:}/sysMusicScore")
 @RequestMapping("${app-config.url.teacher:}/sysMusicScore")
 @Api(tags = "曲库")
 @Api(tags = "曲库")
 @RestController
 @RestController
 public class SysMusicScoreController extends BaseController {
 public class SysMusicScoreController extends BaseController {
 
 
-    @Autowired
+    @Resource
     private SysMusicScoreService sysMusicScoreService;
     private SysMusicScoreService sysMusicScoreService;
-    @Autowired
-    private SysUserFeignService sysUserFeignService;
+    @Resource
+    private SysUserService sysUserService;
 
 
     @ApiOperation(value = "新增")
     @ApiOperation(value = "新增")
     @PostMapping("/add")
     @PostMapping("/add")
@@ -53,14 +52,10 @@ public class SysMusicScoreController extends BaseController {
         if(StringUtils.isEmpty(type)){
         if(StringUtils.isEmpty(type)){
             queryInfo.setType("ALL");
             queryInfo.setType("ALL");
         }
         }
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if(sysUser == null){
-            throw new BizException("请登录");
-        }
         if(queryInfo.getClientType() == null){
         if(queryInfo.getClientType() == null){
             queryInfo.setClientType(ClientTypeEnum.NETWORK_ROOM);
             queryInfo.setClientType(ClientTypeEnum.NETWORK_ROOM);
         }
         }
-        queryInfo.setCreateUserId(sysUser.getId());
+        queryInfo.setCreateUserId(sysUserService.getUserId());
         queryInfo.setShowFlag(1);
         queryInfo.setShowFlag(1);
         return succeed(sysMusicScoreService.queryPage(queryInfo));
         return succeed(sysMusicScoreService.queryPage(queryInfo));
     }
     }

+ 6 - 5
mec-application/src/main/java/com/ym/mec/web/controller/SysMusicScoreController.java

@@ -1,6 +1,5 @@
 package com.ym.mec.web.controller;
 package com.ym.mec.web.controller;
 
 
-import com.ym.mec.biz.dal.dto.MusicScoreDto;
 import com.ym.mec.biz.dal.entity.SysMusicScore;
 import com.ym.mec.biz.dal.entity.SysMusicScore;
 import com.ym.mec.biz.dal.entity.SysMusicScoreCategories;
 import com.ym.mec.biz.dal.entity.SysMusicScoreCategories;
 import com.ym.mec.biz.dal.enums.ClientTypeEnum;
 import com.ym.mec.biz.dal.enums.ClientTypeEnum;
@@ -12,9 +11,11 @@ import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import java.util.List;
 import java.util.List;
@@ -64,13 +65,13 @@ public class SysMusicScoreController extends BaseController {
         return succeed();
         return succeed();
     }*/
     }*/
 
 
-    @ApiOperation(value = "删除")
+/*    @ApiOperation(value = "删除")
     @PostMapping("/del")
     @PostMapping("/del")
     @PreAuthorize("@pcs.hasPermissions('sysMusicScore/del')")
     @PreAuthorize("@pcs.hasPermissions('sysMusicScore/del')")
     public Object del(Integer id) {
     public Object del(Integer id) {
         sysMusicScoreService.del(id);
         sysMusicScoreService.del(id);
         return succeed();
         return succeed();
-    }
+    }*/
 
 
     @ApiOperation(value = "分页查询")
     @ApiOperation(value = "分页查询")
     @GetMapping("/queryPage")
     @GetMapping("/queryPage")

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysMusicScoreCategoriesDao.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.dal.dao;
 package com.ym.mec.biz.dal.dao;
 
 
 
 
+import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetCategoryWrapper;
 import com.ym.mec.biz.dal.entity.SysMusicScoreCategories;
 import com.ym.mec.biz.dal.entity.SysMusicScoreCategories;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.dal.BaseDAO;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
@@ -28,4 +29,6 @@ public interface SysMusicScoreCategoriesDao extends BaseDAO<Integer, SysMusicSco
     List<SysMusicScoreCategories> queryByIds(String ids);
     List<SysMusicScoreCategories> queryByIds(String ids);
     
     
     SysMusicScoreCategories queryByParentId(Integer parentId);
     SysMusicScoreCategories queryByParentId(Integer parentId);
+
+    List<CbsMusicSheetCategoryWrapper.MusicSheetCategory> categoryList(@Param("param") CbsMusicSheetCategoryWrapper.MusicSheetCategoryQuery queryInfo);
 }
 }

+ 12 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysMusicScoreDao.java

@@ -1,7 +1,10 @@
 package com.ym.mec.biz.dal.dao;
 package com.ym.mec.biz.dal.dao;
 
 
 
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetApiWrapper;
 import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetApplicationExtendWrapper;
 import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetApplicationExtendWrapper;
+import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetExtendWrapper;
 import com.ym.mec.biz.dal.dto.SysMusicScoreMetronomeTranscod;
 import com.ym.mec.biz.dal.dto.SysMusicScoreMetronomeTranscod;
 import com.ym.mec.biz.dal.dto.SysMusicScoreTranscod;
 import com.ym.mec.biz.dal.dto.SysMusicScoreTranscod;
 import com.ym.mec.biz.dal.entity.SysMusicScore;
 import com.ym.mec.biz.dal.entity.SysMusicScore;
@@ -28,5 +31,13 @@ public interface SysMusicScoreDao extends BaseDAO<Integer, SysMusicScore> {
 
 
     List<SysMusicScore> findByCbsId(@Param("cbsMusicSheetIds") List<Long> cbsMusicSheetIds);
     List<SysMusicScore> findByCbsId(@Param("cbsMusicSheetIds") List<Long> cbsMusicSheetIds);
 
 
-    void updateBatchByCbsId(List<CbsMusicSheetApplicationExtendWrapper.MusicSheetApplicationExtend> updateMusicScore);
+    void updateBatchByCbsId(@Param("vos") List<CbsMusicSheetApplicationExtendWrapper.MusicSheetApplicationExtend> updateMusicScore);
+
+    void batchInsert(@Param("vos") List<CbsMusicSheetApplicationExtendWrapper.MusicSheetApplicationExtend> addMusicSheet);
+
+    void batchEnable(@Param("cbsMusicSheetIds") String cbsMusicSheetIds, @Param("status") Boolean status);
+
+    void batchDel(@Param("cbsMusicSheetIds") String cbsMusicSheetIds);
+
+    void updateMusicSheet(@Param("param") CbsMusicSheetApiWrapper.MusicSheetUpdate musicSheetUpdate);
 }
 }

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysUserTenantDao.java

@@ -1,6 +1,8 @@
 package com.ym.mec.biz.dal.dao;
 package com.ym.mec.biz.dal.dao;
 
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetExtendWrapper;
 import com.ym.mec.biz.dal.entity.SysUserTenant;
 import com.ym.mec.biz.dal.entity.SysUserTenant;
 import com.ym.mec.biz.dal.vo.SysUserTenantVo;
 import com.ym.mec.biz.dal.vo.SysUserTenantVo;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
@@ -19,5 +21,10 @@ public interface SysUserTenantDao extends BaseMapper<SysUserTenant> {
 
 
     List<SysUserTenantVo> queryUserTenant(@Param("userId") Integer userId);
     List<SysUserTenantVo> queryUserTenant(@Param("userId") Integer userId);
 
 
+    IPage<CbsMusicSheetExtendWrapper.MusicSheetExtend> personOwnerList(@Param("page") IPage<CbsMusicSheetExtendWrapper.MusicSheetExtend> page,
+                                                                       @Param("param") CbsMusicSheetExtendWrapper.MusicSheetExtendQuery queryInfo);
+
+    IPage<CbsMusicSheetExtendWrapper.MusicSheetExtend> orgOwnerList(@Param("page") IPage<CbsMusicSheetExtendWrapper.MusicSheetExtend> page,
+                                                                    @Param("param") CbsMusicSheetExtendWrapper.MusicSheetExtendQuery queryInfo);
 }
 }
 
 

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/SysMusicScoreCategoriesService.java

@@ -2,6 +2,7 @@ package com.ym.mec.biz.service;
 
 
 
 
 import com.ym.mec.auth.api.dto.MusicScoreQueryInfo;
 import com.ym.mec.auth.api.dto.MusicScoreQueryInfo;
+import com.ym.mec.biz.dal.dao.SysMusicScoreCategoriesDao;
 import com.ym.mec.biz.dal.entity.SysMusicScoreCategories;
 import com.ym.mec.biz.dal.entity.SysMusicScoreCategories;
 import com.ym.mec.common.service.BaseService;
 import com.ym.mec.common.service.BaseService;
 
 
@@ -9,6 +10,8 @@ import java.util.List;
 
 
 public interface SysMusicScoreCategoriesService extends BaseService<Integer, SysMusicScoreCategories> {
 public interface SysMusicScoreCategoriesService extends BaseService<Integer, SysMusicScoreCategories> {
 
 
+    SysMusicScoreCategoriesDao getDao();
+
     List<SysMusicScoreCategories> queryTree(MusicScoreQueryInfo menuQueryInfo);
     List<SysMusicScoreCategories> queryTree(MusicScoreQueryInfo menuQueryInfo);
     
     
     List<SysMusicScoreCategories> queryCategoriesTreeList(String categoryIdList, Boolean isQueryEnable);
     List<SysMusicScoreCategories> queryCategoriesTreeList(String categoryIdList, Boolean isQueryEnable);

+ 13 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CbsMusicSheetServiceImpl.java

@@ -7,9 +7,12 @@ import com.dayaedu.cbs.openfeign.service.CbsMusicSheetService;
 import com.dayaedu.cbs.openfeign.wrapper.music.*;
 import com.dayaedu.cbs.openfeign.wrapper.music.*;
 import com.microsvc.toolkit.common.response.paging.PageInfo;
 import com.microsvc.toolkit.common.response.paging.PageInfo;
 import com.microsvc.toolkit.common.response.paging.QueryInfo;
 import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import com.ym.mec.biz.dal.dao.SysUserTenantDao;
 import com.ym.mec.biz.dal.entity.Subject;
 import com.ym.mec.biz.dal.entity.Subject;
 import com.ym.mec.biz.dal.entity.SysMusicScore;
 import com.ym.mec.biz.dal.entity.SysMusicScore;
+import com.ym.mec.biz.dal.entity.SysMusicScoreCategories;
 import com.ym.mec.biz.service.SubjectService;
 import com.ym.mec.biz.service.SubjectService;
+import com.ym.mec.biz.service.SysMusicScoreCategoriesService;
 import com.ym.mec.biz.service.SysMusicScoreService;
 import com.ym.mec.biz.service.SysMusicScoreService;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.exception.BizException;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -31,9 +34,11 @@ public class CbsMusicSheetServiceImpl implements CbsMusicSheetService {
     @Resource
     @Resource
     private SysMusicScoreService sysMusicScoreService;
     private SysMusicScoreService sysMusicScoreService;
     @Resource
     @Resource
-    private MusicTagService musicTagService;
+    private SysMusicScoreCategoriesService sysMusicScoreCategoriesService;
     @Resource
     @Resource
     private SubjectService subjectService;
     private SubjectService subjectService;
+    @Resource
+    private SysUserTenantDao sysUserTenantDao;
 
 
     @Override
     @Override
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
@@ -77,7 +82,7 @@ public class CbsMusicSheetServiceImpl implements CbsMusicSheetService {
             throw new BizException("请选择状态");
             throw new BizException("请选择状态");
         }
         }
         if (!updateMusicSheet.getStatus()){
         if (!updateMusicSheet.getStatus()){
-            musicSheetService.getDao().batchEnable(updateMusicSheet.getIds(),updateMusicSheet.getStatus());
+            sysMusicScoreService.getDao().batchEnable(updateMusicSheet.getIds(),updateMusicSheet.getStatus());
         }
         }
         return true;
         return true;
     }
     }
@@ -86,16 +91,16 @@ public class CbsMusicSheetServiceImpl implements CbsMusicSheetService {
         if (musicSheetApplicationExtendDel == null || StringUtils.isEmpty(musicSheetApplicationExtendDel.getIds())){
         if (musicSheetApplicationExtendDel == null || StringUtils.isEmpty(musicSheetApplicationExtendDel.getIds())){
             throw new BizException("请选择曲目");
             throw new BizException("请选择曲目");
         }
         }
-        musicSheetService.getDao().batchDel(musicSheetApplicationExtendDel.getIds());
+        sysMusicScoreService.getDao().batchDel(musicSheetApplicationExtendDel.getIds());
         return true;
         return true;
     }
     }
 
 
     public List<CbsMusicSheetTagWrapper.MusicSheetTag> tagList(CbsMusicSheetTagWrapper.MusicSheetTagQuery queryInfo){
     public List<CbsMusicSheetTagWrapper.MusicSheetTag> tagList(CbsMusicSheetTagWrapper.MusicSheetTagQuery queryInfo){
-        return musicTagService.getBaseMapper().tagList(queryInfo);
+        return null;
     }
     }
 
 
     public List<CbsMusicSheetCategoryWrapper.MusicSheetCategory> categoryList(CbsMusicSheetCategoryWrapper.MusicSheetCategoryQuery queryInfo){
     public List<CbsMusicSheetCategoryWrapper.MusicSheetCategory> categoryList(CbsMusicSheetCategoryWrapper.MusicSheetCategoryQuery queryInfo){
-        return musicTagService.getBaseMapper().categoryList(queryInfo);
+        return sysMusicScoreCategoriesService.getDao().categoryList(queryInfo);
     }
     }
 
 
     public PageInfo<CbsMusicSheetExtendWrapper.MusicSheetExtend> ownerList(CbsMusicSheetExtendWrapper.MusicSheetExtendQuery queryInfo){
     public PageInfo<CbsMusicSheetExtendWrapper.MusicSheetExtend> ownerList(CbsMusicSheetExtendWrapper.MusicSheetExtendQuery queryInfo){
@@ -104,14 +109,14 @@ public class CbsMusicSheetServiceImpl implements CbsMusicSheetService {
             throw new BizException("请选择来源类型");
             throw new BizException("请选择来源类型");
         }
         }
         if(queryInfo.getSourceType() == EMusicSourceType.PERSON){
         if(queryInfo.getSourceType() == EMusicSourceType.PERSON){
-            return QueryInfo.pageInfo(musicSheetService.getDao().personOwnerList(page, queryInfo));
+            return QueryInfo.pageInfo(sysUserTenantDao.personOwnerList(page, queryInfo));
         }else {
         }else {
-            return QueryInfo.pageInfo(musicSheetService.getDao().orgOwnerList(page, queryInfo));
+            return QueryInfo.pageInfo(sysUserTenantDao.orgOwnerList(page, queryInfo));
         }
         }
     }
     }
 
 
     public boolean updateMusicSheet(CbsMusicSheetApiWrapper.MusicSheetUpdate musicSheetUpdate) {
     public boolean updateMusicSheet(CbsMusicSheetApiWrapper.MusicSheetUpdate musicSheetUpdate) {
-        musicSheetService.getDao().updateMusicSheet(musicSheetUpdate);
+        sysMusicScoreService.getDao().updateMusicSheet(musicSheetUpdate);
         return true;
         return true;
     }
     }
 }
 }

+ 6 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMusicScoreCategoriesServiceImpl.java

@@ -34,7 +34,12 @@ public class SysMusicScoreCategoriesServiceImpl extends BaseServiceImpl<Integer,
 	}
 	}
 
 
 
 
-	@Override
+    @Override
+    public SysMusicScoreCategoriesDao getDao() {
+		return sysMusicScoreCategoriesDao;
+    }
+
+    @Override
 	public List<SysMusicScoreCategories> queryTree(MusicScoreQueryInfo menuQueryInfo) {
 	public List<SysMusicScoreCategories> queryTree(MusicScoreQueryInfo menuQueryInfo) {
 		List<SysMusicScoreCategories> scoreCategories = sysMusicScoreCategoriesDao.findByParentId(menuQueryInfo.getParentId(),menuQueryInfo.getSearch(),menuQueryInfo.getEnable());
 		List<SysMusicScoreCategories> scoreCategories = sysMusicScoreCategoriesDao.findByParentId(menuQueryInfo.getParentId(),menuQueryInfo.getSearch(),menuQueryInfo.getEnable());
 		List<SysMusicScoreCategories> scoreCategoriesAllList = sysMusicScoreCategoriesDao.findByParentId(null,menuQueryInfo.getSearch(),menuQueryInfo.getEnable());
 		List<SysMusicScoreCategories> scoreCategoriesAllList = sysMusicScoreCategoriesDao.findByParentId(null,menuQueryInfo.getSearch(),menuQueryInfo.getEnable());

+ 28 - 46
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMusicScoreServiceImpl.java

@@ -14,10 +14,7 @@ import com.ym.mec.biz.dal.dto.SysMusicScoreMetronomeTranscod;
 import com.ym.mec.biz.dal.dto.SysMusicScoreTranscod;
 import com.ym.mec.biz.dal.dto.SysMusicScoreTranscod;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
 import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
-import com.ym.mec.biz.service.OrganizationService;
-import com.ym.mec.biz.service.SysMusicScoreCategoriesService;
-import com.ym.mec.biz.service.SysMusicScoreService;
-import com.ym.mec.biz.service.UploadFileService;
+import com.ym.mec.biz.service.*;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.entity.UploadReturnBean;
 import com.ym.mec.common.entity.UploadReturnBean;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.exception.BizException;
@@ -52,7 +49,7 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
     @Resource
     @Resource
     private SysMusicScoreAccompanimentDao sysMusicScoreAccompanimentDao;
     private SysMusicScoreAccompanimentDao sysMusicScoreAccompanimentDao;
     @Resource
     @Resource
-    private SysUserFeignService sysUserFeignService;
+    private SysUserService sysUserService;
     @Resource
     @Resource
     private SysMusicScoreCategoriesDao sysMusicScoreCategoriesDao;
     private SysMusicScoreCategoriesDao sysMusicScoreCategoriesDao;
     @Resource
     @Resource
@@ -123,12 +120,8 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
     @Override
     @Override
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
     public void add(MusicScoreDto musicScoreDto) {
     public void add(MusicScoreDto musicScoreDto) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("请登录");
-        }
         SysMusicScore sysMusicScore = musicScoreDto.getSysMusicScore();
         SysMusicScore sysMusicScore = musicScoreDto.getSysMusicScore();
-        sysMusicScore.setCreateUserId(sysUser.getId());
+        sysMusicScore.setCreateUserId(sysUserService.getUserId());
         sysMusicScoreDao.insert(sysMusicScore);
         sysMusicScoreDao.insert(sysMusicScore);
         List<SysMusicScoreAccompaniment> sysMusicScoreAccompaniments = musicScoreDto.getSysMusicScoreAccompaniments();
         List<SysMusicScoreAccompaniment> sysMusicScoreAccompaniments = musicScoreDto.getSysMusicScoreAccompaniments();
         if (sysMusicScoreAccompaniments != null && sysMusicScoreAccompaniments.size() > 0) {
         if (sysMusicScoreAccompaniments != null && sysMusicScoreAccompaniments.size() > 0) {
@@ -158,6 +151,10 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
         if (sysMusicScore == null) {
         if (sysMusicScore == null) {
             throw new BizException("曲目不存在");
             throw new BizException("曲目不存在");
         }
         }
+        Integer userId = sysUserService.getUserId();
+        if (!Objects.equals(sysMusicScore.getCreateUserId(), userId)) {
+            throw new BizException("无权限删除");
+        }
         sysMusicScoreDao.delete(id);
         sysMusicScoreDao.delete(id);
         sysMusicScoreAccompanimentDao.deleteBySongId(id);
         sysMusicScoreAccompanimentDao.deleteBySongId(id);
         Integer categoriesId = sysMusicScore.getMusicScoreCategoriesId();
         Integer categoriesId = sysMusicScore.getMusicScoreCategoriesId();
@@ -195,25 +192,6 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
         }
         }
     }
     }
 
 
-    private void dealMusicScoreParam(SysExamSongQueryInfo queryInfo){
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
-        if(queryInfo.getCategoriesId() != null){
-            List<Integer> categoriesIdList = new ArrayList<>();
-            Integer categoriesId = Integer.parseInt(queryInfo.getCategoriesId());
-
-            SysMusicScoreCategories sysMusicScoreCategories = sysMusicScoreCategoriesService.get(categoriesId);
-
-            if(sysMusicScoreCategories == null){
-                throw new BizException("分类找不到");
-            }
-            categoriesIdList.add(categoriesId);
-            sysMusicScoreCategories = sysMusicScoreCategoriesService.getChildTree(sysMusicScoreCategories);
-            getAllCategoryIdList(categoriesIdList, sysMusicScoreCategories.getSysMusicScoreCategoriesList());
-
-            queryInfo.setCategoriesIdList(categoriesIdList);
-        }
-    }
-
     private void dealMusicScoreData(List<SysMusicScore> records){
     private void dealMusicScoreData(List<SysMusicScore> records){
         if (CollectionUtils.isNotEmpty(records)) {
         if (CollectionUtils.isNotEmpty(records)) {
             List<Long> cbsMusicSheetIds = records.stream().map(e -> e.getCbsMusicSheetId()).collect(Collectors.toList());
             List<Long> cbsMusicSheetIds = records.stream().map(e -> e.getCbsMusicSheetId()).collect(Collectors.toList());
@@ -307,7 +285,8 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
     @Override
     @Override
     public List<SysMusicScore> queryMusicScoreAll(SysExamSongQueryInfo queryInfo) {
     public List<SysMusicScore> queryMusicScoreAll(SysExamSongQueryInfo queryInfo) {
         //封装查询参数
         //封装查询参数
-        dealMusicScoreParam(queryInfo);
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
+        this.initCategoryIds(queryInfo);
         Map<String, Object> params = new HashMap<String, Object>();
         Map<String, Object> params = new HashMap<String, Object>();
         MapUtil.populateMap(params, queryInfo);
         MapUtil.populateMap(params, queryInfo);
 
 
@@ -320,7 +299,8 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
     @Override
     @Override
     public PageInfo<SysMusicScore> queryMusicScorePage(SysExamSongQueryInfo queryInfo) {
     public PageInfo<SysMusicScore> queryMusicScorePage(SysExamSongQueryInfo queryInfo) {
         //封装查询参数
         //封装查询参数
-        dealMusicScoreParam(queryInfo);
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
+        this.initCategoryIds(queryInfo);
 
 
         PageInfo<SysMusicScore> sysMusicScorePageInfo = queryPage(queryInfo);
         PageInfo<SysMusicScore> sysMusicScorePageInfo = queryPage(queryInfo);
         List<SysMusicScore> rows = sysMusicScorePageInfo.getRows();
         List<SysMusicScore> rows = sysMusicScorePageInfo.getRows();
@@ -329,20 +309,14 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
         return sysMusicScorePageInfo;
         return sysMusicScorePageInfo;
     }
     }
 
 
-
-    @Override
-    public PageInfo<SysMusicScore> queryMusicScorePageInfo(SysExamSongQueryInfo queryInfo) {
-        if (queryInfo.getCategoriesId() != null) {
+    private void initCategoryIds(SysExamSongQueryInfo queryInfo){
+        if(StringUtils.isNotEmpty(queryInfo.getCategoriesId())){
             List<Integer> categoriesIdList = new ArrayList<>();
             List<Integer> categoriesIdList = new ArrayList<>();
-            Integer categoriesId = null;
-            if (StringUtils.isNotEmpty(queryInfo.getCategoriesId())) {
-                categoriesId = Integer.parseInt(queryInfo.getCategoriesId());
-            }
-            //List<SysMusicScoreCategories> scoreCategories = sysMusicScoreCategoriesService.queryTree(musicScoreQueryInfo);
+            Integer categoriesId = Integer.parseInt(queryInfo.getCategoriesId());
 
 
             SysMusicScoreCategories sysMusicScoreCategories = sysMusicScoreCategoriesService.get(categoriesId);
             SysMusicScoreCategories sysMusicScoreCategories = sysMusicScoreCategoriesService.get(categoriesId);
 
 
-            if (sysMusicScoreCategories == null) {
+            if(sysMusicScoreCategories == null){
                 throw new BizException("分类找不到");
                 throw new BizException("分类找不到");
             }
             }
             categoriesIdList.add(categoriesId);
             categoriesIdList.add(categoriesId);
@@ -350,12 +324,20 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
             getAllCategoryIdList(categoriesIdList, sysMusicScoreCategories.getSysMusicScoreCategoriesList());
             getAllCategoryIdList(categoriesIdList, sysMusicScoreCategories.getSysMusicScoreCategoriesList());
 
 
             queryInfo.setCategoriesIdList(categoriesIdList);
             queryInfo.setCategoriesIdList(categoriesIdList);
-        }else {
-            if(queryInfo.getCategoriesId() == null){
-                return new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
-            }
         }
         }
-        return this.queryPage(queryInfo);
+    }
+
+
+    @Override
+    public PageInfo<SysMusicScore> queryMusicScorePageInfo(SysExamSongQueryInfo queryInfo) {
+        this.initCategoryIds(queryInfo);
+        if(CollectionUtils.isEmpty(queryInfo.getCategoriesIdList())){
+            return new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+        }
+        PageInfo<SysMusicScore> pageInfo = this.queryPage(queryInfo);
+        List<SysMusicScore> rows = pageInfo.getRows();
+        dealMusicScoreData(rows);
+        return pageInfo;
     }
     }
 
 
     @Override
     @Override

+ 18 - 0
mec-biz/src/main/resources/config/mybatis/SysMusicScoreCategoriesMapper.xml

@@ -204,4 +204,22 @@
 	<select id="queryByParentId" resultMap="SysMusicScoreCategories" >
 	<select id="queryByParentId" resultMap="SysMusicScoreCategories" >
 		SELECT categ.* FROM sys_music_score_categories categ WHERE categ.id_ = #{parentId}
 		SELECT categ.* FROM sys_music_score_categories categ WHERE categ.id_ = #{parentId}
 	</select>
 	</select>
+    <select id="categoryList"
+            resultType="com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetCategoryWrapper$MusicSheetCategory">
+		SELECT t.id_ id,t.name_ name,t.parent_id_ parentId FROM sys_music_score_categories t
+		<where>
+			<if test="param.ids != null and param.ids.size > 0">
+				and t.id_ IN
+				<foreach collection="param.ids" item="id" open="(" close=")" separator=",">
+					#{id}
+				</foreach>
+			</if>
+			<if test="param.id != null">
+				and t.id_ = #{param.id}
+			</if>
+			<if test="param.delFlag != null">
+				and t.enable_ = #{param.delFlag}
+			</if>
+		</where>
+	</select>
 </mapper>
 </mapper>

+ 43 - 31
mec-biz/src/main/resources/config/mybatis/SysMusicScoreMapper.xml

@@ -213,41 +213,53 @@
 	</update>
 	</update>
 	<update id="updateBatchByCbsId">
 	<update id="updateBatchByCbsId">
 		<foreach collection="vos" item="item" index="index" separator=";">
 		<foreach collection="vos" item="item" index="index" separator=";">
-			music_score_categories_id_,name_,type_,speed_,url_,metronome_url_,midi_url_,create_user_id_,order_,
-			update_time_,create_time_,client_type_,rank_ids_,render_from_,enable_evaluation_,show_flag_,
-			                          play_mode_,muse_score_url_,muse_score_memo_,ext_config_json_,ext_style_config_json_
-
-			update music_sheet ms set ms.provider_type_ = CASE WHEN #{item.availableType} = 'PLATFORM' THEN 'PLATFORM'
-			WHEN #{item.availableType} = 'PERSON' THEN 'TEACHER' ELSE 'TENANT' END,
-			ms.music_tag_ = #{item.musicTagIds},ms.payment_type_ = #{item.paymentType},
-			ms.charge_type_ = #{item.paymentType},
-			ms.music_price_ = #{item.musicPrice},ms.top_flag_ = #{item.topFlag},
-			ms.exquisite_flag_ = #{item.exquisiteFlag},ms.sort_number_ = #{item.sortNo},ms.del_flag_ = 0,
-			ms.audit_status_ = CASE WHEN #{item.delFlag} THEN 'PASS' ELSE 'DOING' END
+			update sys_music_score set music_score_categories_id_ = #{item.musicSheetCategoryId},
+			client_type_ = 'SMART_PRACTICE',type_ = 'COMMON',
+			rank_ids_ = CASE WHEN #{item.paymentType} = 'FREE' THEN NULL ELSE '1' END,
+			order_ = #{item.sortNo}
 			<if test="item.musicSheetUpdate != null">
 			<if test="item.musicSheetUpdate != null">
-				,ms.music_sheet_name_ = #{item.musicSheetUpdate.name},
-				ms.music_subject_ = #{item.musicSheetUpdate.subjectIds},
-				ms.music_svg_ = #{item.musicSheetUpdate.musicSvg},
-				ms.composer_ = #{item.musicSheetUpdate.composer},
-				ms.title_img_ = #{item.musicSheetUpdate.musicCover},
-				ms.music_img_ = #{item.musicSheetUpdate.musicCover},
-				ms.accompaniment_type_ = #{item.musicSheetUpdate.audioType},
-				ms.play_speed_ = #{item.musicSheetUpdate.playSpeed},
-				ms.music_price_ = #{item.musicSheetUpdate.musicPrice},
-				ms.notation_ = #{item.musicSheetUpdate.notation},
-				ms.music_sheet_type_ = #{item.musicSheetUpdate.musicSheetType},
-				ms.create_by_ = #{item.musicSheetUpdate.userId},
-				ms.audio_type_ = #{item.musicSheetUpdate.playMode},
-				ms.notation_ = #{item.musicSheetUpdate.notation},
-				ms.show_fingering_ = #{item.musicSheetUpdate.showFingering},
-				ms.can_evaluate_ = #{item.musicSheetUpdate.canEvaluate},
-				ms.source_type_ = CASE WHEN #{item.musicSheetUpdate.sourceType} = 'PLATFORM' THEN 'PLATFORM'
-				WHEN #{item.musicSheetUpdate.sourceType} = 'PERSON' THEN 'TEACHER'
-				ELSE 'TENANT' END
+				,name_ = #{item.musicSheetUpdate.name},
+				subject_ids_ = #{item.musicSheetUpdate.subjectIds},
+				speed_ = #{item.musicSheetUpdate.playSpeed},
+				enable_evaluation_ = #{item.musicSheetUpdate.canEvaluate},
+				play_mode_ = #{item.musicSheetUpdate.playMode}
 			</if>
 			</if>
-			where ms.cbs_music_sheet_id_ = #{item.musicSheetId}
+			where cbs_music_sheet_id_ = #{item.musicSheetId}
 		</foreach>
 		</foreach>
 	</update>
 	</update>
+	<update id="batchEnable">
+		update sys_music_score set show_flag_ = #{status} where FIND_IN_SET(cbs_music_sheet_id_,#{cbsMusicSheetIds})
+	</update>
+	<update id="batchDel">
+		update sys_music_score set del_flag_ = 1 where FIND_IN_SET(cbs_music_sheet_id_,#{cbsMusicSheetIds})
+	</update>
+	<update id="updateMusicSheet">
+		update sys_music_score set name_ = #{param.name},
+		subject_ids_ = #{param.subjectIds},
+		speed_ = #{param.playSpeed},
+		enable_evaluation_ = #{param.canEvaluate},
+		play_mode_ = #{param.playMode}
+		where cbs_music_sheet_id_ = #{param.id}
+	</update>
+
+	<insert id="batchInsert">
+		insert into sys_music_score
+		(music_score_categories_id_,client_type_,type_,rank_ids_,order_
+		,name_,subject_ids_,speed_,enable_evaluation_,play_mode_,show_flag_)
+		values
+		<foreach collection="vos" item="item" separator=",">
+			(#{item.musicSheetCategoryId},
+			'SMART_PRACTICE','COMMON',
+			CASE WHEN #{item.paymentType} = 'FREE' THEN NULL ELSE '1' END,
+			#{item.sortNo},
+			#{item.musicSheetUpdate.name},
+			#{item.musicSheetUpdate.subjectIds},
+			#{item.musicSheetUpdate.playSpeed},
+			#{item.musicSheetUpdate.canEvaluate},
+			#{item.musicSheetUpdate.playMode},0
+			)
+		</foreach>
+	</insert>
 
 
 	<sql id="queryPageSql">
 	<sql id="queryPageSql">
 		<where>
 		<where>

+ 29 - 0
mec-biz/src/main/resources/config/mybatis/SysUserTenantMapper.xml

@@ -33,5 +33,34 @@
                  left join tenant_info as b on a.tenant_id_ = b.id_
                  left join tenant_info as b on a.tenant_id_ = b.id_
         where a.user_id_ = #{userId}
         where a.user_id_ = #{userId}
     </select>
     </select>
+    <select id="personOwnerList"
+            resultType="com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetExtendWrapper$MusicSheetExtend">
+        select su.id_ userId,su.real_name_ username
+        ,'TEACHER' clientType,su.phone_ phone from teacher t
+        left join sys_user su ON su.id_ = t.id_
+        where su.user_type_ LIKE '%TEACHER%' AND su.del_flag_ = 0 AND su.lock_flag_ = 0
+        <if test="param.name != null and param.name != ''">
+            AND (su.phone_ LIKE CONCAT('%',#{param.name},'%') OR su.username_ LIKE CONCAT('%',#{param.name},'%'))
+        </if>
+        <if test="param.userIdList != null and param.userIdList.size > 0">
+            AND su.id_ IN
+            <foreach collection="param.userIdList" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+    </select>
+    <select id="orgOwnerList"
+            resultType="com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetExtendWrapper$MusicSheetExtend">
+        select id_ organizationRoleId,name_ organizationRole,'ORG' clientType,phone_ phone from tenant_info where state_ = 1
+        <if test="param.name != null and param.name != ''">
+            AND (phone_ LIKE CONCAT('%',#{param.name},'%') OR name_ LIKE CONCAT('%',#{param.name},'%'))
+        </if>
+        <if test="param.userIdList != null and param.userIdList.size > 0">
+            AND id_ IN
+            <foreach collection="param.userIdList" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+    </select>
 
 
 </mapper>
 </mapper>