From 4241dcb3f48b6c0ccc775de42bec25b040c93ca9 Mon Sep 17 00:00:00 2001
From: Smile <2767057906@qq.com>
Date: Wed, 12 Mar 2025 11:17:20 +0800
Subject: [PATCH] =?UTF-8?q?bug312=20APP/WEB=E6=8E=A7=E8=B4=A7=E8=AE=A2?=
 =?UTF-8?q?=E5=8D=95=E4=B8=8B=E8=BD=BD=E6=8F=90=E5=8D=95=E6=B7=BB=E5=8A=A0?=
 =?UTF-8?q?=E9=99=90=E5=88=B6=E6=9D=A1=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../order/impl/OrderQueryServiceImpl.java        | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/impl/OrderQueryServiceImpl.java b/yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/impl/OrderQueryServiceImpl.java
index a2ea14bf..b9c73298 100644
--- a/yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/impl/OrderQueryServiceImpl.java
+++ b/yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/impl/OrderQueryServiceImpl.java
@@ -3888,17 +3888,13 @@ public class OrderQueryServiceImpl implements OrderQueryService {
             return success(false);
         }
         // 判断发货人是否是当前登录人
-        Long customerId = dto.getConsignorVO().getCustomerId();
-        String phone = dto.getConsignorVO().getPhone();
-        List<CustomerContactsDO> consignorCustomerList = customerContactsService.getCustomerContactsListByCustomerId(customerId);
-        CustomerContactsDO customerContactsDO = consignorCustomerList.stream().filter(val -> Objects.equals(val.getPhoneNew(), phone)).findFirst().orElse(null);
-        if (Objects.equals(customerContactsDO.getPhoneNew(),user.getMobile())){
+        Long customerContactsId = dto.getConsignorVO().getCustomerContactsId();
+        CustomerContactsDO customerContactsDO = customerContactsService.getById(customerContactsId);
+        if (Objects.equals(customerContactsDO.getUserid(),user.getId())){
             return success(true);
         }
-        Long customerId1 = dto.getConsigneeVO().getCustomerId();
-        String phone1 = dto.getConsigneeVO().getPhone();
-        List<CustomerContactsDO> consigneeCustomerList = customerContactsService.getCustomerContactsListByCustomerId(customerId1);
-        CustomerContactsDO customerContactsDO1 = consigneeCustomerList.stream().filter(val -> Objects.equals(val.getPhoneNew(), phone1)).findFirst().orElse(null);
+        Long customerContactsId1 = dto.getConsigneeVO().getCustomerContactsId();
+        CustomerContactsDO customerContactsDO1 = customerContactsService.getById(customerContactsId1);
         List<OrderControlLogDO> orderControlLogListByOrderIdList = orderControlLogService.getOrderControlLogListByOrderId(orderId, null);
         boolean isFirstAllAllow = false;
         int count = 0; // 新增计数器
@@ -3914,7 +3910,7 @@ public class OrderQueryServiceImpl implements OrderQueryService {
             }
         }
         isFirstAllAllow = (count == 1); // 最终判断是否严格等于1
-        if (dto.getSumNum()==dto.getReleaseNum()&&dto.getCargoControlStatus()==1&&isFirstAllAllow&& msg.contains(String.valueOf(customerContactsDO1.getPhoneNew())) && customerContactsDO1.getPhoneNew().equals(user.getMobile())){
+        if (dto.getSumNum()==dto.getReleaseNum()&&dto.getCargoControlStatus()==1&&isFirstAllAllow&& msg.contains(String.valueOf(customerContactsDO1.getPhoneNew())) && customerContactsDO1.getUserid().equals(user.getId())){
             return success(true);
         }
         return success(false);
-- 
2.22.0