浏览代码

全局修改errcode

wangliang 1 年之前
父节点
当前提交
6dbc3e7e1f
共有 41 个文件被更改,包括 70 次插入56 次删除
  1. 2 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ActivitiServiceImpl.java
  2. 2 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamPaperStructureServiceImpl.java
  3. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/GradeBatchServiceImpl.java
  4. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TFFlowJoinServiceImpl.java
  5. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncBasicClazzImportService.java
  6. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncCreatePdfTempleteService.java
  7. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncDownloadPaperFileBatchService.java
  8. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncDownloadPdfTempleteService.java
  9. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncExaminationExportTemplateService.java
  10. 2 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncExaminationImportTemplateService.java
  11. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncPaperReviewPdfExportService.java
  12. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncScoreBatchDownloadService.java
  13. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncScoreExportService.java
  14. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncScorePushService.java
  15. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncStatisticsDataImportService.java
  16. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncStudentDataImportService.java
  17. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncSysUserDataImportService.java
  18. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncTaskReviewSampleExportService.java
  19. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/export/AsyncExportTaskTemplete.java
  20. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/importData/AsyncImportTaskTemplete.java
  21. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/push/AsyncPushTaskTemplate.java
  22. 5 5
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/TaskLogicServiceImpl.java
  23. 1 1
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamTaskController.java
  24. 1 1
      distributed-print/src/main/java/com/qmth/distributed/print/api/NotifyApiController.java
  25. 2 2
      distributed-print/src/main/java/com/qmth/distributed/print/api/SysController.java
  26. 1 1
      distributed-print/src/main/java/com/qmth/distributed/print/api/TFCustomFlowController.java
  27. 1 1
      distributed-print/src/main/java/com/qmth/distributed/print/aspect/ApiControllerAspect.java
  28. 1 1
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/aspect/LogAspect.java
  29. 2 2
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/BasicAttachmentServiceImpl.java
  30. 2 2
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/BasicCourseServiceImpl.java
  31. 1 1
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/BasicStudentServiceImpl.java
  32. 2 2
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/SysOrgServiceImpl.java
  33. 1 1
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/SysRoleGroupMemberServiceImpl.java
  34. 2 2
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/SysRoleServiceImpl.java
  35. 2 2
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/SysUserServiceImpl.java
  36. 4 4
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/TBTaskServiceImpl.java
  37. 1 1
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/sync/TeachCloudReportTaskUtils.java
  38. 14 0
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/util/ResultUtil.java
  39. 1 1
      teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/SysController.java
  40. 1 1
      teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/TBExamStudentController.java
  41. 1 1
      teachcloud-report/src/main/java/com/qmth/teachcloud/report/aspect/ApiControllerAspect.java

+ 2 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ActivitiServiceImpl.java

@@ -372,7 +372,7 @@ public class ActivitiServiceImpl implements ActivitiService {
         } catch (Exception e) {
             log.error(SystemConstant.LOG_ERROR, e);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }
@@ -595,7 +595,7 @@ public class ActivitiServiceImpl implements ActivitiService {
         } catch (Exception e) {
             log.error(SystemConstant.LOG_ERROR, e);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 2 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamPaperStructureServiceImpl.java

@@ -232,7 +232,7 @@ public class ExamPaperStructureServiceImpl extends ServiceImpl<ExamPaperStructur
                     basicAttachmentService.deleteAttachment(basicAttachment);
                 }
                 if (e instanceof ApiException) {
-                    ResultUtil.error((ApiException) e, e.getMessage());
+                    ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
                 } else {
                     ResultUtil.error(e.getMessage());
                 }
@@ -282,7 +282,7 @@ public class ExamPaperStructureServiceImpl extends ServiceImpl<ExamPaperStructur
                 basicAttachmentService.deleteAttachment(basicAttachment);
             }
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/GradeBatchServiceImpl.java

