Commit 4241dcb3 authored by Smile's avatar Smile Committed by wux

bug312 APP/WEB控货订单下载提单添加限制条件

parent d83b5f57
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment