feat(crm): 支持按逗号分隔的状态列表查询PDI计划
- 兼容前端传入的逗号分隔状态字符串格式 - 支持中英文逗号及空格的自动处理 - 将状态查询从等值匹配改为in查询支持多状态筛选
This commit is contained in:
@@ -112,8 +112,15 @@ public class CrmPdiPlanServiceImpl extends ServiceImpl<CrmPdiPlanMapper, CrmPdiP
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 状态
|
// 状态
|
||||||
|
// 前端可能传 "NEW,READY,ONLINE,PRODUCING" 这种逗号分隔字符串,这里按 in 查询
|
||||||
if (StrUtil.isNotBlank(form.getStatus())) {
|
if (StrUtil.isNotBlank(form.getStatus())) {
|
||||||
queryWrapper.eq("status", form.getStatus());
|
String statusStr = form.getStatus();
|
||||||
|
// 兼容英文逗号/中文逗号、以及可能的空格
|
||||||
|
statusStr = statusStr.replace(',', ',');
|
||||||
|
List<String> statusList = StrUtil.splitTrim(statusStr, ',');
|
||||||
|
if (statusList != null && !statusList.isEmpty()) {
|
||||||
|
queryWrapper.in("status", statusList);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 如果没传状态,默认查 NEW 和 READY
|
// 如果没传状态,默认查 NEW 和 READY
|
||||||
queryWrapper.in("status", "NEW", "READY");
|
queryWrapper.in("status", "NEW", "READY");
|
||||||
|
|||||||
Reference in New Issue
Block a user