Browse Source

节目信息

licailing 4 years ago
parent
commit
d06c581b81

+ 2 - 2
src/main/h5/src/plugins/http.js

@@ -4,8 +4,8 @@ import qs from "qs";
 let baseUrl = "http://localhost:8080";
 switch (process.env.NODE_ENV) {
   case "development":
-    baseUrl = "http://wljtest.izouma.com";
-    // baseUrl = "http://localhost:8080";
+    // baseUrl = "http://wljtest.izouma.com";
+    baseUrl = "http://localhost:8080";
     // baseUrl = 'http://192.168.50.190:8080';
     break;
   case "test":

+ 16 - 22
src/main/h5/src/views/Home.vue

@@ -166,8 +166,8 @@ export default {
       return (
         "http://wljtest.izouma.com/home?performanceId=" +
         this.info.performanceId +
-        "&performanceApplyId=" +
-        this.$route.query.performanceApplyId
+        "&programmeId=" +
+        this.$route.query.programmeId
       );
     },
     showUserInfo() {
@@ -194,41 +194,35 @@ export default {
     } else {
       this.isAdmin = false;
     }
-    this.getInfo(this.$route.query.performanceApplyId, true);
+    this.getInfo(this.$route.query.programmeId, true);
   },
   methods: {
-    getInfo(performanceApplyId, isFirst = false) {
+    getInfo(programmeId, isFirst = false) {
       this.$http
-        .get("/performanceApply/get/" + performanceApplyId, {
+        .get("/programme/getShow/" + programmeId, {
           phone: window.localStorage.getItem("loginPhone")
         })
         .then(res => {
           this.info = res;
           if (
-            `${performanceApplyId}` === this.$route.query.performanceApplyId &&
+            `${programmeId}` === this.$route.query.programmeId &&
             this.isAdmin
           ) {
             this.getRelated();
           }
-          return this.$http.post(
-            "/person/all",
-            {
-              size: 100,
-              query: { del: false, performanceApplyId: performanceApplyId }
-            },
-            { body: "json" }
-          );
+          return this.$http.post("/participant/byProgramme", {
+            programmeId: programmeId
+          });
         })
         .then(res => {
-          this.persons = res.content;
+          this.persons = res;
           if (this.info.signInAt) {
             if (isFirst) {
               this.isScore = true;
             }
             this.$http
               .post(
-                "/performanceScore/breakdown?performanceApplyId=" +
-                  performanceApplyId
+                "/performanceScore/breakdown?performanceApplyId=" + programmeId
               )
               .then(res => {
                 this.scores = res;
@@ -236,8 +230,7 @@ export default {
             if (this.isAdmin) {
               this.$http
                 .post(
-                  "/performanceScore/myScore?performanceApplyId=" +
-                    performanceApplyId
+                  "/performanceScore/myScore?performanceApplyId=" + programmeId
                 )
                 .then(res => {
                   if (res) {
@@ -297,9 +290,10 @@ export default {
         return;
       }
       this.$http
-        .post(
-          "/performanceApply/score?id=" + this.info.id + "&score=" + this.score
-        )
+        .post("/programmeScore/saveScore", {
+          programmeId: this.info.id,
+          score: this.socre
+        })
         .then(res => {
           this.$toast.success("评分成功");
           this.getInfo(this.info.id);

+ 2 - 1
src/main/java/com/izouma/wenlvju/security/WebSecurityConfig.java

@@ -72,7 +72,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
                 .antMatchers("/setting/byFlag").permitAll()
                 .antMatchers("/programme/getShow/**").permitAll()
                 .antMatchers("/programme/getAuth").permitAll()
-                .antMatchers("/programme/getScore").permitAll()
+                .antMatchers("/programme/getScore/**").permitAll()
+                .antMatchers("/participant/byProgramme").permitAll()
                 .antMatchers("/upload/**").permitAll()
                 .antMatchers("/files/**").permitAll()
                 .antMatchers("/static/**").permitAll()

+ 2 - 2
src/main/java/com/izouma/wenlvju/service/UserService.java

@@ -333,10 +333,10 @@ public class UserService {
     /**
      * 扫描作品二维码,通过手机号获取身份
      */
-    public Map<String, String> getAuth(Long id, String phone,String proPhone) {
+    public Map<String, String> getAuth(Long id, String phone, String proPhone) {
         Map<String, String> map = new HashMap<>();
 
-        if (ObjectUtil.isNotNull(id)){
+        if (ObjectUtil.isNotNull(id)) {
             if (phone.equals(proPhone)) {
                 map.put("phone", phone);
                 return map;

+ 14 - 1
src/main/java/com/izouma/wenlvju/service/performance/ProgrammeService.java

@@ -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);
+    }
 }

+ 5 - 0
src/main/java/com/izouma/wenlvju/web/performance/ParticipantController.java

@@ -64,5 +64,10 @@ public class ParticipantController extends BaseController {
     public void batchSave(@RequestBody List<Participant> participants) {
         participantService.batchSave(participants);
     }
+
+    @PostMapping("/byProgramme")
+    public List<Participant> byProgramme(@RequestParam Long programmeId) {
+        return participantRepo.findAllByProgrammeId(programmeId);
+    }
 }
 

+ 3 - 9
src/main/java/com/izouma/wenlvju/web/performance/ProgrammeController.java

@@ -183,16 +183,10 @@ public class ProgrammeController extends BaseController {
         return userService.getAuth(id, phone, apply.getPhone());
     }
 
-    @ApiOperation("查分数登录  ")
+    @ApiOperation("查分数信息")
     @GetMapping("/getScore/{id}")
-    public Programme get(@PathVariable Long id, String phone) {
-        Programme apply = programmeRepo.findById(id).orElseThrow(new BusinessException("无记录"));
-        if (ObjectUtil.isNotNull(apply.getSpecialtyId())) {
-            ArtType artType = artTypeRepo.findById(apply.getSpecialtyId()).orElseThrow(new BusinessException("无此专业"));
-            apply.setSpecialty(artType.getName());
-        }
-        userService.getAuth(id, phone, apply.getPhone());
-        return apply;
+    public ProgrammeShowDTO getScore(@PathVariable Long id, String phone) {
+        return programmeService.get(id, phone);
     }
 }
 

+ 1 - 4
src/main/vue/src/views/performance/ProgrammeOrgList.vue

@@ -614,10 +614,7 @@ export default {
         showCode(row) {
             this.dialogCode = true;
             this.dialogUrl =
-                'http://wljtest.izouma.com/h5/home?performanceId=' +
-                row.performanceId +
-                '&performanceApplyId=' +
-                row.id;
+                'http://wljtest.izouma.com/h5/home?performanceId=' + row.performanceId + '&programmeId=' + row.id;
         },
         clearSearch() {
             this.form = {};