|
|
@@ -16,6 +16,7 @@ import com.izouma.wenlvju.exception.BusinessException;
|
|
|
import com.izouma.wenlvju.repo.*;
|
|
|
import com.izouma.wenlvju.repo.performance.*;
|
|
|
import com.izouma.wenlvju.service.ArtTypeService;
|
|
|
+import com.izouma.wenlvju.service.UserService;
|
|
|
import com.izouma.wenlvju.service.storage.StorageService;
|
|
|
import com.izouma.wenlvju.utils.FileUtils;
|
|
|
import com.izouma.wenlvju.utils.JpaUtils;
|
|
|
@@ -27,6 +28,7 @@ import org.apache.poi.util.TempFile;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.PageImpl;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.persistence.criteria.Predicate;
|
|
|
@@ -59,6 +61,7 @@ public class ProgrammeService {
|
|
|
private ArrangeJudgeRepo arrangeJudgeRepo;
|
|
|
private StorageService storageService;
|
|
|
private RateAuditRepo rateAuditRepo;
|
|
|
+ private UserService userService;
|
|
|
|
|
|
|
|
|
public Page<Programme> all(PageQuery pageQuery) {
|
|
|
@@ -681,8 +684,12 @@ public class ProgrammeService {
|
|
|
*/
|
|
|
public ProgrammeShowDTO showByGO(Long id) {
|
|
|
Programme programme = programmeRepo.findById(id).orElseThrow(new BusinessException("无节目"));
|
|
|
+ return this.toShowDTO(programme);
|
|
|
+ }
|
|
|
+
|
|
|
+ public ProgrammeShowDTO toShowDTO(Programme programme) {
|
|
|
ProgrammeShowDTO dto = new ProgrammeShowDTO(programme);
|
|
|
- List<ParticipantDTO> participants = participantRepo.findAllByProgrammeId(id)
|
|
|
+ List<ParticipantDTO> participants = participantRepo.findAllByProgrammeId(programme.getId())
|
|
|
.stream()
|
|
|
.map(ParticipantDTO::new)
|
|
|
.collect(Collectors.toList());
|
|
|
@@ -694,4 +701,10 @@ public class ProgrammeService {
|
|
|
settingRepo.findById(programme.getLevelSettingId()).ifPresent(st -> dto.setLevel(st.getName()));
|
|
|
return dto;
|
|
|
}
|
|
|
+
|
|
|
+ public ProgrammeShowDTO get(Long id, String phone) {
|
|
|
+ Programme apply = programmeRepo.findById(id).orElseThrow(new BusinessException("无记录"));
|
|
|
+ userService.getAuth(id, phone, apply.getPhone());
|
|
|
+ return this.toShowDTO(apply);
|
|
|
+ }
|
|
|
}
|