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

Commit 2c8f4a37 authored by 胡佳晨's avatar 胡佳晨

分页提交

parent 3837a853
......@@ -752,7 +752,8 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
} else {//演出列表
try {
PageHelper.startPage(performancePartnerListParam.getPage(), performancePartnerListParam.getSize());
List<PerformancePartnerListDao> voList = mongoSlimeUtils.getPerformanceList(performancePartnerListParam);
HashMap<String,Object> map = mongoSlimeUtils.getPerformanceList(performancePartnerListParam);
List<PerformancePartnerListDao> voList = (List<PerformancePartnerListDao>) map.get("data");
for (int i = 0; i < voList.size(); i++) {
PerformancePartnerListDao vo = voList.get(i);
vo.setSaleGeneral(vo.getNumber() - vo.getRefundNumber());
......@@ -772,6 +773,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
}
}
pageInfoTmp = new PageInfo(voList);
pageInfoTmp.setTotal((Long) map.get("total"));
} catch (Exception e) {
e.printStackTrace();
return ResponseDto.failure(ErrorMapping.get(20104));
......
package com.liquidnet.service.slime.util;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.service.kylin.dao.PerformancePartnerListDao;
import com.liquidnet.service.kylin.dto.param.PerformancePartnerListParam;
......@@ -255,7 +256,7 @@ public class MongoSlimeUtils {
return docTicket;
}
public List<PerformancePartnerListDao> getPerformanceList(PerformancePartnerListParam performancePartnerListParam) {
public HashMap<String,Object> getPerformanceList(PerformancePartnerListParam performancePartnerListParam) {
performancePartnerListParam.setOrderType(performancePartnerListParam.getOrderType());
//分页排序
Sort.Direction orderBy = Sort.Direction.DESC;
......@@ -303,6 +304,11 @@ public class MongoSlimeUtils {
.skip(((performancePartnerListParam.getPage() - 1) * performancePartnerListParam.getSize()))
.limit(performancePartnerListParam.getSize()),
KylinPerformanceVo.class, KylinPerformanceVo.class.getSimpleName());
long total = mongoTemplate.count(
Query.query(new Criteria().andOperator(criteria).orOperator(criteriaPerformanceId, Criteria.where("merchantId").is(performancePartnerListParam.getMerchantId())))
.with(Sort.by(orderBy, performancePartnerListParam.getOrderItem())),
KylinPerformanceVo.class, KylinPerformanceVo.class.getSimpleName());
//查询销量
Aggregation aggregation = Aggregation.newAggregation(
Aggregation.match(Criteria.where("status").in(0, 1, 3, 6).and("couponType").is("no").and("transferStatus").in(0, 1, 2, 5).and("performanceId").in(performanceIdList)),
......@@ -404,8 +410,10 @@ public class MongoSlimeUtils {
}
list.add(dao);
}
return list;
HashMap<String ,Object> map = CollectionUtil.mapStringObject();
map.put("data",list);
map.put("total",total);
return map;
}
public List<PerformancePartnerListDao> getPerformanceListField(PerformancePartnerListParam performancePartnerListParam) {
......
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