From 8e6cdfe05d08bdacc62d5eaca49b514150bcfb6f Mon Sep 17 00:00:00 2001 From: luodangjia <luodangjia> Date: 星期一, 13 一月 2025 13:06:59 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/model/Order.java | 4 ++++ ruoyi-service/ruoyi-account/src/main/resources/mapper/account/UserPointMapper.xml | 1 + ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java | 16 ++++------------ ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/GoodsVO.java | 4 ++++ ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/SeckillActivityDetailVO.java | 4 ++++ ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/SeckillActivityInfoServiceImpl.java | 14 ++++++++++++++ ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java | 13 +++++++++++++ 7 files changed, 44 insertions(+), 12 deletions(-) diff --git a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/model/Order.java b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/model/Order.java index 5ca828a..4efccf5 100644 --- a/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/model/Order.java +++ b/ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/model/Order.java @@ -143,6 +143,10 @@ @TableField("express_json") private String expressJson; + @ApiModelProperty(value = "第三方快递结果") + @TableField("express_result") + private String expressResult; + @ApiModelProperty(value = "收货地址信息") @TableField("address_json") private String addressJson; diff --git a/ruoyi-service/ruoyi-account/src/main/resources/mapper/account/UserPointMapper.xml b/ruoyi-service/ruoyi-account/src/main/resources/mapper/account/UserPointMapper.xml index 74192fd..166aa0e 100644 --- a/ruoyi-service/ruoyi-account/src/main/resources/mapper/account/UserPointMapper.xml +++ b/ruoyi-service/ruoyi-account/src/main/resources/mapper/account/UserPointMapper.xml @@ -29,6 +29,7 @@ t_user_point tup LEFT JOIN t_app_user tau ON tup.app_user_id = tau.id <where> + tup.type not in (8, 9, 14) <if test="userPoint.userName != null and userPoint.userName != ''"> AND tau.`name` LIKE concat('%',#{userPoint.userName},'%') </if> diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java index 078c824..e0665fb 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java @@ -47,10 +47,13 @@ @Resource private TokenService tokenService; + + + @GetMapping("/goodsList") @ApiOperation(value = "获取商品评价", tags = {"小程序-获取商品评价"}) public R<List<GoodsEvaluate>> goodsList(@ApiParam("商品id") Integer goodsId){ - List<GoodsEvaluate> list = goodsEvaluateService.lambdaQuery().eq(GoodsEvaluate::getGoodsId, goodsId).list(); + List<GoodsEvaluate> list = goodsEvaluateService.lambdaQuery().eq(GoodsEvaluate::getGoodsId, goodsId).eq(GoodsEvaluate::getDelFlag, 0).eq(GoodsEvaluate::getStatus, 2).list(); for (GoodsEvaluate goodsEvaluate : list) { AppUser appUserById = appUserClient.getAppUserById(goodsEvaluate.getAppUserId()); if(null != appUserById){ @@ -102,18 +105,7 @@ return R.ok(); } - public static void main(String[] args) { - List<Integer> integers = new ArrayList<>(); - integers.add(1); - integers.add(2); - integers.add(3); - integers.add(4); - List<Integer> integers1 = new ArrayList<>(); - integers.retainAll(integers1); - System.err.println(integers); - System.err.println(integers1); - } /** * 评论列表 diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java index 9c2c7b0..9a6dd4e 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java @@ -87,6 +87,8 @@ private GoodsBargainPriceDetailService goodsBargainPriceDetailService; @Resource private OrderClient orderClient; + @Resource + private GoodsEvaluateService goodsEvaluateService; @@ -258,6 +260,17 @@ } Integer integer = orderClient.getGoodsSaleNum(goods.getId(), 1).getData(); goodsVO.setSaleNum(integer); + GoodsEvaluate goodsEvaluate = goodsEvaluateService.lambdaQuery().eq(GoodsEvaluate::getGoodsId, goodsId) + .orderByDesc(GoodsEvaluate::getGrade).eq(GoodsEvaluate::getStatus, 2).eq(GoodsEvaluate::getDelFlag, 0).last(" limit 0, 1").one(); + if (null != goodsEvaluate) { + AppUser appUserById = appUserClient.getAppUserById(goodsEvaluate.getAppUserId()); + if(null != appUserById){ + goodsEvaluate.setUserName(appUserById.getName()); + goodsEvaluate.setAvatar(appUserById.getAvatar()); + goodsEvaluate.setIdStr(String.valueOf(goodsEvaluate.getId())); + } + } + goodsVO.setGoodsEvaluate(goodsEvaluate); return goodsVO; } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/SeckillActivityInfoServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/SeckillActivityInfoServiceImpl.java index 385dfad..5b8e730 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/SeckillActivityInfoServiceImpl.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/SeckillActivityInfoServiceImpl.java @@ -14,6 +14,7 @@ import com.ruoyi.other.mapper.GoodsShopMapper; import com.ruoyi.other.mapper.SeckillActivityInfoMapper; import com.ruoyi.other.mapper.ShopMapper; +import com.ruoyi.other.service.GoodsEvaluateService; import com.ruoyi.other.service.GoodsSeckillService; import com.ruoyi.other.service.GoodsService; import com.ruoyi.other.service.SeckillActivityInfoService; @@ -57,6 +58,8 @@ private GoodsService goodsService; @Resource private OrderClient orderClient; + @Resource + private GoodsEvaluateService goodsEvaluateService; @Override public List<SeckillActivityVO> listSeckillActivity(Goods goods) { @@ -131,6 +134,17 @@ seckillActivityDetailVO.setShopList(shops); Integer integer = orderClient.getGoodsSaleNum(goods.getId(), 2).getData(); seckillActivityDetailVO.setSaleNum(integer); + GoodsEvaluate goodsEvaluate = goodsEvaluateService.lambdaQuery().eq(GoodsEvaluate::getGoodsId, goodsId) + .orderByDesc(GoodsEvaluate::getGrade).eq(GoodsEvaluate::getStatus, 2).eq(GoodsEvaluate::getDelFlag, 0).last(" limit 0, 1").one(); + if (null != goodsEvaluate) { + AppUser appUserById = appUserClient.getAppUserById(goodsEvaluate.getAppUserId()); + if(null != appUserById){ + goodsEvaluate.setUserName(appUserById.getName()); + goodsEvaluate.setAvatar(appUserById.getAvatar()); + goodsEvaluate.setIdStr(String.valueOf(goodsEvaluate.getId())); + } + } + seckillActivityDetailVO.setGoodsEvaluate(goodsEvaluate); return seckillActivityDetailVO; } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/GoodsVO.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/GoodsVO.java index 78e55a9..3c7f3dc 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/GoodsVO.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/GoodsVO.java @@ -1,6 +1,7 @@ package com.ruoyi.other.vo; import com.baomidou.mybatisplus.annotation.TableField; +import com.ruoyi.other.api.domain.GoodsEvaluate; import com.ruoyi.other.api.domain.Shop; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -62,5 +63,8 @@ @ApiModelProperty(value = "门店列表") private List<Shop> shopList; + @ApiModelProperty("评价") + private GoodsEvaluate goodsEvaluate; + } diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/SeckillActivityDetailVO.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/SeckillActivityDetailVO.java index a7870b6..ef7fd6e 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/SeckillActivityDetailVO.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/SeckillActivityDetailVO.java @@ -1,5 +1,6 @@ package com.ruoyi.other.vo; +import com.ruoyi.other.api.domain.GoodsEvaluate; import com.ruoyi.other.api.domain.Shop; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -24,4 +25,7 @@ @ApiModelProperty(value = "商品详情") private String detail; + + @ApiModelProperty("评价") + private GoodsEvaluate goodsEvaluate; } -- Gitblit v1.7.1