| | |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TBranchOfficeResp; |
| | | import com.stylefeng.guns.modular.system.dao.*; |
| | | import com.stylefeng.guns.modular.system.enums.StatusEnum; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.ITBranchOfficeService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | |
| | | |
| | | // 优惠券数据,,,通过订单找到该区域的下单人,找出优惠券信息 |
| | | List<Integer> userIds = orders.stream().map(TOrder::getUserId).collect(Collectors.toList()); |
| | | List<TUserToCoupon> tUserToCoupons = tUserToCouponMapper.selectList(new EntityWrapper<TUserToCoupon>().in("userId", userIds)); |
| | | List<TUserToCoupon> tUserToCoupons = tUserToCouponMapper.selectList(new EntityWrapper<TUserToCoupon>().eq("objectId", tBranchOfficeId) |
| | | .eq("roleType",2)); |
| | | // 优惠券有效数量 |
| | | int validCount = tUserToCoupons.stream().mapToInt(TUserToCoupon::getValidCount).sum(); |
| | | // 过期数量 |
| | |
| | | if(Objects.nonNull(status)){ |
| | | wrapper.eq("status",status); |
| | | } |
| | | wrapper.ne("status", StatusEnum.DELETE.getCode()); |
| | | wrapper.orderBy("createTime",false); |
| | | // 判断代理商 分公司 |
| | | Integer roleType = Objects.requireNonNull(ShiroKit.getUser()).getRoleType(); |
| | | Integer objectId = Objects.requireNonNull(ShiroKit.getUser()).getObjectId(); |
| | |
| | | |
| | | // 优惠券数据,,,通过订单找到该区域的下单人,找出优惠券信息 |
| | | List<Integer> userIds = orderList.stream().map(TOrder::getUserId).collect(Collectors.toList()); |
| | | List<TUserToCoupon> tUserToCoupons = tUserToCouponMapper.selectList(new EntityWrapper<TUserToCoupon>().in("userId", userIds)); |
| | | List<TUserToCoupon> tUserToCoupons = tUserToCouponMapper.selectList(new EntityWrapper<TUserToCoupon>().eq("objectId", tBranchOfficeResp.getId()) |
| | | .eq("roleType",2)); |
| | | // 优惠券有效数量 |
| | | int validCount = tUserToCoupons.stream().mapToInt(TUserToCoupon::getValidCount).sum(); |
| | | // 过期数量 |