浏览代码

管乐迷曲目来源内容平台

zouxuan 1 年之前
父节点
当前提交
c46ee9af3f

+ 3 - 43
mec-application/src/main/java/com/ym/mec/teacher/controller/SysMusicScoreController.java

@@ -1,17 +1,14 @@
 package com.ym.mec.teacher.controller;
 
-import com.ym.mec.biz.dal.dto.MusicScoreDto;
-import com.ym.mec.biz.dal.entity.SysMusicScore;
 import com.ym.mec.biz.dal.enums.ClientTypeEnum;
-import com.ym.mec.biz.dal.enums.ExamSongTypeEnum;
 import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
 import com.ym.mec.biz.service.SysMusicScoreService;
-import com.ym.mec.biz.service.SysUserService;
 import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
 
@@ -22,43 +19,6 @@ public class SysMusicScoreController extends BaseController {
 
     @Resource
     private SysMusicScoreService sysMusicScoreService;
-    @Resource
-    private SysUserService sysUserService;
-
-    @ApiOperation(value = "新增")
-    @PostMapping("/add")
-    public Object add(@RequestBody MusicScoreDto musicScoreDto) {
-        SysMusicScore sysMusicScore = musicScoreDto.getSysMusicScore();
-        sysMusicScore.setType(ExamSongTypeEnum.PERSON);
-        if(sysMusicScore.getClientType() == null){
-            sysMusicScore.setClientType(ClientTypeEnum.NETWORK_ROOM);
-        }
-        sysMusicScore.setShowFlag(1);
-        sysMusicScoreService.add(musicScoreDto);
-        return succeed();
-    }
-
-    @ApiOperation(value = "删除")
-    @PostMapping("/del")
-    public Object del(Integer id) {
-        sysMusicScoreService.del(id);
-        return succeed();
-    }
-
-    @ApiOperation(value = "分页查询")
-    @GetMapping("/queryPage")
-    public Object queryPage(SysExamSongQueryInfo queryInfo) {
-        String type = queryInfo.getType();
-        if(StringUtils.isEmpty(type)){
-            queryInfo.setType("ALL");
-        }
-        if(queryInfo.getClientType() == null){
-            queryInfo.setClientType(ClientTypeEnum.NETWORK_ROOM);
-        }
-        queryInfo.setCreateUserId(sysUserService.getUserId());
-        queryInfo.setShowFlag(1);
-        return succeed(sysMusicScoreService.queryPage(queryInfo));
-    }
 
     @ApiOperation(value = "分页查询")
     @GetMapping("/queryPage2")

+ 4 - 4
mec-application/src/main/java/com/ym/mec/web/controller/SubjectController.java

@@ -132,7 +132,7 @@ public class SubjectController extends BaseController {
         if (Boolean.TRUE.equals(query.getRemoveUsed())) {
             List<Subject> list = subjectService.getDao().notInSubjectIds(query.getSubjectId());
             if (CollectionUtils.isNotEmpty(list)) {
-                List<Long> cbsSubjectIds = list.stream().map(Subject::getCbsSubjectId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
+                List<Long> cbsSubjectIds = list.stream().map(Subject::getCbsSubjectId).filter(Objects::nonNull).map(Integer::longValue).distinct().collect(Collectors.toList());
                 if (CollectionUtils.isNotEmpty(cbsSubjectIds)) {
                     query.setRemoveIds(cbsSubjectIds);
                 }
@@ -163,7 +163,7 @@ public class SubjectController extends BaseController {
             query1.setHasInstrument(true);
             List<SubjectWrapper.Subject> list = subjectService.queryList(query1);
             // 转map
-            Map<Long, SubjectWrapper.Subject> subjectMap = list.stream().collect(Collectors.groupingBy(e -> e.getCbsSubjectId(), Collectors.collectingAndThen(Collectors.toList(), v -> v.get(0))));
+            Map<Long, SubjectWrapper.Subject> subjectMap = list.stream().collect(Collectors.groupingBy(SubjectWrapper.Subject::getCbsSubjectId, Collectors.collectingAndThen(Collectors.toList(), v -> v.get(0))));
 
             List<SubjectWrapper.CbsSubject> cbsSubjects = new ArrayList<>();
             for (CbsSubjectWrapper.Subject subject : subjectPageInfo) {
@@ -187,9 +187,9 @@ public class SubjectController extends BaseController {
                     continue;
                 }
                 // instruments 转map
-                Map<Long, InstrumentWrapper.Instrument> instrumentMap = instruments.stream().collect(Collectors.toMap(InstrumentWrapper.Instrument::getId, o -> o));
+                Map<Integer, InstrumentWrapper.Instrument> instrumentMap = instruments.stream().collect(Collectors.toMap(InstrumentWrapper.Instrument::getId, o -> o));
                 for (SubjectWrapper.Instrument instrument : cbsSubject.getInstruments()) {
-                    instrument.setAdded(instrumentMap.containsKey(instrument.getId().longValue()));
+                    instrument.setAdded(instrumentMap.containsKey(instrument.getId()));
                 }
 
             }

+ 12 - 0
mec-application/src/main/java/com/ym/mec/web/controller/SysMusicScoreController.java

@@ -1,6 +1,8 @@
 package com.ym.mec.web.controller;
 
+import com.alibaba.fastjson.JSONObject;
 import com.dayaedu.cbs.domain.wrapper.MusicSheetWrapper;
+import com.microsvc.toolkit.common.response.template.R;
 import com.ym.mec.biz.dal.dto.ReasonDto;
 import com.ym.mec.biz.dal.entity.SysMusicScore;
 import com.ym.mec.biz.dal.enums.ClientTypeEnum;
@@ -18,6 +20,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import java.util.concurrent.CompletableFuture;
 
 @RequestMapping("${app-config.url.web:}/sysMusicScore")
 @Api(tags = "曲库")
@@ -76,4 +79,13 @@ public class SysMusicScoreController extends BaseController {
         }
         return succeed(sysMusicScoreService.stateList(reasonDto));
     }
+
+    @ApiOperation(value = "数据同步", notes = "曲谱表- 修改曲目缓存 MusicSheetVo.MusicSheet")
+    @PostMapping("/sync")
+    public HttpResponseResult<Object> sync() {
+        CompletableFuture.runAsync(() -> {
+            sysMusicScoreService.sync();
+        });
+        return succeed();
+    }
 }

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/InstrumentWrapper.java

@@ -51,13 +51,13 @@ public class InstrumentWrapper {
     public static class Instrument {
 
         @ApiModelProperty("乐器ID")
-        private Long id;
+        private Integer id;
 
         @ApiModelProperty("乐器名称")
         private String name;
 
         @ApiModelProperty("声部ID")
-        private Long subjectId;
+        private Integer subjectId;
 
         @ApiModelProperty("声部名称")
         private String subjectName;

+ 5 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/InstrumentService.java

@@ -19,7 +19,7 @@ public interface InstrumentService extends IService<Instrument>  {
      * @param id 详情ID
      * @return Instrument
      */
-	Instrument detail(Long id);
+	Instrument detail(Integer id);
 
     /**
      * 分页查询
@@ -43,17 +43,17 @@ public interface InstrumentService extends IService<Instrument>  {
      */
      Boolean update(InstrumentWrapper.Instrument instrument);
 
-    List<Instrument> queryBySubjectId(Long subject);
+    List<Instrument> queryBySubjectId(Integer subject);
 
-    Map<Long,InstrumentWrapper.Instrument> getMapByIds(List<Long> instrumentIdList);
+    Map<Integer,InstrumentWrapper.Instrument> getMapByIds(List<Integer> instrumentIdList);
 
-    List<InstrumentWrapper.Instrument> getInstruments(List<Long> instrumentIdList);
+    List<InstrumentWrapper.Instrument> getInstruments(List<Integer> instrumentIdList);
 
     Map<Integer,List<InstrumentWrapper.Instrument>> getGroupBySubjectId(List<Integer> subjectIds, Boolean enableFlag);
 
     List<InstrumentWrapper.Instrument> getList(InstrumentWrapper.InstrumentQuery query);
 
-    List<Long> getInstrumentIdsBySubjectId(Long subjectId);
+    List<Integer> getInstrumentIdsBySubjectId(Integer subjectId);
 
     void modify(InstrumentWrapper.Update update);
 }

+ 2 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/SysMusicScoreService.java

@@ -18,10 +18,6 @@ public interface SysMusicScoreService extends BaseService<Integer, SysMusicScore
 
     SysMusicScoreDao getDao();
 
-    void add(MusicScoreDto musicScoreDto);
-
-    void del(Integer id);
-
     List<CbsMusicSheetWrapper.MusicSheetApplication> queryCbsMusicSheetApplication(List<String> cbsMusicSheetIds);
 
     List<SysMusicScore> queryMusicScoreAll(SysExamSongQueryInfo queryInfo);
@@ -37,4 +33,6 @@ public interface SysMusicScoreService extends BaseService<Integer, SysMusicScore
     Boolean state(Integer id);
 
     void updateCbs(MusicSheetWrapper.MusicSheetApplicationExtendWrapper addMusicSheetApplicationExtend);
+
+    void sync();
 }

+ 12 - 12
mec-biz/src/main/java/com/ym/mec/biz/service/impl/InstrumentServiceImpl.java

@@ -43,7 +43,7 @@ public class InstrumentServiceImpl extends ServiceImpl<InstrumentDao, Instrument
      * @return Instrument
      */
     @Override
-    public Instrument detail(Long id) {
+    public Instrument detail(Integer id) {
 
         return baseMapper.selectById(id);
     }
@@ -92,7 +92,7 @@ public class InstrumentServiceImpl extends ServiceImpl<InstrumentDao, Instrument
     }
 
     @Override
-    public List<Instrument> queryBySubjectId(Long subject) {
+    public List<Instrument> queryBySubjectId(Integer subject) {
         if (subject == null) {
             return new ArrayList<>();
         }
@@ -102,7 +102,7 @@ public class InstrumentServiceImpl extends ServiceImpl<InstrumentDao, Instrument
     }
 
     @Override
-    public Map<Long, InstrumentWrapper.Instrument> getMapByIds(List<Long> instrumentIdList) {
+    public Map<Integer, InstrumentWrapper.Instrument> getMapByIds(List<Integer> instrumentIdList) {
         if (CollectionUtils.isEmpty(instrumentIdList)) {
             return new HashMap<>();
         }
@@ -112,14 +112,14 @@ public class InstrumentServiceImpl extends ServiceImpl<InstrumentDao, Instrument
     }
 
     @Override
-    public List<InstrumentWrapper.Instrument> getInstruments(List<Long> instrumentIdList) {
+    public List<InstrumentWrapper.Instrument> getInstruments(List<Integer> instrumentIdList) {
         instrumentIdList = instrumentIdList.stream().filter(Objects::nonNull).collect(Collectors.toList());
-        Map<Long, Instrument> idImstrumentMap = this.lambdaQuery().in(Instrument::getId, instrumentIdList).list()
+        Map<Integer, Instrument> idImstrumentMap = this.lambdaQuery().in(Instrument::getId, instrumentIdList).list()
             .stream().collect(Collectors.toMap(Instrument::getId, Function.identity()));
         // 去内容平台查询乐器名称
         CbsMusicalInstrumentWrapper.MusicalInstrumentQuery build = CbsMusicalInstrumentWrapper.MusicalInstrumentQuery.builder()
             .rows(-1)
-            .ids(instrumentIdList.stream().map(Long::intValue).distinct().collect(Collectors.toList()))
+            .ids(instrumentIdList)
             .build();
         List<CbsMusicalInstrumentWrapper.MusicalInstrumentQueryDto> rows;
         try {
@@ -166,12 +166,12 @@ public class InstrumentServiceImpl extends ServiceImpl<InstrumentDao, Instrument
             return new HashMap<>();
         }
         // group
-        Map<Integer, List<Long>> idResult = list.stream()
-            .collect(Collectors.groupingBy(o->o.getSubjectId().intValue(), LinkedHashMap::new,Collectors.mapping(Instrument::getId, Collectors.toList())));
+        Map<Integer, List<Integer>> idResult = list.stream()
+            .collect(Collectors.groupingBy(Instrument::getSubjectId, LinkedHashMap::new,Collectors.mapping(Instrument::getId, Collectors.toList())));
 
         // id 集合
-        List<Long> instrumentIds = list.stream().map(Instrument::getId).collect(Collectors.toList());
-        Map<Long, InstrumentWrapper.Instrument> instrumentMap = getMapByIds(instrumentIds);
+        List<Integer> instrumentIds = list.stream().map(Instrument::getId).collect(Collectors.toList());
+        Map<Integer, InstrumentWrapper.Instrument> instrumentMap = getMapByIds(instrumentIds);
         Map<Integer, List<InstrumentWrapper.Instrument>> result = new HashMap<>();
         idResult.forEach((k,v)->{
             List<InstrumentWrapper.Instrument> instruments = v.stream().map(instrumentMap::get).collect(Collectors.toList());
@@ -189,7 +189,7 @@ public class InstrumentServiceImpl extends ServiceImpl<InstrumentDao, Instrument
     }
 
     @Override
-    public List<Long> getInstrumentIdsBySubjectId(Long subjectId) {
+    public List<Integer> getInstrumentIdsBySubjectId(Integer subjectId) {
         List<Instrument> list = this.lambdaQuery()
             .eq(Instrument::getSubjectId, subjectId)
             .list();
@@ -212,7 +212,7 @@ public class InstrumentServiceImpl extends ServiceImpl<InstrumentDao, Instrument
             if (entity == null) {
                 return;
             }
-            Subject subject = subjectService.get(entity.getSubjectId().intValue());
+            Subject subject = subjectService.get(entity.getSubjectId());
             subjectService.getDao().update(subject);
         }
     }

+ 47 - 148
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMusicScoreServiceImpl.java

@@ -2,67 +2,51 @@ package com.ym.mec.biz.service.impl;
 
 
 import com.alibaba.fastjson.JSONObject;
-import com.dayaedu.cbs.common.enums.music.EMusicAvailableType;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.dayaedu.cbs.domain.wrapper.MusicSheetWrapper;
 import com.dayaedu.cbs.openfeign.client.MusicFeignClientService;
 import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetApplicationExtendClientWrapper;
 import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetWrapper;
 import com.microsvc.toolkit.common.response.template.R;
-import com.ym.mec.biz.dal.dao.SysMusicScoreAccompanimentDao;
 import com.ym.mec.biz.dal.dao.SysMusicScoreCategoriesDao;
 import com.ym.mec.biz.dal.dao.SysMusicScoreDao;
-import com.ym.mec.biz.dal.dto.MusicScoreDto;
 import com.ym.mec.biz.dal.dto.ReasonDto;
 import com.ym.mec.biz.dal.entity.SysMusicScore;
-import com.ym.mec.biz.dal.entity.SysMusicScoreAccompaniment;
 import com.ym.mec.biz.dal.entity.SysMusicScoreCategories;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
-import com.ym.mec.biz.service.*;
+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.common.dal.BaseDAO;
-import com.ym.mec.common.entity.UploadReturnBean;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
-import com.ym.mec.common.service.IdGeneratorService;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.util.collection.MapUtil;
-import com.ym.mec.util.file.FileUtil;
-import com.ym.mec.util.shell.ScriptUtil;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
-import java.io.File;
-import java.io.FileInputStream;
-import java.net.HttpURLConnection;
-import java.net.URL;
 import java.util.*;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
-import static com.ym.mec.biz.dal.enums.ClientTypeEnum.SMART_PRACTICE;
-
 @Service
 public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicScore> implements SysMusicScoreService {
 
     @Resource
     private SysMusicScoreDao sysMusicScoreDao;
     @Resource
-    private SysMusicScoreAccompanimentDao sysMusicScoreAccompanimentDao;
-    @Resource
-    private SysUserService sysUserService;
-    @Resource
     private SysMusicScoreCategoriesDao sysMusicScoreCategoriesDao;
     @Resource
     private SysMusicScoreCategoriesService sysMusicScoreCategoriesService;
     @Resource
-    private IdGeneratorService idGeneratorService;
-    @Resource
-    private UploadFileService uploadFileService;
-    @Resource
     private OrganizationService organizationService;
     @Resource
     private MusicFeignClientService musicFeignClientService;
@@ -80,64 +64,6 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
         return sysMusicScoreDao;
     }
 
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void add(MusicScoreDto musicScoreDto) {
-        SysMusicScore sysMusicScore = musicScoreDto.getSysMusicScore();
-        sysMusicScore.setCreateUserId(sysUserService.getUserId());
-        sysMusicScoreDao.insert(sysMusicScore);
-        List<SysMusicScoreAccompaniment> sysMusicScoreAccompaniments = musicScoreDto.getSysMusicScoreAccompaniments();
-        if (CollectionUtils.isNotEmpty(sysMusicScoreAccompaniments)) {
-            sysMusicScoreAccompaniments.forEach(e -> {
-                e.setIsOpenMetronome(sysMusicScore.getIsOpenMetronome());
-            });
-            sysMusicScoreAccompanimentDao.batchInsert(sysMusicScoreAccompaniments, sysMusicScore.getId(), sysMusicScore.getIsOpenMetronome());
-        }
-        Integer categoriesId = sysMusicScore.getMusicScoreCategoriesId();
-        if (categoriesId != null && sysMusicScore.getClientType() == SMART_PRACTICE) {
-            while (true) {
-                SysMusicScoreCategories categories = sysMusicScoreCategoriesDao.get(categoriesId);
-                if (categories.getParentId() == 0) {
-                    categories.setMusicScoreNum(categories.getMusicScoreNum() + 1);
-                    sysMusicScoreCategoriesDao.update(categories);
-                    return;
-                }
-                categoriesId = categories.getParentId();
-            }
-        }
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void del(Integer id) {
-        SysMusicScore sysMusicScore = sysMusicScoreDao.get(id);
-        if (sysMusicScore == null) {
-            throw new BizException("曲目不存在");
-        }
-        Integer userId = sysUserService.getUserId();
-        if (!Objects.equals(sysMusicScore.getCreateUserId(), userId)) {
-            throw new BizException("无权限删除");
-        }
-        sysMusicScoreDao.delete(id);
-        sysMusicScoreAccompanimentDao.deleteBySongId(id);
-        Integer categoriesId = sysMusicScore.getMusicScoreCategoriesId();
-        if (categoriesId != null && sysMusicScore.getClientType() == SMART_PRACTICE) {
-            while (true) {
-                SysMusicScoreCategories categories = sysMusicScoreCategoriesDao.get(categoriesId);
-                if (categories.getParentId() == 0) {
-                    Integer musicScoreNum = categories.getMusicScoreNum() - 1;
-                    if (musicScoreNum < 0) {
-                        musicScoreNum = 0;
-                    }
-                    categories.setMusicScoreNum(musicScoreNum);
-                    sysMusicScoreCategoriesDao.update(categories);
-                    return;
-                }
-                categoriesId = categories.getParentId();
-            }
-        }
-    }
-
     private String getParentTreeName(Integer categoriesId) {
         StringBuffer sb = new StringBuffer();
         while (true) {
@@ -363,77 +289,50 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
         }
     }
 
-    /**
-     * 进行转码
-     *
-     * @param fileUrl
-     * @return
-     */
-    private String doTranscod(String fileUrl) {
-        String transcodUrl = "";
-        if (StringUtils.isEmpty(fileUrl)) {
-            return transcodUrl;
+    @Override
+    public void sync() {
+        Date date = new Date();
+        // 100个线程的无界线程池
+        ThreadPoolExecutor executorService =  new ThreadPoolExecutor(50, 50,
+                0L, TimeUnit.MILLISECONDS,
+                new LinkedBlockingQueue<>());
+//        while (true) {
+        IPage<MusicSheet> page = baseMapper.selectSyncPage(new Page<>(1, -1));
+        List<MusicSheet> records = page.getRecords();
+        if (CollectionUtils.isEmpty(records)) {
+            return;
         }
-        //文件扩展名
-        String expand = FileUtil.getFileExpandByPath(fileUrl);
-        //将远程文件写入本地临时文件路径
-        String tempFileName = getTempFileName(expand);
-        File tempFile = new File(tempFileName);
-        //转码后文件路径
-        String tempTranscodFileName = getTempFileName(expand);
-        try {
-            URL url = new URL(fileUrl);
-            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
-            //设置超时间为3秒
-            conn.setConnectTimeout(3 * 1000);
-            //防止屏蔽程序抓取而返回403错误
-            conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
-
-            FileUtil.inputStreamToFile(conn.getInputStream(), tempFile);
-
-            String script = "ffmpeg -i " + tempFileName + " -vn -c:a libmp3lame -b:a 320k -ac 2 " + tempTranscodFileName;
-            int i = ScriptUtil.callScript(script);
-            if (i == 0) {
-                //转码成功
-                FileInputStream inputStream = new FileInputStream(tempTranscodFileName);
-                UploadReturnBean uploadReturnBean = uploadFileService.uploadFile(inputStream, expand);
-                transcodUrl = uploadReturnBean.getUrl();
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            //删除服务器中的文件
-            if (tempFile.exists()) {
-                tempFile.delete();
-            }
-            File tempTranscodFile = new File(tempTranscodFileName);
-            if (tempTranscodFile.exists()) {
-                tempTranscodFile.delete();
+        for (MusicSheet record : records) {
+            if (record.getCbsMusicSheetId() != null && !DateUtil.format(record.getCreateTime(),"yyyy-MM-dd HH:mm:ss").equals("2024-06-25 00:00:00")) {
+                continue;
             }
-        }
-        return transcodUrl;
-    }
 
-    /**
-     * 通过网络文件路径获取临时文件路径
-     *
-     * @param fileUrl
-     * @return
-     */
-    String tempPath = "/usr/temp";
-
-    private String getTempFileName(String expand) {
-        //没有目录则创建
-        File file = new File(tempPath);
-        if (!file.exists()) {
-            file.mkdirs();
+            executorService.submit(() ->
+                    {
+
+                        try {
+
+                            syncMusicSheet(record, date);
+                        }catch (Exception e) {
+                            log.error("曲目同步异常,曲目ID:{}", record.getId(), e);
+                        }
+                    }
+            );
         }
-        //.mp3
-        String fileName = tempPath + File.separator + idGeneratorService.generatorId("tempFile");
-        if (StringUtils.isNotEmpty(expand)) {
-            fileName += "." + expand;
+
+        curPage++;
+//        }
+
+        while (!executorService.getQueue().isEmpty()) {
+            try {
+                log.info("线程池中正在执行的任务数量:{},等待数量:{}", executorService.getActiveCount(),executorService.getQueue().size());
+                Thread.sleep(1000);
+            } catch (InterruptedException e) {
+                log.error("线程等待异常", e);
+            }
         }
-        return fileName;
+        log.info("-------------------- 曲目数据同步成功! -------------------------------");
+        executorService.shutdown();
     }
 
     private void getAllCategoryIdList(List<Integer> categoryIdList, List<SysMusicScoreCategories> sysMusicScoreCategoriesList) {