Sfoglia il codice sorgente

Merge branch 'test' of licailing/wenlvju into master

licailing 4 anni fa
parent
commit
d05dc64364

+ 2 - 0
src/main/java/com/izouma/wenlvju/domain/performance/Participant.java

@@ -21,6 +21,8 @@ import java.time.LocalDate;
 @ApiModel(value = "参演人员")
 @Where(clause = "del = 0")
 public class Participant extends BaseEntity {
+    private Long performanceId;
+
     private Long programmeId;
 
     @ApiModelProperty(value = "姓名")

+ 7 - 0
src/main/java/com/izouma/wenlvju/repo/performance/ParticipantRepo.java

@@ -16,7 +16,14 @@ public interface ParticipantRepo extends JpaRepository<Participant, Long>, JpaSp
     @Transactional
     void softDelete(Long id);
 
+    @Query("update Participant t set t.del = true where t.programmeId = ?1")
+    @Modifying
+    @Transactional
+    void softDeleteProgrammeId(Long programmeId);
+
     List<Participant> findAllByProgrammeIdIn(Collection<Long> ids);
 
     List<Participant> findAllByProgrammeId(Long id);
+
+    List<Participant> findByIdNoAndPerformanceId(String idNo, Long performanceId);
 }

+ 0 - 6
src/main/java/com/izouma/wenlvju/service/RateExpertAuditService.java

@@ -2,16 +2,12 @@ package com.izouma.wenlvju.service;
 
 import cn.hutool.core.util.ObjectUtil;
 import com.izouma.wenlvju.domain.Rate;
-import com.izouma.wenlvju.domain.RateAudit;
 import com.izouma.wenlvju.domain.RateExpertAudit;
 import com.izouma.wenlvju.dto.PageQuery;
-import com.izouma.wenlvju.enums.OrganizationGrade;
 import com.izouma.wenlvju.enums.RateStatus;
 import com.izouma.wenlvju.exception.BusinessException;
-import com.izouma.wenlvju.repo.RateAuditRepo;
 import com.izouma.wenlvju.repo.RateExpertAuditRepo;
 import com.izouma.wenlvju.repo.RateRepo;
-import com.izouma.wenlvju.service.sms.NjwlSmsService;
 import com.izouma.wenlvju.utils.JpaUtils;
 import com.izouma.wenlvju.utils.ObjUtils;
 import lombok.AllArgsConstructor;
