From 65530fe055acedee0481c372847e6b874b2609a2 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Wed, 18 Mar 2026 15:02:33 +0800
Subject: [PATCH] feat(mall): 添加公司会员数量限制功能

---
 src/main/java/cc/mrbird/febs/mall/service/impl/ApiClothesOrderServiceImpl.java |   32 ++++++++++++++++++++++++--------
 1 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiClothesOrderServiceImpl.java b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiClothesOrderServiceImpl.java
index a6c9631..ac5d72b 100644
--- a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiClothesOrderServiceImpl.java
+++ b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiClothesOrderServiceImpl.java
@@ -18,7 +18,6 @@
 import cc.mrbird.febs.pay.model.BrandWCPayRequestData;
 import cc.mrbird.febs.pay.service.IPayService;
 import cc.mrbird.febs.pay.service.IXcxPayService;
-import cc.mrbird.febs.rabbit.producter.AgentProducer;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUnit;
 import cn.hutool.core.date.DateUtil;
@@ -67,7 +66,6 @@
     private final MallGoodsCouponMapper mallGoodsCouponMapper;
     private final MallExpressInfoMapper mallExpressInfoMapper;
 
-    private final AgentProducer agentProducer;
     private final IXcxPayService iXcxPayService;
     private final IPayService payService;
     private final MallMemberMapper mallMemberMapper;
@@ -210,6 +208,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 +226,7 @@
                         record.setSizeId(sizeId);
                         record.setSizeName(clothesSize.getName());
                         record.setSizePrice(clothesSize.getPrice());
+                        record.setSizeImage(clothesSize.getImage());
                     }
                 }
             }
@@ -240,7 +241,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 +254,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 +271,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 +284,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 +307,7 @@
                         record.setArtId(artId);
                         record.setArtName(clothesArt.getName());
                         record.setArtPrice(clothesArt.getPrice());
+                        record.setArtImage(clothesArt.getImage());
                     }
                 }
             }
@@ -307,6 +322,7 @@
                         record.setClothId(clothId);
                         record.setClothName(clothesCloth.getName());
                         record.setClothPrice(clothesCloth.getPrice());
+                        record.setClothImage(clothesCloth.getImage());
                     }
                 }
             }
@@ -498,6 +514,9 @@
                 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);
@@ -547,9 +566,6 @@
         BigDecimal realAmount = total.subtract(discountAmount).add(deliveryAmount).setScale(2, RoundingMode.DOWN);
         orderInfo.setRealAmount(realAmount);
         clothesOrderMapper.updateById(orderInfo);
-
-        //过期时间修改成24小时
-        agentProducer.sendClothesOrderCancelDelayMsg(orderInfo.getId(),  24 * 60 * 60 * 1000L);
 
         ApiClothesOrderInfoVo apiClothesOrderInfoVo = new ApiClothesOrderInfoVo();
         apiClothesOrderInfoVo.setOrderId(orderInfo.getId());
@@ -855,7 +871,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()) {

--
Gitblit v1.9.1