licailing 4 лет назад
Родитель
Сommit
60859b04a4

+ 4 - 0
src/main/java/com/izouma/wenlvju/repo/performance/ProgrammeRepo.java

@@ -17,8 +17,12 @@ public interface ProgrammeRepo extends JpaRepository<Programme, Long>, JpaSpecif
 
     long countAllByPerformanceId(Long performanceId);
 
+    long countAllByPerformanceIdAndStatusGreaterThan(Long performanceId, int status);
+
     List<Programme> findAllByPerformanceIdAndStatus(Long performanceId, int status);
 
+    List<Programme> findAllByStatusGreaterThan(int status);
+
     long countAllByArrangeIdAndStatusIsNotNull(Long arrangeId);
 
     @Query("update Programme t set t.allSigned = true where t.arrangeId = ?1")

+ 2 - 2
src/main/java/com/izouma/wenlvju/web/performance/PerformanceController.java

@@ -59,7 +59,7 @@ public class PerformanceController extends BaseController {
 
     @PostMapping("/backAll")
     public Page<Performance> backAll(@RequestBody PageQuery pageQuery) {
-        Map<Long, Long> programme = programmeRepo.findAll()
+        Map<Long, Long> programme = programmeRepo.findAllByStatusGreaterThan(0)
                 .stream()
                 .collect(Collectors.groupingBy(Programme::getPerformanceId, Collectors.counting()));
         return performanceService.all(pageQuery)
@@ -79,7 +79,7 @@ public class PerformanceController extends BaseController {
     @GetMapping("/backGet/{id}")
     public Performance backGet(@PathVariable Long id) {
         Performance performance = performanceRepo.findById(id).orElseThrow(new BusinessException("无记录"));
-        performance.setProgrammeNum(programmeRepo.countAllByPerformanceId(id));
+        performance.setProgrammeNum(programmeRepo.countAllByPerformanceIdAndStatusGreaterThan(id, 0));
         return performance;
     }
 

+ 0 - 3
src/main/vue/src/views/performance/PerformanceEdit.vue

@@ -182,9 +182,6 @@ export default {
             }).then(() => {
                 this.$http.post('/performance/lastYear').then(res => {
                     if (res != '') {
-                        if (res.programmeNum > 0) {
-                            this.edit = true;
-                        }
                         if (typeof res.performanceEnquiries != 'undefined') {
                             this.phones = res.performanceEnquiries;
                         }