From f7cd9fc3a01bce44554f3f1e098dc6b59e305c2d Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Wed, 14 Jul 2021 11:49:55 +0800
Subject: [PATCH] add user/query/userIdentity
---
gc-order/src/main/java/com/xzx/gc/order/service/JhyOrderService.java | 10 ++++------
1 files changed, 4 insertions(+), 6 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 28da66f..3add922 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
@@ -1,6 +1,7 @@
package com.xzx.gc.order.service;
import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageHelper;
@@ -59,17 +60,14 @@
public void addJhyOrder(AddJhyOrderDto orderDto) {
JhyInfo jhyInfo = jhyInfoMapper.selectJhyInfoByUserId(orderDto.getUserId());
- if (jhyInfo == null) {
- throw new RestException(-3, "集物员不存在");
- }
-
if (jhyInfo != null && JhyInfo.CHECK_PASS.equals(jhyInfo.getStatus())) {
throw new RestException(-3, "集货员不能下单");
}
AddressInfo addressInfo = addressMapper.selectByPrimaryKey(orderDto.getAddressId());
- double distance = LocationUtils.getDistance(Convert.toDouble(jhyInfo.getLon()), Convert.toDouble(jhyInfo.getLat()), Convert.toDouble(addressInfo.getLongitude()), Convert.toDouble(addressInfo.getLatitude()));
- if (distance > 500) {
+
+ List<JhyInfo> jhyInfos = jhyInfoMapper.selectJhyInfoListInAddressRange(addressInfo.getAddressId());
+ if (CollUtil.isEmpty(jhyInfos)) {
throw new RestException(-3, "该区域暂无集物员");
}
--
Gitblit v1.9.1