| 
														
															@@ -8,6 +8,7 @@ import com.yonge.cooleshow.biz.dal.dto.MusicSheetDto; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.yonge.cooleshow.biz.dal.entity.MusicSheetAccompaniment; 
														 | 
														
														 | 
														
															 import com.yonge.cooleshow.biz.dal.entity.MusicSheetAccompaniment; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import io.swagger.annotations.Api; 
														 | 
														
														 | 
														
															 import io.swagger.annotations.Api; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import io.swagger.annotations.ApiOperation; 
														 | 
														
														 | 
														
															 import io.swagger.annotations.ApiOperation; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import org.springframework.beans.BeanUtils; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import org.springframework.web.bind.annotation.*; 
														 | 
														
														 | 
														
															 import org.springframework.web.bind.annotation.*; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import org.springframework.beans.factory.annotation.Autowired; 
														 | 
														
														 | 
														
															 import org.springframework.beans.factory.annotation.Autowired; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import org.springframework.web.bind.annotation.RequestMapping; 
														 | 
														
														 | 
														
															 import org.springframework.web.bind.annotation.RequestMapping; 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -45,18 +46,26 @@ public class MusicSheetController extends BaseController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             return failed("用户信息获取失败"); 
														 | 
														
														 | 
														
															             return failed("用户信息获取失败"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if (musicSheetDto.getChargeType()==2 && musicSheetDto.getMusicPrice()==null){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            return failed("此曲谱为收费曲谱,需要提供价格"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         List<MusicSheetAccompaniment> list = null; 
														 | 
														
														 | 
														
															         List<MusicSheetAccompaniment> list = null; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         if (!musicSheetDto.getAudioType().equalsIgnoreCase("midi")){ 
														 | 
														
														 | 
														
															         if (!musicSheetDto.getAudioType().equalsIgnoreCase("midi")){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             list = musicSheetDto.getBackground(); 
														 | 
														
														 | 
														
															             list = musicSheetDto.getBackground(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             if (list.isEmpty()){ 
														 | 
														
														 | 
														
															             if (list.isEmpty()){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 return failed("mp3音频文件对应的主音或者伴奏文件没有提供"); 
														 | 
														
														 | 
														
															                 return failed("mp3音频文件对应的主音或者伴奏文件没有提供"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } else { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            MusicSheet musicSheet = new MusicSheet(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            BeanUtils.copyProperties(musicSheetDto, musicSheet); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            musicSheet.setAuditStatus(0); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            musicSheet.setCreateBy(sysUser.getId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            musicSheet.setUserId(sysUser.getId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            musicSheet.setCreateTime(new Date()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            musicSheetService.save(musicSheet); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        if (musicSheetDto.getChargeType()==2 && musicSheetDto.getMusicPrice()==null){ 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            return failed("此曲谱为收费曲谱,需要提供价格"); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        } 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        musicSheetDto.setAuditStatus(0); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         boolean result = musicSheetService.saveMp3AndAccompaniment(musicSheetDto,sysUser); 
														 | 
														
														 | 
														
															         boolean result = musicSheetService.saveMp3AndAccompaniment(musicSheetDto,sysUser); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         if (result) { 
														 | 
														
														 | 
														
															         if (result) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             return succeed("新增曲谱成功"); 
														 | 
														
														 | 
														
															             return succeed("新增曲谱成功"); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -73,8 +82,12 @@ public class MusicSheetController extends BaseController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             return failed("用户信息获取失败"); 
														 | 
														
														 | 
														
															             return failed("用户信息获取失败"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        musicSheetService.removeById(id); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        return succeed(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        boolean result = musicSheetService.removeById(id); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if (result){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            return succeed("删除成功"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } else { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            return failed("删除失败"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @ApiOperation(value = "修改", httpMethod="POST", consumes="application/json", produces="application/json") 
														 | 
														
														 | 
														
															     @ApiOperation(value = "修改", httpMethod="POST", consumes="application/json", produces="application/json") 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -88,10 +101,14 @@ public class MusicSheetController extends BaseController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             return failed("缺少ID"); 
														 | 
														
														 | 
														
															             return failed("缺少ID"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        //musicSheet.setUpdateBy(sysUser.getId()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        //musicSheet.setUpdateTime(new Date()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        musicSheetService.updateById(musicSheet); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        return succeed(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        musicSheet.setUpdateBy(sysUser.getId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        musicSheet.setUpdateTime(new Date()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        boolean result = musicSheetService.updateById(musicSheet); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if (result){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            return succeed("修改成功"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } else { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            return failed("修改失败"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @ApiOperation(value = "分页查询", httpMethod="POST", consumes="application/json", produces="application/json") 
														 | 
														
														 | 
														
															     @ApiOperation(value = "分页查询", httpMethod="POST", consumes="application/json", produces="application/json") 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -102,19 +119,26 @@ public class MusicSheetController extends BaseController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             return failed("用户信息获取失败"); 
														 | 
														
														 | 
														
															             return failed("用户信息获取失败"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        int pageNo = musicSheetDto.getPageNo(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        int pageSize = musicSheetDto.getPageSize(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        int pageNo; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        int pageSize; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															         try { 
														 | 
														
														 | 
														
															         try { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            if (pageNo==0) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            if (musicSheetDto.getPageNo() ==null || musicSheetDto.getPageNo() ==0) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 pageNo = 1; 
														 | 
														
														 | 
														
															                 pageNo = 1; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } else { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                pageNo = musicSheetDto.getPageNo(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            if (pageSize==0) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            if (musicSheetDto.getPageSize() ==null || musicSheetDto.getPageSize() ==0) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 pageSize = 10; 
														 | 
														
														 | 
														
															                 pageSize = 10; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } else { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                pageSize = musicSheetDto.getPageSize(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															             LambdaQueryWrapper<MusicSheet> lambdaQueryWrapper = Wrappers.lambdaQuery(); 
														 | 
														
														 | 
														
															             LambdaQueryWrapper<MusicSheet> lambdaQueryWrapper = Wrappers.lambdaQuery(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            //lambdaQueryWrapper.like(MusicSheet::getName , "k"); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            lambdaQueryWrapper.or().like(MusicSheet::getMusicSheetName , musicSheetDto.getSearch()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            lambdaQueryWrapper.or().like(MusicSheet::getComposer , musicSheetDto.getSearch()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            lambdaQueryWrapper.or().like(MusicSheet::getMusicTag , musicSheetDto.getSearch()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            lambdaQueryWrapper.or().like(MusicSheet::getMusicSubject , musicSheetDto.getSearch()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															             Page<MusicSheet> page = new Page<>(pageNo,pageSize); 
														 | 
														
														 | 
														
															             Page<MusicSheet> page = new Page<>(pageNo,pageSize); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             return succeed(musicSheetService.page(page, lambdaQueryWrapper)); 
														 | 
														
														 | 
														
															             return succeed(musicSheetService.page(page, lambdaQueryWrapper)); 
														 |