From 38ddb2605167497ca958067e3e918bd1dea2812c Mon Sep 17 00:00:00 2001 From: XinWei <2718030729@qq.com> Date: Thu, 17 Oct 2024 15:17:16 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=95=86=E5=93=81=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=B8=AD=E6=B7=BB=E5=8A=A0=E5=93=81=E7=89=8C?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/app/spu/AppProductSpuController.java | 6 ++++++ .../controller/app/spu/vo/AppProductSpuDetailRespVO.java | 3 ++- .../module/product/service/brand/ProductBrandService.java | 7 +++++++ .../product/service/brand/ProductBrandServiceImpl.java | 8 ++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/AppProductSpuController.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/AppProductSpuController.java index 7706e1c..c0959f5 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/AppProductSpuController.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/AppProductSpuController.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.product.controller.app.spu; import cn.hutool.core.collection.CollUtil; +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; @@ -16,6 +17,7 @@ import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO; import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO; import cn.iocoder.yudao.module.product.enums.ErrorCodeConstants; import cn.iocoder.yudao.module.product.enums.spu.ProductSpuStatusEnum; +import cn.iocoder.yudao.module.product.service.brand.ProductBrandService; import cn.iocoder.yudao.module.product.service.history.ProductBrowseHistoryService; import cn.iocoder.yudao.module.product.service.sku.ProductSkuService; import cn.iocoder.yudao.module.product.service.spu.ProductSpuService; @@ -61,6 +63,8 @@ public class AppProductSpuController { private MemberLevelApi memberLevelApi; @Resource private MemberUserApi memberUserApi; + @Resource + private ProductBrandService productBrandService; @GetMapping("/list-by-ids") @Operation(summary = "获得商品 SPU 列表") @@ -138,6 +142,8 @@ public class AppProductSpuController { spu.setBrowseCount(spu.getBrowseCount() + spu.getVirtualSalesCount()); AppProductSpuDetailRespVO spuVO = BeanUtils.toBean(spu, AppProductSpuDetailRespVO.class) .setSkus(BeanUtils.toBean(skus, AppProductSpuDetailRespVO.Sku.class)); + // 添加品牌详细信息 + spuVO.setProductBrand(productBrandService.getBrandByIdStatus(spu.getBrandId(), CommonStatusEnum.ENABLE.getStatus())); // 处理 vip 价格 MemberLevelRespDTO memberLevel = getMemberLevel(); spuVO.setVipPrice(calculateVipPrice(spuVO.getPrice(), memberLevel)); diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/vo/AppProductSpuDetailRespVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/vo/AppProductSpuDetailRespVO.java index b26c5a0..60e404d 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/vo/AppProductSpuDetailRespVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/vo/AppProductSpuDetailRespVO.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.product.controller.app.spu.vo; import cn.iocoder.yudao.module.product.controller.app.property.vo.value.AppProductPropertyValueDetailRespVO; +import cn.iocoder.yudao.module.product.dal.dataobject.brand.ProductBrandDO; import com.alibaba.excel.annotation.ExcelProperty; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -35,7 +36,7 @@ public class AppProductSpuDetailRespVO { private List sliderPicUrls; @Schema(description = "商品品牌编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - private Long brandId; + private ProductBrandDO productBrand; // ========== 营销相关字段 ========= // ========== SKU 相关字段 ========= diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/brand/ProductBrandService.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/brand/ProductBrandService.java index aa401ed..9680047 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/brand/ProductBrandService.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/brand/ProductBrandService.java @@ -45,6 +45,13 @@ public interface ProductBrandService { */ ProductBrandDO getBrand(Long id); + /** + * 根据编号和状态获取品牌 + * @param id 编号 + * @param status 状态 + * @return cn.iocoder.yudao.module.product.dal.dataobject.brand.ProductBrandDO + */ + ProductBrandDO getBrandByIdStatus(Long id, Integer status); /** * 获得品牌列表 * diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/brand/ProductBrandServiceImpl.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/brand/ProductBrandServiceImpl.java index b97123f..d983027 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/brand/ProductBrandServiceImpl.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/brand/ProductBrandServiceImpl.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.product.service.brand; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.module.product.controller.admin.brand.vo.ProductBrandCreateReqVO; import cn.iocoder.yudao.module.product.controller.admin.brand.vo.ProductBrandListReqVO; import cn.iocoder.yudao.module.product.controller.admin.brand.vo.ProductBrandPageReqVO; @@ -88,6 +89,13 @@ public class ProductBrandServiceImpl implements ProductBrandService { return brandMapper.selectById(id); } + @Override + public ProductBrandDO getBrandByIdStatus(Long id, Integer status) { + LambdaQueryWrapperX wrapperX = new LambdaQueryWrapperX<>(); + wrapperX.eq(ProductBrandDO::getId, id).eq(ProductBrandDO::getStatus, status); + return brandMapper.selectOne(wrapperX); + } + @Override public List getBrandList(Collection ids) { return brandMapper.selectBatchIds(ids); From e3d554da42cf761315467f6e91ca8361a67a8da5 Mon Sep 17 00:00:00 2001 From: XinWei <2718030729@qq.com> Date: Thu, 17 Oct 2024 16:30:07 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=80=80=E6=AC=BE=E7=A9=BA=E6=8C=87?= =?UTF-8?q?=E9=92=88=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trade/service/order/TradeOrderUpdateServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceImpl.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceImpl.java index 80d4545..766df87 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceImpl.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceImpl.java @@ -906,6 +906,9 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService { // 2.1 更新订单的退款金额、积分 Integer orderRefundPrice = order.getRefundPrice() + refundPrice; + if (order.getRefundPoint() == null){ + order.setRefundPoint(0); + } Integer orderRefundPoint = order.getRefundPoint() + orderItem.getUsePoint(); Integer refundStatus = isAllOrderItemAfterSaleSuccess(order.getId()) ? TradeOrderRefundStatusEnum.ALL.getStatus() // 如果都售后成功,则需要取消订单 From 1316b41df70563650918b3f8029f29c570f91bd0 Mon Sep 17 00:00:00 2001 From: XinWei <2718030729@qq.com> Date: Fri, 18 Oct 2024 13:42:20 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=94=AF=E4=BB=98=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E4=B8=ADmerchant=5Forder=5Fid=E9=87=8D=E5=A4=8D=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/pay/dal/dataobject/wallet/PayWalletRechargeDO.java | 3 ++- .../module/system/service/social/SocialClientServiceImpl.java | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/wallet/PayWalletRechargeDO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/wallet/PayWalletRechargeDO.java index a842c95..831aa52 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/wallet/PayWalletRechargeDO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/wallet/PayWalletRechargeDO.java @@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; import cn.iocoder.yudao.module.pay.dal.dataobject.order.PayOrderDO; import cn.iocoder.yudao.module.pay.dal.dataobject.refund.PayRefundDO; import cn.iocoder.yudao.module.pay.enums.refund.PayRefundStatusEnum; +import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; @@ -22,7 +23,7 @@ public class PayWalletRechargeDO extends BaseDO { /** * 编号 */ - @TableId + @TableId(type = IdType.ASSIGN_ID) private Long id; /** diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialClientServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialClientServiceImpl.java index 9fa6642..4f30315 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialClientServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialClientServiceImpl.java @@ -14,6 +14,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.cache.CacheUtils; import cn.iocoder.yudao.framework.common.util.http.HttpUtils; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.module.system.api.social.dto.SocialWxQrcodeReqDTO; import cn.iocoder.yudao.module.system.controller.admin.socail.vo.client.SocialClientPageReqVO; import cn.iocoder.yudao.module.system.controller.admin.socail.vo.client.SocialClientSaveReqVO;