From 81507d0c196821cd333f08c75f3978e726df24cd Mon Sep 17 00:00:00 2001
From: 姜友瑶 <935090232@qq.com>
Date: Tue, 17 May 2022 15:38:10 +0800
Subject: [PATCH] Merge branch 'developer'

---
 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/YuyueAction.java |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/YuyueAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/YuyueAction.java
index 4e958b3..47420ba 100644
--- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/YuyueAction.java
+++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/YuyueAction.java
@@ -122,7 +122,7 @@
             return new AjaxResult(AjaxResult.STATUS_SUCCESS, shopList);
         }
 
-        Double distance = null;
+        BigDecimal distance = null;
         SysShopInfo nearestShop = null;
 
         AjaxResult ajaxResult = new AjaxResult("200", shopList);
@@ -130,9 +130,9 @@
             for (SysShopInfo shopInfo : shopList) {
                 Double shopX = Double.parseDouble(shopInfo.getLongitude());
                 Double shopY = Double.parseDouble(shopInfo.getLatitude());
-                Double disResult = LocationUtil.getDistance(Double.parseDouble(locX), Double.parseDouble(locY), shopX, shopY);
-                shopInfo.setDistance(new BigDecimal(disResult).setScale(1, BigDecimal.ROUND_HALF_UP));
-                if (distance == null || distance > disResult) {
+                BigDecimal disResult = LocationUtil.getDistance(Double.parseDouble(locX), Double.parseDouble(locY), shopX, shopY);
+                shopInfo.setDistance(disResult);
+                if (distance == null || distance.compareTo(disResult)>0) {
                     distance = disResult;
                     nearestShop = shopInfo;
                 }
@@ -225,6 +225,13 @@
         if (vipInfo == null) {
             throw new GlobleException("会员不存在");
         }
+
+        if (SysVipInfo.VALID_FLAG_N == vipInfo.getValidFlag()) {
+            AjaxResult ajaxResult = AjaxResult.buildSuccessInstance(new ArrayList<>(), "获取成功");
+            ajaxResult.putInMap("proj", new ServiceProductListVo());
+            return ajaxResult;
+        }
+
         ServiceProductListVo productListVo = new ServiceProductListVo();
         productListVo.setName(vipInfo.getVipName());
         productListVo.setVipId(vipInfo.getId());
@@ -366,6 +373,12 @@
     public AjaxResult findServiceOrderList(@RequestBody @Validated ErpServiceOrderListDto orderListDto) {
         SysVipInfo sysVipInfo = userCacheManager.getLoginUser();
         orderListDto.setVipId(sysVipInfo.getId());
+
+        SysVipInfo vipInfo = sysVipInfoDao.selectById(sysVipInfo.getId());
+        if (SysVipInfo.VALID_FLAG_N == vipInfo.getValidFlag()) {
+            return AjaxResult.buildSuccessInstance(new ArrayList<>(), "查询成功");
+        }
+
         List<ErpServiceOrderListVo> apiServiceOrderListInPage = projServicesDao.findWxServiceOrderList(orderListDto);
         return AjaxResult.buildSuccessInstance(apiServiceOrderListInPage,"查询成功");
     }

--
Gitblit v1.9.1