xiaoyong931011
2021-11-10 73ea7810ea849cac30910a627d78e0cc41a6329a
20211108
3 files modified
34 ■■■■■ changed files
gc-shop/src/main/java/com/xzx/gc/shop/service/GoodsService.java 13 ●●●●● patch | view | raw | blame | history
gc-shop/src/main/java/com/xzx/gc/shop/vo/XcxGoodsDetailVo.java 6 ●●●●● patch | view | raw | blame | history
gc-shop/src/main/java/com/xzx/gc/shop/vo/XcxGoodsListVo.java 15 ●●●●● patch | view | raw | blame | history
gc-shop/src/main/java/com/xzx/gc/shop/service/GoodsService.java
@@ -46,6 +46,8 @@
    ScoreGoodsStyleMapper scoreGoodsStyleMapper;
    @Resource
    ScoreGoodsSearchMapper scoreGoodsSearchMapper;
    @Resource
    ScoreOrderMapper scoreOrderMapper;
    @Autowired
    private MqUtil mqUtil;
@@ -327,6 +329,17 @@
        PageHelper.startPage(xcxGoodsListDto.getPageNo(), xcxGoodsListDto.getPageSize());
        List<XcxGoodsListVo> data = scoreGoodsMapper.selectXcxGoodsList(xcxGoodsListDto);
        if(StrUtil.isNotEmpty(xcxGoodsListDto.getUserId())){
            if(CollUtil.isNotEmpty(data)){
                for(XcxGoodsListVo xcxGoodsListVo : data){
                    if(ScoreGoods.ISQG_YES == xcxGoodsListVo.getIsQg()){
                        //抢购时间内,用户购买该商品的数量
                        Integer sumCnt = scoreOrderMapper.selectGoodsQuotaTime(xcxGoodsListDto.getUserId(),xcxGoodsListVo.getId(),xcxGoodsListVo.getQgStartTime(),xcxGoodsListVo.getQgEndTime());
                        xcxGoodsListVo.setAvaQuotaTime(xcxGoodsListVo.getQuotaTime() - sumCnt);
                    }
                }
            }
        }
        if(StrUtil.isNotEmpty(xcxGoodsListDto.getName())){
            Example exampleSearch = new Example(ScoreGoodsSearch.class);
            Example.Criteria criteriaSearch = exampleSearch.createCriteria();
gc-shop/src/main/java/com/xzx/gc/shop/vo/XcxGoodsDetailVo.java
@@ -57,6 +57,12 @@
    @ApiModelProperty(value = "剩余时间")
    private Long remainTime;
    @ApiModelProperty(value = "限购数量")
    private Integer quotaTime;
    @ApiModelProperty(value = "剩余限购数量")
    private Integer avaQuotaTime;
    @ApiModelProperty(value = "样式")
    private List<XcxGoodsDetailStyleVo> styles;
gc-shop/src/main/java/com/xzx/gc/shop/vo/XcxGoodsListVo.java
@@ -1,8 +1,11 @@
package com.xzx.gc.shop.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@ApiModel(value = "XcxGoodsListVo", description = "小程序商品列表返回参数类")
@@ -29,6 +32,18 @@
    @ApiModelProperty(value = "库存")
    private Integer stock;
    @ApiModelProperty(value = "限购数量")
    private Integer quotaTime;
    @ApiModelProperty(value = "剩余限购数量")
    private Integer avaQuotaTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date qgStartTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date qgEndTime;
    @ApiModelProperty(value = "是否抢购 1-是 2-否")
    private Integer isQg;
}