|
@@ -34,6 +34,7 @@ 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.util.*;
|
|
@@ -419,6 +420,34 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
|
|
|
executorService.shutdown();
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void del(Long id) {
|
|
|
+ SysMusicScore musicSheet = sysMusicScoreDao.getCbsId(id);
|
|
|
+ if (musicSheet == null) {
|
|
|
+ throw new BizException("曲目不存在");
|
|
|
+ }
|
|
|
+ CbsMusicSheetWrapper.MusicSheetApplicationQuery query = new CbsMusicSheetWrapper.MusicSheetApplicationQuery();
|
|
|
+ query.setApplicationId(applicationId);
|
|
|
+ query.setMusicSheetIds(Collections.singletonList(Long.parseLong(musicSheet.getCbsMusicSheetId())));
|
|
|
+ query.setDelFlag(true);
|
|
|
+ query.setPage(1);
|
|
|
+ query.setRows(1);
|
|
|
+ R<com.microsvc.toolkit.common.response.paging.PageInfo<CbsMusicSheetWrapper.MusicSheetApplication>> pageInfoR = musicFeignClientService.musicSheetPageByApplication(query);
|
|
|
+ if (pageInfoR.getCode() != 200) {
|
|
|
+ throw new BizException("获取曲目信息异常,{}", pageInfoR.getMessage());
|
|
|
+ }
|
|
|
+ List<CbsMusicSheetWrapper.MusicSheetApplication> rows = pageInfoR.feignData().getRows();
|
|
|
+ if (CollectionUtils.isEmpty(rows)) {
|
|
|
+ throw new BizException("获取曲目信息失败");
|
|
|
+ }
|
|
|
+ CbsMusicSheetWrapper.MusicSheetApplication musicSheetApplication = rows.get(0);
|
|
|
+ R<JSONObject> jsonObjectR = musicFeignClientService.musicSheetApplicationExtendDel(musicSheetApplication.getApplicationExtendId());
|
|
|
+ if (jsonObjectR.getCode() != 200) {
|
|
|
+ throw new BizException("曲目删除失败,{}", jsonObjectR.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void syncMusicSheet(SysMusicScore record) {
|
|
|
List<SysMusicScoreAccompaniment> list = sysMusicScoreAccompanimentDao.findByMusicScoreId(record.getId());
|
|
|
|