1
This commit is contained in:
@@ -24,8 +24,7 @@ public class RebateRemarkItem {
|
||||
private Long uploadRecordId;
|
||||
|
||||
/**
|
||||
* 是否判定为异常(空「是否返现」、待补/下次做表等关键词)
|
||||
* 便于列表筛选与着色
|
||||
* 是否异常:导入时「是否返现」列 trim 后不等于「已返现」则为 true,便于列表筛选与着色
|
||||
*/
|
||||
private Boolean abnormal;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,6 @@ import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* 解析跟团返现类 Excel(表头含单号、是否返现、返现金额等),写入订单后返备注 JSON;并保存上传文件与数据库记录。
|
||||
@@ -56,12 +55,6 @@ public class GroupRebateExcelImportService {
|
||||
|
||||
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
|
||||
private JDOrderMapper jdOrderMapper;
|
||||
|
||||
@@ -609,24 +602,14 @@ public class GroupRebateExcelImportService {
|
||||
jdOrderMapper.updateJDOrder(upd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 异常项:「是否返现」列经 trim 后不等于「已返现」(含空、其它文案)。
|
||||
*/
|
||||
static boolean isAbnormalWhetherRebate(String text) {
|
||||
if (text == null) {
|
||||
return true;
|
||||
}
|
||||
String t = 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;
|
||||
return !"已返现".equals(text.trim());
|
||||
}
|
||||
|
||||
private static int findHeaderRowIndex(Sheet sheet) {
|
||||
|
||||
Reference in New Issue
Block a user