Browse Source

feature 修改错误提示信息

xiahan 4 months ago
parent
commit
a0fbda28b4

+ 5 - 9
zhsw-common/src/main/java/com/rongwei/zhsw/system/importListener/MeterReadingRecordListener.java

@@ -100,15 +100,13 @@ public class MeterReadingRecordListener extends AnalysisEventListener<ImportMete
     public void doAfterAllAnalysed(AnalysisContext analysisContext) {
         if (!duplicateRecordList.isEmpty()) {
             throw new CustomException(
-                    "Excel表中" +
-                            duplicateRecordList.stream().map(ImportMeterReadingRecordVo::getAccountNumber).collect(Collectors.joining("、"))
-                            + "户号存在相同抄表日期记录,请检查!");
+                    "Excel表中存在相同抄表日期记录,请检查! 户号为:" +
+                            duplicateRecordList.stream().map(ImportMeterReadingRecordVo::getAccountNumber).collect(Collectors.joining("、")));
         }
         if (!timeAnomalyList.isEmpty()) {
             throw new CustomException(
-                    "Excel表中" +
-                            timeAnomalyList.stream().map(ImportMeterReadingRecordVo::getAccountNumber).collect(Collectors.joining("、"))
-                            + "户号存在抄表日期大于当前日期的记录,请检查!");
+                    "Excel表中存在抄表日期大于当前日期的记录,请检查!  户号为:" +
+                            timeAnomalyList.stream().map(ImportMeterReadingRecordVo::getAccountNumber).collect(Collectors.joining("、")));
         }
         if (recordList.isEmpty()) {
             return;
@@ -135,9 +133,7 @@ public class MeterReadingRecordListener extends AnalysisEventListener<ImportMete
                 .collect(Collectors.joining(" "));
         if (StringUtils.isNotBlank(errorStrDesc)) {
             throw new CustomException(
-                    "Excel表中" +
-                            errorStrDesc
-                            + "记录日期小于对应用户最近抄表日期,请检查!");
+                    "Excel表中存在抄表日期小于对应用户最近抄表日期,请检查! 错误信息为:" +errorStrDesc );
         }
         // 按照户号分组 减少遍历时间
         Map<String, SwUserManagementDo> userMap = allAccountData.stream().collect(Collectors.groupingBy(SwUserManagementDo::getUsernumber,