@@ -26,8 +22,6 @@ public class RateExpertAuditService {
 
     private final RateExpertAuditRepo rateExpertAuditRepo;
     private final RateRepo            rateRepo;
-    private final NjwlSmsService      njwlSmsService;
-    private final RateAuditRepo       rateAuditRepo;
 
     public Page<RateExpertAudit> all(PageQuery pageQuery) {
         return rateExpertAuditRepo.findAll(JpaUtils.toSpecification(pageQuery, RateExpertAudit.class), JpaUtils.toPageRequest(pageQuery));

+ 42 - 7
src/main/java/com/izouma/wenlvju/service/RateService.java

@@ -9,6 +9,7 @@ import com.izouma.wenlvju.domain.*;
 import com.izouma.wenlvju.dto.PageQuery;
 import com.izouma.wenlvju.dto.ReviewTime;
 import com.izouma.wenlvju.enums.AuthorityName;
+import com.izouma.wenlvju.enums.OrganizationGrade;
 import com.izouma.wenlvju.enums.RateStatus;
 import com.izouma.wenlvju.exception.BusinessException;
 import com.izouma.wenlvju.repo.*;
@@ -610,7 +611,7 @@ public class RateService {
     /**
      * 发短信
      *
-     * @param announcement
+     * @param announcement 是否公告短信
      */
     public void batchSendSms(boolean announcement) {
         List<Rate> rates = rateRepo.findAllByStatusAndYear(RateStatus.SUBMIT_PAPER_MATERIALS, String.valueOf(LocalDate.now()
@@ -622,19 +623,53 @@ public class RateService {
         } else {
             njwlSmsService.sendSms(phones, "请你单位在5个工作日内将纸质申请材料(2份)送属地区文化和旅游局文化行政主管部门,逾期不送,作自动放弃处理。");
         }
-
     }
 
     /**
      * 等级
      */
-    public void grade(double excellent,double eligible) {
+    public void gradeRatio(double excellent, double eligible, Long userId) {
         List<Rate> rates = rateRepo.findAllByStatusAndYear(RateStatus.SUBMIT_GRADE, String.valueOf(LocalDate.now()
                 .getYear()));
         rates.sort(Comparator.comparingInt(Rate::getSort));
-        int excellentSum = (int) Math.round(rates.size() * excellent);
-        List<Rate> excellentList = rates.subList(0, excellentSum);
-        int eligibleSum = (int) Math.round(rates.size() * eligible);
-//        List<Rate> eligibleList = rates.subList(total);
+        int size = rates.size();
+        int excellentSum = (int) Math.round(size * excellent / 100);
+        if (excellentSum >= size) {
+            rates.forEach(rate -> {
+                rate.setGrade(OrganizationGrade.EXCELLENT);
+                rate.setStatus(RateStatus.SUBMIT_PAPER_MATERIALS);
+                RateAudit rateAudit = RateAudit.builder()
+                        .userId(userId)
+                        .rateId(rate.getId())
+                        .remark("市政管理员已评审完成,请你单位在5个工作日内将纸质申请材料(2份)送属地区文化行政主管部门。")
+                        .status(RateStatus.SUBMIT_PAPER_MATERIALS.toString())
+                        .build();
+                rateAuditRepo.save(rateAudit);
+            });
+            rateRepo.saveAll(rates);
+            return;
+        }
+
+        int eligibleSum = (int) Math.round(size * eligible / 100);
+        int total = eligibleSum + excellentSum;
+        for (int i = 0; i < size; i++) {
+            Rate rate = rates.get(i);
+            if (i < excellentSum) {
+                rate.setGrade(OrganizationGrade.EXCELLENT);
+            } else if (i < total) {
+                rate.setGrade(OrganizationGrade.ELIGIBLE);
+            } else {
+                rate.setGrade(OrganizationGrade.NOT_ELIGIBLE);
+            }
+            rate.setStatus(RateStatus.SUBMIT_PAPER_MATERIALS);
+            RateAudit rateAudit = RateAudit.builder()
+                    .userId(userId)
+                    .rateId(rate.getId())
+                    .remark("市政管理员已评审完成,请你单位在5个工作日内将纸质申请材料(2份)送属地区文化行政主管部门。")
+                    .status(RateStatus.SUBMIT_PAPER_MATERIALS.toString())
+                    .build();
+            rateAuditRepo.save(rateAudit);
+        }
+        rateRepo.saveAll(rates);
     }
 }

+ 23 - 0
src/main/java/com/izouma/wenlvju/service/performance/ParticipantService.java

@@ -1,5 +1,7 @@
 package com.izouma.wenlvju.service.performance;
 
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.StrUtil;
 import com.izouma.wenlvju.domain.performance.Participant;
 import com.izouma.wenlvju.dto.PageQuery;
 import com.izouma.wenlvju.exception.BusinessException;
@@ -27,9 +29,30 @@ public class ParticipantService {
             if (participant.getId() != null) {
                 Participant orig = participantRepo.findById(participant.getId())
                         .orElseThrow(new BusinessException("无记录"));
+
+                if (StrUtil.isNotEmpty(participant.getIdNo())) {
+                    List<Participant> byIdNo = participantRepo.findByIdNoAndPerformanceId(participant.getIdNo(), participant.getPerformanceId());
+                    if (CollUtil.isNotEmpty(byIdNo)) {
+                        if (byIdNo.size() > 1) {
+                            throw new BusinessException("一人只能报一个节目");
+                        } else {
+                            if (!byIdNo.get(0).getId().equals(participant.getId())) {
+                                throw new BusinessException("一人只能报一个节目");
+                            }
+                        }
+                    }
+                }
+
                 ObjUtils.merge(orig, participant);
                 participantRepo.save(orig);
             } else {
+                if (StrUtil.isNotEmpty(participant.getIdNo())) {
+                    List<Participant> byIdNo = participantRepo.findByIdNoAndPerformanceId(participant.getIdNo(), participant.getPerformanceId());
+                    if (CollUtil.isNotEmpty(byIdNo)) {
+                        throw new BusinessException("一人只能报一个节目");
+                    }
+                }
+
                 participantRepo.save(participant);
             }
         });

+ 13 - 7
src/main/java/com/izouma/wenlvju/service/performance/ProgrammeService.java

@@ -46,6 +46,7 @@ import java.text.SimpleDateFormat;
 import java.time.LocalDate;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
+import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 
 @Service
@@ -249,18 +250,23 @@ public class ProgrammeService {
         }
 
         File destDir = TempFile.createTempDirectory("import");
-//        String originalFilename = file.getOriginalFilename();
-//        boolean zip = Pattern.matches(".zip", FilenameUtils.getExtension(file.getName()));
-//        boolean rar = Pattern.matches(".rar", FilenameUtils.getExtension(file.getName()));
-//        if (rar) {
-
-//        } else if (zip) {
+        String originalFilename = file.getOriginalFilename();
+        boolean zip = Pattern.matches("zip", FilenameUtils.getExtension(originalFilename));
+        boolean rar = false;
+        if (!zip) {
+            rar = Pattern.matches("rar", FilenameUtils.getExtension(originalFilename));
+        }
+        if (rar) {
+            FileUtils.unrar(file.getInputStream(), destDir);
+        } else if (zip) {
             try {
                 ZipUtil.unzip(file.getInputStream(), destDir, StandardCharsets.UTF_8);
             } catch (Exception e) {
                 ZipUtil.unzip(file.getInputStream(), destDir, Charset.forName("gbk"));
             }
-//        }
+        } else {
+            throw new BusinessException("最能上传zip或者rar压缩包");
+        }
 
 
         File xlsxFile = FileUtils.findInDir(destDir, null);

+ 65 - 39
src/main/java/com/izouma/wenlvju/utils/FileUtils.java

@@ -2,6 +2,10 @@ package com.izouma.wenlvju.utils;
 
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.junrar.Archive;
+import com.github.junrar.exception.RarException;
+import com.github.junrar.rarfile.FileHeader;
+import com.izouma.wenlvju.exception.BusinessException;
 import org.apache.commons.io.FilenameUtils;
 import org.apache.commons.lang3.StringUtils;
 
@@ -13,6 +17,7 @@ import java.nio.file.attribute.PosixFileAttributes;
 import java.nio.file.attribute.PosixFilePermission;
 import java.nio.file.attribute.PosixFilePermissions;
 import java.util.*;
+import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 public class FileUtils {
@@ -204,45 +209,6 @@ public class FileUtils {
 
     }
 
-
-    public static Map<String, File> findExcel(File dir) {
-        if (!(dir.exists() && dir.isDirectory())) return null;
-        for (File file : dir.listFiles()) {
-            String name = file.getName().toLowerCase();
-            if ((name.endsWith(".xlsx") || name.endsWith(".xls")) && !name.startsWith(".") && !file.isHidden()) {
-                Map<String, File> fileMap = new HashMap<>();
-                fileMap.put("file", file);
-                fileMap.put("destDir", dir);
-                return fileMap;
-            } else if (file.isDirectory() && !file.isHidden()) {
-                return findExcel(file);
-            }
-        }
-        return null;
-    }
-
-    public static File findByName(File dir, String fileName) {
-        if (!(dir.exists() && dir.isDirectory())) return null;
-        for (File file : dir.listFiles()) {
-            String name = file.getName().toLowerCase();
-            if (name.contains(fileName)) {
-                return file;
-            }
-        }
-        return null;
-    }
-
-    public static File findExcel1(File dir) {
-        if (!(dir.exists() && dir.isDirectory())) return null;
-        for (File file : dir.listFiles()) {
-            String name = file.getName().toLowerCase();
-            if ((name.endsWith(".xlsx") || name.endsWith(".xls")) && !name.startsWith(".") && !file.isHidden()) {
-                return file;
-            }
-        }
-        return null;
-    }
-
     public static File findInDir(File dir, String fileName) {
         if (dir.isDirectory()) {
             for (File file : dir.listFiles()) {
@@ -309,4 +275,64 @@ public class FileUtils {
         }
         return null;
     }
+
+    public static void unrar(InputStream sourceRar, File destDir) throws Exception {
+        Archive archive = null;
+        FileOutputStream fos = null;
+        System.out.println("Starting 开始解压...");
+        try {
+            archive = new Archive(sourceRar);
+            FileHeader fh = archive.nextFileHeader();
+            File destFileName;
+            while (fh != null) {
+
+                //中文名称乱码
+                String fileName = fh.getFileNameW().replaceAll("/", File.separator).replaceAll("\\\\", File.separator);
+                if (StringUtils.isBlank(fileName)) {
+                    fileName = fh.getFileNameString()
+                            .replaceAll("/", File.separator)
+                            .replaceAll("\\\\", File.separator);
+                }
+
+//                String compressFileName = fh.getFileNameString().trim();
+                destFileName = new File(destDir.getAbsolutePath() + "/" + fileName);
+                if (fh.isDirectory()) {
+                    if (!destFileName.exists()) {
+                        destFileName.mkdirs();
+                    }
+                    fh = archive.nextFileHeader();
+                    continue;
+                }
+                if (!destFileName.getParentFile().exists()) {
+                    destFileName.getParentFile().mkdirs();
+                }
+
+                fos = new FileOutputStream(destFileName);
+                archive.extractFile(fh, fos);
+                fos.close();
+                fos = null;
+                fh = archive.nextFileHeader();
+            }
+
+            archive.close();
+            archive = null;
+            System.out.println("解压完毕...");
+        } catch (Exception e) {
+            throw e;
+        } finally {
+            if (fos != null) {
+                try {
+                    fos.close();
+                } catch (Exception e) {
+                }
+            }
+            if (archive != null) {
+                try {
+                    archive.close();
+                } catch (Exception e) {
+                }
+            }
+        }
+    }
+
 }

+ 13 - 0
src/main/java/com/izouma/wenlvju/web/RateController.java

@@ -181,10 +181,23 @@ public class RateController extends BaseController {
         return rateRepo.countAllByOrganizationIdAndYear(id, year) == 0;
     }
 
+    @ApiOperation("提交纸质材料")
     @PostMapping("/paperMaterial")
     public void paperMaterial(@RequestParam Long id, @RequestParam RateStatus status, String remark) {
         rateService.paperMaterial(id, status, remark, SecurityUtils.getAuthenticatedUser().getId());
     }
 
+    @ApiOperation("批量发送短信")
+    @PostMapping("/batchSendSms")
+    public void batchSendSms(boolean announcement) {
+        rateService.batchSendSms(announcement);
+    }
+
+    @ApiOperation("设置等级比例")
+    @PostMapping("/gradeRatio")
+    public void gradeRatio(double excellent, double eligible) {
+        rateService.gradeRatio(excellent, eligible, SecurityUtils.getAuthenticatedUser().getId());
+    }
+
 }
 

+ 4 - 0
src/main/java/com/izouma/wenlvju/web/performance/ProgrammeController.java

@@ -7,6 +7,7 @@ import com.izouma.wenlvju.dto.*;
 import com.izouma.wenlvju.enums.ProgrammeStatus;
 import com.izouma.wenlvju.enums.SignedIn;
 import com.izouma.wenlvju.exception.BusinessException;
+import com.izouma.wenlvju.repo.performance.ParticipantRepo;
 import com.izouma.wenlvju.repo.performance.PerformanceRepo;
 import com.izouma.wenlvju.repo.performance.ProgrammeRepo;
 import com.izouma.wenlvju.service.UserService;
@@ -37,6 +38,7 @@ public class ProgrammeController extends BaseController {
     private ProgrammeRepo    programmeRepo;
     private UserService      userService;
     private PerformanceRepo  performanceRepo;
+    private ParticipantRepo  participantRepo;
 
     //@PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/save")
@@ -82,6 +84,8 @@ public class ProgrammeController extends BaseController {
     @PostMapping("/del/{id}")
     public void del(@PathVariable Long id) {
         programmeRepo.softDelete(id);
+        // 删除参演人员
+        participantRepo.softDeleteProgrammeId(id);
     }
 
     @GetMapping("/excel")

+ 5 - 1
src/main/vue/src/components/OrganizationLog.vue

@@ -135,7 +135,11 @@
                             </el-form-item>
                             <el-form-item label="营业执照" prop="businessLicense" class="address">
                                 <!-- <single-upload v-model="formData.businessLicense"></single-upload> -->
-                                <img style="width:100px;height100px" :src="formData.businessLicense" alt="" />
+                                <el-image
+                                    style="width:100px;height100px"
+                                    :src="formData.businessLicense"
+                                    :preview-src-list="[formData.businessLicense]"
+                                ></el-image>
                             </el-form-item>
                         </div>
                     </el-collapse-transition>

+ 3 - 0
src/main/vue/src/components/ProgrammeLog.vue

@@ -83,6 +83,9 @@
                             <el-form-item prop="instructor" label="指导老师">
                                 <el-input v-model="formData.instructor" class="width" readonly></el-input>
                             </el-form-item>
+                            <el-form-item prop="instructorPhone" label="联系方式">
+                                <el-input v-model="formData.instructorPhone" class="width" readonly></el-input>
+                            </el-form-item>
                             <div
                                 v-if="
                                     formData.specialty == '中国画' ||

+ 11 - 3
src/main/vue/src/views/performance/ProgrammeEdit.vue

@@ -587,10 +587,18 @@ export default {
 
                     this.programmeId = res.id;
                     this.$nextTick(() => {
-                        this.$http.post('/participant/batchSave', this.saveOtherJson, { body: 'json' });
+                        this.$http
+                            .post('/participant/batchSave', this.saveOtherJson, { body: 'json' })
+                            .then(() => {
+                                this.$message.success('成功');
+                                this.$router.go(-1);
+                            })
+                            .catch(e => {
+                                console.log(e);
+                                this.saving = false;
+                                this.$message.error(e.error);
+                            });
                     });
-                    this.$message.success('成功');
-                    this.$router.go(-1);
                 })
                 .catch(e => {
                     console.log(e);

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

@@ -177,7 +177,7 @@
             :height="tableHeight"
         >
             <el-table-column v-if="multipleMode" align="center" type="selection" width="50"> </el-table-column>
-            <el-table-column prop="id" label="编号" width="80"> </el-table-column>
+            <el-table-column prop="id" label="编号" width="80" fixed="left"> </el-table-column>
             <el-table-column prop="name" label="节目名称" fixed="left"> </el-table-column>
             <el-table-column prop="specialty" label="参赛专业"> </el-table-column>
             <el-table-column

+ 3 - 62
src/main/vue/src/views/rate/RateList.vue

@@ -1,68 +1,6 @@
 <template>
     <div class="list-view">
         <div class="filters-container">
-            <!-- <el-input placeholder="输入关键字" v-model="search" clearable class="filter-item"></el-input>
-             <el-button @click="addRow" type="primary" icon="el-icon-plus" class="filter-item">创建申请 </el-button> -->
-            <!-- <el-button
-                @click="download"
-                type="primary"
-                icon="el-icon-download"
-                :loading="downloading"
-                class="filter-item"
-                :disabled="totalElements <= 0"
-                >导出EXCEL
-            </el-button>
-            <el-select v-model="year" placeholder="请选择年度" class="filter-item" clearable>
-                <el-option v-for="item in years" :key="item" :value="item" :label="item + '年'"></el-option>
-            </el-select>
-            <el-select v-model="agency" placeholder="所属考级机构" multiple class="filter-item">
-                <el-option
-                    v-for="(item, index) in examination"
-                    :key="index"
-                    :value="item.value"
-                    :label="item.label"
-                ></el-option>
-            </el-select>
-            <el-input
-                placeholder="输入承办单位名称"
-                v-model="search"
-                clearable
-                class="filter-item"
-                @change="getData"
-            ></el-input>
-            <el-select
-                style="width: 220px"
-                v-model="status"
-                placeholder="请选择的状态"
-                class="filter-item"
-                multiple
-                clearable
-                @change="getData"
-            >
-                <el-option
-                    v-for="item in statusOptions"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
-                ></el-option>
-            </el-select>
-            <el-select
-                style="width: 220px"
-                v-model="grade"
-                placeholder="请选择的等级"
-                class="filter-item"
-                multiple
-                clearable
-                @change="getData"
-            >
-                <el-option
-                    v-for="item in gradeOptions"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
-                ></el-option>
-            </el-select> -->
-            <!-- <el-button @click="getData" type="primary" icon="el-icon-search" class="filter-item">搜索 </el-button> -->
             <div>
                 <el-col :span="7">
                     <span class="span-size">申请年度</span>
@@ -193,6 +131,9 @@
                     <span v-if="row.score">{{ row.score }}</span>
                     <span v-else>暂无</span>
                 </template>
+                <template slot="header" slot-scope="{ column }">
+                    <sortable-header :column="column" :current-sort="sort" @changeSort="changeSort"> </sortable-header>
+                </template>
             </el-table-column>
             <el-table-column prop="grade" label="等级">
                 <template slot-scope="{ row }">

+ 37 - 2
src/main/vue/src/views/rate/RateListDone.vue

@@ -122,8 +122,12 @@
                         :disabled="totalElements <= 0"
                         >导出EXCEL
                     </el-button>
-                    <el-button type="primary" :loading="downloading" class="filter-item">公告短信通知 </el-button>
-                    <el-button type="primary" :loading="downloading" class="filter-item">提交材料短信通知 </el-button>
+                    <el-button type="primary" :loading="downloading" class="filter-item" @click="batchSendSms(true)"
+                        >公告短信通知
+                    </el-button>
+                    <el-button type="primary" :loading="downloading" class="filter-item" @click="batchSendSms(false)"
+                        >提交材料短信通知
+                    </el-button>
                 </el-col>
             </div>
         </div>
@@ -152,6 +156,9 @@
                     <span v-if="row.score">{{ row.score }}</span>
                     <span v-else>暂无</span>
                 </template>
+                <template slot="header" slot-scope="{ column }">
+                    <sortable-header :column="column" :current-sort="sort" @changeSort="changeSort"> </sortable-header>
+                </template>
             </el-table-column>
             <el-table-column prop="grade" label="等级">
                 <template slot-scope="{ row }">
@@ -605,6 +612,34 @@ export default {
                     });
                     this.$set(row, 'loading', false);
                 });
+        },
+        batchSendSms(res) {
+            this.$confirm('发送短信后不可撤回,确认发送吗?', '提示', {
+                confirmButtonText: '确认',
+                cancelButtonText: '取消',
+                type: 'warning'
+            })
+                .then(() => {
+                    this.$http
+                        .post('/rate/batchSendSms', {
+                            announcement: res
+                        })
+                        .then(res => {
+                            this.$message.success('发送成功');
+                            this.getData();
+                        })
+                        .catch(e => {
+                            console.log(e);
+                            this.$message.error(e.error);
+                        });
+                })
+                .catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消'
+                    });
+                    this.$set(row, 'loading', false);
+                });
         }
     }
 };

