licailing 5 лет назад
Родитель
Сommit
c7d824c604
25 измененных файлов с 1049 добавлено и 11 удалено
  1. 6 0
      pom.xml
  2. 24 0
      src/main/java/com/izouma/wenlvju/domain/Rate.java
  3. 18 0
      src/main/java/com/izouma/wenlvju/domain/Record.java
  4. 67 0
      src/main/java/com/izouma/wenlvju/domain/Regulatory.java
  5. 49 0
      src/main/java/com/izouma/wenlvju/dto/RecordDTO.java
  6. 2 1
      src/main/java/com/izouma/wenlvju/enums/AuthorityName.java
  7. 4 0
      src/main/java/com/izouma/wenlvju/enums/RateStatus.java
  8. 12 0
      src/main/java/com/izouma/wenlvju/enums/RegulatoryStatus.java
  9. 3 0
      src/main/java/com/izouma/wenlvju/repo/RecordRepo.java
  10. 16 0
      src/main/java/com/izouma/wenlvju/repo/RegulatoryRepo.java
  11. 7 0
      src/main/java/com/izouma/wenlvju/service/RecordService.java
  12. 20 0
      src/main/java/com/izouma/wenlvju/service/RegulatoryService.java
  13. 35 1
      src/main/java/com/izouma/wenlvju/web/RecordController.java
  14. 71 0
      src/main/java/com/izouma/wenlvju/web/RegulatoryController.java
  15. 5 0
      src/main/java/com/izouma/wenlvju/web/UserController.java
  16. 0 0
      src/main/resources/genjson/Regulatory.json
  17. BIN
      src/main/vue/src/assets/code.png
  18. 24 0
      src/main/vue/src/router.js
  19. 2 2
      src/main/vue/src/views/PerformanceApplyEdit.vue
  20. 21 4
      src/main/vue/src/views/PerformanceApplyList.vue
  21. 6 1
      src/main/vue/src/views/PerformanceApplyList2.vue
  22. 270 0
      src/main/vue/src/views/RecordList2.vue
  23. 170 0
      src/main/vue/src/views/RegulatoryEdit.vue
  24. 215 0
      src/main/vue/src/views/RegulatoryList.vue
  25. 2 2
      src/main/vue/src/views/UserList.vue

+ 6 - 0
pom.xml

@@ -265,6 +265,12 @@
             <artifactId>easy-captcha</artifactId>
             <version>1.6.2</version>
         </dependency>
+        <!-- hutool -->
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.3.0</version>
+        </dependency>
 
     </dependencies>
 

+ 24 - 0
src/main/java/com/izouma/wenlvju/domain/Rate.java

@@ -0,0 +1,24 @@
+package com.izouma.wenlvju.domain;
+
+import com.izouma.wenlvju.enums.RateStatus;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.persistence.Entity;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+//@Entity
+@ApiModel(value = "评星定级")
+public class Rate extends BaseEntity {
+    @ApiModelProperty(value = "年度")
+    private String year;
+
+    private RateStatus status;
+}

+ 18 - 0
src/main/java/com/izouma/wenlvju/domain/Record.java

@@ -2,6 +2,7 @@ package com.izouma.wenlvju.domain;
 
 import com.izouma.wenlvju.annotations.Searchable;
 import com.izouma.wenlvju.enums.RecordStatus;
+import com.izouma.wenlvju.enums.RegulatoryStatus;
 import com.izouma.wenlvju.enums.WorkCategory;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -13,6 +14,7 @@ import lombok.NoArgsConstructor;
 import javax.persistence.Entity;
 import javax.persistence.EnumType;
 import javax.persistence.Enumerated;
+import javax.persistence.Transient;
 import java.time.LocalDate;
 
 @Data
@@ -80,4 +82,20 @@ public class Record extends BaseEntity {
     private RecordStatus status;
 
     private String district;
+
+    @ApiModelProperty(value = "法人姓名")
+    private String privacyPolicy;
+
+    @ApiModelProperty(value = "证件号码")
+    private String IDNo;
+
+    @ApiModelProperty(value = "监管人员")
+    private Long supervisorUserId;
+
+    @ApiModelProperty(value = "监管状态")
+    @Enumerated(EnumType.STRING)
+    private RegulatoryStatus regulatoryStatus;
+
+    @Transient
+    private String supervisorNickname;
 }

+ 67 - 0
src/main/java/com/izouma/wenlvju/domain/Regulatory.java

