Administrator
2025-05-16 9265a439968f7df5b93a9435f2dc958d8a9c45a3
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java
@@ -208,11 +208,11 @@
                    }
                    MallGoods mallGoods = mallGoodsMapper.selectById(sku.getGoodsId());
                    // 零撸专区购买
                    // todo 纯积分商品一个账号限制购买一次
//                    if (new BigDecimal(mallGoods.getPresentPrice()).compareTo(BigDecimal.ZERO) == 0) {
//                        List<MallOrderItem> items = mallOrderItemMapper.selectItemByGoodsIdUnCancel(mallGoods.getId(), member.getId());
//                        if (CollUtil.isNotEmpty(items)) {
//                            throw new FebsException("积分商品限制一件");
//                            throw new FebsException("积分商品一个账号只能购买一次");
//                        }
//                    }
@@ -317,6 +317,7 @@
        for (AddOrderItemDto item : items) {
            Long skuId = item.getSkuId();
            Integer cnt = item.getCnt();
            MallGoodsSku sku = skusAll.stream().filter(s -> s.getId().equals(skuId)).findFirst().orElse(null);
            if (ObjectUtil.isNotEmpty(sku)) {
                Long goodsId = sku.getGoodsId();
@@ -324,7 +325,7 @@
                if (ObjectUtil.isNotEmpty(mallGoods)) {
                    BigDecimal multi = mallGoods.getStaticProp().divide(BigDecimal.valueOf(100), 4, RoundingMode.HALF_DOWN);
                    //获取该商品该规格的积分
                    BigDecimal scoreAmount = sku.getOriginalPrice().multiply(multi).setScale(0, RoundingMode.HALF_DOWN);
                    BigDecimal scoreAmount = sku.getOriginalPrice().multiply(multi).multiply(new BigDecimal(cnt)).setScale(0, RoundingMode.HALF_DOWN);
                    scoreAmountMap.put(skuId, scoreAmount);
                }
            }
@@ -621,7 +622,7 @@
                            ScoreFlowTypeEnum.PAY_BALANCE.getValue(),
                            orderInfo.getOrderNo(),
                            FlowTypeEnum.BALANCE.getValue(),
                            StrUtil.format(ScoreFlowTypeEnum.PAY_BALANCE.getDesc(),orderInfo.getScoreAmount()),
                            StrUtil.format(ScoreFlowTypeEnum.PAY_BALANCE.getDesc(),orderInfo.getAmount()),
                            2
                    );
                    agentProducer.sendOrderCoupon(orderInfo.getId());
@@ -724,13 +725,13 @@
        if (ObjectUtil.isNull(orderInfo)) {
            throw new FebsException("订单不存在");
        }
        List<MallOrderItem> items = orderInfo.getItems();
        if(CollUtil.isNotEmpty(items)){
            for(MallOrderItem mallOrderItem : items){
                mallOrderItem.setItemAmount(mallOrderItemMapper.selectById(mallOrderItem.getId()).getAmount());
                mallOrderItem.setScoreAmount(mallOrderItemMapper.selectById(mallOrderItem.getId()).getScoreAmount());
            }
        }
//        List<MallOrderItem> items = orderInfo.getItems();
//        if(CollUtil.isNotEmpty(items)){
//            for(MallOrderItem mallOrderItem : items){
//                mallOrderItem.setItemAmount(mallOrderItemMapper.selectById(mallOrderItem.getId()).getAmount());
//                mallOrderItem.setScoreAmount(mallOrderItemMapper.selectById(mallOrderItem.getId()).getScoreAmount());
//            }
//        }
        OrderDetailVo orderDetailVo = MallOrderInfoConversion.INSTANCE.entityToDetailVo(orderInfo);
@@ -950,7 +951,7 @@
                mallGoodsComment.setSkuName(mallGoodsSku.getSkuName());
                mallGoodsComment.setStyleId(mallGoodsSku.getStyleId());
                mallGoodsComment.setStyleName(mallGoodsSku.getStyleName());
                mallGoodsComment.setShowState(MallGoodsComment.SHOW_STATE_ENABLE);
                mallGoodsComment.setShowState(MallGoodsComment.SHOW_STATE_DISABLED);
                mallGoodsCommentMapper.insert(mallGoodsComment);
            }
        }