| | |
| | | * @param carIds 车辆id集合 |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/t-app-user-car/getCarByIds") |
| | | @PostMapping(value = "/t-app-user-car/t-app-user-car/getCarByIds") |
| | | public R<List<TAppUserCar>> getCarByIds(@RequestBody List<Long> carIds); |
| | | |
| | | |
| | |
| | | */ |
| | | @PostMapping("/grantCoupon") |
| | | public R grantCoupon(@RequestBody GrantCouponDto dto){ |
| | | dto.setWaysToObtain(3); |
| | | List<TAppCoupon> res = new ArrayList<>(); |
| | | TCoupon coupon = otherClient.getCouponById(dto.getCouponId()).getData(); |
| | | |
| | |
| | | break; |
| | | case 2: |
| | | // 根据市codes 查询用户ids |
| | | List<Long> collect1 = appUserService.list(new QueryWrapper<TAppUser>() |
| | | List<Long> collect1 = new ArrayList<>(); |
| | | // 根据市codes 查询用户ids |
| | | if (StringUtils.hasLength(dto.getProvinceCode())){ |
| | | List<Long> collect2 = appUserService.list(new QueryWrapper<TAppUser>() |
| | | .in("province_code", Arrays.asList(dto.getProvinceCode().split(",")))) |
| | | .stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | collect1.addAll(collect2); |
| | | } |
| | | if (StringUtils.hasLength(dto.getCityCode())){ |
| | | List<Long> collect2 = appUserService.list(new QueryWrapper<TAppUser>() |
| | | .in("city_code", Arrays.asList(dto.getCityCode().split(",")))) |
| | | .stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | collect1.addAll(collect2); |
| | | } |
| | | for (Long l : collect1) { |
| | | TAppCoupon tAppCoupon = new TAppCoupon(); |
| | | tAppCoupon.setAppUserId(l); |
| | |
| | | for (int i = 0; i < split1.length; i++) { |
| | | Integer reduce = tShoppingOrderService.list(new QueryWrapper<TShoppingOrder>() |
| | | .eq("order_type",1) |
| | | .ne("refund_status", 2)) |
| | | .eq("goods_id", split1[i]) |
| | | .isNull("refund_status")) |
| | | .stream().map(TShoppingOrder::getPurchaseQuantity).reduce(0, Integer::sum); |
| | | res.add(reduce); |
| | | } |
| | | break; |
| | | case 2: |
| | | for (int i = 0; i < split1.length; i++) { |
| | | Integer reduce = exchangeOrderService.list(new QueryWrapper<TExchangeOrder>().eq("order_type",1).ne("status",4).eq("goods_id", split1[i])) |
| | | Integer reduce = exchangeOrderService.list(new QueryWrapper<TExchangeOrder>().eq("order_type",1) |
| | | .ne("status",4).eq("goods_id", split1[i])) |
| | | .stream().map(TExchangeOrder::getPurchaseQuantity).reduce(0, Integer::sum); |
| | | res.add(reduce); |
| | | } |
| | |
| | | List<TOrderInvoiceVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | for (TOrderInvoiceVO tOrderInvoiceVO : list) { |
| | | tOrderInvoiceVO.setUid(tOrderInvoiceVO.getId().toString()); |
| | | List<Long> collect = orderInvoiceDetailService.lambdaQuery().eq(TOrderInvoiceDetail::getOrderInvoiceId, tOrderInvoiceVO.getId()) |
| | | .eq(TOrderInvoiceDetail::getOrderType, 1).list().stream() |
| | | List<Long> collect = orderInvoiceDetailService.lambdaQuery().eq(TOrderInvoiceDetail::getOrderInvoiceId, tOrderInvoiceVO.getId()).list().stream() |
| | | .map(TOrderInvoiceDetail::getOrderId).collect(Collectors.toList()); |
| | | // 将其全部转化为String |
| | | tOrderInvoiceVO.setIds(collect.stream().map(String::valueOf).collect(Collectors.toList())); |
| | | } |
| | | // 查询这个开票的订单ids |
| | | |
| | | if (!list.isEmpty()){ |
| | | List<Long> ids = list.stream().map(TOrderInvoiceVO::getId).collect(Collectors.toList()); |
| | | |
| | | List<TOrderInvoiceDetail> orderInvoiceDetailList = orderInvoiceDetailService.list(new LambdaQueryWrapper<TOrderInvoiceDetail>() |
| | |
| | | |
| | | List<TAppUser> finalTAppUsers = tAppUsers; |
| | | list.forEach(e->{ |
| | | if (e.getOrderType()!=null&&e.getOrderType()==1){ |
| | | e.setServiceTariff(orderInvoiceDetailList.get(0).getServiceTariff()); |
| | | }else{ |
| | | e.setServiceTariff(new BigDecimal("0")); |
| | | } |
| | | e.setElectricityTariff(orderInvoiceDetailList.get(0).getElectricityTariff()); |
| | | e.setAddedServiceTariff(orderInvoiceDetailList.get(0).getAddedServiceTariff()); |
| | | e.setAddedService(orderInvoiceDetailList.stream().filter(t->t.getAddedService()!=null).map(TOrderInvoiceDetail::getAddedService).reduce(BigDecimal::add).get()); |
| | |
| | | e.setUserPhone(finalTAppUsers.stream().filter(t->t.getId()!=null).filter(m->m.getId().equals(Long.parseLong(e.getBillingUserId().toString()))).findFirst().get().getPhone()); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | |
| | | <if test="null != req.code and req.code!=''"> |
| | | and t1.code LIKE CONCAT('%',#{req.code},'%') |
| | | </if> |
| | | <if test="null != req.status"> |
| | | and t1.status = #{req.status} |
| | | </if> |
| | | <if test="null != req.userIds and req.userIds.size()>0" > |
| | | and t1.app_user_id in |
| | | <foreach collection="req.userIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="null != req.couponIds and req.couponIds.size()>0 or null != req.couponIds and req.couponIds.size()>0" > |
| | | and (t1.goods_id in |
| | | <foreach collection="req.goodsIds" item="item" index="index" separator="," open="(" close=")"> |
| | | <if test="null != req.userIds and req.userIds.size()>0" > |
| | | and t1.app_user_id in |
| | | <foreach collection="req.userIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | or |
| | | </if> |
| | | |
| | | <if test="null != req.couponIds and req.couponIds.size()>0" > |
| | | and t1.coupon_id in |
| | | <foreach collection="req.couponIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | ) |
| | | </if> |
| | | <if test="null != req.goodsIds and req.goodsIds.size()>0" > |
| | | and t1.goods_id in |
| | | <foreach collection="req.goodsIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="startTime1 != null and startTime1!=''"> |
| | | and (t1.create_time between #{startTime1} and #{startTime2}) |
| | |
| | | <if test="null != req.code and req.code!=''"> |
| | | and t1.code LIKE CONCAT('%',#{req.code},'%') |
| | | </if> |
| | | <if test="null != req.status"> |
| | | and t1.status = #{req.status} |
| | | </if> |
| | | <if test="null != req.userIds and req.userIds.size()>0" > |
| | | and t1.app_user_id in |
| | | <foreach collection="req.userIds" item="item" index="index" separator="," open="(" close=")"> |
| | |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="null != req.couponIds and req.couponIds.size()>0 or null != req.couponIds and req.couponIds.size()>0" > |
| | | and (t1.goods_id in |
| | | <foreach collection="req.goodsIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | or |
| | | <if test="null != req.couponIds and req.couponIds.size()>0" > |
| | | and t1.coupon_id in |
| | | <foreach collection="req.couponIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | ) |
| | | </if> |
| | | <if test="null != req.goodsIds and req.goodsIds.size()>0" > |
| | | and t1.goods_id in |
| | | <foreach collection="req.goodsIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="startTime1 != null and startTime1!=''"> |
| | | and (t1.create_time between #{startTime1} and #{startTime2}) |
| | |
| | | and t1.vip_id = #{req.vipId} |
| | | </if> |
| | | <if test="startTime1 != null and startTime1!=''"> |
| | | and (t1.create_time between #{startTime1} and #{startTime2} |
| | | and t1.create_time between #{startTime1} and #{startTime2} |
| | | </if> |
| | | and t1.payment_status = 2 |
| | | AND t1.del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} |
| | |
| | | AND inventory = 0 |
| | | </if> |
| | | <if test="req.otherState != null and req.otherState ==3"> |
| | | AND status = 3 |
| | | AND status = 2 |
| | | </if> |
| | | AND del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} |
| | | </where> |