From b839bd7b77f73c03aa70233c3a896c6cb41852f0 Mon Sep 17 00:00:00 2001 From: Chopper Date: Wed, 19 May 2021 20:21:59 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=8A=9B=E5=87=BA=E7=9A=84=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E5=90=97=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- framework/src/main/java/cn/lili/common/enums/ResultCode.java | 3 +-- .../cn/lili/modules/order/cart/service/CartServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/framework/src/main/java/cn/lili/common/enums/ResultCode.java b/framework/src/main/java/cn/lili/common/enums/ResultCode.java index 0abac758..8dd3af54 100644 --- a/framework/src/main/java/cn/lili/common/enums/ResultCode.java +++ b/framework/src/main/java/cn/lili/common/enums/ResultCode.java @@ -124,8 +124,7 @@ public enum ResultCode { * 购物车 */ CART_ERROR(30001, "读取结算页的购物车异常"), - GOODS_NOT_SUPPORT(30002, "以下商品不支持当前收货地址:"), - SHIPPING_NOT_APPLY(30005, "当前选择地址暂不支持配送!"), + SHIPPING_NOT_APPLY(30005, "购物商品不支持当前收货地址配送"), /** * 订单 */ diff --git a/framework/src/main/java/cn/lili/modules/order/cart/service/CartServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/cart/service/CartServiceImpl.java index 7d05f2e6..8e1434b8 100644 --- a/framework/src/main/java/cn/lili/modules/order/cart/service/CartServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/order/cart/service/CartServiceImpl.java @@ -528,7 +528,7 @@ public class CartServiceImpl implements CartService { break forTemplates; } } - throw new ServiceException(ResultCode.GOODS_NOT_SUPPORT, cartSkuVO.getGoodsSku().getGoodsName()); + throw new ServiceException(ResultCode.SHIPPING_NOT_APPLY, cartSkuVO.getGoodsSku().getGoodsName()); } } From bb2a28aae0d18f74085132dbd6c40d1476ed70f7 Mon Sep 17 00:00:00 2001 From: pikachu <1321288662@qq.com> Date: Thu, 20 May 2021 08:32:02 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/lili/modules/goods/entity/dos/Parameters.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/goods/entity/dos/Parameters.java b/framework/src/main/java/cn/lili/modules/goods/entity/dos/Parameters.java index 6b39f1ea..f9198944 100644 --- a/framework/src/main/java/cn/lili/modules/goods/entity/dos/Parameters.java +++ b/framework/src/main/java/cn/lili/modules/goods/entity/dos/Parameters.java @@ -34,13 +34,8 @@ public class Parameters extends BaseEntity { @Length(max = 50, message = "参数名称不能超过50字") private String paramName; - @ApiModelProperty(value = "参数类型1 输入项 2 选择项", required = true) - @NotNull(message = "参数类型必选") - @Min(value = 1, message = "参数类型传值不正确") - @Max(value = 2, message = "参数类型传值不正确") - private Integer paramType; - @ApiModelProperty(value = "选择值,当参数类型是选择项2时,必填,逗号分隔") + @ApiModelProperty(value = "选择值") private String options; @ApiModelProperty(value = "是否可索引,0 不显示 1 显示", required = true) From 1eee2eb5b14c12694a9f3f174de1917a08caa922 Mon Sep 17 00:00:00 2001 From: Chopper Date: Thu, 20 May 2021 09:50:29 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=95=86=E5=93=81=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B7=B2=E5=88=A0=E9=99=A4=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java index a23defa1..0b45e62a 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java @@ -236,6 +236,9 @@ public class GoodsServiceImpl extends ServiceImpl implements @Override public Integer goodsNum(GoodsStatusEnum goodsStatusEnum, GoodsAuthEnum goodsAuthEnum) { LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(); + + queryWrapper.eq(Goods::getDeleteFlag,false); + if (goodsStatusEnum != null) { queryWrapper.eq(Goods::getMarketEnable, goodsStatusEnum.name()); } From 5c41b06381f2d970196135163d8fbebc404dbf71 Mon Sep 17 00:00:00 2001 From: Chopper Date: Thu, 20 May 2021 10:09:12 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E4=B8=AD=EF=BC=8C=E5=90=8D=E7=A7=B0=E5=B1=95=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lili/modules/order/order/serviceimpl/OrderServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/OrderServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/OrderServiceImpl.java index 078405c5..50a5db0a 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/OrderServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/OrderServiceImpl.java @@ -260,7 +260,7 @@ public class OrderServiceImpl extends ServiceImpl implements this.sendUpdateStatusMessage(orderMessage); String message = "订单付款,付款方式[" + PaymentMethodEnum.valueOf(paymentMethod).paymentName() + "]"; - OrderLog orderLog = new OrderLog(orderSn, "-1", UserEnums.SYSTEM.name(), "系统操作", message); + OrderLog orderLog = new OrderLog(orderSn, "-1", UserEnums.SYSTEM.getRole(), "系统操作", message); orderLogService.save(orderLog); From 683e47425c81fde2506a6153704d3b2a8d1ae2be Mon Sep 17 00:00:00 2001 From: lifenlong Date: Thu, 20 May 2021 10:14:02 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BC=9A=E5=91=98=E8=AF=84=E4=BB=B7?= =?UTF-8?q?=E6=9B=B4=E6=94=B9=E5=95=86=E5=93=81=E7=B4=A2=E5=BC=95=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/lili/listener/GoodsMessageListener.java | 5 +---- .../modules/goods/serviceimpl/GoodsSkuServiceImpl.java | 10 ++++++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/consumer/src/main/java/cn/lili/listener/GoodsMessageListener.java b/consumer/src/main/java/cn/lili/listener/GoodsMessageListener.java index 7391dede..f02719b8 100644 --- a/consumer/src/main/java/cn/lili/listener/GoodsMessageListener.java +++ b/consumer/src/main/java/cn/lili/listener/GoodsMessageListener.java @@ -3,14 +3,12 @@ package cn.lili.listener; import cn.hutool.json.JSONUtil; import cn.lili.common.rocketmq.tags.GoodsTagsEnum; import cn.lili.event.GoodsCommentCompleteEvent; -import cn.lili.event.MemberRegisterEvent; import cn.lili.modules.goods.entity.dos.Goods; import cn.lili.modules.goods.entity.dos.GoodsSku; import cn.lili.modules.goods.entity.dto.GoodsCompleteMessage; import cn.lili.modules.goods.service.GoodsService; import cn.lili.modules.goods.service.GoodsSkuService; import cn.lili.modules.member.entity.dos.FootPrint; -import cn.lili.modules.member.entity.dos.Member; import cn.lili.modules.member.entity.dos.MemberEvaluation; import cn.lili.modules.member.service.FootprintService; import cn.lili.modules.member.service.GoodsCollectionService; @@ -18,7 +16,6 @@ import cn.lili.modules.search.entity.dos.EsGoodsIndex; import cn.lili.modules.search.service.EsGoodsIndexService; import cn.lili.modules.store.service.StoreService; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.rocketmq.common.message.MessageExt; import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; @@ -96,9 +93,9 @@ public class GoodsMessageListener implements RocketMQListener { break; //商品评价 case GOODS_COMMENT_COMPLETE: + MemberEvaluation memberEvaluation = JSONUtil.toBean(new String(messageExt.getBody()), MemberEvaluation.class); for (GoodsCommentCompleteEvent goodsCommentCompleteEvent : goodsCommentCompleteEvents) { try { - MemberEvaluation memberEvaluation = JSONUtil.toBean(new String(messageExt.getBody()), MemberEvaluation.class); goodsCommentCompleteEvent.goodsComment(memberEvaluation); } catch (Exception e) { log.error("评价{},在{}业务中,状态修改事件执行异常", diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java index 6d63599b..d5d04291 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java @@ -407,10 +407,10 @@ public class GoodsSkuServiceImpl extends ServiceImpl i goodEvaluationQueryWrapper.eq(MemberEvaluation::getGrade, EvaluationGradeEnum.GOOD.name()); // 好评数量 - double highPraiseNum = memberEvaluationService.count(goodEvaluationQueryWrapper); + int highPraiseNum = memberEvaluationService.count(goodEvaluationQueryWrapper); // 更新商品评价数量 - goodsSku.setCommentNum(goodsSku.getCommentNum() + 1); + goodsSku.setCommentNum(goodsSku.getCommentNum() != null ? goodsSku.getCommentNum() + 1 : 1); // 好评率 double grade = NumberUtil.div(highPraiseNum, goodsSku.getCommentNum().doubleValue(), 2) * 100; @@ -419,6 +419,12 @@ public class GoodsSkuServiceImpl extends ServiceImpl i this.update(goodsSku); //修改规格索引 goodsIndexService.updateIndexCommentNum(goodsSku.getId(), goodsSku.getCommentNum(), (int) highPraiseNum, grade); + + //修改商品评价数量 + Goods goods = goodsService.getById(goodsSku.getGoodsId()); + goods.setCommentNum(goods.getCommentNum() + 1); + goodsService.updateById(goods); + } /** From d50388001fd48795eb053fb2f14a7613eac17522 Mon Sep 17 00:00:00 2001 From: lifenlong Date: Thu, 20 May 2021 11:35:54 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E5=95=86=E5=93=81=E6=95=B0=E9=87=8F=E5=8E=BB=E9=99=A4=E5=B7=B2?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=95=86=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../goods/serviceimpl/GoodsServiceImpl.java | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java index 0b45e62a..6b7aea66 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsServiceImpl.java @@ -55,9 +55,6 @@ import java.util.List; @Transactional public class GoodsServiceImpl extends ServiceImpl implements GoodsService { - //商品 - @Autowired - private GoodsMapper goodsMapper; //商品属性 @Autowired private GoodsParamsService goodsParamsService; @@ -85,7 +82,7 @@ public class GoodsServiceImpl extends ServiceImpl implements @Override public void underStoreGoods(String storeId) { - this.goodsMapper.underStoreGoods(storeId); + this.baseMapper.underStoreGoods(storeId); } @Override @@ -237,15 +234,10 @@ public class GoodsServiceImpl extends ServiceImpl implements public Integer goodsNum(GoodsStatusEnum goodsStatusEnum, GoodsAuthEnum goodsAuthEnum) { LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(); - queryWrapper.eq(Goods::getDeleteFlag,false); - - if (goodsStatusEnum != null) { - queryWrapper.eq(Goods::getMarketEnable, goodsStatusEnum.name()); - } - if (goodsAuthEnum != null) { - queryWrapper.eq(Goods::getIsAuth, goodsAuthEnum.name()); - } - queryWrapper.eq(StringUtils.equals(UserContext.getCurrentUser().getRole().name(), UserEnums.STORE.name()), + queryWrapper.eq(Goods::getDeleteFlag,false) + .eq(goodsStatusEnum != null,Goods::getMarketEnable, goodsStatusEnum.name()) + .eq(goodsAuthEnum != null,Goods::getIsAuth, goodsAuthEnum.name()) + .eq(StringUtils.equals(UserContext.getCurrentUser().getRole().name(), UserEnums.STORE.name()), Goods::getStoreId, UserContext.getCurrentUser().getStoreId()); return this.count(queryWrapper);