@@ -373,7 +373,7 @@ public class GradeBatchServiceImpl extends ServiceImpl<GradeBatchMapper, GradeBa
         } catch (Exception e) {
             gradeBatch.setResult(TaskResultEnum.ERROR);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TFFlowJoinServiceImpl.java

@@ -77,7 +77,7 @@ public class TFFlowJoinServiceImpl extends ServiceImpl<TFFlowJoinMapper, TFFlowJ
         } catch (Exception e) {
             log.error(SystemConstant.LOG_ERROR, e);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncBasicClazzImportService.java

@@ -59,7 +59,7 @@ public class AsyncBasicClazzImportService extends AsyncImportTaskTemplete {
             stringJoinerSummary.add(MessageFormat.format("{0}{1}{2}{3}", DateUtil.format(new Date(), SystemConstant.DEFAULT_DATE_PATTERN), EXCEPTION_TITLE, EXCEPTION_DATA, e.getMessage()));
             tbTask.setResult(TaskResultEnum.ERROR);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncCreatePdfTempleteService.java

@@ -80,7 +80,7 @@ public class AsyncCreatePdfTempleteService extends AsyncCreateTaskTemplete {
                         || ((ApiException) e).getCode() == ExceptionResultEnum.EXAM_TASK_IS_NULL.getCode()) {
                     tbTask.setErrorMessage(e.getMessage());
                 }
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncDownloadPaperFileBatchService.java

@@ -59,7 +59,7 @@ public class AsyncDownloadPaperFileBatchService extends AsyncExportTaskTemplete
             stringJoinerSummary.add(MessageFormat.format("{0}{1}{2}{3}", DateUtil.format(new Date(), SystemConstant.DEFAULT_DATE_PATTERN), EXCEPTION_TITLE, EXCEPTION_DATA, e.getMessage()));
             tbTask.setResult(TaskResultEnum.ERROR);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncDownloadPdfTempleteService.java

@@ -59,7 +59,7 @@ public class AsyncDownloadPdfTempleteService extends AsyncExportTaskTemplete {
             stringJoinerSummary.add(MessageFormat.format("{0}{1}{2}{3}", DateUtil.format(new Date(), SystemConstant.DEFAULT_DATE_PATTERN), EXCEPTION_TITLE, EXCEPTION_DATA, e.getMessage()));
             tbTask.setResult(TaskResultEnum.ERROR);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncExaminationExportTemplateService.java

@@ -57,7 +57,7 @@ public class AsyncExaminationExportTemplateService extends AsyncExportTaskTemple
             stringJoinerSummary.add(MessageFormat.format("{0}{1}{2}{3}", DateUtil.format(new Date(), SystemConstant.DEFAULT_DATE_PATTERN), EXCEPTION_TITLE, EXCEPTION_DATA, e.getMessage()));
             tbTask.setResult(TaskResultEnum.ERROR);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 2 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncExaminationImportTemplateService.java

@@ -119,7 +119,7 @@ public class AsyncExaminationImportTemplateService extends AsyncImportTaskTemple
             examDetailService.deleteExaminationDataByExamDetailIds(examDetailIdList);
 
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }
@@ -277,7 +277,7 @@ public class AsyncExaminationImportTemplateService extends AsyncImportTaskTemple
             tbTask.setSummary(summary);
             tbTask.setResult(TaskResultEnum.ERROR);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncPaperReviewPdfExportService.java

@@ -54,7 +54,7 @@ public class AsyncPaperReviewPdfExportService extends AsyncExportTaskTemplete {
             stringJoinerSummary.add(MessageFormat.format("{0}{1}{2}{3}", DateUtil.format(new Date(), SystemConstant.DEFAULT_DATE_PATTERN), EXCEPTION_TITLE, EXCEPTION_DATA, e.getMessage()));
             tbTask.setResult(TaskResultEnum.ERROR);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncScoreBatchDownloadService.java

@@ -54,7 +54,7 @@ public class AsyncScoreBatchDownloadService extends AsyncExportTaskTemplete {
             stringJoinerSummary.add(MessageFormat.format("{0}{1}{2}{3}", DateUtil.format(new Date(), SystemConstant.DEFAULT_DATE_PATTERN), EXCEPTION_TITLE, EXCEPTION_DATA, e.getMessage()));
             tbTask.setResult(TaskResultEnum.ERROR);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncScoreExportService.java

@@ -52,7 +52,7 @@ public class AsyncScoreExportService extends AsyncExportTaskTemplete {
             stringJoinerSummary.add(MessageFormat.format("{0}{1}{2}{3}", DateUtil.format(new Date(), SystemConstant.DEFAULT_DATE_PATTERN), EXCEPTION_TITLE, EXCEPTION_DATA, e.getMessage()));
             tbTask.setResult(TaskResultEnum.ERROR);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncScorePushService.java

@@ -77,7 +77,7 @@ public class AsyncScorePushService extends AsyncPushTaskTemplate {
             tSyncExamLog.setEndTime(System.currentTimeMillis());
             tSyncExamLog.setResult(TaskResultEnum.ERROR);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncStatisticsDataImportService.java

@@ -57,7 +57,7 @@ public class AsyncStatisticsDataImportService extends AsyncImportTaskTemplete {
             stringJoinerSummary.add(MessageFormat.format("{0}{1}{2}{3}", DateUtil.format(new Date(), SystemConstant.DEFAULT_DATE_PATTERN), EXCEPTION_TITLE, EXCEPTION_DATA, e.getMessage()));
             tbTask.setResult(TaskResultEnum.ERROR);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncStudentDataImportService.java

@@ -70,7 +70,7 @@ public class AsyncStudentDataImportService extends AsyncImportTaskTemplete {
             stringJoinerSummary.add(MessageFormat.format("{0}{1}{2}{3}", DateUtil.format(new Date(), SystemConstant.DEFAULT_DATE_PATTERN), EXCEPTION_TITLE, EXCEPTION_DATA, e.getMessage()));
             tbTask.setResult(TaskResultEnum.ERROR);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncSysUserDataImportService.java

@@ -77,7 +77,7 @@ public class AsyncSysUserDataImportService extends AsyncImportTaskTemplete {
             stringJoinerSummary.add(MessageFormat.format("{0}{1}{2}{3}", DateUtil.format(new Date(), SystemConstant.DEFAULT_DATE_PATTERN), EXCEPTION_TITLE, EXCEPTION_DATA, e.getMessage()));
             tbTask.setResult(TaskResultEnum.ERROR);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncTaskReviewSampleExportService.java

@@ -51,7 +51,7 @@ public class AsyncTaskReviewSampleExportService extends AsyncExportTaskTemplete
             stringJoinerSummary.add(MessageFormat.format("{0}{1}{2}{3}", DateUtil.format(new Date(), SystemConstant.DEFAULT_DATE_PATTERN), EXCEPTION_TITLE, EXCEPTION_DATA, e.getMessage()));
             tbTask.setResult(TaskResultEnum.ERROR);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/export/AsyncExportTaskTemplete.java

@@ -62,7 +62,7 @@ public abstract class AsyncExportTaskTemplete {
             tbTask.setSummary(stringJoinerSummary.toString());
             tbTask.setResult(TaskResultEnum.ERROR);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/importData/AsyncImportTaskTemplete.java

@@ -102,7 +102,7 @@ public abstract class AsyncImportTaskTemplete {
 //                tbTask.setResetCount(new AtomicInteger(tbTask.getResetCount()).incrementAndGet());
 //            }
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/push/AsyncPushTaskTemplate.java

@@ -61,7 +61,7 @@ public abstract class AsyncPushTaskTemplate {
             tSyncExamLog.setSummary(stringJoinerSummary.toString());
             tSyncExamLog.setResult(TaskResultEnum.ERROR);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 5 - 5
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/TaskLogicServiceImpl.java

@@ -603,7 +603,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                     .eq(ExamDetail::getId, examDetailId);
             examDetailService.update(updateWrapper);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }
@@ -953,7 +953,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                 data[1] = data[1].substring(0, data[1].indexOf("'"));
                 throw ExceptionResultEnum.SQL_ERROR.exception("[" + FieldUniqueEnum.convertToTitle(columnStr) + "'" + data[1] + "']" + "数据不允许重复插入");
             } else if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }
@@ -1056,7 +1056,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
         } catch (Exception e) {
             log.error(SystemConstant.LOG_ERROR, e);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }
@@ -1264,7 +1264,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
         } catch (Exception e) {
             log.error(SystemConstant.LOG_ERROR, e);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }
@@ -1371,7 +1371,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
         } catch (Exception e) {
             log.error(SystemConstant.LOG_ERROR, e);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 1 - 1
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamTaskController.java

@@ -180,7 +180,7 @@ public class ExamTaskController {
                 basicAttachmentService.deleteAttachment(basicAttachment);
             }
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 1 - 1
distributed-print/src/main/java/com/qmth/distributed/print/api/NotifyApiController.java

@@ -138,7 +138,7 @@ public class NotifyApiController {
         } catch (Exception e) {
             log.error(SystemConstant.LOG_ERROR, e);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 2 - 2
distributed-print/src/main/java/com/qmth/distributed/print/api/SysController.java

@@ -476,7 +476,7 @@ public class SysController {
                 basicAttachmentService.deleteAttachment(basicAttachment);
             }
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }
@@ -552,7 +552,7 @@ public class SysController {
                 basicAttachmentService.deleteAttachment(basicTranslateAttachment);
             }
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 1 - 1
distributed-print/src/main/java/com/qmth/distributed/print/api/TFCustomFlowController.java

@@ -138,7 +138,7 @@ public class TFCustomFlowController {
                 String columnStr = errorColumn.substring(errorColumn.lastIndexOf("key") + 3, errorColumn.length()).replaceAll("'", "");
                 throw ExceptionResultEnum.SQL_ERROR.exception("[" + FieldUniqueEnum.convertToTitle(columnStr) + "]数据不允许重复插入");
             } else if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 1 - 1
distributed-print/src/main/java/com/qmth/distributed/print/aspect/ApiControllerAspect.java

@@ -75,7 +75,7 @@ public class ApiControllerAspect {
         } catch (Exception e) {
             log.error(SystemConstant.LOG_ERROR, e);
             if (e instanceof ApiException) {
-                return ResultUtil.error((ApiException) e, e.getMessage());
+                return ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 return ResultUtil.error(e.getMessage());
             }

+ 1 - 1
teachcloud-common/src/main/java/com/qmth/teachcloud/common/aspect/LogAspect.java

@@ -80,7 +80,7 @@ public class LogAspect {
             runStatus = "失败";
             log.error(SystemConstant.LOG_ERROR, e);
             if (e instanceof ApiException) {
-                return ResultUtil.error((ApiException) e, e.getMessage());
+                return ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 return ResultUtil.error(e.getMessage());
             }

+ 2 - 2
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/BasicAttachmentServiceImpl.java

@@ -97,7 +97,7 @@ public class BasicAttachmentServiceImpl extends ServiceImpl<BasicAttachmentMappe
             log.error(SystemConstant.LOG_ERROR, e);
             deleteAttachment(basicAttachment);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }
@@ -205,7 +205,7 @@ public class BasicAttachmentServiceImpl extends ServiceImpl<BasicAttachmentMappe
             log.error(SystemConstant.LOG_ERROR, e);
             deleteAttachment(basicAttachment);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 2 - 2
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/BasicCourseServiceImpl.java

@@ -164,7 +164,7 @@ public class BasicCourseServiceImpl extends ServiceImpl<BasicCourseMapper, Basic
                 String content = JdbcErrorUtil.parseErrorMsg(e.getMessage().toString());
                 throw ExceptionResultEnum.SQL_ERROR.exception(content);
             } else if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }
@@ -439,7 +439,7 @@ public class BasicCourseServiceImpl extends ServiceImpl<BasicCourseMapper, Basic
                     String content = JdbcErrorUtil.parseErrorMsg(e.getMessage().toString());
                     throw ExceptionResultEnum.SQL_ERROR.exception(content);
                 } else if (e instanceof ApiException) {
-                    ResultUtil.error((ApiException) e, e.getMessage());
+                    ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
                 } else {
                     ResultUtil.error(e.getMessage());
                 }

+ 1 - 1
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/BasicStudentServiceImpl.java

@@ -273,7 +273,7 @@ public class BasicStudentServiceImpl extends ServiceImpl<BasicStudentMapper, Bas
                 String content = JdbcErrorUtil.parseErrorMsg(e.getMessage().toString());
                 throw ExceptionResultEnum.SQL_ERROR.exception(content);
             } else if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 2 - 2
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/SysOrgServiceImpl.java

@@ -202,7 +202,7 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
                 String columnStr = errorColumn.substring(errorColumn.lastIndexOf("key") + 3, errorColumn.length()).replaceAll("'", "");
                 throw ExceptionResultEnum.SQL_ERROR.exception("[" + FieldUniqueEnum.convertToTitle(columnStr) + "]数据不允许重复插入");
             } else if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }
@@ -572,7 +572,7 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
                 String content = JdbcErrorUtil.parseErrorMsg(e.getMessage().toString());
                 throw ExceptionResultEnum.SQL_ERROR.exception(content);
             } else if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 1 - 1
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/SysRoleGroupMemberServiceImpl.java

@@ -102,7 +102,7 @@ public class SysRoleGroupMemberServiceImpl extends ServiceImpl<SysRoleGroupMembe
                     throw ExceptionResultEnum.SQL_ERROR.exception("[" + FieldUniqueEnum.convertToTitle(columnStr) + "]数据不允许重复插入");
                 }
             } else if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 2 - 2
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/SysRoleServiceImpl.java

