From 7d47e9d021938dba5a203bb93dde424255030de4 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Tue, 23 Jun 2026 11:06:38 +0800
Subject: [PATCH] fix(config): 更新测试环境数据库配置并优化国家配送列表界面

---
 src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java
index 491f7a4..72462ca 100644
--- a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java
+++ b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java
@@ -33,6 +33,7 @@
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.RequiredArgsConstructor;
@@ -115,6 +116,8 @@
         this.baseMapper.insert(orderInfo);
 
         BigDecimal total = BigDecimal.ZERO;
+        //运费
+        BigDecimal delivaryAmount = addOrderDto.getDeliveryAmount() == null ? BigDecimal.ZERO : addOrderDto.getDeliveryAmount();
         for (AddOrderItemDto item : addOrderDto.getItems()) {
             MallOrderItem orderItem = new MallOrderItem();
 
@@ -137,6 +140,8 @@
             if(1 != goodsResult){
                 throw new FebsException("Discontinued");
             }
+
+            delivaryAmount = delivaryAmount.add(mallGoods.getCarriageAmount());
 
             BigDecimal amount = sku.getPresentPrice().multiply(BigDecimal.valueOf(item.getCnt()));
             orderItem.setAmount(amount);
@@ -162,9 +167,6 @@
             }
             mallOrderItemMapper.insert(orderItem);
         }
-
-        //运费
-        BigDecimal delivaryAmount = addOrderDto.getDeliveryAmount() == null ? BigDecimal.ZERO : addOrderDto.getDeliveryAmount();
         orderInfo.setCarriage(delivaryAmount);
 
         total = total.add(delivaryAmount);
@@ -786,19 +788,23 @@
     public void goodsComment(ApiAddCommentDtos addCommentDtos) {
         Long orderId = addCommentDtos.getOrderId();
         MallMember member = LoginUserUtil.getLoginUser();
-        MallOrderInfo orderInfo = this.baseMapper.selectOrderDetailsById(orderId);
+        MallOrderInfo orderInfo = this.baseMapper.selectById(orderId);
         if (orderInfo == null || AppContants.DEL_FLAG_Y == orderInfo.getDelFlag()) {
-            throw new FebsException("订单不存在");
+            throw new FebsException("Order does not exist");
         }
         if (OrderStatusEnum.FINISH.getValue() != orderInfo.getStatus()) {
-            throw new FebsException("该状态不能评价");
+            throw new FebsException("This status cannot be evaluated");
         }
         if (MallOrderInfo.COMMENT_STATE_YES == orderInfo.getCommentState()) {
-            throw new FebsException("该状态不能评价");
+            throw new FebsException("This status cannot be evaluated");
         }
 
-        orderInfo.setCommentState(MallOrderInfo.COMMENT_STATE_YES);
-        this.baseMapper.updateById(orderInfo);
+        this.baseMapper.update(
+                null,
+                Wrappers.lambdaUpdate(MallOrderInfo.class)
+                .set(MallOrderInfo::getCommentState, MallOrderInfo.COMMENT_STATE_YES)
+                .eq(MallOrderInfo::getId, orderId)
+        );
 
         List<ApiAddCommentDto> apiAddCommentDtos = addCommentDtos.getApiAddCommentDtos();
         if(CollUtil.isNotEmpty(apiAddCommentDtos)){
@@ -814,7 +820,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);
             }
         }

--
Gitblit v1.9.1