This commit is contained in:
van
2026-03-24 16:36:04 +08:00
parent 3d5ee6e624
commit 312a068bd3
2 changed files with 5 additions and 23 deletions

View File

@@ -24,8 +24,7 @@ public class RebateRemarkItem {
private Long uploadRecordId; private Long uploadRecordId;
/** /**
* 是否判定为异常(空「是否返现」、待补/下次做表等关键词) * 是否异常:导入时「是否返现」列 trim 后不等于「已返现」则为 true便于列表筛选与着色
* 便于列表筛选与着色
*/ */
private Boolean abnormal; private Boolean abnormal;
} }

View File

@@ -42,7 +42,6 @@ import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.Set; import java.util.Set;
import java.util.regex.Pattern;
/** /**
* 解析跟团返现类 Excel表头含单号、是否返现、返现金额等写入订单后返备注 JSON并保存上传文件与数据库记录。 * 解析跟团返现类 Excel表头含单号、是否返现、返现金额等写入订单后返备注 JSON并保存上传文件与数据库记录。
@@ -56,12 +55,6 @@ public class GroupRebateExcelImportService {
private static final String[] EXCEL_EXT = { "xls", "xlsx" }; private static final String[] EXCEL_EXT = { "xls", "xlsx" };
private static final Pattern ABNORMAL_HINT = Pattern.compile(
".*(异常|待补|待返|下次|驳回|未返|不返|暂缓|缺|补表|重做|暂无|无$|-).*", Pattern.CASE_INSENSITIVE);
private static final Pattern POSITIVE_HINT = Pattern.compile(
".*(已返|已返现|正常|完成|通过|✓|√|到账).*", Pattern.CASE_INSENSITIVE);
@Resource @Resource
private JDOrderMapper jdOrderMapper; private JDOrderMapper jdOrderMapper;
@@ -609,24 +602,14 @@ public class GroupRebateExcelImportService {
jdOrderMapper.updateJDOrder(upd); jdOrderMapper.updateJDOrder(upd);
} }
/**
* 异常项:「是否返现」列经 trim 后不等于「已返现」(含空、其它文案)。
*/
static boolean isAbnormalWhetherRebate(String text) { static boolean isAbnormalWhetherRebate(String text) {
if (text == null) { if (text == null) {
return true; return true;
} }
String t = text.trim(); return !"已返现".equals(text.trim());
if (t.isEmpty()) {
return true;
}
if ("-".equals(t) || "".equals(t) || "暂无".equals(t) || "".equals(t)) {
return true;
}
if (POSITIVE_HINT.matcher(t).matches() && !ABNORMAL_HINT.matcher(t).matches()) {
return false;
}
if (ABNORMAL_HINT.matcher(t).matches()) {
return true;
}
return false;
} }
private static int findHeaderRowIndex(Sheet sheet) { private static int findHeaderRowIndex(Sheet sheet) {