Commit fc741fff authored by libin's avatar libin

会员订单列表

parent f37a491d
...@@ -425,7 +425,7 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> { ...@@ -425,7 +425,7 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
} }
public List<UserBo> findUserDetailInfo(List<UserBo> userBos) { public List<UserBo> findUserDetailInfo(List<UserBo> userBos) {
Map<Integer, Integer> userIdAndFacilitateIdMap = userBos.stream().filter(x->Objects.nonNull(x.getFacilitateId())).collect(Collectors.toMap(UserBo::getUserId, UserBo::getFacilitateId)); Map<String, Integer> userIdAndFacilitateIdMap = userBos.stream().filter(x->Objects.nonNull(x.getFacilitateId())).collect(Collectors.toMap(UserBo::getOrderNo, UserBo::getFacilitateId));
List<Integer> userIdList = userBos.stream().map(UserBo::getUserId).distinct().collect(Collectors.toList()); List<Integer> userIdList = userBos.stream().map(UserBo::getUserId).distinct().collect(Collectors.toList());
//查询上级人 //查询上级人
......
...@@ -43,5 +43,6 @@ public class MemberOrderBo { ...@@ -43,5 +43,6 @@ public class MemberOrderBo {
private BigDecimal couponAmount; private BigDecimal couponAmount;
private BigDecimal realAmount; private BigDecimal realAmount;
private Long payTime; private Long payTime;
private Integer hasPay;
} }
...@@ -346,9 +346,9 @@ public class OrderMemberService extends AbstractOrderHandle<OrderMemberDetailBiz ...@@ -346,9 +346,9 @@ public class OrderMemberService extends AbstractOrderHandle<OrderMemberDetailBiz
private MemberOrderStatisticsBo getMemberOrderStatisticsBo(List<MemberOrderBo> baseOrders){ private MemberOrderStatisticsBo getMemberOrderStatisticsBo(List<MemberOrderBo> baseOrders){
MemberOrderStatisticsBo memberOrderStatisticsBo = new MemberOrderStatisticsBo(); MemberOrderStatisticsBo memberOrderStatisticsBo = new MemberOrderStatisticsBo();
Map<BigDecimal, List<MemberOrderBo>> baseOrderMap = baseOrders.stream().collect(Collectors.groupingBy(MemberOrderBo::getOrderAmount, Collectors.toList())); Map<BigDecimal, List<MemberOrderBo>> baseOrderMap = baseOrders.stream().filter(x->x.getHasPay()==1).collect(Collectors.groupingBy(MemberOrderBo::getOrderAmount, Collectors.toList()));
memberOrderStatisticsBo.setOrderNum(baseOrders.size()); memberOrderStatisticsBo.setOrderNum(baseOrders.size());
BigDecimal totalAmount = baseOrders.stream().map(MemberOrderBo::getOrderAmount).reduce(BigDecimal.ZERO, (x, y) -> x.add(y)); BigDecimal totalAmount = baseOrders.stream().filter(x->x.getHasPay()==1).map(MemberOrderBo::getOrderAmount).reduce(BigDecimal.ZERO, (x, y) -> x.add(y));
memberOrderStatisticsBo.setTotalAmount(totalAmount); memberOrderStatisticsBo.setTotalAmount(totalAmount);
List<MemberOrderBo> diamondOrders = baseOrderMap.get(levelEnum.DIAMOND.getPrice()); List<MemberOrderBo> diamondOrders = baseOrderMap.get(levelEnum.DIAMOND.getPrice());
......
...@@ -297,6 +297,7 @@ ...@@ -297,6 +297,7 @@
`pay_time` AS `payTime`, `pay_time` AS `payTime`,
`coupon_amount` AS `couponAmount`, `coupon_amount` AS `couponAmount`,
`user_id` AS `userId`, `user_id` AS `userId`,
`has_pay` AS `hasPay`,
`member_level` AS `memberLevel`, `member_level` AS `memberLevel`,
`facilitate_id` AS `facilitateId`, `facilitate_id` AS `facilitateId`,
`facilitate_phone` AS `facilitatePhone` `facilitate_phone` AS `facilitatePhone`
...@@ -334,9 +335,6 @@ ...@@ -334,9 +335,6 @@
<if test="endPayTime!=null and startPayTime==null"> <if test="endPayTime!=null and startPayTime==null">
and `pay_time` <![CDATA[<=#{endPayTime}]]> and `pay_time` <![CDATA[<=#{endPayTime}]]>
</if> </if>
<if test="isPay == true">
and `has_pay`=1
</if>
<if test="userIds!=null and userIds.size()>0"> <if test="userIds!=null and userIds.size()>0">
and `user_id` IN and `user_id` IN
<foreach collection="userIds" item="userId" separator="," open="(" close=")"> <foreach collection="userIds" item="userId" separator="," open="(" close=")">
......
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