From 9dfd9506d0743a22d404046ffe7cda6081404a8a Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Tue, 30 Jun 2026 17:09:36 +0800
Subject: [PATCH] feat(order): 添加XT支付功能和确认收款功能

---
 src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java |   55 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 53 insertions(+), 2 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 400aa3e..e9aee27 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
@@ -71,6 +71,7 @@
     private final IApiMallMemberService memberService;
     private final IMallMoneyFlowService mallMoneyFlowService;
     private final RedisUtils redisUtils;
+    private final MallCountryDeliveryMapper mallCountryDeliveryMapper;
 
     private final AgentProducer agentProducer;
     private final ApiChatPayService apiChatPayService;
@@ -164,8 +165,23 @@
             mallOrderItemMapper.insert(orderItem);
         }
 
+
+
         //运费
-        BigDecimal delivaryAmount = addOrderDto.getDeliveryAmount() == null ? BigDecimal.ZERO : addOrderDto.getDeliveryAmount();
+        MallCountryDelivery delivery = mallCountryDeliveryMapper.selectOne(
+                Wrappers.lambdaQuery(MallCountryDelivery.class)
+                        .eq(MallCountryDelivery::getCountryCode, addOrderDto.getCountryCode().toUpperCase())
+                        .eq(MallCountryDelivery::getStatus, 1)
+        );
+        MallCountryDelivery defaultDelivery = mallCountryDeliveryMapper.selectOne(
+                Wrappers.lambdaQuery(MallCountryDelivery.class)
+                        .eq(MallCountryDelivery::getCountryCode, "DEFAULT")
+                        .eq(MallCountryDelivery::getStatus, 1)
+        );
+        BigDecimal delivaryAmount = defaultDelivery.getShippingFee();
+        if (delivery != null) {
+            delivaryAmount = delivery.getShippingFee();
+        }
         orderInfo.setCarriage(delivaryAmount);
 
         total = total.add(delivaryAmount);
@@ -174,7 +190,13 @@
         orderInfo.setName(address.getFristName() + address.getName());
         orderInfo.setPhone(address.getPhone());
 
-        orderInfo.setAddress(address.getArea()+ address.getAddress()+address.getCity()+address.getProvince() + address.getCountry() );
+        orderInfo.setAddress(
+                        address.getAddress() +"  -  "
+                        +address.getArea() +"  -  "
+                        +address.getCity() +"  -  "
+                        +address.getProvince() +"  -  "
+                        +address.getCountryName() +"  -  "
+                        + address.getCountry() );
         orderInfo.setLatitude(address.getLatitude());
         orderInfo.setLongitude(address.getLongitude());
         this.baseMapper.updateById(orderInfo);
@@ -980,4 +1002,33 @@
         return new FebsResponse().success().data(objects);
     }
 
+    @Override
+    public FebsResponse createOrderByXtPay() {
+
+        DataDictionaryCustom dataDictionaryCustom = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+                "PAY_LINK", "XT_LINK"
+        );
+
+        DataDictionaryCustom dataDictionaryCustomImg = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+                "PAY_LINK", "XT_LINK_IMG"
+        );
+        if (ObjectUtil.isEmpty(dataDictionaryCustom)){
+            return new FebsResponse().fail().message("Payment channel exception");
+        }
+        if (ObjectUtil.isEmpty(dataDictionaryCustomImg)){
+            return new FebsResponse().fail().message("Payment channel exception");
+        }
+        if (StrUtil.isEmpty(dataDictionaryCustom.getValue())){
+            return new FebsResponse().fail().message("Payment channel exception");
+        }
+        if (StrUtil.isEmpty(dataDictionaryCustomImg.getValue())){
+            return new FebsResponse().fail().message("Payment channel exception");
+        }
+
+        Map<String, Object> result = new HashMap<>();
+        result.put("link", dataDictionaryCustom.getValue());
+        result.put("linkImg", dataDictionaryCustomImg.getValue());
+        return new FebsResponse().success().data(result);
+    }
+
 }

--
Gitblit v1.9.1