Browse Source

美术阅卷10月新增需求-修复导出分档和分数生源地显示不对的BUG

wangliang 5 năm trước cách đây
mục cha
commit
2fd5e9ac61

+ 4 - 1
stmms-ms-accesscontrol/src/main/java/cn/com/qmth/stmms/ms/accesscontrol/api/AuthApi.java

@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpSession;
+import java.util.Objects;
 
 /**
  * Created by zhengmin on 2016/11/1.
@@ -71,7 +72,9 @@ public class AuthApi {
             session.setAttribute("token", null);
         }
         session.setAttribute("token", System.currentTimeMillis() + "#" + domain.getLoginName());
-        session.setAttribute("markUser", domain);
+        if (!Objects.equals(loginConfig.clientLoginConfig().getLoginName(), user.getLoginName()) && !Objects.equals(loginConfig.inspectionLoginConfig().getLoginName(), user.getLoginName())) {
+            session.setAttribute("markUser", domain);
+        }
         return domain;
     }
 

+ 5 - 5
stmms-ms-admin/src/main/java/cn/com/qmth/stmms/ms/admin/dto/ExportLevelResultDTO.java

@@ -11,7 +11,7 @@ public class ExportLevelResultDTO {
     private String examNumber;
     private String studentName;
     private String areaName;
-    private String areaCode;
+    private String sourceName;
     //    private String groupCell;
     private String result;
     private String teacherName;
@@ -117,11 +117,11 @@ public class ExportLevelResultDTO {
         this.areaName = areaName;
     }
 
-    public String getAreaCode() {
-        return areaCode;
+    public String getSourceName() {
+        return sourceName;
     }
 
-    public void setAreaCode(String areaCode) {
-        this.areaCode = areaCode;
+    public void setSourceName(String sourceName) {
+        this.sourceName = sourceName;
     }
 }

+ 10 - 10
stmms-ms-admin/src/main/java/cn/com/qmth/stmms/ms/admin/exporter/ScoreExporter.java

@@ -61,7 +61,7 @@ public class ScoreExporter {
             EXAM_NUMBER = "准考证号",
             NAME = "姓名",
             AREA_NAME = "考区",
-            AREA_CODE = "生源地",
+            SOURCE_NAME = "生源地",
             SC_NAME = "色彩",
             SM_NAME = "素描",
             SX_NAME = "速写",
@@ -198,7 +198,7 @@ public class ScoreExporter {
         sheet.setColumnWidth(2, 30 * 256);
         //生源地
         Cell cell3 = row.createCell(3);
-        cell3.setCellValue(AREA_CODE);
+        cell3.setCellValue(SOURCE_NAME);
         cell3.setCellStyle(style);
         CellRangeAddress region4 = new CellRangeAddress(0, 1, (short) 3, (short) 3);
         sheet.addMergedRegion(region4);
@@ -268,9 +268,9 @@ public class ScoreExporter {
     @RequestMapping(value = "exportLevelResult", method = RequestMethod.GET)
     public void exportLevelResult(@RequestParam Long workId, HttpServletResponse response) {
         //测试-导出档位成绩表
-        String scSql = "select temp.*, mt.`result`, p.area_code as areaCode, p.exam_number as examNumber, p.student_name as studentName, t.area_name as areaName, p.mark_by_leader as markByLeader, p.`level` from mark_task as mt , (select mu.id, mu.name as teacherName, mu.`role`, mu.subject, mu.work_id as workId from mark_user as mu where mu.work_id = ? and mu.`role` = 'MARKER'and (mu.mark_right = 0 or mu.mark_right = 2) and mu.subject = 'SC'and mu.enabled = 1) temp, paper p, student t where mt.marker_id = temp.id and mt.paper_id = p.id and t.exam_number = p.exam_number and mt.work_id = ? and mt.stage = 1 ";
-        String smSql = "select temp.*, mt.`result`, p.area_code as areaCode, p.exam_number as examNumber, p.student_name as studentName, t.area_name as areaName, p.mark_by_leader as markByLeader, p.`level` from mark_task as mt , (select mu.id, mu.name as teacherName, mu.`role`, mu.subject, mu.work_id as workId from mark_user as mu where mu.work_id = ? and mu.`role` = 'MARKER'and (mu.mark_right = 0 or mu.mark_right = 2) and mu.subject = 'SM'and mu.enabled = 1) temp, paper p, student t where mt.marker_id = temp.id and mt.paper_id = p.id and t.exam_number = p.exam_number and mt.work_id = ? and mt.stage = 1 ";
-        String sxSql = "select temp.*, mt.`result`, p.area_code as areaCode, p.exam_number as examNumber, p.student_name as studentName, t.area_name as areaName, p.mark_by_leader as markByLeader, p.`level` from mark_task as mt , (select mu.id, mu.name as teacherName, mu.`role`, mu.subject, mu.work_id as workId from mark_user as mu where mu.work_id = ? and mu.`role` = 'MARKER'and (mu.mark_right = 0 or mu.mark_right = 2) and mu.subject = 'SX'and mu.enabled = 1) temp, paper p, student t where mt.marker_id = temp.id and mt.paper_id = p.id and t.exam_number = p.exam_number and mt.work_id = ? and mt.stage = 1 ";
+        String scSql = "select temp.*, mt.`result`, p.source_name as sourceName, p.exam_number as examNumber, p.student_name as studentName, t.area_name as areaName, p.mark_by_leader as markByLeader, p.`level` from mark_task as mt , (select mu.id, mu.name as teacherName, mu.`role`, mu.subject, mu.work_id as workId from mark_user as mu where mu.work_id = ? and mu.`role` = 'MARKER'and (mu.mark_right = 0 or mu.mark_right = 2) and mu.subject = 'SC'and mu.enabled = 1) temp, paper p, student t where mt.marker_id = temp.id and mt.paper_id = p.id and t.exam_number = p.exam_number and mt.work_id = ? and mt.stage = 1 ";
+        String smSql = "select temp.*, mt.`result`, p.source_name as sourceName, p.exam_number as examNumber, p.student_name as studentName, t.area_name as areaName, p.mark_by_leader as markByLeader, p.`level` from mark_task as mt , (select mu.id, mu.name as teacherName, mu.`role`, mu.subject, mu.work_id as workId from mark_user as mu where mu.work_id = ? and mu.`role` = 'MARKER'and (mu.mark_right = 0 or mu.mark_right = 2) and mu.subject = 'SM'and mu.enabled = 1) temp, paper p, student t where mt.marker_id = temp.id and mt.paper_id = p.id and t.exam_number = p.exam_number and mt.work_id = ? and mt.stage = 1 ";
+        String sxSql = "select temp.*, mt.`result`, p.source_name as sourceName, p.exam_number as examNumber, p.student_name as studentName, t.area_name as areaName, p.mark_by_leader as markByLeader, p.`level` from mark_task as mt , (select mu.id, mu.name as teacherName, mu.`role`, mu.subject, mu.work_id as workId from mark_user as mu where mu.work_id = ? and mu.`role` = 'MARKER'and (mu.mark_right = 0 or mu.mark_right = 2) and mu.subject = 'SX'and mu.enabled = 1) temp, paper p, student t where mt.marker_id = temp.id and mt.paper_id = p.id and t.exam_number = p.exam_number and mt.work_id = ? and mt.stage = 1 ";
         //拼装问号
         scSql = sqlUtil.sqlPrint(scSql, workId, workId);
         smSql = sqlUtil.sqlPrint(smSql, workId, workId);
@@ -332,7 +332,7 @@ public class ScoreExporter {
                 cellIndex.getAndIncrement();
                 drawExcelFixedHead(finalSheet, style, hssfRow, new HeaderNode(listv.getAreaName(), firstRow, firstRow, cellIndex.get(), cellIndex.get()));
                 cellIndex.getAndIncrement();
-                drawExcelFixedHead(finalSheet, style, hssfRow, new HeaderNode(listv.getAreaCode(), firstRow, firstRow, cellIndex.get(), cellIndex.get()));
+                drawExcelFixedHead(finalSheet, style, hssfRow, new HeaderNode(listv.getSourceName(), firstRow, firstRow, cellIndex.get(), cellIndex.get()));
                 cellIndex.getAndIncrement();
                 Map<String, ExportLevelResultDTO> map = studentAnswerMap.get(listv.getExamNumber());
                 if (Objects.nonNull(map) && map.size() > 0) {
@@ -382,9 +382,9 @@ public class ScoreExporter {
     @RequestMapping(value = "exportScoreResult", method = RequestMethod.GET)
     public void exportScoreResult(@RequestParam Long workId, HttpServletResponse response) {
         //测试-导出分数成绩表
-        String scSql = "select temp.*, mt.`result`, p.area_code as areaCode, p.exam_number as examNumber, p.student_name as studentName, t.area_name as areaName, p.score as level,p.mark_by_leader as markByLeader from mark_task as mt , (select mu.id, mu.name as teacherName, mu.`role`, mu.subject, mu.work_id as workId from mark_user as mu where mu.work_id = ? and mu.`role` = 'MARKER'and (mu.mark_right = 1 or mu.mark_right = 2) and mu.subject = 'SC'and mu.enabled = 1) temp, paper p, student t where mt.marker_id = temp.id and mt.paper_id = p.id and t.exam_number = p.exam_number and mt.work_id = ? and mt.stage = 2 ";
-        String smSql = "select temp.*, mt.`result`, p.area_code as areaCode, p.exam_number as examNumber, p.student_name as studentName, t.area_name as areaName, p.score as level,p.mark_by_leader as markByLeader from mark_task as mt , (select mu.id, mu.name as teacherName, mu.`role`, mu.subject, mu.work_id as workId from mark_user as mu where mu.work_id = ? and mu.`role` = 'MARKER'and (mu.mark_right = 1 or mu.mark_right = 2) and mu.subject = 'SM'and mu.enabled = 1) temp, paper p, student t where mt.marker_id = temp.id and mt.paper_id = p.id and t.exam_number = p.exam_number and mt.work_id = ? and mt.stage = 2 ";
-        String sxSql = "select temp.*, mt.`result`, p.area_code as areaCode, p.exam_number as examNumber, p.student_name as studentName, t.area_name as areaName, p.score as level,p.mark_by_leader as markByLeader from mark_task as mt , (select mu.id, mu.name as teacherName, mu.`role`, mu.subject, mu.work_id as workId from mark_user as mu where mu.work_id = ? and mu.`role` = 'MARKER'and (mu.mark_right = 1 or mu.mark_right = 2) and mu.subject = 'SX'and mu.enabled = 1) temp, paper p, student t where mt.marker_id = temp.id and mt.paper_id = p.id and t.exam_number = p.exam_number and mt.work_id = ? and mt.stage = 2 ";
+        String scSql = "select temp.*, mt.`result`, p.source_name as sourceName, p.exam_number as examNumber, p.student_name as studentName, t.area_name as areaName, p.score as level,p.mark_by_leader as markByLeader from mark_task as mt , (select mu.id, mu.name as teacherName, mu.`role`, mu.subject, mu.work_id as workId from mark_user as mu where mu.work_id = ? and mu.`role` = 'MARKER'and (mu.mark_right = 1 or mu.mark_right = 2) and mu.subject = 'SC'and mu.enabled = 1) temp, paper p, student t where mt.marker_id = temp.id and mt.paper_id = p.id and t.exam_number = p.exam_number and mt.work_id = ? and mt.stage = 2 ";
+        String smSql = "select temp.*, mt.`result`, p.source_name as sourceName, p.exam_number as examNumber, p.student_name as studentName, t.area_name as areaName, p.score as level,p.mark_by_leader as markByLeader from mark_task as mt , (select mu.id, mu.name as teacherName, mu.`role`, mu.subject, mu.work_id as workId from mark_user as mu where mu.work_id = ? and mu.`role` = 'MARKER'and (mu.mark_right = 1 or mu.mark_right = 2) and mu.subject = 'SM'and mu.enabled = 1) temp, paper p, student t where mt.marker_id = temp.id and mt.paper_id = p.id and t.exam_number = p.exam_number and mt.work_id = ? and mt.stage = 2 ";
+        String sxSql = "select temp.*, mt.`result`, p.source_name as sourceName, p.exam_number as examNumber, p.student_name as studentName, t.area_name as areaName, p.score as level,p.mark_by_leader as markByLeader from mark_task as mt , (select mu.id, mu.name as teacherName, mu.`role`, mu.subject, mu.work_id as workId from mark_user as mu where mu.work_id = ? and mu.`role` = 'MARKER'and (mu.mark_right = 1 or mu.mark_right = 2) and mu.subject = 'SX'and mu.enabled = 1) temp, paper p, student t where mt.marker_id = temp.id and mt.paper_id = p.id and t.exam_number = p.exam_number and mt.work_id = ? and mt.stage = 2 ";
         //拼装问号
         scSql = sqlUtil.sqlPrint(scSql, workId, workId);
         smSql = sqlUtil.sqlPrint(smSql, workId, workId);
@@ -446,7 +446,7 @@ public class ScoreExporter {
                 cellIndex.getAndIncrement();
                 drawExcelFixedHead(finalSheet, style, hssfRow, new HeaderNode(listv.getAreaName(), firstRow, firstRow, cellIndex.get(), cellIndex.get()));
                 cellIndex.getAndIncrement();
-                drawExcelFixedHead(finalSheet, style, hssfRow, new HeaderNode(listv.getAreaCode(), firstRow, firstRow, cellIndex.get(), cellIndex.get()));
+                drawExcelFixedHead(finalSheet, style, hssfRow, new HeaderNode(listv.getSourceName(), firstRow, firstRow, cellIndex.get(), cellIndex.get()));
                 cellIndex.getAndIncrement();
                 Map<String, ExportLevelResultDTO> map = studentAnswerMap.get(listv.getExamNumber());
                 if (Objects.nonNull(map) && map.size() > 0) {

+ 4 - 3
stmms-ms-main/src/main/resources/application.properties

@@ -7,7 +7,7 @@ spring.datasource.validation-query=SELECT 1 FROM DUAL
 spring.datasource.test-on-borrow=true
 
 #redis
-#spring.redis.host=192.168.199.102
+#spring.redis.host=192.168.199.102a
 #spring.redis.port=32768
 
 server.tomcat.max-threads=256
@@ -15,8 +15,9 @@ server.port=8080
 server.compression.enabled=true
 server.compression.mime-types:application/json,application/xml,text/html,text/xml,text/plain,text/css,application/javascript
 logging.file=./logs/sys.log
-logging.level.org.springframework=ERROR
-logging.level.org.hibernate=ERROR
+logging.level.root=info
+logging.level.org.springframework=info
+logging.level.org.hibernate=info
 spring.jpa.show-sql=true
 spring.jpa.hibernate.ddl-auto=update
 spring.http.multipart.max-file-size=10Mb