@@ -160,7 +160,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
                 String columnStr = errorColumn.substring(errorColumn.lastIndexOf("key") + 3, errorColumn.length()).replaceAll("'", "");
                 throw ExceptionResultEnum.SQL_ERROR.exception("[" + FieldUniqueEnum.convertToTitle(columnStr) + "]数据不允许重复插入");
             } else if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }
@@ -234,7 +234,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
                 String columnStr = errorColumn.substring(errorColumn.lastIndexOf("key") + 3, errorColumn.length()).replaceAll("'", "");
                 throw ExceptionResultEnum.SQL_ERROR.exception("[" + FieldUniqueEnum.convertToTitle(columnStr) + "]数据不允许重复插入");
             } else if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 2 - 2
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/SysUserServiceImpl.java

@@ -607,7 +607,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
                 String content = JdbcErrorUtil.parseErrorMsg(e.getMessage().toString());
                 throw ExceptionResultEnum.SQL_ERROR.exception(content);
             } else if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }
@@ -701,7 +701,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
                 String columnStr = errorColumn.substring(errorColumn.lastIndexOf("key") + 3, errorColumn.length()).replaceAll("'", "");
                 throw ExceptionResultEnum.SQL_ERROR.exception("[" + FieldUniqueEnum.convertToTitle(columnStr) + "]数据不允许重复插入");
             } else if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 4 - 4
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/TBTaskServiceImpl.java

