记得上下班打卡 | git大法好,push需谨慎

Commit 28e4abab authored by 胡佳晨's avatar 胡佳晨

修改资金列表bug

parent 8d5bbc69
...@@ -845,13 +845,6 @@ public class GoblinMongoUtils { ...@@ -845,13 +845,6 @@ public class GoblinMongoUtils {
int finalCount = skipCount + size; int finalCount = skipCount + size;
List<GoblinGoodsInfoVo> spuIdAndName = null; List<GoblinGoodsInfoVo> spuIdAndName = null;
Criteria criteria = Criteria.where("status").in(GoblinStatusConst.Status.ORDER_LOG_STATUS_11.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_22.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_28.getValue()).and("storeId").is(storeId); Criteria criteria = Criteria.where("status").in(GoblinStatusConst.Status.ORDER_LOG_STATUS_11.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_22.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_28.getValue()).and("storeId").is(storeId);
if (spuName != null) {
//根据spu名称查询spuId
Query query = Query.query(Criteria.where("name").regex(".*?" + spuName + ".*").and("storeId").is(storeId));
query.fields().include("spuId").include("name");
spuIdAndName = mongoTemplate.find(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
criteria = criteria.and("spuId").in(spuIdAndName.stream().map(GoblinGoodsInfoVo::getSpuId).collect(Collectors.toList()));
}
if (st != null && et != null) { if (st != null && et != null) {
criteria = criteria.and("createdAt").gte(st).lt(et); criteria = criteria.and("createdAt").gte(st).lt(et);
} }
...@@ -862,9 +855,20 @@ public class GoblinMongoUtils { ...@@ -862,9 +855,20 @@ public class GoblinMongoUtils {
List<String> spuIdList = countList.stream().map(GoblinOrderLogVo::getSpuId).distinct().collect(Collectors.toList()); List<String> spuIdList = countList.stream().map(GoblinOrderLogVo::getSpuId).distinct().collect(Collectors.toList());
long total = spuIdList.size(); long total = spuIdList.size();
if (finalCount > total) { if (finalCount > total) {
finalCount = (int) total; finalCount = (int) total - 1;
}
if (spuName != null) {
//根据spu名称查询spuId
Query query = Query.query(Criteria.where("name").regex(".*?" + spuName + ".*").and("storeId").is(storeId));
query.fields().include("spuId").include("name");
spuIdAndName = mongoTemplate.find(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
spuIdList = spuIdAndName.stream().map(GoblinGoodsInfoVo::getSpuId).collect(Collectors.toList());
if (finalCount > spuIdList.size()) {
finalCount = spuIdList.size() - 1;
}
} }
criteria = criteria.and("spuId").in(spuIdList.subList(skipCount, finalCount)); criteria = criteria.and("spuId").in(spuIdList.subList(skipCount, finalCount));
//查询聚合数据 //查询聚合数据
Aggregation aggregation = Aggregation.newAggregation( Aggregation aggregation = Aggregation.newAggregation(
Aggregation.match(criteria), Aggregation.match(criteria),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment