puzhibing
2024-09-29 07aa59cf3e26a25792f40ec8e92f316e907aec9c
合併代碼
8个文件已修改
73 ■■■■ 已修改文件
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserCarClient.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppCouponController.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TExchangeOrderController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderInvoiceServiceImpl.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TExchangeOrderMapper.xml 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TShoppingOrderMapper.xml 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TVipOrderMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TGoodsMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserCarClient.java
@@ -26,7 +26,7 @@
     * @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);
    
    
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppCouponController.java
@@ -223,6 +223,7 @@
     */
    @PostMapping("/grantCoupon")
    public R  grantCoupon(@RequestBody GrantCouponDto dto){
        dto.setWaysToObtain(3);
        List<TAppCoupon> res = new ArrayList<>();
        TCoupon coupon = otherClient.getCouponById(dto.getCouponId()).getData();
@@ -246,9 +247,20 @@
                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);
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TExchangeOrderController.java
@@ -202,14 +202,16 @@
                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);
                }
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderInvoiceServiceImpl.java
@@ -263,14 +263,14 @@
        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>()
@@ -278,7 +278,11 @@
        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());
@@ -288,6 +292,8 @@
                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;
ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TExchangeOrderMapper.xml
@@ -37,23 +37,33 @@
        <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})
ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TShoppingOrderMapper.xml
@@ -231,6 +231,9 @@
        <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=")">
@@ -238,17 +241,17 @@
            </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})
ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TVipOrderMapper.xml
@@ -42,7 +42,7 @@
            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()}
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TGoodsMapper.xml
@@ -46,7 +46,7 @@
                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>