xuhy
2024-08-07 ed2dc880efb818edf48a1ac46709397c18cd52dc
Merge remote-tracking branch 'origin/master'
19个文件已修改
2个文件已删除
3个文件已添加
362 ■■■■ 已修改文件
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/OrderFallbackFactory.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/OrderClient.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-order/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/TActivity.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/TGoods.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/GoodsDTO.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/GoodsFallbackFactory.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/OtherFallbackFactory.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/GoodsClient.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/OtherClient.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/ServiceNameConstants.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/pom.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TActivityController.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TAdvertisingController.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TGoodsController.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TActivityMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TGoodsMapper.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TActivityService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TGoodsService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TActivityServiceImpl.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TAdvertisingServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TGoodsServiceImpl.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/resources/mapper/TActivityMapper.xml 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/resources/mapper/TGoodsMapper.xml 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/OrderFallbackFactory.java
New file
@@ -0,0 +1,27 @@
package com.ruoyi.order.api.factory;
import com.ruoyi.order.api.feignClient.ChargingOrderClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
/**
 * 充电订单服务降级处理
 *
 * @author ruoyi
 */
@Component
public class OrderFallbackFactory implements FallbackFactory<ChargingOrderClient>
{
    private static final Logger log = LoggerFactory.getLogger(OrderFallbackFactory.class);
    @Override
    public ChargingOrderClient create(Throwable cause) {
        log.error("商品订单调用失败:{}", cause.getMessage());
        return new ChargingOrderClient() {
        };
    }
}
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/OrderClient.java
New file
@@ -0,0 +1,21 @@
package com.ruoyi.order.api.feignClient;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.order.api.factory.ChargingOrderFallbackFactory;
import com.ruoyi.order.api.factory.OrderFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import java.util.List;
/**
 * 后台订单服务
 * @author ruoyi
 */
@FeignClient(contextId = "OrderClient", value = ServiceNameConstants.CONTRACT_ORDER, fallbackFactory = OrderFallbackFactory.class)
public interface OrderClient {
    @PostMapping("/t-exchange-order/getSalesCountByGoodsIds")
    R<List<Integer>> getSalesCountByGoodsId(String goodsIds);
}
ruoyi-api/ruoyi-api-order/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -1 +1,2 @@
com.ruoyi.order.api.factory.ChargingOrderFallbackFactory
com.ruoyi.order.api.factory.ChargingOrderFallbackFactory
com.ruoyi.order.api.factory.OrderFallbackFactory
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/TActivity.java
@@ -58,7 +58,9 @@
    @TableField("status")
    private Integer status;
    @ApiModelProperty(value = "活动状态 1未开始 2已开始 3已结束")
    @TableField(exist = false)
    private Integer startState;
}
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/TGoods.java
@@ -100,6 +100,8 @@
    private Integer status;
    @ApiModelProperty(value = "销量")
    @TableField(exist = false)
    private Integer salesCount;
}
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/dto/GoodsDTO.java
New file
@@ -0,0 +1,19 @@
package com.ruoyi.other.api.dto;
import com.ruoyi.common.core.web.page.BasePage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("商品管理列表查询DTO")
public class GoodsDTO extends BasePage {
    @ApiModelProperty(value = "商品状态 1上架 2下架")
    private Integer status;
    @ApiModelProperty(value = "商品名称")
    private String name;
    @ApiModelProperty(value = "1现金购买 2积分兑换 ")
    private Integer type;
    @ApiModelProperty(value = "1全部 2已售罄 ")
    private Integer otherState;
}
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/GoodsFallbackFactory.java
File was deleted
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/OtherFallbackFactory.java
@@ -4,7 +4,6 @@
import com.ruoyi.account.api.dto.UnitListQueryDto;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.other.api.domain.TCompany;
import com.ruoyi.other.api.feignClient.GoodsClient;
import com.ruoyi.other.api.feignClient.OtherClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/GoodsClient.java
File was deleted
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/OtherClient.java
@@ -5,7 +5,6 @@
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.other.api.domain.TCompany;
import com.ruoyi.other.api.factory.GoodsFallbackFactory;
import com.ruoyi.other.api.factory.OtherFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/ServiceNameConstants.java
@@ -35,4 +35,5 @@
     * 车辆合同的serviceid
     */
    public static final String CONTRACT_SERVICE = "ruoyi-contract";
    public static final String CONTRACT_ORDER = "ruoyi-order";
}
ruoyi-service/ruoyi-other/pom.xml
@@ -24,6 +24,14 @@
        <dependency>
            <groupId>com.ruoyi</groupId>
            <artifactId>ruoyi-api-other</artifactId>
            <version>3.6.2</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.ruoyi</groupId>
            <artifactId>ruoyi-api-order</artifactId>
            <version>3.6.2</version>
            <scope>compile</scope>
        </dependency>
        <!-- SpringCloud Alibaba Nacos Config -->
        <dependency>
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TActivityController.java
@@ -1,9 +1,16 @@
package com.ruoyi.other.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.PageInfo;
import com.ruoyi.other.api.domain.TActivity;
import com.ruoyi.other.api.domain.TAdvertising;
import com.ruoyi.other.api.dto.AdvertisingDTO;
import com.ruoyi.other.service.TActivityService;
import com.ruoyi.other.service.TAdvertisingService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
 * <p>