+ 56 - 1
src/main/vue/src/views/rate/RateListPending.vue

@@ -122,6 +122,7 @@
                         :disabled="totalElements <= 0"
                         >导出EXCEL
                     </el-button>
+                    <el-button @click="dialogRatio = true" type="primary">设置等级</el-button>
                 </el-col>
             </div>
         </div>
@@ -256,6 +257,35 @@
                 </div>
             </div>
         </el-dialog>
+        <el-dialog title="等级比例" :visible.sync="dialogRatio" width="500px" center>
+            <div style="height: 150px;width:400px;margin:0 0 2px 80px">
+                <el-form :form="ratioForm">
+                    <el-form-item label="优秀比例(%)">
+                        <el-input-number
+                            v-model="ratioForm.excellent"
+                            :min="0"
+                            :max="100"
+                            @change="changeEligible"
+                            style="width: 160px"
+                        ></el-input-number>
+                    </el-form-item>
+                    <el-form-item label="合格比例(%)">
+                        <el-input-number
+                            v-model="ratioForm.eligible"
+                            :min="0"
+                            :max="100"
+                            @change="changeExcellent"
+                            style="width: 160px"
+                        ></el-input-number>
+                    </el-form-item>
+                    <el-form-item>
+                        <el-button style="margin-left: 170px" type="primary" size="mini" @click="gradeRatio"
+                            >确定</el-button
+                        >
+                    </el-form-item>
+                </el-form>
+            </div>
+        </el-dialog>
     </div>
 </template>
 <script>
