From e3c5378b79d23f4cebb4059c78bfbdd32cd5a2f9 Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期一, 26 四月 2021 14:02:46 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopOrderServiceImpl.java |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopOrderServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopOrderServiceImpl.java
index 5bb465f..d1c97ae 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopOrderServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopOrderServiceImpl.java
@@ -161,6 +161,7 @@
         if(shopOrders.isEmpty()){//未查询到用户上一笔订单
             //查询用户收货地址中的默认地址
             ComShopUserAddressDO userAddressDO = comShopUserAddressDAO.selectOne(new QueryWrapper<ComShopUserAddressDO>()
+                    .eq("delete_status", 2)
                     .eq("user_id",orderPreviewDTO.getUserId()).eq("is_default",ComShopUserAddressDO.isDefault.yes));
             if(userAddressDO != null){
                 ComShopUserAddressVO userAddressVO = new ComShopUserAddressVO();
@@ -178,9 +179,11 @@
         }else{//查询到用户上一笔订单
             ComShopUserAddressDO userAddressDO = comShopUserAddressDAO.selectById(shopOrders.get(0).getReceiverId());
             if(userAddressDO != null){
-                ComShopUserAddressVO userAddressVO = new ComShopUserAddressVO();
-                BeanUtils.copyProperties(userAddressDO,userAddressVO);
-                orderPreviewVO.setUserAddressVO(userAddressVO);
+                if(userAddressDO.getDeleteStatus() == 2) {
+                    ComShopUserAddressVO userAddressVO = new ComShopUserAddressVO();
+                    BeanUtils.copyProperties(userAddressDO, userAddressVO);
+                    orderPreviewVO.setUserAddressVO(userAddressVO);
+                }
             }
         }
         return R.ok(orderPreviewVO);
@@ -198,7 +201,7 @@
         ComShopOrderVO shopOrderVO = new ComShopOrderVO();
         //查询用户收货地址
         ComShopUserAddressDO userAddressDO = comShopUserAddressDAO.selectById(orderCreateDTO.getReceiverId());
-        if(userAddressDO == null){
+        if(userAddressDO == null||userAddressDO.getDeleteStatus()!=2){
             return R.fail("收货地址不存在");
         }
         //用户id

--
Gitblit v1.7.1