@@ -14,8 +21,38 @@
 * @since 2024-08-06
 */
@RestController
@RequestMapping("/t-activity")
@RequestMapping("/activity")
public class TActivityController {
    @Autowired
    private TActivityService activityService;
    @PostMapping("/saveActivity")
    @ApiOperation(tags = {"管理后台-活动管理"},value = "活动添加")
    public AjaxResult saveActivity(@RequestBody TActivity dto) {
        activityService.save(dto);
        return AjaxResult.success();
    }
    @GetMapping("/delete")
    @ApiOperation(tags = {"管理后台-活动管理"},value = "活动删除")
    public AjaxResult delete(Integer id) {
        activityService.removeById(id);
        return AjaxResult.success();
    }
    @PostMapping("/updateVip")
    @ApiOperation(tags = {"管理后台-活动管理"},value = "活动修改")
    public AjaxResult updateActivity(@RequestBody TActivity dto) {
        activityService.updateById(dto);
        return AjaxResult.success();
    }
    @GetMapping("/getInfo")
    @ApiOperation(tags = {"管理后台-活动管理"},value = "活动查看详情")
    public AjaxResult<TActivity> getInfo(Integer id) {
        return AjaxResult.ok(activityService.getById(id));
    }
    @ApiOperation(tags = {"管理后台-活动管理"},value = "活动列表分页查询")
    @PostMapping(value = "/pageList")
    public AjaxResult<PageInfo<TActivity>> pageList(@RequestBody AdvertisingDTO dto) {
        return AjaxResult.ok(activityService.pageList(dto));
    }
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TAdvertisingController.java
@@ -29,31 +29,31 @@
    @Autowired
    private TAdvertisingService advertisingService;
    @PostMapping("/saveAdvertising")
    @ApiOperation(value = "广告添加")
    @ApiOperation(tags = {"管理后台-广告管理"},value = "广告添加")
    public AjaxResult saveAdvertising(@RequestBody TAdvertising dto) {
        advertisingService.save(dto);
        return AjaxResult.success();
    }
    @GetMapping("/delete")
    @ApiOperation(value = "广告删除")
    @ApiOperation(tags = {"管理后台-广告管理"},value = "广告删除")
    public AjaxResult delete(Integer id) {
        advertisingService.removeById(id);
        return AjaxResult.success();
    }
    @PostMapping("/updateVip")
    @ApiOperation(value = "广告修改")
    @ApiOperation(tags = {"管理后台-广告管理"},value = "广告修改")
    public AjaxResult updateVip(@RequestBody TAdvertising dto) {
        advertisingService.updateById(dto);
        return AjaxResult.success();
    }
    @GetMapping("/getInfo")
    @ApiOperation(value = "广告查看详情")
    @ApiOperation(tags = {"管理后台-广告管理"},value = "广告查看详情")
    public AjaxResult<TAdvertising> getInfo(Integer id) {
        return AjaxResult.ok(advertisingService.getById(id));
    }
    @ApiOperation(value = "广告列表分页查询")
    @ApiOperation(tags = {"管理后台-广告管理"},value = "广告列表分页查询")
    @PostMapping(value = "/pageList")
    public AjaxResult<PageInfo<TAdvertising>> pageList(AdvertisingDTO dto) {
    public AjaxResult<PageInfo<TAdvertising>> pageList(@RequestBody AdvertisingDTO dto) {
        return AjaxResult.ok(advertisingService.pageList(dto));
    }
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TGoodsController.java
@@ -1,9 +1,18 @@
package com.ruoyi.other.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.PageInfo;
import com.ruoyi.other.api.domain.TActivity;
import com.ruoyi.other.api.domain.TGoods;
import com.ruoyi.other.api.dto.AdvertisingDTO;
import com.ruoyi.other.api.dto.GoodsDTO;
import com.ruoyi.other.service.TActivityService;
import com.ruoyi.other.service.TAdvertisingService;
import com.ruoyi.other.service.TGoodsService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
 * <p>
@@ -16,6 +25,37 @@
@RestController
@RequestMapping("/t-goods")
public class TGoodsController {
    @Autowired
    private TGoodsService goodsService;
    @Autowired
    private TActivityService activityService;
    @PostMapping("/saveGoods")
    @ApiOperation(tags = {"管理后台-商品管理"},value = "商品添加")
    public AjaxResult saveActivity(@RequestBody TGoods dto) {
        goodsService.save(dto);
        return AjaxResult.success();
    }
    @GetMapping("/delete")
    @ApiOperation(tags = {"管理后台-商品管理"},value = "商品删除")
    public AjaxResult delete(Integer id) {
        goodsService.removeById(id);
        return AjaxResult.success();
    }
    @PostMapping("/updateVip")
    @ApiOperation(tags = {"管理后台-商品管理"},value = "商品修改")
    public AjaxResult updateActivity(@RequestBody TGoods dto) {
        goodsService.updateById(dto);
        return AjaxResult.success();
    }
    @GetMapping("/getInfo")
    @ApiOperation(tags = {"管理后台-商品管理"},value = "商品查看详情")
    public AjaxResult<TGoods> getInfo(Integer id) {
        return AjaxResult.ok(goodsService.getById(id));
    }
    @ApiOperation(tags = {"管理后台-商品管理"},value = "商品列表分页查询")
    @PostMapping(value = "/pageList")
    public AjaxResult<PageInfo<TGoods>> pageList(@RequestBody GoodsDTO dto) {
        return AjaxResult.ok(goodsService.pageList(dto));
    }
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TActivityMapper.java
@@ -1,7 +1,13 @@
package com.ruoyi.other.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.common.core.web.page.PageInfo;
import com.ruoyi.other.api.domain.TActivity;
import com.ruoyi.other.api.domain.TAdvertising;
import com.ruoyi.other.api.dto.AdvertisingDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
 * <p>
@@ -13,4 +19,5 @@
 */
public interface TActivityMapper extends BaseMapper<TActivity> {
    List<TActivity> pageList(@Param("pageInfo")PageInfo<TActivity> pageInfo, @Param("req") AdvertisingDTO dto);
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TGoodsMapper.java
@@ -1,7 +1,13 @@
package com.ruoyi.other.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.common.core.web.page.PageInfo;
import com.ruoyi.other.api.domain.TActivity;
import com.ruoyi.other.api.domain.TGoods;
import com.ruoyi.other.api.dto.GoodsDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
 * <p>
@@ -13,4 +19,6 @@
 */
public interface TGoodsMapper extends BaseMapper<TGoods> {
    List<TGoods> pageList(@Param("pageInfo")PageInfo<TGoods> pageInfo, @Param("req") GoodsDTO dto);
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TActivityService.java
@@ -1,7 +1,9 @@
package com.ruoyi.other.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.web.page.PageInfo;
import com.ruoyi.other.api.domain.TActivity;
import com.ruoyi.other.api.dto.AdvertisingDTO;
/**
 * <p>
@@ -13,4 +15,5 @@
 */
public interface TActivityService extends IService<TActivity> {
    PageInfo<TActivity> pageList(AdvertisingDTO dto);
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TGoodsService.java
@@ -1,7 +1,9 @@
package com.ruoyi.other.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.web.page.PageInfo;
import com.ruoyi.other.api.domain.TGoods;
import com.ruoyi.other.api.dto.GoodsDTO;
/**
 * <p>
@@ -13,4 +15,6 @@
 */
public interface TGoodsService extends IService<TGoods> {
    PageInfo<TGoods> pageList(GoodsDTO dto);
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TActivityServiceImpl.java
@@ -1,10 +1,16 @@
package com.ruoyi.other.service.impl;
import com.ruoyi.common.core.web.page.PageInfo;
import com.ruoyi.other.api.domain.TActivity;
import com.ruoyi.other.api.domain.TAdvertising;
import com.ruoyi.other.api.dto.AdvertisingDTO;
import com.ruoyi.other.mapper.TActivityMapper;
import com.ruoyi.other.service.TActivityService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.List;
/**
 * <p>
@@ -17,4 +23,22 @@
@Service
public class TActivityServiceImpl extends ServiceImpl<TActivityMapper, TActivity> implements TActivityService {
    @Override
    public PageInfo<TActivity> pageList(AdvertisingDTO dto) {
        PageInfo<TActivity> pageInfo = new PageInfo<>(dto.getPageCurr(),dto.getPageSize());
        List<TActivity> list = this.baseMapper.pageList(pageInfo,dto);
        for (TActivity tAdvertising : list) {
            // 如果开始时间大于当前时间 那么设置状态startState为1 未开始
            if (tAdvertising.getStartTime().isAfter(LocalDateTime.now())) {
                tAdvertising.setStartState(1);
            } else if (tAdvertising.getEndTime().isBefore(LocalDateTime.now())) {
                tAdvertising.setStartState(3);
            } else {
                tAdvertising.setStartState(2);
            }
        }
        pageInfo.setRecords(list);
        return pageInfo;
    }
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TAdvertisingServiceImpl.java
@@ -9,6 +9,7 @@
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.List;
/**
@@ -25,8 +26,18 @@
    @Override
    public PageInfo<TAdvertising> pageList(AdvertisingDTO dto) {
        PageInfo<TAdvertising> pageInfo = new PageInfo<>(dto.getStartState(),dto.getPageSize());
        PageInfo<TAdvertising> pageInfo = new PageInfo<>(dto.getPageCurr(),dto.getPageSize());
        List<TAdvertising> list = this.baseMapper.pageList(pageInfo,dto);
        for (TAdvertising tAdvertising : list) {
            // 如果开始时间大于当前时间 那么设置状态startState为1 未开始
            if (tAdvertising.getStartTime().isAfter(LocalDateTime.now())) {
                tAdvertising.setStartState(1);
            } else if (tAdvertising.getEndTime().isBefore(LocalDateTime.now())) {
                tAdvertising.setStartState(3);
            } else {
                tAdvertising.setStartState(2);
            }
        }
        pageInfo.setRecords(list);
        return pageInfo;
    }
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TGoodsServiceImpl.java
@@ -1,10 +1,17 @@
package com.ruoyi.other.service.impl;
import com.ruoyi.common.core.web.page.PageInfo;
import com.ruoyi.order.api.feignClient.OrderClient;
import com.ruoyi.other.api.domain.TGoods;
import com.ruoyi.other.api.dto.GoodsDTO;
import com.ruoyi.other.mapper.TGoodsMapper;
import com.ruoyi.other.service.TGoodsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.List;
/**
 * <p>
@@ -17,4 +24,27 @@
@Service
public class TGoodsServiceImpl extends ServiceImpl<TGoodsMapper, TGoods> implements TGoodsService {
    @Autowired
    private OrderClient orderClient;
    @Override
    public PageInfo<TGoods> pageList(GoodsDTO dto) {
        PageInfo<TGoods> pageInfo = new PageInfo<>(dto.getPageCurr(),dto.getPageSize());
        List<TGoods> list = this.baseMapper.pageList(pageInfo,dto);
        StringBuilder stringBuilder = new StringBuilder();
        for (TGoods temp : list) {
            stringBuilder.append(temp.getId()).append(",");
        }
        if (StringUtils.hasLength(stringBuilder)){
            // 去除最后一个字符
            stringBuilder.deleteCharAt(stringBuilder.length()-1);
        }
        String string = stringBuilder.toString();
        List<Integer> data = orderClient.getSalesCountByGoodsId(string).getData();
//        goodsClient
        // 远程调用cha'xun
        pageInfo.setRecords(list);
        return pageInfo;
    }
}
ruoyi-service/ruoyi-other/src/main/resources/mapper/TActivityMapper.xml
@@ -20,5 +20,24 @@
    <sql id="Base_Column_List">
        id, name, img, start_time, end_time, jump_type, jump_url, status, create_time, del_flag
    </sql>
    <select id="pageList" resultType="com.ruoyi.other.api.domain.TActivity">
        select * from t_activity
        <where>
            <if test="req.name != null and req.name != ''">
                AND  `name` LIKE concat('%',#{req.name}, '%')
            </if>
            <if test="req.state == 1">
                AND  start_time >= NOW()
            </if>
            <if test="req.state == 2">
                AND  start_time &lt;= NOW() AND end_time >= NOW()
            </if>
            <if test="req.state == 3">
                AND  end_time &lt;= NOW()
            </if>
            AND del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()}
        </where>
        ORDER BY create_time DESC
    </select>
</mapper>
ruoyi-service/ruoyi-other/src/main/resources/mapper/TGoodsMapper.xml
@@ -30,5 +30,24 @@
    <sql id="Base_Column_List">
        id, type, name, cover_picture, details_picture, dispatch_address, service_description, original_price, preferential_price, vip_price, redeem_points, limit_exchange_times, inventory, underlying_sales, describe, introduce, explain, status, create_time, del_flag
    </sql>
    <select id="pageList" resultType="com.ruoyi.other.api.domain.TGoods">
        select * from t_goods
        <where>
            <if test="req.name != null and req.name != ''">
                AND  `name` LIKE concat('%',#{req.name}, '%')
            </if>
            <if test="req.type != null">
                AND  `type` = #{req.type}
            </if>
            <if test="req.status != null">
                AND  status = #{req.status}
            </if>
            <if test="req.otherState != null and req.otherState = 2">
                AND  inventory = 0
            </if>
            AND del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()}
        </where>
        ORDER BY create_time DESC
    </select>
</mapper>