@@ -291,7 +321,9 @@ export default {
             year: '',
             districts: [],
             district: '',
-            dateRange: ''
+            dateRange: '',
+            dialogRatio: false,
+            ratioForm: {}
         };
     },
     created() {
@@ -612,6 +644,29 @@ export default {
                     });
                     this.$set(row, 'loading', false);
                 });
+        },
+        changeEligible(res) {
+            this.ratioForm.eligible = 100 - res;
+        },
+        changeExcellent(res) {
+            this.ratioForm.excellent = 100 - res;
+        },
+        gradeRatio() {
+            this.$http
+                .post('/rate/gradeRatio', {
+                    excellent: this.ratioForm.excellent,
+                    eligible: this.ratioForm.eligible
+                })
+                .then(res => {
+                    this.$message.success('等级设置成功');
+                    this.getData();
+                    this.dialogRatio = false;
+                })
+                .catch(e => {
+                    console.log(e);
+                    this.dialogRatio = false;
+                    this.$message.error(e.error);
+                });
         }
     }
 };

+ 6 - 2
src/test/java/com/izouma/wenlvju/repo/RepoTest.java

@@ -206,7 +206,11 @@ public class RepoTest extends ApplicationTests {
 
     @Test
     public void test6() {
-        String phone = "18205083565";
-        System.out.println(phone.replace(phone.substring(3, phone.length() - 4), "****"));
+//        String phone = "18205083565";
+//        System.out.println(phone.replace(phone.substring(3, phone.length() - 4), "****"));
+        int sum1 = Math.round(75 * 20 / 100);
+        System.out.println(sum1);
+        int sum2 = Math.round(75 * 80 / 100);
+        System.out.println(sum1 + sum2);
     }
 }