From 774cb0ede0572062f025132a5c2a0262188abf05 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Fri, 23 Jul 2021 09:53:11 +0800
Subject: [PATCH] Merge branch 'score-shop' of http://120.27.238.55:7000/r/xzx into score-shop

---
 gc-order/src/main/java/com/xzx/gc/order/service/JhyOrderService.java |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/gc-order/src/main/java/com/xzx/gc/order/service/JhyOrderService.java b/gc-order/src/main/java/com/xzx/gc/order/service/JhyOrderService.java
index 0906376..0dba707 100644
--- a/gc-order/src/main/java/com/xzx/gc/order/service/JhyOrderService.java
+++ b/gc-order/src/main/java/com/xzx/gc/order/service/JhyOrderService.java
@@ -63,7 +63,9 @@
     public void addJhyOrder(AddJhyOrderDto orderDto) {
         JhyInfo jhyInfo = jhyInfoMapper.selectJhyInfoByUserId(orderDto.getUserId());
         if (jhyInfo != null && JhyInfo.CHECK_PASS.equals(jhyInfo.getStatus())) {
-            throw new RestException(-3, "集货员不能下单");
+            if (JhyInfo.IS_JHY_Y.equals(jhyInfo.getIsJhy())) {
+                throw new RestException(-3, "集货员不能下单");
+            }
         }
 
         AddressInfo addressInfo = addressMapper.selectByPrimaryKey(orderDto.getAddressId());
@@ -159,6 +161,10 @@
             throw new RestException(-3, "订单不存在");
         }
 
+        if (order.getUserId().equals(jhyInfo.getUserId())) {
+            throw new RestException(-3, "不能抢自己的单");
+        }
+
         order.setJhyId(userId);
         order.setStatus(JhyOrder.ORDER_STATUS_IMG);
         jhyOrderMapper.updateByPrimaryKey(order);

--
Gitblit v1.9.1