소스 검색

APP登录逻辑调整

FengChaoYu 1 개월 전
부모
커밋
0f64639158

+ 4 - 0
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/bean/user/UserWxBean.java

@@ -1,5 +1,6 @@
 package com.gree.mall.miniapp.bean.user;
 
+import com.gree.mall.miniapp.bean.StorageBean;
 import com.gree.mall.miniapp.plus.entity.User;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -57,4 +58,7 @@ public class UserWxBean extends User {
     private Integer billingDay = new Integer("0");
     @ApiModelProperty("账期天数(1-30天)")
     private Integer paymentGracePeriod = new Integer("0");
+
+    @ApiModelProperty("定位仓库")
+    private StorageBean storage;
 }

+ 1 - 1
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/commonmapper/AppMapper.java

@@ -51,5 +51,5 @@ public interface AppMapper {
      * 通过定位获取仓库列表
      */
     @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
-    List<StorageBean> findStorageByLocate(String lng, String lat);
+    List<StorageBean> findStorageByLocate(String companyWechatId, String lng, String lat);
 }

+ 0 - 3
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/commonmapper/GoodsSpecDetailMapper.java

@@ -50,12 +50,9 @@ public interface GoodsSpecDetailMapper {
                                              @Param("minPrice") BigDecimal minPrice,
                                              @Param("maxPrice") BigDecimal maxPrice,
                                              @Param("tags") List<String> tags,
-                                              @Param("userId") String userId,
-                                             @Param("userType") String userType,
                                              @Param("keyword") String keyword,
                                              @Param("categoryId") String categoryId,
                                              @Param("sort") Integer sort,
-                                             @Param("yjhx") Boolean yjhx,
                                              @Param("companyWechatId") String companyWechatId);
 
 

+ 7 - 15
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/controller/common/CommonController.java

@@ -14,13 +14,9 @@ import com.gree.mall.miniapp.logic.ExpressLogic;
 import com.gree.mall.miniapp.logic.common.CommonLogic;
 import com.gree.mall.miniapp.logic.common.outside.WechatLogic;
 import com.gree.mall.miniapp.plus.entity.*;
-import com.gree.mall.miniapp.plus.service.AdminCompanyWechatOtherService;
-import com.gree.mall.miniapp.plus.service.OrderDetailService;
-import com.gree.mall.miniapp.plus.service.OrderInfoService;
-import com.gree.mall.miniapp.plus.service.OrderTaxService;
+import com.gree.mall.miniapp.plus.service.*;
 import com.gree.mall.miniapp.utils.RedisUtil;
 import com.gree.mall.miniapp.utils.VerifiUtils;