@@ -0,0 +1,67 @@
+package com.izouma.wenlvju.domain;
+
+import com.sun.org.apache.regexp.internal.RE;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.hibernate.annotations.NotFound;
+import org.hibernate.annotations.NotFoundAction;
+
+import javax.persistence.*;
+import java.time.LocalDate;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+@Entity
+@ApiModel(value = "监管管理")
+public class Regulatory extends BaseEntity {
+    private Long recordId;
+
+    @ManyToOne(fetch = FetchType.LAZY)
+    @JoinColumn(name = "recordId", insertable = false, updatable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
+    @NotFound(action = NotFoundAction.IGNORE)
+    private Record record;
+
+
+    @ApiModelProperty(value = "监管人员")
+    private Long supervisorUserId;
+
+    @ManyToOne(fetch = FetchType.LAZY)
+    @JoinColumn(name = "supervisorUserId", insertable = false, updatable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
+    @NotFound(action = NotFoundAction.IGNORE)
+    private User supervisorUser;
+
+
+    private LocalDate time;
+
+    @ApiModelProperty(value = "是否考前备案")
+    private Boolean isRecord;
+    @ApiModelProperty(value = "是否明显位置张贴《考试简章》")
+    private Boolean isPostExamGuide;
+    @ApiModelProperty(value = "考场服务设备是否完善")
+    private Boolean isPerfectDeviceServices;
+    @ApiModelProperty(value = "考试时间与备案考试时间是否一致")
+    private Boolean isHaveTheSameTime;
+    @ApiModelProperty(value = "考试地点与备案考试地点是否一致")
+    private Boolean isSameAddress;
+    @ApiModelProperty(value = "是否有无相关专业考官且佩戴考官证")
+    private Boolean isExaminer;
+    @ApiModelProperty(value = "是否现场对艺术水平做出评定")
+    private Boolean isRate;
+    @ApiModelProperty(value = "是否是所属考级机构教材确定的考级内容")
+    private Boolean isSureContent;
+    @ApiModelProperty(value = "是否在明显位置张贴《疫情防控指南》海报")
+    private Boolean isPostPoster;
+    @ApiModelProperty(value = "考点是否配备测量体温设备,且专人值守")
+    private Boolean isHaveThermometer;
+    @ApiModelProperty(value = "考场是否实施预约限流措施")
+    private Boolean isSchedule;
+
+    @ApiModelProperty(value = "其他")
+    private String other;
+}

+ 49 - 0
src/main/java/com/izouma/wenlvju/dto/RecordDTO.java

@@ -0,0 +1,49 @@
+package com.izouma.wenlvju.dto;
+
+import com.izouma.wenlvju.annotations.Searchable;
+import com.izouma.wenlvju.domain.BaseEntity;
+import com.izouma.wenlvju.enums.RecordStatus;
+import com.izouma.wenlvju.enums.WorkCategory;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import java.time.LocalDate;
+
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+@ApiModel("监管管理")
+public class RecordDTO {
+    private Long id;
+
+    @ApiModelProperty(value = "考级活动名称")
+    private String examinationName;
+
+    @ApiModelProperty(value = "考级机构名称")
+    private String examinationAgency;
+
+    @ApiModelProperty(value = "承办单位名称")
+    private String organizer;
+
+    @ApiModelProperty(value = "备案时间")
+    private LocalDate recordTime;
+
+    private String district;
+
+    @ApiModelProperty(value = "法人姓名")
+    private String privacyPolicy;
+
+    @ApiModelProperty(value = "证件号码")
+    private String IDNo;
+
+    @ApiModelProperty(value = "监管人")
+    private String supervisorNickname;
+}

+ 2 - 1
src/main/java/com/izouma/wenlvju/enums/AuthorityName.java

@@ -3,7 +3,8 @@ package com.izouma.wenlvju.enums;
 public enum AuthorityName {
     ROLE_USER("普通用户"),
     ROLE_DEV("开发者"),
-    ROLE_ADMIN("管理员");
+    ROLE_ADMIN("管理员"),
+    ROLE_SUPERVISOR("监管员");
     private final String description;
 
     AuthorityName(String description) {

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

@@ -0,0 +1,4 @@
+package com.izouma.wenlvju.enums;
+
+public enum RateStatus {
+}

+ 12 - 0
src/main/java/com/izouma/wenlvju/enums/RegulatoryStatus.java

@@ -0,0 +1,12 @@
+package com.izouma.wenlvju.enums;
+
+public enum RegulatoryStatus {
+    /*
+    待提交
+     */
+    SUBMIT_PENDING,
+    /*
+    已提交
+     */
+    SUBMITTED
+}

+ 3 - 0
src/main/java/com/izouma/wenlvju/repo/RecordRepo.java

@@ -7,6 +7,7 @@ import org.springframework.data.jpa.repository.Modifying;
 import org.springframework.data.jpa.repository.Query;
 
 import javax.transaction.Transactional;
+import java.util.List;
 
 public interface RecordRepo extends JpaRepository<Record, Long>, JpaSpecificationExecutor<Record> {
     @Query("update Record t set t.del = true where t.id = ?1")
@@ -15,4 +16,6 @@ public interface RecordRepo extends JpaRepository<Record, Long>, JpaSpecificatio
     void softDelete(Long id);
 
     Record findFirstByDelIsTrue();
+
+    List<Record> findAllBySupervisorUserId(Long supervisorUserId);
 }

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

@@ -0,0 +1,16 @@
+package com.izouma.wenlvju.repo;
+
+import com.izouma.wenlvju.domain.Regulatory;
+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 RegulatoryRepo extends JpaRepository<Regulatory, Long>, JpaSpecificationExecutor<Regulatory> {
+    @Query("update Regulatory t set t.del = true where t.id = ?1")
+    @Modifying
+    @Transactional
+    void softDelete(Long id);
+}

+ 7 - 0
src/main/java/com/izouma/wenlvju/service/RecordService.java

@@ -2,6 +2,7 @@ package com.izouma.wenlvju.service;
 
 import com.izouma.wenlvju.domain.Record;
 import com.izouma.wenlvju.dto.PageQuery;
+import com.izouma.wenlvju.exception.BusinessException;
 import com.izouma.wenlvju.repo.RecordRepo;
 import com.izouma.wenlvju.utils.JpaUtils;
 import lombok.AllArgsConstructor;
@@ -17,4 +18,10 @@ public class RecordService {
     public Page<Record> all(PageQuery pageQuery) {
         return recordRepo.findAll(JpaUtils.toSpecification(pageQuery, Record.class), JpaUtils.toPageRequest(pageQuery));
     }
+
+    public Record addSupervisor(Long id, Long userId) {
+        Record record = recordRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+        record.setSupervisorUserId(userId);
+        return recordRepo.save(record);
+    }
 }

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

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

+ 35 - 1
src/main/java/com/izouma/wenlvju/web/RecordController.java

@@ -1,11 +1,19 @@
 package com.izouma.wenlvju.web;
+
 import com.izouma.wenlvju.domain.Record;
+import com.izouma.wenlvju.domain.User;
+import com.izouma.wenlvju.dto.RecordDTO;
+import com.izouma.wenlvju.enums.AuthorityName;
+import com.izouma.wenlvju.repo.UserRepo;
+import com.izouma.wenlvju.security.Authority;
 import com.izouma.wenlvju.service.RecordService;
 import com.izouma.wenlvju.dto.PageQuery;
 import com.izouma.wenlvju.exception.BusinessException;
 import com.izouma.wenlvju.repo.RecordRepo;
 import com.izouma.wenlvju.utils.ObjUtils;
+import com.izouma.wenlvju.utils.SecurityUtils;
 import com.izouma.wenlvju.utils.excel.ExcelUtils;
+import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import org.springframework.data.domain.Page;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -14,13 +22,16 @@ import org.springframework.web.bind.annotation.*;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 @RestController
 @RequestMapping("/record")
 @AllArgsConstructor
 public class RecordController extends BaseController {
     private RecordService recordService;
-    private RecordRepo recordRepo;
+    private RecordRepo    recordRepo;
+    private UserRepo      userRepo;
 
     //@PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/save")
@@ -63,5 +74,28 @@ public class RecordController extends BaseController {
         record.setDel(false);
         return recordRepo.save(record);
     }
+
+    @ApiOperation("增加监管人")
+    @PostMapping("/addSupervisor")
+    public Record addSupervisor(@RequestParam Long id, @RequestParam Long userId) {
+        return recordService.addSupervisor(id, userId);
+    }
+
+    @PostMapping("/allDTO")
+    public Page<Record> allDTO(@RequestBody PageQuery pageQuery) {
+        Map<Long, String> userMap = userRepo.findAllByAuthoritiesContainsAndDelFalse(Authority.get(AuthorityName.ROLE_SUPERVISOR))
+                .stream()
+                .collect(Collectors.toMap(User::getId, User::getNickname));
+        return recordService.all(pageQuery)
+                .map(record -> {
+                    record.setSupervisorNickname(userMap.get(record.getSupervisorUserId()));
+                    return record;
+                });
+    }
+
+    @GetMapping("/supervisor")
+    public List<Record> supervisor() {
+        return recordRepo.findAllBySupervisorUserId(SecurityUtils.getAuthenticatedUser().getId());
+    }
 }
 

+ 71 - 0
src/main/java/com/izouma/wenlvju/web/RegulatoryController.java

@@ -0,0 +1,71 @@
+package com.izouma.wenlvju.web;
+
+import com.izouma.wenlvju.domain.Record;
+import com.izouma.wenlvju.domain.Regulatory;
+import com.izouma.wenlvju.enums.RegulatoryStatus;
+import com.izouma.wenlvju.repo.RecordRepo;
+import com.izouma.wenlvju.service.RegulatoryService;
+import com.izouma.wenlvju.dto.PageQuery;
+import com.izouma.wenlvju.exception.BusinessException;
+import com.izouma.wenlvju.repo.RegulatoryRepo;
+import com.izouma.wenlvju.utils.ObjUtils;
+import com.izouma.wenlvju.utils.excel.ExcelUtils;
+import io.swagger.annotations.ApiOperation;
+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("/regulatory")
+@AllArgsConstructor
+public class RegulatoryController extends BaseController {
+    private RegulatoryService regulatoryService;
+    private RegulatoryRepo    regulatoryRepo;
+    private RecordRepo        recordRepo;
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/save")
+    public Regulatory save(@RequestBody Regulatory record) {
+        if (record.getId() != null) {
+            Regulatory orig = regulatoryRepo.findById(record.getId()).orElseThrow(new BusinessException("无记录"));
+            ObjUtils.merge(orig, record);
+            return regulatoryRepo.save(orig);
+        }
+        if (record.getRecordId() != null) {
+            Record record1 = recordRepo.findById(record.getRecordId()).orElseThrow(new BusinessException("无记录"));
+            record1.setRegulatoryStatus(RegulatoryStatus.SUBMITTED);
+            recordRepo.save(record1);
+        }
+        return regulatoryRepo.save(record);
+    }
+
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/all")
+    public Page<Regulatory> all(@RequestBody PageQuery pageQuery) {
+        return regulatoryService.all(pageQuery);
+    }
+
+    @GetMapping("/get/{id}")
+    public Regulatory get(@PathVariable Long id) {
+        return regulatoryRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+    }
+
+    @PostMapping("/del/{id}")
+    public void del(@PathVariable Long id) {
+        regulatoryRepo.softDelete(id);
+    }
+
+    @GetMapping("/excel")
+    @ResponseBody
+    public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
+        List<Regulatory> data = all(pageQuery).getContent();
+        ExcelUtils.export(response, data);
+    }
+}
+

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

@@ -127,4 +127,9 @@ public class UserController extends BaseController {
         return jwtTokenUtil.generateToken(JwtUserFactory.create(userRepo.findById(userId)
                 .orElseThrow(new BusinessException("用户不存在"))));
     }
+
+    @PostMapping("/authority")
+    public List<User> authority(@RequestParam String authorityName) {
+        return userRepo.findAllByAuthoritiesContainsAndDelFalse(Authority.builder().name(authorityName).build());
+    }
 }

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
src/main/resources/genjson/Regulatory.json


BIN
src/main/vue/src/assets/code.png


+ 24 - 0
src/main/vue/src/router.js

@@ -111,6 +111,14 @@ const router = new Router({
                         title: '备案管理编辑'
                     }
                 },
+                {
+                    path: '/recordList2',
+                    name: 'RecordList2',
+                    component: () => import(/* webpackChunkName: "recordList" */ '@/views/RecordList2.vue'),
+                    meta: {
+                        title: '监管管理'
+                    }
+                },
                 {
                     path: '/recordList',
                     name: 'RecordList',
@@ -177,6 +185,22 @@ const router = new Router({
                     meta: {
                         title: '参演人员'
                     }
+                },
+                {
+                    path: '/regulatoryEdit',
+                    name: 'RegulatoryEdit',
+                    component: () => import(/* webpackChunkName: "regulatoryEdit" */ '@/views/RegulatoryEdit.vue'),
+                    meta: {
+                        title: '监管管理编辑'
+                    }
+                },
+                {
+                    path: '/regulatoryList',
+                    name: 'RegulatoryList',
+                    component: () => import(/* webpackChunkName: "regulatoryList" */ '@/views/RegulatoryList.vue'),
+                    meta: {
+                        title: '监管管理'
+                    }
                 }
                 /**INSERT_LOCATION**/
             ]

+ 2 - 2
src/main/vue/src/views/PerformanceApplyEdit.vue

@@ -33,7 +33,7 @@
                     </el-option>
                 </el-select>
             </el-form-item> -->
-            <el-form-item prop="showTime" label="表演时间">
+            <!-- <el-form-item prop="showTime" label="表演时间">
                 <el-date-picker
                     v-model="formData.showTime"
                     type="datetime"
@@ -41,7 +41,7 @@
                     placeholder="选择日期时间"
                 >
                 </el-date-picker>
-            </el-form-item>
+            </el-form-item> -->
             <el-form-item>
                 <el-button @click="onSave" :loading="saving" type="primary">保存</el-button>
                 <el-button @click="onDelete" :loading="saving" type="danger" v-if="formData.id">删除 </el-button>

+ 21 - 4
src/main/vue/src/views/PerformanceApplyList.vue

@@ -38,7 +38,7 @@
                     <!-- <el-button @click="editRow(row)" type="primary" size="mini" plain>编辑</el-button>
                     <el-button @click="deleteRow(row)" type="danger" size="mini" plain>删除</el-button> -->
                     <el-button @click="showDialog(row)" type="primary" size="mini" plain>参演人员维护</el-button>
-                    <el-button @click="editRow(row)" type="primary" size="mini" plain>二维码</el-button>
+                    <el-button @click="dialogCode = true" type="primary" size="mini" plain>二维码</el-button>
                 </template>
             </el-table-column>
         </el-table>
@@ -66,9 +66,14 @@
 
         <el-dialog title="参演人员" :visible.sync="dialogVisible" width="500px" center>
             <div>
+                <!-- <span class="span-size">姓名</span> <span class="span-size">手机号</span>
                 <div v-for="item in person" :key="item.id" style="padding: 10px 10px 10px 100px">
                     <span class="span-size">{{ item.name }}</span> <span class="span-size">{{ item.phone }}</span>
-                </div>
+                </div> -->
+                <el-table :data="person">
+                    <el-table-column prop="name" label="姓名" align="center"></el-table-column>
+                    <el-table-column prop="phone" label="手机号" align="center"></el-table-column>
+                </el-table>
                 <div style="margin: 10px 170px 0">
                     <el-button class="dia-mar" type="primary" @click="add = true" v-if="!add" size="mini"
                         >添加人员</el-button
@@ -94,6 +99,12 @@
                 </div>
             </div>
         </el-dialog>
+
+        <el-dialog title="二维码" :visible.sync="dialogCode" width="400px" center>
+            <div style="margin-left: 70px;">
+                <img style="width: 200px; heght: 200px;" src="@/assets/code.png" />
+            </div>
+        </el-dialog>
     </div>
 </template>
 <script>
@@ -121,7 +132,8 @@ export default {
                 name: '',
                 value: ''
             },
-            add: false
+            add: false,
+            dialogCode: false
         };
     },
     computed: {
@@ -138,7 +150,12 @@ export default {
             return '';
         },
         beforeGetData() {
-            return { search: this.search };
+            return {
+                search: this.search,
+                query: {
+                    performanceId: Number(this.$route.query.perforId)
+                }
+            };
         },
         toggleMultipleMode(multipleMode) {
             this.multipleMode = multipleMode;

+ 6 - 1
src/main/vue/src/views/PerformanceApplyList2.vue

@@ -164,7 +164,12 @@ export default {
             return '';
         },
         beforeGetData() {
-            return { search: this.search };
+            return {
+                search: this.search,
+                query: {
+                    performanceId: Number(this.$route.query.perforId)
+                }
+            };
         },
         toggleMultipleMode(multipleMode) {
             this.multipleMode = multipleMode;

+ 270 - 0
src/main/vue/src/views/RecordList2.vue

@@ -0,0 +1,270 @@
+<template>
+    <div class="list-view">
+        <div class="filters-container">
+            <!-- <el-input placeholder="输入关键字" v-model="search" clearable class="filter-item"></el-input> -->
+            <el-select class="filter-item" v-model="districtId" clearable>
+                <el-option v-for="item in district" :key="item.id" :value="item.name" :label="item.name"></el-option>
+            </el-select>
+            <el-button @click="getData" type="primary" icon="el-icon-search" class="filter-item">查询 </el-button>
+            <!-- <el-button
+                @click="download"
+                type="primary"
+                icon="el-icon-download"
+                :loading="downloading"
+                class="filter-item"
+                >导出EXCEL
+            </el-button> -->
+        </div>
+        <el-table
+            :data="tableData"
+            row-key="id"
+            ref="table"
+            header-row-class-name="table-header-row"
+            header-cell-class-name="table-header-cell"
+            row-class-name="table-row"
+            cell-class-name="table-cell"
+            :height="tableHeight"
+        >
+            <el-table-column v-if="multipleMode" align="center" type="selection" width="50"> </el-table-column>
+            <!-- <el-table-column prop="id" label="ID" width="100"> </el-table-column> -->
+            <el-table-column prop="organizer" label="承办单位"> </el-table-column>
+            <el-table-column prop="district" label="通讯地址"> </el-table-column>
+            <el-table-column prop="privacyPolicy" label="法人姓名"> </el-table-column>
+            <el-table-column prop="idno" label="证件号码"> </el-table-column>
+            <el-table-column prop="examinationAgency" label="所属考级机构"> </el-table-column>
+            <el-table-column prop="recordTime" label="备案时间"> </el-table-column>
+            <el-table-column prop="supervisorNickname" label="监管人员"> </el-table-column>
+            <el-table-column label="操作" align="center" fixed="right" min-width="80">
+                <template slot-scope="{ row }">
+                    <el-button @click="supervision(row.id)" type="primary" size="mini" plain>分配监管人</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+        <div class="pagination-wrapper">
+            <!-- <div class="multiple-mode-wrapper">
+                <el-button v-if="!multipleMode" @click="toggleMultipleMode(true)">批量编辑</el-button>
+                <el-button-group v-else>
+                    <el-button @click="operation1">批量操作1</el-button>
+                    <el-button @click="operation2">批量操作2</el-button>
+                    <el-button @click="toggleMultipleMode(false)">取消</el-button>
+                </el-button-group>
+            </div> -->
+            <el-pagination
+                background
+                @size-change="onSizeChange"
+                @current-change="onCurrentChange"
+                :current-page="page"
+                :page-sizes="[10, 20, 30, 40, 50]"
+                :page-size="pageSize"
+                layout="total, sizes, prev, pager, next, jumper"
+                :total="totalElements"
+            >
+            </el-pagination>
+        </div>
+        <el-dialog title="分配监管人" :visible.sync="dialogVisible" width="500px" center>
+            <div>
+                <el-table :data="supervisor">
+                    <el-table-column prop="nickname" label="昵称"></el-table-column>
+                    <el-table-column prop="phone" label="手机号"></el-table-column>
+                    <el-table-column label="操作" align="center" fixed="right" min-width="80">
+                        <template slot-scope="{ row }">
+                            <el-button @click="addRegulatory(row.id)" type="success" size="mini" plain>确认</el-button>
+                        </template>
+                    </el-table-column>
+                </el-table>
+            </div>
+        </el-dialog>
+    </div>
+</template>
+<script>
+import { mapState } from 'vuex';
+import pageableTable from '@/mixins/pageableTable';
+
+export default {
+    name: 'RecordList',
+    mixins: [pageableTable],
+    created() {
+        this.$http
+            .get('/district/NJ')
+            .then(res => {
+                this.district = res;
+            })
+            .catch(e => {
+                console.log(e);
+                this.$message.error(e.error);
+            });
+    },
+    mounted() {
+        this.$http
+            .post('/user/authority', { authorityName: 'ROLE_SUPERVISOR' })
+            .then(res => {
+                this.supervisor = res;
+                // if (res.length > 0) {
+                //     res.forEach(item => {
+                //         this.supervisor.push({
+                //             label: item.nickname,
+                //             value: item.id
+                //         });
+                //     });
+                // }
+            })
+            .catch(e => {
+                console.log(e);
+                this.$message.error(e.error);
+            });
+    },
+    data() {
+        return {
+            multipleMode: false,
+            search: '',
+            url: '/record/allDTO',
+            downloading: false,
+            district: [],
+            districtId: '',
+            supervisor: [],
+            dialogVisible: false,
+            recordId: ''
+        };
+    },
+    computed: {
+        selection() {
+            return this.$refs.table.selection.map(i => i.id);
+        }
+    },
+    methods: {
+        categoryFormatter(row, column, cellValue, index) {
+            let selectedOption = this.categoryOptions.find(i => i.value === cellValue);
+            if (selectedOption) {
+                return selectedOption.label;
+            }
+            return '';
+        },
+        statusFormatter(row, column, cellValue, index) {
+            let selectedOption = this.statusOptions.find(i => i.value === cellValue);
+            if (selectedOption) {
+                return selectedOption.label;
+            }
+            return '';
+        },
+        beforeGetData() {
+            return {
+                search: this.search,
+                query: {
+                    district: this.districtId,
+                    del: false
+                }
+            };
+        },
+        toggleMultipleMode(multipleMode) {
+            this.multipleMode = multipleMode;
+            if (!multipleMode) {
+                this.$refs.table.clearSelection();
+            }
+        },
+        addRow() {
+            this.$router.push({
+                path: '/recordEdit',
+                query: {
+                    ...this.$route.query
+                }
+            });
+        },
+        editRow(row) {
+            this.$router.push({
+                path: '/recordEdit',
+                query: {
+                    id: row.id
+                }
+            });
+        },
+        download() {
+            this.downloading = true;
+            this.$axios
+                .get('/record/excel', {
+                    responseType: 'blob',
+                    params: { size: 10000 }
+                })
+                .then(res => {
+                    console.log(res);
+                    this.downloading = false;
+                    const downloadUrl = window.URL.createObjectURL(new Blob([res.data]));
+                    const link = document.createElement('a');
+                    link.href = downloadUrl;
+                    link.setAttribute('download', res.headers['content-disposition'].split('filename=')[1]);
+                    document.body.appendChild(link);
+                    link.click();
+                    link.remove();
+                })
+                .catch(e => {
+                    console.log(e);
+                    this.downloading = false;
+                    this.$message.error(e.error);
+                });
+        },
+        operation1() {
+            this.$notify({
+                title: '提示',
+                message: this.selection
+            });
+        },
+        operation2() {
+            this.$message('操作2');
+        },
+        deleteRow(row) {
+            this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' })
+                .then(() => {
+                    return this.$http.post(`/record/del/${row.id}`);
+                })
+                .then(() => {
+                    this.$message.success('删除成功');
+                    this.getData();
+                })
+                .catch(e => {
+                    if (e !== 'cancel') {
+                        this.$message.error(e.error);
+                    }
+                });
+        },
+        distribute() {
+            this.$alert('已分发到各区县!', '分发', {
+                confirmButtonText: '确定'
+            });
+        },
+        update() {
+            this.$http
+                .get('/record/update')
+                .then(res => {
+                    this.getData();
+                })
+                .catch(e => {
+                    console.log(e);
+                    this.$message.error(e.error);
+                });
+        },
+        supervision(id) {
+            this.dialogVisible = true;
+            this.recordId = id;
+        },
+        addRegulatory(id) {
+            this.$http
+                .post('/record/addSupervisor', {
+                    id: this.recordId,
+                    userId: id
+                })
+                .then(res => {
+                    this.saving = false;
+                    this.$message.success('成功');
+                    this.dialogVisible = false;
+                    this.recordId = '';
+                    this.getData();
+                })
+                .catch(e => {
+                    console.log(e);
+                    this.saving = false;
+                    this.$message.error(e.error);
+                });
+        }
+    }
+};
+</script>
+<style lang="less" scoped></style>

+ 170 - 0
src/main/vue/src/views/RegulatoryEdit.vue

@@ -0,0 +1,170 @@
+<template>
+    <div class="edit-view">
+        <el-form
+            :model="record"
+            ref="record"
+            label-width="120px"
+            label-position="right"
+            size="small"
+            style="max-width: 580px;"
+        >
+            <el-form-item label="承办单位">
+                <el-input v-model="formData.record.organizer" readonly></el-input>
+            </el-form-item>
+            <el-form-item label="所属考级机构">
+                <el-input v-model="formData.record.examinationAgency" readonly></el-input>
+            </el-form-item>
+            <el-form-item label="联系人">
+                <el-input v-model="formData.record.examOwner" readonly></el-input>
+            </el-form-item>
+            <el-form-item label="联系方式">
+                <el-input v-model="formData.record.examOwnerPhone" readonly></el-input>
+            </el-form-item>
+            <el-form-item label="考试时间">
+                <el-input
+                    v-model="formData.record.examinationStartTime"
+                    style="width: 200px;margin-right: 10px"
+                    readonly
+                ></el-input>
+                至
+                <el-input
+                    v-model="formData.record.examinationEndTime"
+                    style="width: 200px;margin-left: 10px "
+                    readonly
+                ></el-input>
+            </el-form-item>
+            <el-form-item label="监管人员">
+                <el-input v-model="formData.supervisorUser.nickname" readonly></el-input>
+            </el-form-item>
+        </el-form>
+        <br />
+        <el-divider direction="horizontal" content-position="left">检查信息</el-divider>
+        <el-form
+            :model="formData"
+            :rules="rules"
+            ref="form"
+            label-width="290px"
+            label-position="right"
+            size="small"
+            style="max-width: 600px;"
+        >
+            <el-form-item prop="time" label="时间">
+                <el-date-picker v-model="formData.time" type="date" value-format="yyyy-MM-dd" placeholder="选择日期">
+                </el-date-picker>
+            </el-form-item>
+            <el-form-item prop="isRecord" label="是否考前备案">
+                <el-switch v-model="formData.isRecord"></el-switch>
+            </el-form-item>
+            <el-form-item prop="isPostExamGuide" label="是否明显位置张贴《考试简章》">
+                <el-switch v-model="formData.isPostExamGuide"></el-switch>
+            </el-form-item>
+            <el-form-item prop="isPerfectDeviceServices" label="考场服务设备是否完善">
+                <el-switch v-model="formData.isPerfectDeviceServices"></el-switch>
+            </el-form-item>
+            <el-form-item prop="isHaveTheSameTime" label="考试时间与备案考试时间是否一致">
+                <el-switch v-model="formData.isHaveTheSameTime"></el-switch>
+            </el-form-item>
+            <el-form-item prop="isSameAddress" label="考试地点与备案考试地点是否一致">
+                <el-switch v-model="formData.isSameAddress"></el-switch>
+            </el-form-item>
+            <el-form-item prop="isExaminer" label="是否有无相关专业考官且佩戴考官证">
+                <el-switch v-model="formData.isExaminer"></el-switch>
+            </el-form-item>
+            <el-form-item prop="isRate" label="是否现场对艺术水平做出评定">
+                <el-switch v-model="formData.isRate"></el-switch>
+            </el-form-item>
+            <el-form-item prop="isSureContent" label="是否是所属考级机构教材确定的考级内容">
+                <el-switch v-model="formData.isSureContent"></el-switch>
+            </el-form-item>
+            <el-form-item prop="isPostPoster" label="是否在明显位置张贴《疫情防控指南》海报">
+                <el-switch v-model="formData.isPostPoster"></el-switch>
+            </el-form-item>
+            <el-form-item prop="isHaveThermometer" label="考点是否配备测量体温设备,且专人值守">
+                <el-switch v-model="formData.isHaveThermometer"></el-switch>
+            </el-form-item>
+            <el-form-item prop="isSchedule" label="考场是否实施预约限流措施">
+                <el-switch v-model="formData.isSchedule"></el-switch>
+            </el-form-item>
+            <el-form-item prop="other" label="其他">
+                <el-input type="textarea" v-model="formData.other"></el-input>
+            </el-form-item>
+            <el-form-item>
+                <el-button @click="onSave" :loading="saving" type="primary">保存</el-button>
+                <el-button @click="onDelete" :loading="saving" type="danger" v-if="formData.id">删除 </el-button>
+                <el-button @click="$router.go(-1)">取消</el-button>
+            </el-form-item>
+        </el-form>
+    </div>
+</template>
+<script>
+export default {
+    name: 'RegulatoryEdit',
+    created() {
+        if (this.$route.query.id) {
+            this.$http
+                .get('regulatory/get/' + this.$route.query.id)
+                .then(res => {
+                    this.formData = res;
+                    this.record = res.record;
+                })
+                .catch(e => {
+                    console.log(e);
+                    this.$message.error(e.error);
+                });
+        }
+    },
+    data() {
+        return {
+            saving: false,
+            formData: {},
+            rules: {},
+            record: {}
+        };
+    },
+    methods: {
+        onSave() {
+            this.$refs.form.validate(valid => {
+                if (valid) {
+                    this.submit();
+                } else {
+                    return false;
+                }
+            });
+        },
+        submit() {
+            let data = { ...this.formData };
+
+            this.saving = true;
+            this.$http
+                .post('/regulatory/save', data, { body: 'json' })
+                .then(res => {
+                    this.saving = false;
+                    this.$message.success('成功');
+                    this.$router.go(-1);
+                })
+                .catch(e => {
+                    console.log(e);
+                    this.saving = false;
+                    this.$message.error(e.error);
+                });
+        },
+        onDelete() {
+            this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' })
+                .then(() => {
+                    return this.$http.post(`/regulatory/del/${this.formData.id}`);
+                })
+                .then(() => {
+                    this.$message.success('删除成功');
+                    this.$router.go(-1);
+                })
+                .catch(e => {
+                    if (e !== 'cancel') {
+                        console.log(e);
+                        this.$message.error((e || {}).error || '删除失败');
+                    }
+                });
+        }
+    }
+};
+</script>
+<style lang="less" scoped></style>

+ 215 - 0
src/main/vue/src/views/RegulatoryList.vue

@@ -0,0 +1,215 @@
+<template>
+    <div class="list-view">
+        <div class="filters-container">
+            <el-input placeholder="输入关键字" v-model="search" clearable class="filter-item"></el-input>
+            <el-button @click="getData" type="primary" icon="el-icon-search" class="filter-item">搜索 </el-button>
+            <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"
+                >导出EXCEL
+            </el-button>
+        </div>
+        <el-table
+            :data="tableData"
+            row-key="id"
+            ref="table"
+            header-row-class-name="table-header-row"
+            header-cell-class-name="table-header-cell"
+            row-class-name="table-row"
+            cell-class-name="table-cell"
+            :height="tableHeight"
+        >
+            <el-table-column v-if="multipleMode" align="center" type="selection" width="50"> </el-table-column>
+            <!-- <el-table-column prop="id" label="ID" width="100"> </el-table-column> -->
+            <el-table-column prop="record.organizer" label="承办单位"> </el-table-column>
+            <el-table-column prop="record.district" label="通讯地址"> </el-table-column>
+            <el-table-column prop="supervisorUser.nickname" label="监管人员"> </el-table-column>
+            <el-table-column prop="time" label="时间"> </el-table-column>
+            <el-table-column prop="isRecord" label="是否考前备案">
+                <template slot-scope="{ row }">
+                    <el-tag :type="row.isRecord ? '' : 'info'">{{ row.isRecord }}</el-tag>
+                </template>
+            </el-table-column>
+            <el-table-column prop="isPostExamGuide" label="是否明显位置张贴《考试简章》">
+                <template slot-scope="{ row }">
+                    <el-tag :type="row.isPostExamGuide ? '' : 'info'">{{ row.isPostExamGuide }}</el-tag>
+                </template>
+            </el-table-column>
+            <el-table-column prop="isPerfectDeviceServices" label="考场服务设备是否完善">
+                <template slot-scope="{ row }">
+                    <el-tag :type="row.isPerfectDeviceServices ? '' : 'info'">{{ row.isPerfectDeviceServices }}</el-tag>
+                </template>
+            </el-table-column>
+            <el-table-column prop="isHaveTheSameTime" label="考试时间与备案考试时间是否一致">
+                <template slot-scope="{ row }">
+                    <el-tag :type="row.isHaveTheSameTime ? '' : 'info'">{{ row.isHaveTheSameTime }}</el-tag>
+                </template>
+            </el-table-column>
+            <el-table-column prop="isSameAddress" label="考试地点与备案考试地点是否一致">
+                <template slot-scope="{ row }">
+                    <el-tag :type="row.isSameAddress ? '' : 'info'">{{ row.isSameAddress }}</el-tag>
+                </template>
+            </el-table-column>
+            <el-table-column prop="isExaminer" label="是否有无相关专业考官且佩戴考官证">
+                <template slot-scope="{ row }">
+                    <el-tag :type="row.isExaminer ? '' : 'info'">{{ row.isExaminer }}</el-tag>
+                </template>
+            </el-table-column>
+            <el-table-column prop="isRate" label="是否现场对艺术水平做出评定">
+                <template slot-scope="{ row }">
+                    <el-tag :type="row.isRate ? '' : 'info'">{{ row.isRate }}</el-tag>
+                </template>
+            </el-table-column>
+            <el-table-column prop="isSureContent" label="是否是所属考级机构教材确定的考级内容">
+                <template slot-scope="{ row }">
+                    <el-tag :type="row.isSureContent ? '' : 'info'">{{ row.isSureContent }}</el-tag>
+                </template>
+            </el-table-column>
+            <el-table-column prop="isPostPoster" label="是否在明显位置张贴《疫情防控指南》海报">
+                <template slot-scope="{ row }">
+                    <el-tag :type="row.isPostPoster ? '' : 'info'">{{ row.isPostPoster }}</el-tag>
+                </template>
+            </el-table-column>
+            <el-table-column prop="isHaveThermometer" label="考点是否配备测量体温设备,且专人值守">
+                <template slot-scope="{ row }">
+                    <el-tag :type="row.isHaveThermometer ? '' : 'info'">{{ row.isHaveThermometer }}</el-tag>
+                </template>
+            </el-table-column>
+            <el-table-column prop="isSchedule" label="考场是否实施预约限流措施">
+                <template slot-scope="{ row }">
+                    <el-tag :type="row.isSchedule ? '' : 'info'">{{ row.isSchedule }}</el-tag>
+                </template>
+            </el-table-column>
+            <el-table-column prop="other" label="其他"> </el-table-column>
+            <el-table-column label="操作" align="center" fixed="right" min-width="150">
+                <template slot-scope="{ row }">
+                    <el-button @click="editRow(row)" type="primary" size="mini" plain>编辑</el-button>
+                    <el-button @click="deleteRow(row)" type="danger" size="mini" plain>删除</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+        <div class="pagination-wrapper">
+            <!-- <div class="multiple-mode-wrapper">
+                <el-button v-if="!multipleMode" @click="toggleMultipleMode(true)">批量编辑</el-button>
+                <el-button-group v-else>
+                    <el-button @click="operation1">批量操作1</el-button>
+                    <el-button @click="operation2">批量操作2</el-button>
+                    <el-button @click="toggleMultipleMode(false)">取消</el-button>
+                </el-button-group>
+            </div> -->
+            <el-pagination
+                background
+                @size-change="onSizeChange"
+                @current-change="onCurrentChange"
+                :current-page="page"
+                :page-sizes="[10, 20, 30, 40, 50]"
+                :page-size="pageSize"
+                layout="total, sizes, prev, pager, next, jumper"
+                :total="totalElements"
+            >
+            </el-pagination>
+        </div>
+    </div>
+</template>
+<script>
+import { mapState } from 'vuex';
+import pageableTable from '@/mixins/pageableTable';
+
+export default {
+    name: 'RegulatoryList',
+    mixins: [pageableTable],
+    data() {
+        return {
+            multipleMode: false,
+            search: '',
+            url: '/regulatory/all',
+            downloading: false
+        };
+    },
+    computed: {
+        selection() {
+            return this.$refs.table.selection.map(i => i.id);
+        }
+    },
+    methods: {
+        beforeGetData() {
+            return { search: this.search };
+        },
+        toggleMultipleMode(multipleMode) {
+            this.multipleMode = multipleMode;
+            if (!multipleMode) {
+                this.$refs.table.clearSelection();
+            }
+        },
+        addRow() {
+            this.$router.push({
+                path: '/regulatoryEdit',
+                query: {
+                    ...this.$route.query
+                }
+            });
+        },
+        editRow(row) {
+            this.$router.push({
+                path: '/regulatoryEdit',
+                query: {
+                    id: row.id
+                }
+            });
+        },
+        download() {
+            this.downloading = true;
+            this.$axios
+                .get('/regulatory/excel', {
+                    responseType: 'blob',
+                    params: { size: 10000 }
+                })
+                .then(res => {
+                    console.log(res);
+                    this.downloading = false;
+                    const downloadUrl = window.URL.createObjectURL(new Blob([res.data]));
+                    const link = document.createElement('a');
+                    link.href = downloadUrl;
+                    link.setAttribute('download', res.headers['content-disposition'].split('filename=')[1]);
+                    document.body.appendChild(link);
+                    link.click();
+                    link.remove();
+                })
+                .catch(e => {
+                    console.log(e);
+                    this.downloading = false;
+                    this.$message.error(e.error);
+                });
+        },
+        operation1() {
+            this.$notify({
+                title: '提示',
+                message: this.selection
+            });
+        },
+        operation2() {
+            this.$message('操作2');
+        },
+        deleteRow(row) {
+            this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' })
+                .then(() => {
+                    return this.$http.post(`/regulatory/del/${row.id}`);
+                })
+                .then(() => {
+                    this.$message.success('删除成功');
+                    this.getData();
+                })
+                .catch(e => {
+                    if (e !== 'cancel') {
+                        this.$message.error(e.error);
+                    }
+                });
+        }
+    }
+};
+</script>
+<style lang="less" scoped></style>

+ 2 - 2
src/main/vue/src/views/UserList.vue

@@ -4,14 +4,14 @@
             <el-input placeholder="输入关键字" v-model="search" clearable class="filter-item"></el-input>
             <el-button @click="getData" type="primary" icon="el-icon-search" class="filter-item">搜索 </el-button>
             <el-button @click="addRow" type="primary" icon="el-icon-plus" class="filter-item">添加 </el-button>
-            <el-button
+            <!-- <el-button
                 @click="download"
                 type="primary"
                 icon="el-icon-download"
                 :loading="downloading"
                 class="filter-item"
                 >导出EXCEL
-            </el-button>
+            </el-button> -->
         </div>
         <el-table
             :data="tableData"

Некоторые файлы не были показаны из-за большого количества измененных файлов