From db3c1f464e80458a1b6ccbe31b0355775df8e574 Mon Sep 17 00:00:00 2001
From: jiangqs <jiangqs>
Date: 星期三, 23 八月 2023 20:45:34 +0800
Subject: [PATCH] bug

---
 ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/console/ShopController.java |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/console/ShopController.java b/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/console/ShopController.java
index fea4303..1b8ca88 100644
--- a/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/console/ShopController.java
+++ b/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/console/ShopController.java
@@ -1,8 +1,12 @@
 package com.ruoyi.shop.controller.console;
 
+import com.github.binarywang.wxpay.bean.profitsharingV3.ProfitSharingReceiver;
+import com.ruoyi.common.core.constant.CacheConstants;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.exception.ServiceException;
 import com.ruoyi.common.core.utils.bean.BeanUtils;
+import com.ruoyi.common.redis.service.RedisService;
+import com.ruoyi.common.security.utils.SecurityUtils;
 import com.ruoyi.shop.domain.pojo.shop.ShopAuthentication;
 import com.ruoyi.shop.domain.pojo.shop.ShopProportion;
 import com.ruoyi.shop.domain.pojo.shop.ShopRelUser;
@@ -69,6 +73,8 @@
     @Resource
     private ShopProportionService shopProportionService;
 
+    @Resource
+    private RedisService redisService;
     /**
      * 企业微信H5登录
      * @param qwUserDetail
@@ -85,6 +91,12 @@
         Long userId = shopStaff.getUserId();
         SysUser sysUser = remoteUserService.getSysUser(userId).getData();
         Optional.ofNullable(sysUser).orElseThrow(() -> new ServiceException("登录失败,未查询到用户"));
+        Shop shop = shopService.getByShopId(shopStaff.getShopId());
+        if(shop.getFrozenFlag()==1){
+            String userKey = SecurityUtils.getUserKey();
+            redisService.deleteObject(CacheConstants.LOGIN_TOKEN_KEY+userKey);
+            throw new ServiceException("商户已被冻结",401);
+        }
         // 构造登录返回信息
         QwH5LoginVo qwH5LoginVo = new QwH5LoginVo();
         qwH5LoginVo.setUserid(qwUserDetail.getUserid());
@@ -348,4 +360,10 @@
         shopService.authShop();
         return R.ok();
     }
+
+    @PostMapping("/addProfitSharingReceiver")
+    R authShop(@RequestBody ProfitSharingReceiver profitSharingReceiver){
+        shopService.addProfitSharingReceiver(profitSharingReceiver);
+        return R.ok();
+    }
 }

--
Gitblit v1.7.1