licailing 4 vuotta sitten
vanhempi
commit
c15ec2f87f

+ 0 - 2
src/main/java/com/izouma/wenlvju/domain/regulation/NumOfReport.java

@@ -1,11 +1,9 @@
 package com.izouma.wenlvju.domain.regulation;
 
 import lombok.AllArgsConstructor;
-import lombok.Builder;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
-@Builder
 @AllArgsConstructor
 @NoArgsConstructor
 @Data

+ 2 - 0
src/main/java/com/izouma/wenlvju/domain/regulation/Report.java

@@ -8,6 +8,7 @@ import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
 import lombok.NoArgsConstructor;
+import org.hibernate.annotations.Where;
 
 import javax.persistence.*;
 import java.util.List;
@@ -18,6 +19,7 @@ import java.util.Map;
 @NoArgsConstructor
 @Builder
 @Entity
+@Where(clause = "del = 0")
 public class Report extends BaseEntity {
     private String title;
 

+ 7 - 0
src/main/java/com/izouma/wenlvju/domain/regulation/ReportStatistic.java

@@ -7,14 +7,18 @@ import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
 import lombok.NoArgsConstructor;
+import org.hibernate.annotations.Where;
 
+import javax.persistence.Entity;
 import javax.persistence.EnumType;
 import javax.persistence.Enumerated;
 
 @Data
 @Builder
+@Entity
 @NoArgsConstructor
 @AllArgsConstructor
+@Where(clause = "del = 0")
 public class ReportStatistic extends BaseEntity {
     private Long reportId;
 
@@ -36,4 +40,7 @@ public class ReportStatistic extends BaseEntity {
 
     @ApiModelProperty(value = "报考人数")
     private int examQuantity;
+
+    @ApiModelProperty(value = "专家审核内容")
+    private String expertAudit;
 }

+ 4 - 0
src/main/java/com/izouma/wenlvju/enums/PerformanceStatus.java

@@ -21,6 +21,10 @@ public enum PerformanceStatus {
     待评分
      */
     RATE,
+    /*
+    评奖完成
+     */
+    RATE_COMPLETE,
 
     //复审
     /*

+ 16 - 0
src/main/java/com/izouma/wenlvju/repo/regulation/ReportStatisticRepo.java

@@ -0,0 +1,16 @@
+package com.izouma.wenlvju.repo.regulation;
+
+import com.izouma.wenlvju.domain.regulation.ReportStatistic;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+
+import javax.transaction.Transactional;
+
+public interface ReportStatisticRepo extends JpaRepository<ReportStatistic, Long>, JpaSpecificationExecutor<ReportStatistic> {
+    @Query("update ReportStatistic t set t.del = true where t.id = ?1")
+    @Modifying
+    @Transactional
+    void softDelete(Long id);
+}

+ 63 - 73
src/main/java/com/izouma/wenlvju/service/regulation/ReportService.java

@@ -7,9 +7,7 @@ import com.izouma.wenlvju.domain.GradingOrganization;
 import com.izouma.wenlvju.domain.Organization;
 import com.izouma.wenlvju.domain.Record;
 import com.izouma.wenlvju.domain.RecordSpecialty;
-import com.izouma.wenlvju.domain.regulation.Complain;
-import com.izouma.wenlvju.domain.regulation.NumOfReport;
-import com.izouma.wenlvju.domain.regulation.Report;
+import com.izouma.wenlvju.domain.regulation.*;
 import com.izouma.wenlvju.dto.PageQuery;
 import com.izouma.wenlvju.dto.ReportDTO;
 import com.izouma.wenlvju.enums.ReportType;
@@ -22,6 +20,7 @@ import com.izouma.wenlvju.repo.RecordSpecialtyRepo;
 import com.izouma.wenlvju.repo.regulation.ComplainRepo;
 import com.izouma.wenlvju.repo.regulation.RecordExpertAuditRepo;
 import com.izouma.wenlvju.repo.regulation.ReportRepo;
+import com.izouma.wenlvju.repo.regulation.ReportStatisticRepo;
 import com.izouma.wenlvju.service.storage.StorageService;
 import com.izouma.wenlvju.utils.JpaUtils;
 import freemarker.template.Configuration;
@@ -58,6 +57,7 @@ public class ReportService {
     private RecordExpertAuditRepo   recordExpertAuditRepo;
     private RecordSpecialtyRepo     recordSpecialtyRepo;
     private StorageService          storageService;
+    private ReportStatisticRepo     reportStatisticRepo;
 
     public Page<Report> all(PageQuery pageQuery) {
         return reportRepo.findAll(JpaUtils.toSpecification(pageQuery, Report.class), JpaUtils.toPageRequest(pageQuery));
@@ -132,7 +132,7 @@ public class ReportService {
     /**
      * 生成报告
      */
-    public List<ReportDTO> generate(List<Record> records, List<Long> recordIds, List<Complain> complains) {
+    public List<ReportStatistic> generate(List<Record> records, List<Complain> complains) {
         List<GradingOrganization> gradingOrganizations = gradingOrganizationRepo.findAll();
         Map<String, GradingOrganization> gradingOrganizationMap = gradingOrganizations
                 .stream()
@@ -162,7 +162,7 @@ public class ReportService {
         // 没有备案但是被投诉
         Set<Long> ids = new HashSet<>(complainsByName.keySet());
 
-        List<ReportDTO> reportDTOS = new ArrayList<>();
+        List<ReportStatistic> reportDTOS = new ArrayList<>();
         examinationAgency.forEach((key, value) -> {
             GradingOrganization go = gradingOrganizationMap.get(key.trim());
 
@@ -187,7 +187,7 @@ public class ReportService {
 //                    .filter(ra -> ids.contains(ra.getRecordId()) && !ra.isValue())
 //                    .collect(Collectors.groupingBy(RecordExpertAudit::getType, Collectors.counting()));
 
-            reportDTOS.add(ReportDTO.builder()
+            reportDTOS.add(ReportStatistic.builder()
                     .unitType(UnitType.GRADING_ORGANIZATION)
                     .name(key)
                     .complain(size)
@@ -220,7 +220,7 @@ public class ReportService {
             int examQuantity = value.stream().mapToInt(Record::getExamQuantity).sum();
 
 
-            reportDTOS.add(ReportDTO.builder()
+            reportDTOS.add(ReportStatistic.builder()
                     .unitType(UnitType.ORGANIZATION)
                     .name(name)
                     .complain(size)
@@ -247,7 +247,7 @@ public class ReportService {
                 } else if (UnitType.ORGANIZATION.equals(unitType)) {
                     name = orMap.get(id).getName();
                 }
-                reportDTOS.add(ReportDTO.builder()
+                reportDTOS.add(ReportStatistic.builder()
                         .unitType(unitType)
                         .name(name)
                         .complain(complainList.size())
@@ -264,64 +264,55 @@ public class ReportService {
     /*
     总统计图
      */
-    public List<NumOfReport> getTotal(List<Record> records, List<Complain> complains) {
+    public List<NumOfReport> getTotal(List<Record> records, List<Complain> complains, List<RecordExpertAudit> recordAudits) {
         List<NumOfReport> total = new ArrayList<>(3);
         //备案条数
-        total.add(NumOfReport.builder()
-                .name("record")
-                .num(records.size())
-                .build());
+        total.add(new NumOfReport("record", records.size()));
         //报考人数
         int examQuantity = records.stream().mapToInt(Record::getExamQuantity).sum();
-        total.add(NumOfReport.builder()
-                .name("examQuantity")
-                .num(examQuantity)
-                .build());
+        total.add(new NumOfReport("totalExamQuantity", examQuantity));
         //投诉条数
-        total.add(NumOfReport.builder()
-                .name("complain")
-                .num(complains.size())
-                .build());
-
+        total.add(new NumOfReport("totalComplain", complains.size()));
+        //检查数量
+        Map<Long, List<RecordExpertAudit>> auditMap = recordAudits.stream()
+                .collect(Collectors.groupingBy(RecordExpertAudit::getRecordId));
+        total.add(new NumOfReport("totalAudit", auditMap.size()));
         return total;
-//        Map<String, Integer> map = new HashMap<>();
-//        //备案条数
-//        map.put("record", records.size());
-//        //报考人数
-//        map.put("examQuantity", examQuantity);
-//        //投诉数量
-//        map.put("complain", complains.size());
-//        return map;
     }
 
     /*
     各专业考场数量-饼图
      */
-    public Map<String, Long> getSpecialty(List<RecordSpecialty> recordSpecialties) {
-        Map<String, Long> specialtyCount = recordSpecialties.stream().filter(rs -> StrUtil.isNotEmpty(rs.getCode()))
-                .collect(Collectors.groupingBy(RecordSpecialty::getCode, Collectors.counting()));
-        Map<String, Long> result = new HashMap<>(5);
-        result.put("01", 0L);
-        result.put("02", 0L);
-        result.put("03", 0L);
-        result.put("04", 0L);
-        result.put("05", 0L);
-
-        specialtyCount.forEach((key, value) -> {
-            String name = "01";
-            if (key.startsWith("02")) {
-                name = "02";
-            } else if (key.startsWith("03")) {
-                name = "03";
-            } else if (key.startsWith("04")) {
-                name = "04";
-            } else if (key.startsWith("05")) {
-                name = "05";
+    public List<NumOfReport> getSpecialty(List<RecordSpecialty> recordSpecialties) {
+        int sum01 = 0;
+        int sum02 = 0;
+        int sum03 = 0;
+        int sum04 = 0;
+        int sum05 = 0;
+
+        for (RecordSpecialty specialty : recordSpecialties) {
+            if (StrUtil.isEmpty(specialty.getCode())) {
+                continue;
             }
-            Long count = result.get(name) + value;
-            result.put(name, count);
-        });
-        return result;
+            if (specialty.getCode().startsWith("01")) {
+                sum01 += specialty.getNumOfExam();
+            } else if (specialty.getCode().startsWith("02")) {
+                sum02 += specialty.getNumOfExam();
+            } else if (specialty.getCode().startsWith("03")) {
+                sum03 += specialty.getNumOfExam();
+            } else if (specialty.getCode().startsWith("04")) {
+                sum04 += specialty.getNumOfExam();
+            } else if (specialty.getCode().startsWith("05")) {
+                sum05 += specialty.getNumOfExam();
+            }
+        }
+        List<NumOfReport> reports = new ArrayList<>();
+        reports.add(new NumOfReport("music", sum01));
+        reports.add(new NumOfReport("dance", sum02));
+        reports.add(new NumOfReport("fineArt", sum03));
+        reports.add(new NumOfReport("operaDrama", sum04));
+        reports.add(new NumOfReport("folkArt", sum05));
+        return reports;
     }
 
     /*
@@ -356,11 +347,13 @@ public class ReportService {
         //备案专业
         List<Long> recordIds = records.stream().map(Record::getId).collect(Collectors.toList());
         List<RecordSpecialty> recordSpecialties = recordSpecialtyRepo.findAllByRecordIdIn(recordIds);
+        //备案检查
+        List<RecordExpertAudit> recordAudits = recordExpertAuditRepo.findAllByRecordIdIn(recordIds);
 
         Map<String, Object> dataMap = new HashMap<>();
 
         //标题
-        dataMap.put("year", report.getYear());
+        dataMap.put("year", String.valueOf(report.getYear()));
         if (ReportType.QUARTERLY.equals(report.getType())) {
             String[] arr = {"一季度", "二季度", "三季度", "四季度"};
             dataMap.put("quarterly", arr[report.getQuarterly() - 1]);
@@ -374,26 +367,19 @@ public class ReportService {
         }
 
         //总统计
-        List<NumOfReport> total = this.getTotal(records, complains);
+        List<NumOfReport> total = this.getTotal(records, complains, recordAudits);
         total.forEach(num -> dataMap.put(num.getName(), num.getNum()));
-//        dataMap.put("record", total.get("record"));
-//        dataMap.put("totalExamQuantity", total.get("examQuantity"));
-//        dataMap.put("totalComplain", total.get("complain"));
 
         //各专业统计
-        Map<String, Long> specialty = this.getSpecialty(recordSpecialties);
-        dataMap.put("music", specialty.get("01"));
-        dataMap.put("dance", specialty.get("02"));
-        dataMap.put("fineArt", specialty.get("03"));
-        dataMap.put("operaDrama", specialty.get("04"));
-        dataMap.put("folkArt", specialty.get("05"));
+        List<NumOfReport> specialty = this.getSpecialty(recordSpecialties);
+        specialty.forEach(num -> dataMap.put(num.getName(), num.getNum()));
 
         //考级机构/承办单位统计
-        List<ReportDTO> reportDTOS = this.generate(records, recordIds, complains);
-        Map<UnitType, List<ReportDTO>> unitTypeListMap = reportDTOS.stream()
-                .collect(Collectors.groupingBy(ReportDTO::getUnitType));
+        List<ReportStatistic> reportDTOS = this.generate(records, complains);
+        Map<UnitType, List<ReportStatistic>> unitTypeListMap = reportDTOS.stream()
+                .collect(Collectors.groupingBy(ReportStatistic::getUnitType));
         //考级机构
-        List<ReportDTO> reportsGo = unitTypeListMap.get(UnitType.GRADING_ORGANIZATION);
+        List<ReportStatistic> reportsGo = unitTypeListMap.get(UnitType.GRADING_ORGANIZATION);
         List<Map<String, Object>> listMapGo = new ArrayList<>();
         reportsGo.forEach(dto -> {
             Map<String, Object> goMap = new HashMap<>();
@@ -407,9 +393,9 @@ public class ReportService {
         dataMap.put("list", listMapGo);
 
         //承办单位
-        List<ReportDTO> reports = unitTypeListMap.get(UnitType.ORGANIZATION);
+        List<ReportStatistic> reportStatistics = unitTypeListMap.get(UnitType.ORGANIZATION);
         List<Map<String, Object>> listMap = new ArrayList<>();
-        reports.forEach(dto -> {
+        reportStatistics.forEach(dto -> {
             Map<String, Object> orMap = new HashMap<>();
             orMap.put("name", dto.getName());
             orMap.put("examCenterQuantity", dto.getExamCenterQuantity());
@@ -433,11 +419,15 @@ public class ReportService {
         String url = storageService.uploadFromInputStream(is, "word" + "/" + new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(new Date())
                 + RandomStringUtils.randomAlphabetic(8) + ".docx");
 
+        report.setSpecialty(specialty);
         report.setTotal(total);
         report.setFile(url);
         report.setTime(String.valueOf(date.get("time")));
         report.setTitle("南京市社会艺术水平考级监管报告");
-        reportRepo.save(report);
-
+        Long id = reportRepo.save(report).getId();
+        List<ReportStatistic> statistics = reportStatistics.stream()
+                .peek(statistic -> statistic.setReportId(id))
+                .collect(Collectors.toList());
+        reportStatisticRepo.saveAll(statistics);
     }
 }

+ 20 - 0
src/main/java/com/izouma/wenlvju/service/regulation/ReportStatisticService.java

@@ -0,0 +1,20 @@
+package com.izouma.wenlvju.service.regulation;
+
+import com.izouma.wenlvju.domain.regulation.ReportStatistic;
+import com.izouma.wenlvju.dto.PageQuery;
+import com.izouma.wenlvju.repo.regulation.ReportStatisticRepo;
+import com.izouma.wenlvju.utils.JpaUtils;
+import lombok.AllArgsConstructor;
+import org.springframework.data.domain.Page;
+import org.springframework.stereotype.Service;
+
+@Service
+@AllArgsConstructor
+public class ReportStatisticService {
+
+    private ReportStatisticRepo reportStatisticRepo;
+
+    public Page<ReportStatistic> all(PageQuery pageQuery) {
+        return reportStatisticRepo.findAll(JpaUtils.toSpecification(pageQuery, ReportStatistic.class), JpaUtils.toPageRequest(pageQuery));
+    }
+}

+ 63 - 0
src/main/java/com/izouma/wenlvju/web/regulation/ReportStatisticController.java

@@ -0,0 +1,63 @@
+package com.izouma.wenlvju.web.regulation;
+
+import com.izouma.wenlvju.web.BaseController;
+import com.izouma.wenlvju.domain.regulation.ReportStatistic;
+import com.izouma.wenlvju.service.regulation.ReportStatisticService;
+import com.izouma.wenlvju.dto.PageQuery;
+import com.izouma.wenlvju.exception.BusinessException;
+import com.izouma.wenlvju.repo.regulation.ReportStatisticRepo;
+import com.izouma.wenlvju.utils.ObjUtils;
+import com.izouma.wenlvju.utils.excel.ExcelUtils;
+
+import lombok.AllArgsConstructor;
+import org.springframework.data.domain.Page;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.List;
+
+@RestController
+@RequestMapping("/reportStatistic")
+@AllArgsConstructor
+public class ReportStatisticController extends BaseController {
+    private ReportStatisticService reportStatisticService;
+    private ReportStatisticRepo reportStatisticRepo;
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/save")
+    public ReportStatistic save(@RequestBody ReportStatistic record) {
+        if (record.getId() != null) {
+            ReportStatistic orig = reportStatisticRepo.findById(record.getId()).orElseThrow(new BusinessException("无记录"));
+            ObjUtils.merge(orig, record);
+            return reportStatisticRepo.save(orig);
+        }
+        return reportStatisticRepo.save(record);
+    }
+
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/all")
+    public Page<ReportStatistic> all(@RequestBody PageQuery pageQuery) {
+        return reportStatisticService.all(pageQuery);
+    }
+
+    @GetMapping("/get/{id}")
+    public ReportStatistic get(@PathVariable Long id) {
+        return reportStatisticRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+    }
+
+    @PostMapping("/del/{id}")
+    public void del(@PathVariable Long id) {
+        reportStatisticRepo.softDelete(id);
+    }
+
+    @GetMapping("/excel")
+    @ResponseBody
+    public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
+        List<ReportStatistic> data = all(pageQuery).getContent();
+        ExcelUtils.export(response, data);
+    }
+}
+

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
src/main/resources/genjson/ReportStatistic.json


+ 28 - 0
src/main/resources/templates/ReportTemplate.ftl

@@ -829,6 +829,34 @@
               </w:r>
             </w:p>
           </w:tc>
+          <w:tc>
+            <w:tcPr>
+              <w:tcW w:w="2841" w:type="dxa"/>
+              <w:shd w:val="clear" w:color="auto" w:fill="auto"/>
+            </w:tcPr>
+            <w:p>
+              <w:pPr>
+                <w:listPr>
+                  <w:ilvl w:val="0"/>
+                  <w:ilfo w:val="0"/>
+                </w:listPr>
+                <w:jc w:val="center"/>
+                <w:rPr>
+                  <w:rFonts w:hint="fareast"/>
+                  <w:vertAlign w:val="baseline"/>
+                  <w:lang/>
+                </w:rPr>
+              </w:pPr>
+              <w:r>
+                <w:rPr>
+                  <w:rFonts w:hint="default"/>
+                  <w:vertAlign w:val="baseline"/>
+                  <w:lang/>
+                </w:rPr>
+                <w:t>${totalAudit}</w:t>
+              </w:r>
+            </w:p>
+          </w:tc>
         </w:tr>
       </w:tbl>
       <w:p>

+ 53 - 39
src/main/vue/src/widgets/ArtTypeWidget.vue

@@ -1,11 +1,10 @@
 <template>
     <widget-card :bodyStyle="bodyStyle" ref="container">
         <template #header>
-            <span>考级分类</span>
-
-            <el-select @change="setChart" style="float:right" v-model="chooseYear" size="mini" placeholder="请选择">
+            <span>投诉数量</span>
+            <!-- <el-select @change="setChart" style="float:right" v-model="chooseYear" size="mini" placeholder="请选择">
                 <el-option v-for="item in years" :key="item" :label="item" :value="item"> </el-option>
-            </el-select>
+            </el-select> -->
         </template>
         <div ref="chart" class="chart" style="flex-grow:1"></div>
     </widget-card>
@@ -32,53 +31,68 @@ export default {
         }
     },
     mounted() {
-        this.$http.post('/artType/allList').then(res => {
-            this.types = res;
+        this.$http.post('/reportStatistic/all', { sort: 'complain,desc', size: 20 }, { body: 'json' }).then(res => {
+            this.types = res.content;
             this.myChart = echarts.init(this.$refs.chart);
-            this.setChart('2021');
+            this.setChart();
         });
     },
     methods: {
-        setChart(year) {
+        setChart() {
             let res = [...this.types];
+            // console.log(res);
             let data = [];
             let data2 = [];
-            let total = { ...this.allData }[year].dengji;
-
-            let allNum = res.reduce((pre, cur) => {
-                return pre + (cur.children.length || 1);
-            }, 0);
 
-            let num = 0;
-
-            res.forEach((item, index) => {
-                let _nums = 0;
-                if (item.children.length > 0) {
-                    item.children.forEach((child, childIndex) => {
-                        let _childVal = this.getRandomMoney(allNum - num, total);
-                        num++;
-                        total -= _childVal;
-                        _nums += _childVal;
-                        data2.push({
-                            name: child.name,
-                            value: _childVal
-                        });
+            res.forEach(item => {
+                if (item.unitType == 'GRADING_ORGANIZATION') {
+                    data.push({
+                        name: item.name,
+                        value: item.complain
                     });
-                } else {
-                    let _childVal = this.getRandomMoney(allNum - num, total);
-                    num++;
-                    total -= _childVal;
-                    _nums += _childVal;
+                } else if (item.unitType == 'ORGANIZATION') {
                     data2.push({
                         name: item.name,
-                        value: _childVal
+                        value: item.complain
                     });
                 }
-                data.push({
-                    name: item.name,
-                    value: _nums
-                });
             });
+            // let total = { ...this.allData }[year].dengji;
+
+            // let allNum = res.reduce((pre, cur) => {
+            //     return pre + (cur.children.length || 1);
+            // }, 0);
+
+            // let num = 0;
+
+            // res.forEach((item, index) => {
+            //     let _nums = 0;
+            //     if (item.children.length > 0) {
+            //         item.children.forEach((child, childIndex) => {
+            //             let _childVal = this.getRandomMoney(allNum - num, total);
+            //             num++;
+            //             total -= _childVal;
+            //             _nums += _childVal;
+            //             data2.push({
+            //                 name: child.name,
+            //                 value: _childVal
+            //             });
+            //         });
+            //     } else {
+            //         let _childVal = this.getRandomMoney(allNum - num, total);
+            //         num++;
+            //         total -= _childVal;
+            //         _nums += _childVal;
+            //         data2.push({
+            //             name: item.name,
+            //             value: _childVal
+            //         });
+            //     }
+            //     data.push({
+            //         name: item.name,
+            //         value: _nums
+            //     });
+            // });
 
             let option = {
                 tooltip: {
@@ -93,7 +107,7 @@ export default {
                 },
                 series: [
                     {
-                        name: '考级分类',
+                        name: '投诉数量',
                         type: 'pie',
                         selectedMode: 'single',
                         radius: [0, '30%'],
@@ -112,7 +126,7 @@ export default {
                         }
                     },
                     {
-                        name: '考级分类',
+                        name: '投诉数量',
                         type: 'pie',
                         radius: ['45%', '60%'],
                         data: data2

+ 1 - 1
src/main/vue/src/widgets/BoardWidget.vue

@@ -1,7 +1,7 @@
 <template>
     <widget-card :bodyStyle="bodyStyle" ref="container">
         <template slot="header">
-            通知
+            通知
         </template>
         <div class="boardList" :style="{ height: height + 'px' }">
             <router-link

+ 24 - 11
src/main/vue/src/widgets/DatasWidget.vue

@@ -2,24 +2,24 @@
     <widget-card>
         <template slot="header">
             <span>数据总揽</span>
-
-            <el-select style="float:right" v-model="chooseYear" size="mini" placeholder="请选择">
+            <span style="float:right">{{ time }}</span>
+            <!-- <el-select style="float:right" v-model="chooseYear" size="mini" placeholder="请选择">
                 <el-option v-for="item in years" :key="item" :label="item" :value="item"> </el-option>
-            </el-select>
+            </el-select> -->
         </template>
 
         <el-row :gutter="20">
             <el-col :span="6" :offset="0">
-                <UserWidget :year="chooseYear"></UserWidget>
+                <UserWidget :value="types['record']"></UserWidget>
             </el-col>
             <el-col :span="6" :offset="0">
-                <UserWidget2 :year="chooseYear"></UserWidget2>
+                <UserWidget3 :value="types['totalExamQuantity']"></UserWidget3>
             </el-col>
             <el-col :span="6" :offset="0">
-                <UserWidget3 :year="chooseYear"></UserWidget3>
+                <UserWidget2 :value="types['totalComplain']"></UserWidget2>
             </el-col>
             <el-col :span="6" :offset="0">
-                <UserWidget4 :year="chooseYear"></UserWidget4>
+                <UserWidget4 :value="types['totalAudit']"></UserWidget4>
             </el-col>
         </el-row>
     </widget-card>
@@ -35,14 +35,27 @@ import { GridLayout, GridItem } from 'vue-grid-layout';
 export default {
     data() {
         return {
-            chooseYear: '2021'
+            chooseYear: '2021',
+            time: '',
+            types: {},
+            record: 0,
+            totalExamQuantity: 0,
+            totalComplain: 0
         };
     },
     mixins: [widget],
     computed: {
-        years() {
-            return Object.keys({ ...this.allData });
-        }
+        // years() {
+        //     return Object.keys({ ...this.allData });
+        // }
+    },
+    mounted() {
+        this.$http.get('/report/get/' + this.$route.query.id).then(res => {
+            res.total.forEach(item => {
+                this.types[item.name] = item.num;
+            });
+            this.time = res.time;
+        });
     },
     components: {
         WidgetCard,

+ 38 - 19
src/main/vue/src/widgets/ExamWidegt.vue

@@ -1,10 +1,11 @@
 <template>
     <widget-card :bodyStyle="bodyStyle" ref="container">
         <template #header
-            ><span>报考人数</span>
-            <el-select @change="setChart" style="float:right" v-model="chooseYear" size="mini" placeholder="请选择">
+            ><span>考场数量</span>
+            <!-- <span style="float:right">{{ time }}</span> -->
+            <!-- <el-select @change="setChart" style="float:right" v-model="chooseYear" size="mini" placeholder="请选择">
                 <el-option v-for="item in years" :key="item" :label="item" :value="item"> </el-option>
-            </el-select>
+            </el-select> -->
         </template>
         <div ref="chart" class="chart" style="flex-grow:1"></div>
     </widget-card>
@@ -22,35 +23,53 @@ export default {
                 display: 'flex'
             },
             chooseYear: '2021',
-            types: []
+            types: [],
+            time: ''
         };
     },
     computed: {
-        years() {
-            return Object.keys({ ...this.allData });
-        }
+        // years() {
+        //     return Object.keys({ ...this.allData });
+        // }
     },
     mounted() {
-        this.$http.post('/artType/allList').then(res => {
-            this.types = res;
+        this.$http.get('/report/get/' + this.$route.query.id).then(res => {
+            this.types = res.specialty;
+            this.time = res.time;
             this.myChart = echarts.init(this.$refs.chart);
-            this.setChart('2021');
+            this.setChart();
         });
     },
     methods: {
-        setChart(year) {
+        setChart() {
             let maxRadius = this.getMax(this.$refs.container.$el.offsetWidth, this.$refs.container.$el.offsetHeight);
             let data = [];
             let res = [...this.types];
 
-            let total = this.allData[year].baokao;
+            // let total = this.allData[year].baokao;
 
-            res.forEach((item, index) => {
-                let _val = this.getRandomMoney(res.length - index, total);
-                total -= _val;
+            // res.forEach((item, index) => {
+            //     let _val = this.getRandomMoney(res.length - index, total);
+            //     total -= _val;
+            //     data.push({
+            //         name: item.name,
+            //         value: _val
+            //     });
+            // });
+            res.forEach(item => {
+                let name = '音乐';
+                if (item.name == 'dance') {
+                    name = '舞蹈';
+                } else if (item.name == 'fineArt') {
+                    name = '美术';
+                } else if (item.name == 'operaDrama') {
+                    name = '戏曲戏剧';
+                } else if (item.name == 'folkArt') {
+                    name = '曲艺';
+                }
                 data.push({
-                    name: item.name,
-                    value: _val
+                    name: name,
+                    value: item.num
                 });
             });
             data = data.sort((a, b) => {
@@ -68,14 +87,14 @@ export default {
                 },
                 series: [
                     {
-                        name: '报考人数',
+                        name: '考场数量',
                         type: 'pie',
                         radius: [20, Math.ceil(maxRadius / 6)],
                         labelLine: {
                             length: 30
                         },
                         label: {
-                            formatter: ' {b|{b}:}{c}万人 {per|{d}%}  ',
+                            formatter: ' {b|{b}:}{c} {per|{d}%}  ',
                             backgroundColor: '#F6F8FC',
                             borderColor: '#8C8D8E',
                             borderWidth: 1,

+ 171 - 93
src/main/vue/src/widgets/PassWidget.vue

@@ -1,6 +1,6 @@
 <template>
     <widget-card :bodyStyle="bodyStyle" ref="container">
-        <template #header>年度通过率</template>
+        <template #header>报考人数</template>
         <div ref="chart" class="chart" style="flex-grow:1"></div>
     </widget-card>
 </template>
@@ -16,25 +16,45 @@ export default {
             myChart: null,
             bodyStyle: {
                 display: 'flex'
-            }
+            },
+            types: []
         };
     },
     mounted() {
+        this.$http
+            .post(
+                '/reportStatistic/all',
+                { sort: 'examQuantity,desc', size: 20, query: { unitType: 'ORGANIZATION' } },
+                { body: 'json' }
+            )
+            .then(res => {
+                this.types = res.content;
+                this.myChart = echarts.init(this.$refs.chart);
+            });
         setTimeout(() => {
             this.$nextTick(() => {
-                let info = { ...this.allData };
-                let data = Object.keys(info).map(item => {
-                    return {
-                        year: item,
-                        ...info[item]
-                    };
+                // let info = { ...this.allData };
+                // let data = Object.keys(info).map(item => {
+                //     return {
+                //         year: item,
+                //         ...info[item]
+                //     };
+                // });
+                // let data = this.types;
+                // console.log(data);
+                let data = [];
+                this.types.forEach(item => {
+                    data.push({
+                        name: item.name,
+                        num: item.examQuantity
+                    });
                 });
 
                 var chartDom = this.$refs.chart;
                 var myChart = echarts.init(chartDom);
                 var option;
 
-                option = option = {
+                option = {
                     tooltip: {
                         trigger: 'axis',
                         axisPointer: {
@@ -42,17 +62,17 @@ export default {
                             crossStyle: {
                                 color: '#999'
                             }
-                        },
-                        formatter: '{b}年<br/>{a0}: {c0}万<br />{a1}: {c1}万<br />{a2}: {c2}%'
+                        }
+                        // formatter: '{b}年<br/>{a0}: {c0}万<br />{a1}: {c1}万<br />{a2}: {c2}%'
                     },
                     legend: {
-                        data: ['报考人数', '通过人数', '通过率']
+                        data: ['报考人数']
                     },
                     xAxis: [
                         {
                             type: 'category',
                             data: data.map(item => {
-                                return item.year;
+                                return item.name;
                             }),
                             axisPointer: {
                                 type: 'shadow'
@@ -65,27 +85,15 @@ export default {
                     yAxis: [
                         {
                             type: 'value',
-                            name: '人次',
+                            name: '人次',
                             min: 0,
-                            interval: 50,
+                            interval: 100,
                             axisLabel: {
                                 formatter: '{value} '
                             },
                             axisLine: {
                                 show: false
                             }
-                        },
-                        {
-                            type: 'value',
-                            name: '通过率',
-                            min: 0,
-                            interval: 20,
-                            axisLabel: {
-                                formatter: '{value} %'
-                            },
-                            axisLine: {
-                                show: false
-                            }
                         }
                     ],
                     series: [
@@ -93,81 +101,151 @@ export default {
                             name: '报考人数',
                             type: 'bar',
                             data: data.map(item => {
-                                return item.baokao;
-                            }),
-                            label: {
-                                show: true,
-                                position: 'top',
-                                formatter: '{c}万'
-                            }
-                        },
-                        {
-                            name: '通过人数',
-                            type: 'bar',
-                            data: data.map(item => {
-                                return item.pass;
+                                return item.num;
                             }),
                             label: {
                                 show: true,
                                 position: 'top',
-                                formatter: '{c}万'
-                            }
-                        },
-                        {
-                            name: '通过率',
-                            type: 'line',
-                            yAxisIndex: 1,
-                            data: data.map(item => {
-                                return Math.ceil((item.pass * 100) / item.baokao);
-                            }),
-                            label: {
-                                formatter: '{b}: {c}%'
-                            },
-                            markPoint: {
-                                data: [
-                                    {
-                                        type: 'max',
-                                        name: '最大值',
-                                        label: {
-                                            color: '#fff',
-                                            fontWeight: 'bolder',
-                                            formatter: '{c}%'
-                                        }
-                                    },
-                                    {
-                                        type: 'min',
-                                        name: '最小值',
-                                        label: {
-                                            color: '#fff',
-                                            fontWeight: 'bolder',
-                                            formatter: '{c}%'
-                                        }
-                                    }
-                                ]
-                            },
-                            markLine: {
-                                data: [
-                                    {
-                                        type: 'average',
-                                        name: '平均值',
-                                        label: {
-                                            position: 'start',
-                                            formatter: '平均通过率为: {c}%',
-                                            distance: [-200, 10],
-                                            fontSize: 14,
-                                            fontWeight: 'bolder',
-                                            backgroundColor: 'inherit',
-                                            color: '#fff',
-                                            padding: [12, 20, 12, 20],
-                                            borderRadius: 6
-                                        }
-                                    }
-                                ]
+                                formatter: '{c}'
                             }
                         }
                     ]
                 };
 
+                // option = option = {
+                //     tooltip: {
+                //         trigger: 'axis',
+                //         axisPointer: {
+                //             type: 'cross',
+                //             crossStyle: {
+                //                 color: '#999'
+                //             }
+                //         },
+                //         formatter: '{b}年<br/>{a0}: {c0}万<br />{a1}: {c1}万<br />{a2}: {c2}%'
+                //     },
+                //     legend: {
+                //         data: ['报考人数', '通过人数', '通过率']
+                //     },
+                //     xAxis: [
+                //         {
+                //             type: 'category',
+                //             data: data.map(item => {
+                //                 return item.year;
+                //             }),
+                //             axisPointer: {
+                //                 type: 'shadow'
+                //             },
+                //             axisLine: {
+                //                 show: false
+                //             }
+                //         }
+                //     ],
+                //     yAxis: [
+                //         {
+                //             type: 'value',
+                //             name: '万人次',
+                //             min: 0,
+                //             interval: 50,
+                //             axisLabel: {
+                //                 formatter: '{value} '
+                //             },
+                //             axisLine: {
+                //                 show: false
+                //             }
+                //         },
+                //         {
+                //             type: 'value',
+                //             name: '通过率',
+                //             min: 0,
+                //             interval: 20,
+                //             axisLabel: {
+                //                 formatter: '{value} %'
+                //             },
+                //             axisLine: {
+                //                 show: false
+                //             }
+                //         }
+                //     ],
+                //     series: [
+                //         {
+                //             name: '报考人数',
+                //             type: 'bar',
+                //             data: data.map(item => {
+                //                 return item.baokao;
+                //             }),
+                //             label: {
+                //                 show: true,
+                //                 position: 'top',
+                //                 formatter: '{c}万'
+                //             }
+                //         },
+                //         {
+                //             name: '通过人数',
+                //             type: 'bar',
+                //             data: data.map(item => {
+                //                 return item.pass;
+                //             }),
+                //             label: {
+                //                 show: true,
+                //                 position: 'top',
+                //                 formatter: '{c}万'
+                //             }
+                //         },
+                //         {
+                //             name: '通过率',
+                //             type: 'line',
+                //             yAxisIndex: 1,
+                //             data: data.map(item => {
+                //                 return Math.ceil((item.pass * 100) / item.baokao);
+                //             }),
+                //             label: {
+                //                 formatter: '{b}: {c}%'
+                //             },
+                //             markPoint: {
+                //                 data: [
+                //                     {
+                //                         type: 'max',
+                //                         name: '最大值',
+                //                         label: {
+                //                             color: '#fff',
+                //                             fontWeight: 'bolder',
+                //                             formatter: '{c}%'
+                //                         }
+                //                     },
+                //                     {
+                //                         type: 'min',
+                //                         name: '最小值',
+                //                         label: {
+                //                             color: '#fff',
+                //                             fontWeight: 'bolder',
+                //                             formatter: '{c}%'
+                //                         }
+                //                     }
+                //                 ]
+                //             },
+                //             markLine: {
+                //                 data: [
+                //                     {
+                //                         type: 'average',
+                //                         name: '平均值',
+                //                         label: {
+                //                             position: 'start',
+                //                             formatter: '平均通过率为: {c}%',
+                //                             distance: [-200, 10],
+                //                             fontSize: 14,
+                //                             fontWeight: 'bolder',
+                //                             backgroundColor: 'inherit',
+                //                             color: '#fff',
+                //                             padding: [12, 20, 12, 20],
+                //                             borderRadius: 6
+                //                         }
+                //                     }
+                //                 ]
+                //             }
+                //         }
+                //     ]
+                // };
+
                 option && myChart.setOption(option);
             });
         }, 500);

+ 5 - 5
src/main/vue/src/widgets/UserWidget.vue

@@ -2,8 +2,8 @@
     <widget-card :bodyStyle="bodyStyle">
         <i class="fa-fw fas fa-building fa-3x" style="color: #40c9c6;"></i>
         <div class="info">
-            <div class="text">承办单位</div>
-            <div class="num">{{ yearInfo.chenban }}</div>
+            <div class="text">备案数量</div>
+            <div class="num">{{ value }}</div>
         </div>
     </widget-card>
 </template>
@@ -13,9 +13,9 @@ import widget from '../mixins/widget';
 
 export default {
     props: {
-        year: {
-            type: String,
-            default: '2021'
+        value: {
+            type: Number,
+            default: 0
         }
     },
     mixins: [widget],

+ 10 - 10
src/main/vue/src/widgets/UserWidget2.vue

@@ -2,8 +2,8 @@
     <widget-card :bodyStyle="bodyStyle" path="/gradingOrganizationList">
         <i class="fa-fw fas fa-school fa-3x" style="color: #40c9c6;"></i>
         <div class="info">
-            <div class="text">考级机构</div>
-            <div class="num">{{ yearInfo.jigou }}</div>
+            <div class="text">投诉咨询</div>
+            <div class="num">{{ value }}</div>
         </div>
     </widget-card>
 </template>
@@ -13,9 +13,9 @@ import widget from '../mixins/widget';
 
 export default {
     props: {
-        year: {
-            type: String,
-            default: '2021'
+        value: {
+            type: Number,
+            default: 0
         }
     },
     mixins: [widget],
@@ -27,11 +27,11 @@ export default {
             }
         };
     },
-    computed: {
-        yearInfo() {
-            return this.allData[this.year];
-        }
-    },
+    // computed: {
+    //     yearInfo() {
+    //         return this.allData[this.year];
+    //     }
+    // },
     components: {
         WidgetCard
     }

+ 4 - 4
src/main/vue/src/widgets/UserWidget3.vue

@@ -3,7 +3,7 @@
         <i class="fa-fw fas fa-child fa-3x" style="color: #40c9c6;"></i>
         <div class="info">
             <div class="text">报考人数</div>
-            <div class="num">{{ yearInfo.baokao }}万</div>
+            <div class="num">{{ value }}</div>
         </div>
     </widget-card>
 </template>
@@ -13,9 +13,9 @@ import widget from '../mixins/widget';
 
 export default {
     props: {
-        year: {
-            type: String,
-            default: '2021'
+        value: {
+            type: Number,
+            default: 0
         }
     },
     mixins: [widget],

+ 8 - 8
src/main/vue/src/widgets/UserWidget4.vue

@@ -2,8 +2,8 @@
     <widget-card :bodyStyle="bodyStyle">
         <i class="fa-fw fas fa-database fa-3x" style="color: #40c9c6;"></i>
         <div class="info">
-            <div class="text">等级评定</div>
-            <div class="num">{{ yearInfo.dengji }}</div>
+            <div class="text">检查数量</div>
+            <div class="num">{{ value }}</div>
         </div>
     </widget-card>
 </template>
@@ -13,9 +13,9 @@ import widget from '../mixins/widget';
 
 export default {
     props: {
-        year: {
-            type: String,
-            default: '2021'
+        value: {
+            type: Number,
+            default: 0
         }
     },
     mixins: [widget],
@@ -28,9 +28,9 @@ export default {
         };
     },
     computed: {
-        yearInfo() {
-            return this.allData[this.year];
-        }
+        // yearInfo() {
+        //     return this.allData[this.year];
+        // }
     },
     components: {
         WidgetCard

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä