Administrator
2025-08-01 a044bf6fcbf8ccbe591c26dc5120f7a5cb365c41
src/main/java/cc/mrbird/febs/mall/service/impl/ApiClothesOrderServiceImpl.java
@@ -210,6 +210,8 @@
        ClothesOrderDraft clothesOrderDraft = clothesOrderDraftMapper.selectById(id);
        if (ObjectUtil.isNotNull(clothesOrderDraft)){
            Long draftId = clothesOrderDraft.getId();
            Long typeId = clothesOrderDraft.getTypeId();
            ClothesType clothesType = clothesTypeMapper.selectById(typeId);
            record.setTypeId(typeId);
@@ -226,6 +228,7 @@
                        record.setSizeId(sizeId);
                        record.setSizeName(clothesSize.getName());
                        record.setSizePrice(clothesSize.getPrice());
                        record.setSizeImage(clothesSize.getImage());
                    }
                }
            }
@@ -240,7 +243,7 @@
            BigDecimal totalPatternPrice = BigDecimal.ZERO;
            List<ClothesPatternRemark> clothesPatternRemarks = clothesPatternRemarkMapper.selectList(
                    Wrappers.lambdaQuery(ClothesPatternRemark.class)
                            .eq(ClothesPatternRemark::getSourceId, record.getId())
                            .eq(ClothesPatternRemark::getSourceId, draftId)
                            .eq(ClothesPatternRemark::getType, SocialPatternLocationTypeEnum.DRAFT.getValue())
            );
            if(CollUtil.isNotEmpty(clothesPatternRemarks)){
@@ -253,6 +256,13 @@
                    vo.setPatternName(clothesPattern.getName());
                    vo.setPatternPrice(clothesPattern.getPrice());
                    vo.setPatternRemark(entity.getRemark());
                    vo.setPatternImage(clothesPattern.getImage());
                    vo.setBoxHeight(clothesPattern.getBoxHeight());
                    vo.setBoxWidth(clothesPattern.getBoxWidth());
                    vo.setLeftPercent(clothesPattern.getLeftPercent());
                    vo.setTopPercent(clothesPattern.getTopPercent());
                    vos.add(vo);
                    totalPatternPrice = totalPatternPrice.add(clothesPattern.getPrice());
@@ -263,7 +273,7 @@
            BigDecimal totalLocationPrice = BigDecimal.ZERO;
            List<ClothesLocationRemark> clothesLocationRemarks = clothesLocationRemarkMapper.selectList(
                    Wrappers.lambdaQuery(ClothesLocationRemark.class)
                            .eq(ClothesLocationRemark::getSourceId, record.getId())
                            .eq(ClothesLocationRemark::getSourceId, draftId)
                            .eq(ClothesLocationRemark::getType, SocialPatternLocationTypeEnum.DRAFT.getValue())
            );
            if(CollUtil.isNotEmpty(clothesLocationRemarks)){
@@ -276,6 +286,12 @@
                    vo.setLocationName(location.getName());
                    vo.setLocationPrice(location.getPrice());
                    vo.setLocationRemark(entity.getRemark());
                    vo.setLocationImage(location.getImage());
                    vo.setBoxHeight(location.getBoxHeight());
                    vo.setBoxWidth(location.getBoxWidth());
                    vo.setLeftPercent(location.getLeftPercent());
                    vo.setTopPercent(location.getTopPercent());
                    vos.add(vo);
                    totalLocationPrice = totalLocationPrice.add(location.getPrice());
@@ -293,6 +309,7 @@
                        record.setArtId(artId);
                        record.setArtName(clothesArt.getName());
                        record.setArtPrice(clothesArt.getPrice());
                        record.setArtImage(clothesArt.getImage());
                    }
                }
            }
@@ -307,6 +324,7 @@
                        record.setClothId(clothId);
                        record.setClothName(clothesCloth.getName());
                        record.setClothPrice(clothesCloth.getPrice());
                        record.setClothImage(clothesCloth.getImage());
                    }
                }
            }
@@ -431,7 +449,7 @@
                orderItem.setItemId(cloth.getId());
                orderItem.setName(cloth.getName());
                orderItem.setPrice(cloth.getPrice());
                orderItem.setItemCnt(item.getCnt());
                orderItem.setItemCnt(orderItem.getItemCnt());
                orderItem.setAmount(cloth.getPrice().multiply(new BigDecimal(orderItem.getItemCnt())).setScale(2, RoundingMode.DOWN));
                clothesOrderItemMapper.insert(orderItem);
@@ -445,7 +463,7 @@
                orderItem.setItemId(size.getId());
                orderItem.setName(size.getName());
                orderItem.setPrice(size.getPrice());
                orderItem.setItemCnt(item.getCnt());
                orderItem.setItemCnt(orderItem.getItemCnt());
                orderItem.setAmount(orderItem.getPrice().multiply(new BigDecimal(orderItem.getItemCnt())).setScale(2, RoundingMode.DOWN));
                clothesOrderItemMapper.insert(orderItem);
@@ -459,7 +477,7 @@
                orderItem.setItemId(location.getId());
                orderItem.setName(location.getName());
                orderItem.setPrice(location.getPrice());
                orderItem.setItemCnt(item.getCnt());
                orderItem.setItemCnt(orderItem.getItemCnt());
                orderItem.setAmount(orderItem.getPrice().multiply(new BigDecimal(orderItem.getItemCnt())).setScale(2, RoundingMode.DOWN));
                orderItem.setRemark(item.getPatternRemark());
                clothesOrderItemMapper.insert(orderItem);
@@ -475,7 +493,7 @@
                orderItem.setRemark(item.getPatternRemark());
                orderItem.setName(pattern.getName());
                orderItem.setPrice(pattern.getPrice());
                orderItem.setItemCnt(item.getCnt());
                orderItem.setItemCnt(orderItem.getItemCnt());
                orderItem.setRemark(item.getPatternRemark());
                orderItem.setAmount(orderItem.getPrice().multiply(new BigDecimal(orderItem.getItemCnt())).setScale(2, RoundingMode.DOWN));
                clothesOrderItemMapper.insert(orderItem);
@@ -490,7 +508,7 @@
                orderItem.setItemId(art.getId());
                orderItem.setName(art.getName());
                orderItem.setPrice(art.getPrice());
                orderItem.setItemCnt(item.getCnt());
                orderItem.setItemCnt(orderItem.getItemCnt());
                orderItem.setAmount(orderItem.getPrice().multiply(new BigDecimal(orderItem.getItemCnt())).setScale(2, RoundingMode.DOWN));
                clothesOrderItemMapper.insert(orderItem);
@@ -498,10 +516,13 @@
                continue;
            } else if (ClothesOrderItemEnum.CUSTOMIZE.getCode() == item.getType()) {
                ClothesMemberStature clothesMemberStature = clothesMemberStatureMapper.selectById(item.getSkuId());
                if (ObjectUtil.isNull(clothesMemberStature)){
                    throw new FebsException("请选择您的自定义尺码");
                }
                orderItem.setItemId(clothesMemberStature.getId());
                orderItem.setName(clothesMemberStature.getName());
                orderItem.setPrice(BigDecimal.ZERO);
                orderItem.setItemCnt(item.getCnt());
                orderItem.setItemCnt(orderItem.getItemCnt());
                orderItem.setAmount(orderItem.getPrice().multiply(new BigDecimal(orderItem.getItemCnt())).setScale(2, RoundingMode.DOWN));
                clothesOrderItemMapper.insert(orderItem);
@@ -747,6 +768,22 @@
        return new FebsResponse().success().data(voPage);
    }
    @Override
    public FebsResponse findMarkCnt() {
        Long memberId = LoginUserUtil.getLoginUser().getId();
        List<Map<String, Integer>> maps = clothesOrderMapper.selectOrderStatusCnt(memberId);
        Map<Integer, Integer> orderCnt = new HashMap<>();
        if (CollUtil.isNotEmpty(maps)) {
            for (Map<String, Integer> map : maps) {
                orderCnt.put(map.get("status"), map.get("cnt"));
            }
        }
        Map<String, Object> result = new HashMap<>();
        result.put("order", orderCnt);
        return new FebsResponse().success().data(result);
    }
    private List<ApiClothesOrderItemInfoVo> buildOrderItemInfo(Long id) {
@@ -839,7 +876,7 @@
        if(ObjectUtil.isNull(orderInfo)){
            throw new FebsException("订单不存在");
        }
        if (member.getId() != orderInfo.getMemberId()) {
        if (!ObjectUtil.equal(member.getId(), orderInfo.getMemberId())) {
            throw new FebsException("无权限操作");
        }
        if (ClothesEnum.UP.getCode() == orderInfo.getDelFlag()) {