-import com.gree.mall.miniapp.utils.qywx.AesException;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -65,6 +61,8 @@ public class CommonController {
     AdminCompanyWechatOtherService adminCompanyWechatOtherService;
     @Resource
     WechatLogic wechatLogic;
+    @Resource
+    AdminPlatformService adminPlatformService;
 
     @PostMapping("/upload")
     @ApiOperation(value = "文件上传")
@@ -164,17 +162,11 @@ public class CommonController {
     @GetMapping("/config/get")
     @ApiOperation("获取小程序配置")
     public ResponseHelper<AdminCompanyWechat> getConfig(HttpServletRequest request) {
-        CurrentCompanyWechat currentCompanyWechat = commonLogic.getCurrentCompanyWechat(request);
+        final AdminPlatform adminPlatform = adminPlatformService.getById(1);
+        CurrentCompanyWechat currentCompanyWechat = new CurrentCompanyWechat();
         //剔除不返回的内容
-        currentCompanyWechat.setAppId(null);
-        currentCompanyWechat.setSubAppId(null);
-        currentCompanyWechat.setSubSecret(null);
-        currentCompanyWechat.setSecret1(null);
-        currentCompanyWechat.setSecret2(null);
-        currentCompanyWechat.setSecret3(null);
-        currentCompanyWechat.setMchKey(null);
-        currentCompanyWechat.setMchId(null);
-        currentCompanyWechat.setCorpId(null);
+        currentCompanyWechat.setMinAppName(adminPlatform.getMinAppName())
+                .setMinLogo1(adminPlatform.getMinLogo1());
         return ResponseHelper.success(currentCompanyWechat);
     }
 

+ 0 - 10
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/controller/renovation/RenovationController.java

@@ -2,7 +2,6 @@ package com.gree.mall.miniapp.controller.renovation;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.gree.mall.miniapp.annotation.ApiNotAuth;
-import com.gree.mall.miniapp.bean.StorageBean;
 import com.gree.mall.miniapp.bean.goods.GoodsNewBean;
 import com.gree.mall.miniapp.exception.RemoteServiceException;
 import com.gree.mall.miniapp.helper.ResponseHelper;
@@ -88,13 +87,4 @@ public class RenovationController {
         return ResponseHelper.success(orderShares);
     }
 
-    @ApiNotAuth
-    @GetMapping("/storage/list")
-    @ApiOperation("仓库列表")
-    public ResponseHelper<List<StorageBean>> storageList(
-            HttpServletRequest request
-    ) throws RemoteServiceException {
-        List<StorageBean> storageList = renovationLogic.storageList(request);
-        return ResponseHelper.success(storageList);
-    }
 }

+ 46 - 0
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/controller/storage/StorageController.java

@@ -0,0 +1,46 @@
+package com.gree.mall.miniapp.controller.storage;
+
+import com.gree.mall.miniapp.annotation.ApiNotAuth;
+import com.gree.mall.miniapp.bean.StorageBean;
+import com.gree.mall.miniapp.exception.RemoteServiceException;
+import com.gree.mall.miniapp.helper.ResponseHelper;
+import com.gree.mall.miniapp.logic.storage.StorageLogic;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@Slf4j
+@RestController
+@Api(value = "仓库API", tags ={"仓库API"} )
+@RequestMapping(value = "/storage", produces = "application/json; charset=utf-8")
+public class StorageController {
+
+    @Resource
+    StorageLogic storageLogic;
+
+    @ApiNotAuth
+    @GetMapping("/locate/list")
+    @ApiOperation("仓库列表")
+    public ResponseHelper<List<StorageBean>> locateStorageList(
+            @ApiParam(value = "商户id(切换商户时过滤仓库用)") @RequestParam(required = false) String companyWechatId,
+            @ApiParam(value = "经度(不传会取用户当前定位填充)") @RequestParam(required = false) String lng,
+            @ApiParam(value = "纬度(不传会取用户当前定位填充)") @RequestParam(required = false) String lat
+    ) throws RemoteServiceException {
+        List<StorageBean> storageList = storageLogic.locateStorageList(companyWechatId, lng, lat);
+        return ResponseHelper.success(storageList);
+    }
+
+    @PostMapping("/update/user")
+    @ApiOperation("更新最近访问一次仓库id")
+    public ResponseHelper<List<StorageBean>> updateUser(
+            @ApiParam(value = "仓库id", required = true) @RequestParam String storageId
+    ) throws RemoteServiceException {
+        storageLogic.updateUser(storageId);
+        return ResponseHelper.success();
+    }
+}

+ 48 - 40
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/common/CommonLogic.java

@@ -66,6 +66,8 @@ public class CommonLogic {
     OrderInfoService orderInfoService;
     @Resource
     AdminPlatformService adminPlatformService;
+    @Resource
+    StorageService storageService;
     @Value("${spring.profiles.active}")
     private String profiles;
     @Value("${inf.url}")
@@ -88,66 +90,72 @@ public class CommonLogic {
      */
     public CurrentCompanyWechat getCurrentCompanyWechat(HttpServletRequest request) {
 
-        String userId = CommonUtils.getUserId(request);
+        final String userId = CommonUtils.getUserId(request);
+        final String storageId = CommonUtils.getStorageId(request);
+        final String source = CommonUtils.getSource(request);
         String token = CommonUtils.getToken(request);
-        String storageId = CommonUtils.getStorageId(request);
+
+        if (StringUtils.isBlank(source)) {
+            throw new RemoteServiceException("非法请求, 来源不明");
+        }
+
+        if (StringUtils.isBlank(storageId)) {
+            throw new RemoteServiceException("缺少仓库信息");
+        }
 
         if (StringUtils.isBlank(token)) {
             token = request.getParameter("x-token");
         }
 
+        final AdminPlatform adminPlatform = adminPlatformService.getById(1);
+
         AdminCompanyWechat adminCompanyWechat;
         User user = null;
 
-        // TODO 处理逻辑修改
-        adminCompanyWechat = adminCompanyWechatService.lambdaQuery()
-                .last("limit 1")
-                .one();
 
-        final AdminPlatform adminPlatform = adminPlatformService.getById(1);
-        if (StringUtils.isNotBlank(token)) {
+        final Storage storage = storageService.getById(storageId);
+        adminCompanyWechat = adminCompanyWechatService.getById(storage.getCompanyWechatId());
+        CurrentCompanyWechat currentCompanyWechat = new CurrentCompanyWechat();
+        BeanUtils.copyProperties(adminCompanyWechat, currentCompanyWechat);
+
+        currentCompanyWechat.setCurrentCompanyWechatId(currentCompanyWechat.getCompanyWechatId());
+        currentCompanyWechat.setCurrentCompanyName(currentCompanyWechat.getCompanyName());
+
+        if (StringUtils.isNotBlank(token) && source.equals("APP")) {
             Object result = redisUtil.get(Constant.RedisPrefix.TOKEN_APP_USER + token);
             if (Objects.isNull(result)) {
                 throw new RemoteServiceException("非法请求,登录信息不存在");
             }
             user = (User) result;
-        }
-
-
-        CurrentCompanyWechat currentCompanyWechat = new CurrentCompanyWechat();
-        BeanUtils.copyProperties(adminCompanyWechat, currentCompanyWechat);
-        if (Objects.nonNull(user)) {
-            currentCompanyWechat.setCurrentCompanyWechatId(adminCompanyWechat.getCompanyWechatId());
-            currentCompanyWechat.setCurrentCompanyName(adminCompanyWechat.getCompanyName());
-            currentCompanyWechat.setAppModuleJson(adminPlatform.getAppModuleJson());
-            currentCompanyWechat.setUserId(user.getUserId());
             currentCompanyWechat.setUser(user);
+            currentCompanyWechat.setUserId(user.getUserId());
+            currentCompanyWechat.setAppModuleJson(adminPlatform.getAppModuleJson());
         }
 
-        // 商户授信用户记录
-        final UserCompanyCredit userCompanyCredit = userCompanyCreditService.lambdaQuery()
-                .eq(UserCompanyCredit::getUserId, userId)
-                .eq(UserCompanyCredit::getCompanyWechatId, currentCompanyWechat.getCompanyWechatId())
-                .one();
-
-        // 是否配送员记录
-        final Integer existDelivery = userCompanyDeliveryService.lambdaQuery()
-                .eq(UserCompanyDelivery::getUserId, userId)
-                .eq(UserCompanyDelivery::getCompanyWechatId, currentCompanyWechat.getCompanyWechatId())
-                .count();
-
-        currentCompanyWechat.setIsDelivery(existDelivery > 0);
-
-        if (Objects.nonNull(userCompanyCredit)) {
-            currentCompanyWechat.setCreditLimit(userCompanyCredit.getCreditLimit());
-            currentCompanyWechat.setAvailableCredit(userCompanyCredit.getAvailableCredit());
-            currentCompanyWechat.setIsCreditEnabled(userCompanyCredit.getIsCreditEnabled());
-            currentCompanyWechat.setBillingDay(userCompanyCredit.getBillingDay());
-            currentCompanyWechat.setPaymentGracePeriod(userCompanyCredit.getPaymentGracePeriod());
+        if (Objects.nonNull(user)) {
+            // 商户授信用户记录
+            final UserCompanyCredit userCompanyCredit = userCompanyCreditService.lambdaQuery()
+                    .eq(UserCompanyCredit::getUserId, userId)
+                    .eq(UserCompanyCredit::getCompanyWechatId, currentCompanyWechat.getCompanyWechatId())
+                    .one();
+
+            // 是否配送员记录
+            final Integer existDelivery = userCompanyDeliveryService.lambdaQuery()
+                    .eq(UserCompanyDelivery::getUserId, userId)
+                    .eq(UserCompanyDelivery::getCompanyWechatId, currentCompanyWechat.getCompanyWechatId())
+                    .count();
+
+            currentCompanyWechat.setIsDelivery(existDelivery > 0);
+
+            if (Objects.nonNull(userCompanyCredit)) {
+                currentCompanyWechat.setCreditLimit(userCompanyCredit.getCreditLimit());
+                currentCompanyWechat.setAvailableCredit(userCompanyCredit.getAvailableCredit());
+                currentCompanyWechat.setIsCreditEnabled(userCompanyCredit.getIsCreditEnabled());
+                currentCompanyWechat.setBillingDay(userCompanyCredit.getBillingDay());
+                currentCompanyWechat.setPaymentGracePeriod(userCompanyCredit.getPaymentGracePeriod());
+            }
         }
-
         return currentCompanyWechat;
-
     }
 
     /**

+ 9 - 10
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/goods/GoodsLogic.java

@@ -82,23 +82,21 @@ public class GoodsLogic {
      * @param pageSize
      * @return
      */
-    public IPage<GoodsNewBean> page(HttpServletRequest request,List<String> brandId,BigDecimal minPrice,BigDecimal maxPrice,List<String> tag,
-                                    String keyword,String categoryId, Integer sort,Boolean yjhx,Integer pageNum, Integer pageSize) {
+    public IPage<GoodsNewBean> page(HttpServletRequest request, List<String> brandId, BigDecimal minPrice, BigDecimal maxPrice, List<String> tag,
+                                    String keyword, String categoryId, Integer sort, Integer pageNum, Integer pageSize) {
         CurrentCompanyWechat currentCompanyWechat = commonLogic.getCurrentCompanyWechat(request);
 
         IPage<GoodsNewBean> page = goodsSpecDetailMapper.queryGoodsList(new Page(pageNum, pageSize),
-                brandId,minPrice,maxPrice,tag,
-                currentCompanyWechat.getUser().getUserId(), currentCompanyWechat.getUser().getType(), keyword, categoryId,sort,yjhx,currentCompanyWechat.getCompanyWechatId());
-        this.supplyGoodsNewBean(page,currentCompanyWechat);
+                brandId, minPrice, maxPrice, tag, keyword, categoryId, sort, currentCompanyWechat.getCompanyWechatId());
+        this.supplyGoodsNewBean(page, currentCompanyWechat);
         return page;
     }
 
 
-
-    public void supplyGoodsNewBean(IPage<GoodsNewBean> page, CurrentCompanyWechat currentCompanyWechat){
+    public void supplyGoodsNewBean(IPage<GoodsNewBean> page, CurrentCompanyWechat currentCompanyWechat) {
         //判定上坪是否在秒杀中 在就覆盖其价格
         for (GoodsNewBean goodsNewBean : page.getRecords()) {
-            if(goodsNewBean == null){
+            if (goodsNewBean == null) {
                 continue;
             }
         }
@@ -107,7 +105,7 @@ public class GoodsLogic {
         for (GoodsNewBean goodsNewBean : page.getRecords()) {
             //查询上标签
             List<GoodsTagRela> list1 = goodsTagRelaService.lambdaQuery().eq(GoodsTagRela::getGoodsId, goodsNewBean.getGoodsId())
-                    .eq(GoodsTagRela::getType,1).list();
+                    .eq(GoodsTagRela::getType, 1).list();
             if (list1.size() > 0) {
                 List<String> collect1 = list1.stream().map(GoodsTagRela::getGoodsTagName).collect(Collectors.toList());
                 goodsNewBean.setTags1(collect1);
@@ -116,7 +114,7 @@ public class GoodsLogic {
             //查询活动专区标签 //查询下标签
             //活动商品
             List<GoodsTagRela> list = goodsTagRelaService.lambdaQuery().eq(GoodsTagRela::getGoodsId, goodsNewBean.getGoodsId())
-                    .eq(GoodsTagRela::getType,2).list();
+                    .eq(GoodsTagRela::getType, 2).list();
             if (list.size() > 0) {
                 List<String> collect1 = list.stream().map(GoodsTagRela::getGoodsTagName).collect(Collectors.toList());
                 goodsNewBean.setTags2(collect1);
@@ -260,6 +258,7 @@ public class GoodsLogic {
 
     /**
      * 获取商品
+     *
      * @param goodsId
      * @return
      */

+ 1 - 13
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/renovation/RenovationLogic.java

@@ -11,6 +11,7 @@ import com.gree.mall.miniapp.logic.common.CommonLogic;
 import com.gree.mall.miniapp.logic.goods.GoodsLogic;
 import com.gree.mall.miniapp.plus.entity.*;
 import com.gree.mall.miniapp.plus.service.*;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -91,17 +92,4 @@ public class RenovationLogic {
         return page;
     }
 
-
-    /**
-     * 仓库列表
-     * @param request
-     * @return
-     */
-    public List<StorageBean> storageList(HttpServletRequest request) {
-        CurrentCompanyWechat currentCompanyWechat = commonLogic.getCurrentCompanyWechat(request);
-        final String locate = currentCompanyWechat.getUser().getCurLocate();
-        final String[] locates = locate.split(",");
-        List<StorageBean> storageList = appMapper.findStorageByLocate(locates[0], locates[1]);
-        return storageList;
-    }
 }

+ 51 - 0
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/storage/StorageLogic.java

@@ -0,0 +1,51 @@
+package com.gree.mall.miniapp.logic.storage;
+
+import com.gree.mall.miniapp.bean.StorageBean;
+import com.gree.mall.miniapp.bean.user.CurrentCompanyWechat;
+import com.gree.mall.miniapp.commonmapper.AppMapper;
+import com.gree.mall.miniapp.logic.common.CommonLogic;
+import com.gree.mall.miniapp.plus.entity.User;
+import com.gree.mall.miniapp.plus.service.UserService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class StorageLogic {
+
+    private final CommonLogic commonLogic;
+    private final AppMapper appMapper;
+    private final UserService userService;
+
+    /**
+     * 仓库列表
+     * @param lng
+     * @param lat
+     * @return
+     */
+    public List<StorageBean> locateStorageList(String companyWechatId, String lng, String lat) {
+        if (StringUtils.isBlank(lng) || StringUtils.isBlank(lat)) {
+            CurrentCompanyWechat currentCompanyWechat = commonLogic.getCurrentCompanyWechat();
+            final String locate = currentCompanyWechat.getUser().getCurLocate();
+            final String[] locates = locate.split(",");
+            lng = locates[0];
+            lat = locates[1];
+        }
+        List<StorageBean> storageList = appMapper.findStorageByLocate(companyWechatId, lng, lat);
+        return storageList;
+    }
+
+    public void updateUser(String storageId) {
+        CurrentCompanyWechat currentCompanyWechat = commonLogic.getCurrentCompanyWechat();
+        // 更新最近一次仓库
+        userService.lambdaUpdate()
+                .set(User::getLastStorageId, storageId)
+                .eq(User::getUserId, currentCompanyWechat.getUserId())
+                .update();
+    }
+}

+ 22 - 6
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/user/UserLogic.java

@@ -1,20 +1,17 @@
 package com.gree.mall.miniapp.logic.user;
 
-import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.date.DateUtil;
-import cn.hutool.core.lang.ObjectId;
-import cn.hutool.core.util.IdUtil;
-import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.RandomUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gree.mall.miniapp.bean.StorageBean;
 import com.gree.mall.miniapp.bean.common.WechatOpenBean;
 import com.gree.mall.miniapp.bean.settle.OrderShareBean;
 import com.gree.mall.miniapp.bean.user.*;
-import com.gree.mall.miniapp.bean.websit.WebsitVO;
 import com.gree.mall.miniapp.commonmapper.CommonMapper;
 import com.gree.mall.miniapp.commonmapper.MyProfitMapper;
 import com.gree.mall.miniapp.commonmapper.OrderShareRankMapper;
@@ -27,6 +24,7 @@ import com.gree.mall.miniapp.logic.common.SMSLogic;
 import com.gree.mall.miniapp.logic.common.outside.WechatLogic;
 import com.gree.mall.miniapp.logic.coupon.CouponLogic;
 import com.gree.mall.miniapp.logic.order.ShoppingCartLogic;
+import com.gree.mall.miniapp.logic.storage.StorageLogic;
 import com.gree.mall.miniapp.plus.entity.*;
 import com.gree.mall.miniapp.plus.service.*;
 import com.gree.mall.miniapp.utils.*;
@@ -46,7 +44,6 @@ import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.locks.Lock;
-import java.util.function.Function;
 import java.util.stream.Collectors;
 
 /**
@@ -109,6 +106,8 @@ public class UserLogic {
     PgOrderWorkerService pgOrderWorkerService;
     @Resource
     SMSLogic smsLogic;
+    @Resource
+    StorageLogic storageLogic;
 
     /**
      * 微信小程序授权
@@ -335,6 +334,7 @@ public class UserLogic {
         userWxBean.setToken(token);
         userWxBean.setShoppingCartNums(shoppingCartLogic.total(userWxBean.getUserId(), null));
         redisUtil.set(Constant.RedisPrefix.TOKEN_WX + token, userWxBean.getUserId(), 7 * 24 * 60 * 60 * 1000);
+
         return userWxBean;
     }
 
@@ -345,6 +345,22 @@ public class UserLogic {
         userWxBean.setToken(token);
         redisUtil.set(Constant.RedisPrefix.TOKEN_WX + token, userWxBean.getUserId(), 7 * 24 * 60 * 60);
         redisUtil.set(Constant.RedisPrefix.TOKEN_APP_USER + token, user, 7 * 24 * 60 * 60);
+
+        final String[] locate = user.getCurLocate().split(",");
+        final List<StorageBean> storageBeans = storageLogic.locateStorageList(null, locate[0], locate[1]);
+
+        // 如果有最近一次选仓库
+        if (StringUtils.isNotBlank(user.getLastStorageId())) {
+            final List<StorageBean> existsList = storageBeans.stream().filter(v -> v.getStorageId().equals(user.getLastStorageId())).collect(Collectors.toList());
+            if (CollectionUtil.isNotEmpty(existsList)) {
+                userWxBean.setStorage(existsList.get(0));
+            }
+        }
+
+        if (Objects.isNull(userWxBean.getStorage())) {
+            userWxBean.setStorage(storageBeans.get(0));
+        }
+
         return userWxBean;
     }
 

+ 3 - 0
mall-miniapp-service/src/main/resources/mapper/AppMapper.xml

@@ -108,6 +108,9 @@
             AND lat IS NOT NULL
             AND lng != ''
             AND lat != ''
+            <if test="companyWechatId != null and companyWechatId !=''">
+                AND company_wechat_id = #{companyWechatId}
+            </if>
         ORDER BY distance ASC
     </select>