@@ -114,7 +114,7 @@ public class TBTaskServiceImpl extends ServiceImpl<TBTaskMapper, TBTask> impleme
         } catch (Exception e) {
             log.error(SystemConstant.LOG_ERROR, e);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }
@@ -151,7 +151,7 @@ public class TBTaskServiceImpl extends ServiceImpl<TBTaskMapper, TBTask> impleme
         } catch (Exception e) {
             log.error(SystemConstant.LOG_ERROR, e);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }
@@ -179,7 +179,7 @@ public class TBTaskServiceImpl extends ServiceImpl<TBTaskMapper, TBTask> impleme
         } catch (Exception e) {
             log.error(SystemConstant.LOG_ERROR, e);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }
@@ -196,7 +196,7 @@ public class TBTaskServiceImpl extends ServiceImpl<TBTaskMapper, TBTask> impleme
         } catch (Exception e) {
             log.error(SystemConstant.LOG_ERROR, e);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 1 - 1
teachcloud-common/src/main/java/com/qmth/teachcloud/common/sync/TeachCloudReportTaskUtils.java

@@ -251,7 +251,7 @@ public class TeachCloudReportTaskUtils {
         } catch (Exception e) {
             log.error(SystemConstant.LOG_ERROR, e);
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 14 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/util/ResultUtil.java

@@ -61,6 +61,20 @@ public class ResultUtil {
         throw new ApiException(e.getStatus(), e.getCode(), message, message);
     }
 
+    public static Result error(ApiException e, int code, String message) {
+        try {
+            StringJoiner stringJoiner = new StringJoiner("");
+            HttpServletRequest request = ServletUtil.getRequest();
+            stringJoiner.add("[error path]:").add(request.getServletPath()).add("\r\n");
+            stringJoiner.add("[status]:").add(String.valueOf(e.getStatus().value())).add("\r\n");
+            stringJoiner.add("[code]:").add(String.valueOf(code)).add("\r\n");
+            stringJoiner.add("[message]:").add(message);
+            log.error(SystemConstant.LOG_ERROR, stringJoiner.toString());
+        } catch (Exception e1) {
+        }
+        throw new ApiException(e.getStatus(), code, message, message);
+    }
+
     public static Result error(ExceptionResultEnum e, int code, String message) {
         try {
             StringJoiner stringJoiner = new StringJoiner("");

+ 1 - 1
teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/SysController.java

@@ -259,7 +259,7 @@ public class SysController {
                 basicAttachmentService.deleteAttachment(basicAttachment);
             }
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 1 - 1
teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/TBExamStudentController.java

@@ -80,7 +80,7 @@ public class TBExamStudentController {
                 basicAttachmentService.deleteAttachment(basicAttachment);
             }
             if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
+                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 ResultUtil.error(e.getMessage());
             }

+ 1 - 1
teachcloud-report/src/main/java/com/qmth/teachcloud/report/aspect/ApiControllerAspect.java

@@ -75,7 +75,7 @@ public class ApiControllerAspect {
         } catch (Exception e) {
             log.error(SystemConstant.LOG_ERROR, e);
             if (e instanceof ApiException) {
-                return ResultUtil.error((ApiException) e, e.getMessage());
+                return ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
                 return ResultUtil.error(e.getMessage());
             }