Explorar el Código

去除冗余代码,修改部分bug

bigwit11 hace 4 años
padre
commit
65b3c52074

BIN
1.jpg


+ 0 - 11
pom.xml

@@ -172,17 +172,6 @@
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-starter-zookeeper-config</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.hibernate</groupId>
-            <artifactId>hibernate-core</artifactId>
-            <version>5.0.12.Final</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.tomcat</groupId>
-            <artifactId>tomcat-tribes</artifactId>
-            <version>7.0.47</version>
-        </dependency>
-
 
     </dependencies>
 

+ 0 - 17
src/main/java/com/mooctest/controller/PaperController.java

@@ -1,28 +1,20 @@
 package com.mooctest.controller;
 
-import antlr.PrintWriterWithSMAP;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.mooctest.service.AuditTaskService;
-import com.mooctest.service.BugExcelInputService;
 import com.mooctest.service.ExcelInputService;
 import com.mooctest.service.PaperService;
-import org.apache.poi.hssf.record.DVALRecord;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.http.HttpRequest;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
-import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
-import java.io.PrintWriter;
 import java.sql.Timestamp;
-import java.util.HashMap;
 import java.util.Map;
 
 @Controller
@@ -34,9 +26,6 @@ public class PaperController {
     PaperService paperService;
 
     @Autowired
-    BugExcelInputService bugExcelInputService;
-
-    @Autowired
     ExcelInputService excelInputService;
 
     private String ITEM_GROUP_NAME = "item_group_list";
@@ -114,12 +103,6 @@ public class PaperController {
     }
 
 
-//    @GetMapping("/reloadJob")
-//    @ResponseBody
-//    public JSONObject reloadJob ( Model model, @RequestParam("id") String id ){
-//        JSONObject res = auditTaskService.getSingleTask(id);
-//        return res;
-//    }
 private void changeTime2Long ( Object input){
     JSONObject temp = (JSONObject) input;
     temp.put("create_time",new Timestamp(Long.parseLong(temp.get("create_time").toString()))); // 修改创建时间的格式  以便前段展示

+ 2 - 2
src/main/java/com/mooctest/controller/TaskController.java

@@ -49,8 +49,8 @@ public class TaskController {
     public String home(Model model) {
         // 获得所有taskDTO,包括本地和慕测端
         List<TaskDTO> tasks = taskService.getAllTasks();
-        List<TaskDTO> localtasks = taskService.findTask();
-        tasks.addAll(localtasks);
+        List<TaskDTO> localTasks = taskService.findTask();
+        tasks.addAll(localTasks);
         // 将获得任务传给前端
         model.addAttribute("tasks", tasks);
         // 转到task_list页面

+ 2 - 5
src/main/java/com/mooctest/data/TaskDTO.java

@@ -1,10 +1,12 @@
 package com.mooctest.data;
 
 import lombok.AllArgsConstructor;
+import lombok.Builder;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
 @Data
+@Builder
 @NoArgsConstructor
 @AllArgsConstructor
 public class TaskDTO {
@@ -19,9 +21,4 @@ public class TaskDTO {
     private long numOfTotalBug;
     private long numOfUndeal;
 
-    public TaskDTO(long examId, long caseId, String name) {
-        this.examId = examId;
-        this.caseId = caseId;
-        this.name = name;
-    }
 }

+ 0 - 176
src/main/java/com/mooctest/service/BugExcelInputService.java

@@ -1,176 +0,0 @@
-package com.mooctest.service;
-
-import com.fasterxml.jackson.annotation.ObjectIdGenerators;
-import com.mongodb.MongoClient;
-import com.mongodb.MongoCredential;
-import com.mongodb.ServerAddress;
-import com.mongodb.client.MongoCollection;
-import com.mongodb.client.MongoDatabase;
-import com.mooctest.dao2.BugDao;
-import com.mooctest.data.BugDTO;
-import com.mooctest.model.Bug;
-import com.mooctest.model.BugData;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.bson.Document;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.io.*;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
-@Service
-public class BugExcelInputService {
-
-    public String saveMultipartFile(MultipartFile file, String fileSaveName){
-        OutputStream os = null;
-        InputStream inputStream = null;
-        String fileName = fileSaveName;
-        String fileFullPath = null;
-
-        try {
-            inputStream = file.getInputStream();
-            fileName = file.getOriginalFilename();
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        try {
-            String path = System.getProperty("user.dir");
-            // 2、保存到临时文件
-            // 1K的数据缓冲
-            byte[] bs = new byte[1024];
-            // 读取到的数据长度
-            int len;
-            // 输出的文件流保存到本地文件
-            File tempFile = new File(path);
-            if (!tempFile.exists()) {
-                tempFile.mkdirs();
-            }
-            fileFullPath = tempFile.getPath() + File.separator + fileName;
-            os = new FileOutputStream(fileFullPath);
-            // 开始读取
-            while ((len = inputStream.read(bs)) != -1) {
-                os.write(bs, 0, len);
-            }
-
-
-        } catch (IOException e) {
-            e.printStackTrace();
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            // 完毕,关闭所有链接
-            try {
-                os.close();
-                inputStream.close();
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-
-        }
-
-        return fileFullPath;
-    }
-
-    public void excelToMongo(Integer PORT, String IP, String DATABASE, String USERNAME, String PASSWORD, String COLLECTION, String ADDRESS) {
-        try {
-            // 输入文件
-            FileInputStream inputStream = new FileInputStream(ADDRESS);
-            // 根据输入流导入Excel产生Workbook对象
-            Workbook workbook = null;
-            try {
-                workbook = new HSSFWorkbook(inputStream);
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-            // IP,端口
-            ServerAddress serverAddress = new ServerAddress(IP, PORT);
-            List<ServerAddress> address = new ArrayList<ServerAddress>();
-            address.add(serverAddress);
-            // 用户名,数据库,密码
-            MongoCredential credential = MongoCredential.createCredential(USERNAME, DATABASE, PASSWORD.toCharArray());
-            List<MongoCredential> credentials = new ArrayList<MongoCredential>();
-            credentials.add(credential);
-            // 通过验证获取连接
-            MongoClient mongoClient = new MongoClient(address, credentials);
-            // 连接到数据库
-            MongoDatabase mongoDatabase = mongoClient.getDatabase(DATABASE);
-
-
-            // 连接文档
-            MongoCollection<Document> collection = mongoDatabase.getCollection(COLLECTION);
-//            MongoCollection<Document> task = mongoDatabase.getCollection("Task");
-
-            System.out.println("连接成功");
-
-            List<Document> documents = new ArrayList<Document>();
-            List<String> fieldList = new ArrayList<String>();
-            // 获取Excel文档中第一个表单
-            Sheet sheet = workbook.getSheetAt(0);
-            // 获取表单第一行作为表头
-            Row topRow = sheet.getRow(0);
-            for (Cell cell : topRow) {
-                fieldList.add(cell.toString());
-            }
-
-            System.out.println("文件列表" + fieldList);
-            // 获得表单的行数
-            int rows = sheet.getLastRowNum() + 1;
-            // 获得每行的列数
-            int colunms = fieldList.size();
-            // 从第二行开始遍历表格
-            for (int i = 1; i < rows; i++) {
-                Row row = sheet.getRow(i);
-                Document document = new Document();
-//                Document taskDocument = new Document();
-                int exam_id = 0;
-                int case_id = 0;
-                String exam_case_id;
-                long data = System.currentTimeMillis();
-                // 每行从第一行开始遍历列
-                for (int j = 0; j < colunms; j++) {
-                    Cell cell = row.getCell(j);
-                    if (j == 0){
-                        exam_id = new Double(Double.parseDouble(cell.toString())).intValue();
-                        exam_id = exam_id + 10000000;
-                        document.append(fieldList.get(j), exam_id);
-//                        taskDocument.append(fieldList.get(j), exam_id);
-
-                    }else if(j == 1){
-                        case_id = new Double(Double.parseDouble(cell.toString())).intValue();
-                        case_id = case_id + 10000000;
-                        document.append(fieldList.get(j), case_id);
-//                        taskDocument.append(fieldList.get(j), case_id);
-
-
-                    }else if (j == 4 || j == 5){
-                        int num = new Double(Double.parseDouble(cell.toString())).intValue();
-                        document.append(fieldList.get(j), num);
-
-
-
-                    }else{
-                        document.append(fieldList.get(j), cell.toString());
-                    }
-                }
-                exam_case_id = exam_id + "-" + case_id;
-                document.append("exam_case_id", exam_case_id);
-                document.append("create_time_millis", data);
-
-                documents.add(document);
-            }
-            System.out.println("documents" + documents);
-            collection.insertMany(documents);
-            System.out.println("插入成功");
-        } catch (FileNotFoundException e) {
-            System.err.println(e.getClass().getName() + ": " + e.getMessage());
-        }
-    }
-
-}

+ 26 - 35
src/main/java/com/mooctest/service/ExcelInputService.java

@@ -2,14 +2,18 @@ package com.mooctest.service;
 
 import com.mooctest.dao.ExtendBugDao;
 import com.mooctest.dao.TaskDao;
+import com.mooctest.event.EventUtil;
 import com.mooctest.model.ExtendBug;
 import com.mooctest.model.Task;
+import org.apache.commons.io.IOUtils;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.bson.Document;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
@@ -20,6 +24,9 @@ import java.util.*;
 @Service
 public class ExcelInputService {
 
+    private static Logger logger = LoggerFactory.getLogger(EventUtil.class);
+
+
     @Autowired
     TaskDao taskDao;
 
@@ -29,19 +36,11 @@ public class ExcelInputService {
     // 接收前端文件,并将MultipartFile文件转换成File文件,并返回文件路径
     public String saveMultipartFile(MultipartFile file, String fileSaveName){
         OutputStream os = null;
-        InputStream inputStream = null;
-        String fileName = fileSaveName;
         String fileFullPath = null;
-        String fileType =null;
-
-        try {
-            inputStream = file.getInputStream();
-            fileName = file.getOriginalFilename();
-
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        try {
+        String fileName = file.getOriginalFilename();
+        try (
+                InputStream inputStream  = file.getInputStream();
+        ) {
             String path = System.getProperty("user.dir");
             // 2、保存到临时文件
             // 1K的数据缓冲
@@ -59,21 +58,12 @@ public class ExcelInputService {
             while ((len = inputStream.read(bs)) != -1) {
                 os.write(bs, 0, len);
             }
-
-
         } catch (IOException e) {
             e.printStackTrace();
         } catch (Exception e) {
             e.printStackTrace();
-        } finally {
-            // 完毕,关闭所有链接
-            try {
-                os.close();
-                inputStream.close();
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-
+        }finally {
+            IOUtils.closeQuietly(os);
         }
         return fileFullPath;
     }
@@ -95,12 +85,8 @@ public class ExcelInputService {
             // 输入文件
             FileInputStream inputStream = new FileInputStream(address);
             // 根据输入流导入Excel产生Workbook对象
-            Workbook workbook = null;
-            try {
-                workbook = new HSSFWorkbook(inputStream);
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
+            Workbook workbook = new HSSFWorkbook(inputStream);
+
 
             fieldList = new ArrayList<String>();
             // 获取Excel文档中第一个表单
@@ -119,7 +105,7 @@ public class ExcelInputService {
                 fieldList.add(cell.toString());
             }
 
-            System.out.println("文件列表" + fieldList);
+            logger.info("文件列表" + fieldList);
             // 获得表单的行数
             int rows = sheet.getLastRowNum() + 1;
 
@@ -150,7 +136,7 @@ public class ExcelInputService {
                     if(topName.equals("title") || topName.equals("题目")){
                         String title;
                         if(cell == null || cell.toString().equals("")){
-                            title = "null";
+                            title = "";
                         }else{
                             title = cell.toString();
                         }
@@ -158,7 +144,7 @@ public class ExcelInputService {
                     }else if(topName.equals("bug_category") || topName.equals("分类")){
                         String bug_category;
                         if(cell == null || cell.toString().equals("")){
-                            bug_category = "null";
+                            bug_category = "";
                         }else{
                             bug_category = cell.toString();
                         }
@@ -184,7 +170,7 @@ public class ExcelInputService {
                     }else{
                         String description;
                         if(cell == null || cell.toString().equals("")){
-                            description = "null";
+                            description = "";
                         }else{
                             description = cell.toString();
                         }
@@ -196,14 +182,19 @@ public class ExcelInputService {
                 System.out.println(extendBug);
                 extendBugDao.save(extendBug);
             }
-            System.out.println("插入成功");
+            logger.info("文件导入成功!");
             // 导入成功后将本地文件夹删除
             File file = new File(address);
             file.delete();
             insert_map.put("insert_success", true);
             return insert_map;
         } catch (FileNotFoundException e) {
-            System.err.println(e.getClass().getName() + ": " + e.getMessage());
+            logger.info(e.getMessage());
+            insert_map.put("insert_success", false);
+            return insert_map;
+        } catch (IOException e) {
+            logger.info(e.getMessage());
+            insert_map.put("file_is_null", true);
             insert_map.put("insert_success", false);
             return insert_map;
         }

+ 2 - 62
src/main/java/com/mooctest/service/TaskService.java

@@ -126,35 +126,14 @@ public class TaskService {
     // 在本地获得task方法
     public List<TaskDTO> findTask() {
         List<TaskDTO> taskDTOs = new ArrayList<>();
-            /*
-             * MongoClient               连接服务器
-             * MongoDatabase             连接数据库
-             * MongoCollection           连接表
-             * FindIterable<Document>    记录型迭代器
-             * MongoCursor               记录游标
-             * 应用顺序: 服务器-->数据库-->表-->记录迭代器-->记录游标
-             */
-//            MongoClient mongoClient = new MongoClient("localhost", 27017);
-//            MongoDatabase mongoDatabase = mongoClient.getDatabase("crowd_review");
-//            MongoCollection<Document> collection = mongoDatabase.getCollection("Task");
-//            FindIterable<Document> findIterable = collection.find();
-//            MongoCursor<Document> mongoCursor = findIterable.iterator();
+
         List<Task> tasks = taskDao.findAll();
         for (Task task: tasks) {
-            TaskDTO taskDTO = new TaskDTO((long) task.getTaskId(), (long) task.getCaseId(), task.getName());
+            TaskDTO taskDTO =  TaskDTO.builder().examId((long) task.getTaskId()).caseId( (long) task.getCaseId()).name(task.getName()).build();
             taskDTOs.add(taskDTO);
 
         }
 
-//        while(mongoCursor.hasNext()){
-//                Document  task = mongoCursor.next();
-//                TaskDTO taskDTO = new TaskDTO();
-//                taskDTO.setExamId((long)task.getInteger("task_id"));
-//                taskDTO.setCaseId((long)task.getInteger("case_id"));
-//                taskDTO.setName(task.getString("name"));
-//                taskDTOs.add(taskDTO);
-//
-//        }
 
         return taskDTOs.stream()
                 .map(taskDTO -> {
@@ -230,45 +209,6 @@ public class TaskService {
         return  tasksJson;
     }
 
-//    public List<TaskDTO> getAllTasks() {
-//        RestTemplate rt = new RestTemplate();
-//        StringHttpMessageConverter stringHttpMessageConverter=new StringHttpMessageConverter(Charset.forName("UTF-8"));
-//        List<HttpMessageConverter<?>> list=new ArrayList<HttpMessageConverter<?>>();
-//        list.add(stringHttpMessageConverter);
-//        rt.setMessageConverters(list);
-//        JSONObject tasksJson = JSON.parseObject(rt.getForObject(taskInfoAddr, String.class));
-//        ListIterator<Object> tasksIter = tasksJson.getJSONArray("data").listIterator();
-//
-//        List<TaskDTO> dtos = new ArrayList<>();
-//        while (tasksIter.hasNext()) {
-//            JSONObject taskInfo = (JSONObject) tasksIter.next();
-//
-//            TaskDTO dto = new TaskDTO();
-//            dto.setExamId(Long.parseLong(taskInfo.getString("task_id")));
-//            dto.setCaseId(Long.parseLong(taskInfo.getString("case_id")));
-//            dto.setName(taskInfo.getString("name"));
-//
-//            dtos.add(dto);
-//        }
-//
-//        return dtos.stream()
-//                .map(taskDTO -> {
-//                    long totalBugs = masterReportDao.countByExamIdAndCaseId(taskDTO.getExamId(), taskDTO.getCaseId());
-//                    long undealBugs = 0;
-//                    if (totalBugs == 0) {
-//                        totalBugs = bugReportService.getAllBugs(taskDTO.getExamId(), taskDTO.getCaseId()).size();
-//                        undealBugs = totalBugs;
-//                    } else {
-//                        undealBugs = masterReportDao.countByExamIdAndCaseIdAndStatus(taskDTO.getExamId(), taskDTO.getCaseId(), 0);
-//                    }
-//                    taskDTO.setNumOfTotalBug(totalBugs);
-//                    taskDTO.setNumOfUndeal(undealBugs);
-//
-//                    return taskDTO;
-//                }).sorted(Comparator.comparing(TaskDTO::getExamId).reversed())
-//                .collect(Collectors.toList());
-//
-//    }
 
     public boolean distribute(String examId,String caseId){
         RestTemplate template = new RestTemplate();

+ 2 - 2
src/main/java/com/mooctest/util/Doc2VecUtil.java

@@ -15,8 +15,8 @@ public class Doc2VecUtil {
             synchronized (Doc2VecUtil.class) {
                 if (docVectorModel == null) {
                     try {
-                        docVectorModel = new DocVectorModel(new WordVectorModel("D:\\work\\project\\yanbaoronghe\\data\\sgns.wiki.word"));
-//                        docVectorModel = new DocVectorModel(new  WordVectorModel("/Users/insomnialee/Desktop/sgns.wiki.word"));
+//                        docVectorModel = new DocVectorModel(new WordVectorModel("D:\\work\\project\\yanbaoronghe\\data\\sgns.wiki.word"));
+                        docVectorModel = new DocVectorModel(new  WordVectorModel("/project/sgns.wiki.word"));
                     } catch (IOException e) {
                         e.printStackTrace();
                     }

+ 0 - 17
src/main/resources/templates/add_excel.html

@@ -1,17 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <title>导入任务</title>
-</head>
-<body>
-<form action="/excelToMongo" method="post" enctype="multipart/form-data">
-    测试名称:<input type="text" name="name"/>
-    <br/>
-    导入Excel文件:<input type="file" name="excelFile">
-    <br/>
-    <input type="submit" value="提交">
-</form>
-
-</body>
-</html>

+ 0 - 10
src/main/resources/templates/add_excel_ok.html

@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <title>Title</title>
-</head>
-<body>
-    提交成功!!!
-</body>
-</html>

+ 6 - 23
src/main/resources/templates/agg_report_new.html

@@ -296,26 +296,16 @@
                             <div class="form-group">
                                 <label>Bug 复现程度</label>
                                 <select id="recurrent" name="recurrent" class="form-control">
-<!--                                    <option th:each="mapItem : ${recurrent2String}"-->
-<!--                                            th:value="${mapItem.key}" th:text="${mapItem.value}">必现</option>-->
-                                    <option value="1">其他</option>
-                                    <option value="2">无规律复现</option>
-                                    <option value="3">小概率复现</option>
-                                    <option value="4">大概率复现</option>
-                                    <option value="5">必现</option>
+                                    <option th:each="mapItem : ${recurrent2String}" th:if="${mapItem.key !=0 }"
+                                            th:value="${mapItem.key}" th:text="${mapItem.value}">必现</option>
                                 </select>
                             </div>
                             <!-- select -->
                             <div class="form-group">
                                 <label>Bug 严重性</label>
                                 <select id="severity" name="severity" class="form-control">
-<!--                                    <option th:each="mapItem : ${severity2String}"-->
-<!--                                            th:value="${mapItem.key}" th:text="${mapItem.value}">必现</option>-->
-                                    <option value="1">待定</option>
-                                    <option value="2">较轻</option>
-                                    <option value="3">一般</option>
-                                    <option value="4">严重</option>
-                                    <option value="5">紧急</option>
+                                    <option th:each="mapItem : ${severity2String}" th:if="${mapItem.key !=0 }"
+                                            th:value="${mapItem.key}" th:text="${mapItem.value}">必现</option>
                                 </select>
                             </div>
 
@@ -323,15 +313,8 @@
                             <div class="form-group">
                                 <label>Bug 分类</label>
                                 <select id="category" class="form-control">
-<!--                                    <option th:each="mapItem : ${category2String}"-->
-<!--                                            th:value="${mapItem.key}" th:text="${mapItem.value}">必现</option>-->
-                                    <option value="1">安全</option>
-                                    <option value="2">功能不完整</option>
-                                    <option value="3">性能</option>
-                                    <option value="4">页面布局缺陷</option>
-                                    <option value="5">用户体验</option>
-                                    <option value="6">不正常退出</option>
-                                    <option value="7">其他</option>
+                                    <option th:each="mapItem : ${category2String}" th:if="${mapItem.key !=0 }"
+                                            th:value="${mapItem.key}" th:text="${mapItem.value}">必现</option>
                                 </select>
                             </div>
 

+ 6 - 23
src/main/resources/templates/aggr_report.html

@@ -226,26 +226,16 @@
                             <div class="form-group">
                                 <label>Bug 复现程度</label>
                                 <select id="recurrent" name="recurrent" class="form-control">
-<!--                                    <option th:each="mapItem : ${recurrent2String}"-->
-<!--                                            th:value="${mapItem.key}" th:text="${mapItem.value}">必现</option>-->
-                                    <option value="1">其他</option>
-                                    <option value="2">无规律复现</option>
-                                    <option value="3">小概率复现</option>
-                                    <option value="4">大概率复现</option>
-                                    <option value="5">必现</option>
+                                    <option th:each="mapItem : ${recurrent2String}" th:if="${mapItem.key !=0 }"
+                                            th:value="${mapItem.key}" th:text="${mapItem.value}">必现</option>
                                 </select>
                             </div>
                             <!-- select -->
                             <div class="form-group">
                                 <label>Bug 严重性</label>
                                 <select id="severity" name="severity" class="form-control">
-<!--                                    <option th:each="mapItem : ${severity2String}"-->
-<!--                                            th:value="${mapItem.key}" th:text="${mapItem.value}">必现</option>-->
-                                    <option value="1">待定</option>
-                                    <option value="2">较轻</option>
-                                    <option value="3">一般</option>
-                                    <option value="4">严重</option>
-                                    <option value="5">紧急</option>
+                                    <option th:each="mapItem : ${severity2String}" th:if="${mapItem.key !=0 }"
+                                            th:value="${mapItem.key}" th:text="${mapItem.value}">必现</option>
                                 </select>
                             </div>
 
@@ -253,15 +243,8 @@
                             <div class="form-group">
                                 <label>Bug 分类</label>
                                 <select id="category" class="form-control">
-<!--                                    <option th:each="mapItem : ${category2String}"-->
-<!--                                            th:value="${mapItem.key}" th:text="${mapItem.value}">必现</option>-->
-                                    <option value="1">安全</option>
-                                    <option value="2">功能不完整</option>
-                                    <option value="3">性能</option>
-                                    <option value="4">页面布局缺陷</option>
-                                    <option value="5">用户体验</option>
-                                    <option value="6">不正常退出</option>
-                                    <option value="7">其他</option>
+                                    <option th:each="mapItem : ${category2String}" th:if="${mapItem.key !=0 }"
+                                            th:value="${mapItem.key}" th:text="${mapItem.value}">必现</option>
                                 </select>
                             </div>
 

+ 7 - 23
src/main/resources/templates/single_report.html

@@ -219,26 +219,16 @@
                             <div class="form-group">
                                 <label>Bug 复现程度</label>
                                 <select id="recurrent" name="recurrent" class="form-control">
-<!--                                    <option th:each="mapItem : ${recurrent2String}"-->
-<!--                                            th:value="${mapItem.key}" th:text="${mapItem.value}">必现</option>-->
-                                    <option value="1">其他</option>
-                                    <option value="2">无规律复现</option>
-                                    <option value="3">小概率复现</option>
-                                    <option value="4">大概率复现</option>
-                                    <option value="5">必现</option>
+                                    <option th:each="mapItem : ${recurrent2String}" th:if="${mapItem.key !=0 }"
+                                            th:value="${mapItem.key}" th:text="${mapItem.value}">必现</option>
                                 </select>
                             </div>
                             <!-- select -->
                             <div class="form-group">
                                 <label>Bug 严重性</label>
                                 <select id="severity" name="severity" class="form-control">
-<!--                                    <option th:each="mapItem : ${severity2String}"-->
-<!--                                            th:value="${mapItem.key}" th:text="${mapItem.value}">必现</option>-->
-                                    <option value="1">待定</option>
-                                    <option value="2">较轻</option>
-                                    <option value="3">一般</option>
-                                    <option value="4">严重</option>
-                                    <option value="5">紧急</option>
+                                    <option th:each="mapItem : ${severity2String}" th:if="${mapItem.key !=0 }"
+                                            th:value="${mapItem.key}" th:text="${mapItem.value}">必现</option>
                                 </select>
                             </div>
 
@@ -246,15 +236,9 @@
                             <div class="form-group">
                                 <label>Bug 分类</label>
                                 <select id="category" class="form-control">
-<!--                                    <option th:each="mapItem : ${category2String}"-->
-<!--                                            th:value="${mapItem.key}" th:text="${mapItem.value}">必现</option>-->
-                                    <option value="1">安全</option>
-                                    <option value="2">功能不完整</option>
-                                    <option value="3">性能</option>
-                                    <option value="4">页面布局缺陷</option>
-                                    <option value="5">用户体验</option>
-                                    <option value="6">不正常退出</option>
-                                    <option value="7">其他</option>
+                                    <option th:each="mapItem : ${category2String}" th:if="${mapItem.key !=0 }"
+                                            th:value="${mapItem.key}" th:text="${mapItem.value}">必现</option>
+
                                 </select>
                             </div>
 

+ 2 - 16
src/main/resources/templates/thumbnail/raw_report.html

@@ -6,26 +6,12 @@
 		<b th:if="${isMaster}" th:text="|Master-${bugReport.id}|"></b>
 		<b th:unless="${isMaster}" th:text="${bugReport.id}"></b>
 	</li>
-<!-- 	<li class="list-group-item">
-		<b>Type:    </b>
-		<label class="label" style="background-color: rgb(244, 172, 7); margin-right: 5px;">
-			<span class="glyphicon glyphicon-file" style="margin-right: 5px;"></span>
-			Raw Report
-		</label>
-		{% if is_master %}
-		<label class="label" style="background-color: rgb(252, 165, 4);">
-			<span class="glyphicon glyphicon-file" style="margin-right: 5px;"></span>
-			Master Report
-		</label>
-		{% endif %}
-	</li> -->
+
 	<li class="list-group-item" style="max-width: 290px; min-height: 363px;">
-		<!-- <b>Content: </b><br> -->
 		<span th:text="${bugReport.description}"></span><br />
-
 		<img class="my-img-thumbnail pointer" th:src="${imgUrl}"
 			 th:each="imgUrl,iterStat : ${bugReport.getImgUrls()}"
-			 th:onclick="'javascript:showimage(\''+${imgUrl}+'\');'"/>
+			 th:onclick="showimage([[${imgUrl}]])"/>
 	</li>
 </ul>
 </html>

+ 4 - 1
src/main/resources/templates/thumbnail/sup_report.html

@@ -38,7 +38,10 @@
                         <img th:if="${img.isDiff()}" class="my-img-thumbnail pointer" style="border: 2px solid red;"
                              th:src="${img.imgUrl}" th:onclick="'javascript:showimage(\''+${img.imgUrl}+'\');'"/>
                         <img th:unless="${img.isDiff()}" class="my-img-thumbnail pointer"
-                             th:src="${img.imgUrl}" th:onclick="'javascript:showimage(\''+${img.imgUrl}+'\');'"/>
+                             th:src="${img.imgUrl}" th:onclick="showimage([[${img.imgUrl}]])"/>
+
+
+
                     </th:block>
 
                 </li>

+ 6 - 23
src/main/resources/templates/tree_report_new.html

@@ -288,26 +288,16 @@
                             <div class="form-group">
                                 <label>Bug 复现程度</label>
                                 <select id="recurrent" name="recurrent" class="form-control">
-<!--                                    <option th:each="mapItem : ${recurrent2String}"-->
-<!--                                            th:value="${mapItem.key}" th:text="${mapItem.value}" >必现</option>-->
-                                    <option value="1">其他</option>
-                                    <option value="2">无规律复现</option>
-                                    <option value="3">小概率复现</option>
-                                    <option value="4">大概率复现</option>
-                                    <option value="5">必现</option>
+                                    <option th:each="mapItem : ${recurrent2String}" th:if="${mapItem.key !=0 }"
+                                            th:value="${mapItem.key}" th:text="${mapItem.value}" >必现</option>
                                 </select>
                             </div>
                             <!-- select -->
                             <div class="form-group">
                                 <label>Bug 严重性</label>
                                 <select id="severity" name="severity" class="form-control">
-<!--                                    <option th:each="mapItem : ${severity2String}"-->
-<!--                                            th:value="${mapItem.key}" th:text="${mapItem.value}">必现</option>-->
-                                    <option value="1">待定</option>
-                                    <option value="2">较轻</option>
-                                    <option value="3">一般</option>
-                                    <option value="4">严重</option>
-                                    <option value="5">紧急</option>
+                                    <option th:each="mapItem : ${severity2String}" th:if="${mapItem.key !=0 }"
+                                            th:value="${mapItem.key}" th:text="${mapItem.value}">必现</option>
                                 </select>
                             </div>
 
@@ -315,15 +305,8 @@
                             <div class="form-group">
                                 <label>Bug 分类</label>
                                 <select id="category" class="form-control">
-<!--                                    <option th:each="mapItem : ${category2String}"-->
-<!--                                            th:value="${mapItem.key}" th:text="${mapItem.value}">必现</option>-->
-                                    <option value="1">安全</option>
-                                    <option value="2">功能不完整</option>
-                                    <option value="3">性能</option>
-                                    <option value="4">页面布局缺陷</option>
-                                    <option value="5">用户体验</option>
-                                    <option value="6">不正常退出</option>
-                                    <option value="7">其他</option>
+                                    <option th:each="mapItem : ${category2String}" th:if="${mapItem.key !=0 }"
+                                            th:value="${mapItem.key}" th:text="${mapItem.value}">必现</option>
                                 </select>
                             </div>