|
|
@@ -3,6 +3,7 @@ package com.zhongshu.card.server.core.dao.pay.impl;
|
|
|
import com.github.microservice.components.data.mongo.mongo.dao.MongoDao;
|
|
|
import com.github.microservice.components.data.mongo.mongo.helper.DBHelper;
|
|
|
import com.zhongshu.card.client.model.pay.WithdrawPageParam;
|
|
|
+import com.zhongshu.card.client.type.AuditStatus;
|
|
|
import com.zhongshu.card.client.type.WithdrawStatus;
|
|
|
import com.zhongshu.card.server.core.dao.pay.WithdrawOrderDao;
|
|
|
import com.zhongshu.card.server.core.dao.pay.extend.WithdrawOrderDaoExtend;
|
|
|
@@ -17,6 +18,7 @@ import org.springframework.data.mongodb.core.query.Criteria;
|
|
|
import org.springframework.data.mongodb.core.query.Query;
|
|
|
import org.springframework.data.mongodb.core.query.Update;
|
|
|
|
|
|
+import java.util.List;
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
public class WithdrawOrderDaoImpl implements WithdrawOrderDaoExtend {
|
|
|
@@ -28,7 +30,7 @@ public class WithdrawOrderDaoImpl implements WithdrawOrderDaoExtend {
|
|
|
MongoTemplate mongoTemplate;
|
|
|
|
|
|
@Override
|
|
|
- public Page<WithdrawOrder> page(Pageable pageable, String projectOid, String oid, Long startTime, Long endTime, String search) {
|
|
|
+ public Page<WithdrawOrder> page(Pageable pageable, String projectOid, String oid, Long startTime, Long endTime, String search, AuditStatus auditStatus) {
|
|
|
Criteria criteria = new Criteria();
|
|
|
|
|
|
if (StringUtils.isNotBlank(projectOid)) {
|
|
|
@@ -48,6 +50,14 @@ public class WithdrawOrderDaoImpl implements WithdrawOrderDaoExtend {
|
|
|
criteria.and("withdrawUser.name").regex(namePattern);
|
|
|
}
|
|
|
|
|
|
+ if (auditStatus != null) {
|
|
|
+ if (auditStatus.equals(AuditStatus.Processed)){
|
|
|
+ criteria.and("auditStatus").in(List.of(AuditStatus.Success, AuditStatus.Fail));
|
|
|
+ }else {
|
|
|
+ criteria.and("auditStatus").is(auditStatus);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
Query query = new Query(criteria);
|
|
|
query.with(Sort.by(Sort.Order.asc("sort"), Sort.Order.desc("createTime")));
|
|
|
return dbHelper.pages(query, pageable, WithdrawOrder.class);
|