Merge pull request 'bug修复和商品品牌信息返回' (#53) from cxw into master
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #53
This commit is contained in:
commit
eb477862fc
@ -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));
|
||||
|
@ -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<String> sliderPicUrls;
|
||||
|
||||
@Schema(description = "商品品牌编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long brandId;
|
||||
private ProductBrandDO productBrand;
|
||||
// ========== 营销相关字段 =========
|
||||
|
||||
// ========== SKU 相关字段 =========
|
||||
|
@ -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);
|
||||
/**
|
||||
* 获得品牌列表
|
||||
*
|
||||
|
@ -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<ProductBrandDO> wrapperX = new LambdaQueryWrapperX<>();
|
||||
wrapperX.eq(ProductBrandDO::getId, id).eq(ProductBrandDO::getStatus, status);
|
||||
return brandMapper.selectOne(wrapperX);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProductBrandDO> getBrandList(Collection<Long> ids) {
|
||||
return brandMapper.selectBatchIds(ids);
|
||||
|
@ -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() // 如果都售后成功,则需要取消订单
|
||||
|
@ -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;
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user