Browse Source

普通员工页面:CODE1-10修改为CODE0-3、CODE5-10

wangggziwen 9 months ago
parent
commit
c75b9d393c

+ 27 - 24
rc-admin/src/main/java/com/ruoyi/web/controller/rc/TAuditController.java

@@ -145,23 +145,26 @@ public class TAuditController extends BaseController
             List<TChapter> tChapters = tChapterService.selectTChapterList(chapter);
             for (TChapter tChapter : tChapters) {
                 String code = tChapter.getCode();
-                char firstChar = code.charAt(0);
-                TQuestionnaire questionnaire = new TQuestionnaire();
-                questionnaire.setChapterId(tChapter.getId());
-                List<TQuestionnaire> tQuestionnaires = tQuestionnaireService.selectTQuestionnaireList(questionnaire);
-                for (TQuestionnaire tQuestionnaire : tQuestionnaires) {
-                    boolean flag = "1".equals(tQuestionnaire.getCompletionStatus());
-                    switch (firstChar) {
-                        case '0': code0Count++; if (flag) {code0CompleteCount++;} break;
-                        case '1': code1Count++; if (flag) {code1CompleteCount++;} break;
-                        case '2': code2Count++; if (flag) {code2CompleteCount++;} break;
-                        case '3': code3Count++; if (flag) {code3CompleteCount++;} break;
-                        case '4': code4Count++; if (flag) {code4CompleteCount++;} break;
-                        case '5': code5Count++; if (flag) {code5CompleteCount++;} break;
-                        case '6': code6Count++; if (flag) {code6CompleteCount++;} break;
-                        case '7': code7Count++; if (flag) {code7CompleteCount++;} break;
-                        case '8': code8Count++; if (flag) {code8CompleteCount++;} break;
-                        case '9': code9Count++; if (flag) {code9CompleteCount++;} break;
+                int index = code.indexOf(",");
+                if (index != -1) {
+                    code = code.substring(0, index);
+                    TQuestionnaire questionnaire = new TQuestionnaire();
+                    questionnaire.setChapterId(tChapter.getId());
+                    List<TQuestionnaire> tQuestionnaires = tQuestionnaireService.selectTQuestionnaireList(questionnaire);
+                    for (TQuestionnaire tQuestionnaire : tQuestionnaires) {
+                        boolean flag = "1".equals(tQuestionnaire.getCompletionStatus());
+                        switch (code) {
+                            case "0": code0Count++; if (flag) {code0CompleteCount++;} break;
+                            case "1": code1Count++; if (flag) {code1CompleteCount++;} break;
+                            case "2": code2Count++; if (flag) {code2CompleteCount++;} break;
+                            case "3": code3Count++; if (flag) {code3CompleteCount++;} break;
+                            case "5": code4Count++; if (flag) {code4CompleteCount++;} break;
+                            case "6": code5Count++; if (flag) {code5CompleteCount++;} break;
+                            case "7": code6Count++; if (flag) {code6CompleteCount++;} break;
+                            case "8": code7Count++; if (flag) {code7CompleteCount++;} break;
+                            case "9": code8Count++; if (flag) {code8CompleteCount++;} break;
+                            case "10": code9Count++; if (flag) {code9CompleteCount++;} break;
+                        }
                     }
                 }
             }
@@ -179,23 +182,23 @@ public class TAuditController extends BaseController
             map.put("code1", code1CompleteProgress.toString());
             map.put("code2", code2CompleteProgress.toString());
             map.put("code3", code3CompleteProgress.toString());
-            map.put("code4", code4CompleteProgress.toString());
-            map.put("code5", code5CompleteProgress.toString());
-            map.put("code6", code6CompleteProgress.toString());
-            map.put("code7", code7CompleteProgress.toString());
-            map.put("code8", code8CompleteProgress.toString());
-            map.put("code9", code9CompleteProgress.toString());
+            map.put("code5", code4CompleteProgress.toString());
+            map.put("code6", code5CompleteProgress.toString());
+            map.put("code7", code6CompleteProgress.toString());
+            map.put("code8", code7CompleteProgress.toString());
+            map.put("code9", code8CompleteProgress.toString());
+            map.put("code10", code9CompleteProgress.toString());
         } else {
             map.put("code0", "0");
             map.put("code1", "0");
             map.put("code2", "0");
             map.put("code3", "0");
-            map.put("code4", "0");
             map.put("code5", "0");
             map.put("code6", "0");
             map.put("code7", "0");
             map.put("code8", "0");
             map.put("code9", "0");
+            map.put("code10", "0");
         }
         return success(map);
     }

+ 2 - 2
ruoyi-ui/src/views/home2.vue

@@ -107,7 +107,7 @@ export default {
           },
           yAxis: {
             type: 'category',
-            data: ['CODE 0', 'CODE 1', 'CODE 2', 'CODE 3', 'CODE 4', 'CODE 5', 'CODE 6', 'CODE 7', 'CODE 8', 'CODE 9'],
+            data: ['CODE 0', 'CODE 1', 'CODE 2', 'CODE 3', 'CODE 5', 'CODE 6', 'CODE 7', 'CODE 8', 'CODE 9', 'CODE 10'],
             axisTick: {
               alignWithLabel: true
             }
@@ -123,12 +123,12 @@ export default {
                 {value: data.code1 * 100, itemStyle: {color: '#91CC75'}},
                 {value: data.code2 * 100, itemStyle: {color: '#91CC75'}},
                 {value: data.code3 * 100, itemStyle: {color: '#91CC75'}},
-                {value: data.code4 * 100, itemStyle: {color: '#91CC75'}},
                 {value: data.code5 * 100, itemStyle: {color: '#91CC75'}},
                 {value: data.code6 * 100, itemStyle: {color: '#91CC75'}},
                 {value: data.code7 * 100, itemStyle: {color: '#91CC75'}},
                 {value: data.code8 * 100, itemStyle: {color: '#91CC75'}},
                 {value: data.code9 * 100, itemStyle: {color: '#91CC75'}},
+                {value: data.code10 * 100, itemStyle: {color: '#91CC75'}},
               ],
               // data: [
               //   {value: data.code0 * 100, itemStyle: {color: '#5470C6'}},