From dbff53150cdc807faa56c0d1a947d24b69f372b9 Mon Sep 17 00:00:00 2001 From: jiangqs <jiangqs> Date: 星期四, 31 八月 2023 18:43:20 +0800 Subject: [PATCH] bug --- ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/console/ShopController.java | 50 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 47 insertions(+), 3 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 4b5e9e0..c36aa00 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,11 @@ package com.ruoyi.shop.controller.console; +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 +72,8 @@ @Resource private ShopProportionService shopProportionService; + @Resource + private RedisService redisService; /** * 企业微信H5登录 * @param qwUserDetail @@ -85,6 +90,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()); @@ -139,10 +150,10 @@ @PostMapping("/getShopByBelongUserId") public R<ShopRelUserVo> getShopByBelongUserId(@RequestBody Long userId) { - Shop shop = shopService.getShopByBelongUserId(userId); - Optional.ofNullable(shop).orElseThrow(() -> new ServiceException("未查询到商户信息")); + List<Shop> shopList = shopService.getShopByBelongUserId(userId); + Optional.ofNullable(shopList.get(0)).orElseThrow(() -> new ServiceException("未查询到商户信息")); ShopRelUserVo shopRelUserVo = new ShopRelUserVo(); - shopRelUserVo.setShopId(shop.getShopId()); + shopRelUserVo.setShopId(shopList.get(0).getShopId()); return R.ok(shopRelUserVo); } @@ -329,4 +340,37 @@ shopStaffService.editMgtShopStaff(mgtShopStaffEditDto); return R.ok(); } + + /** + * @description + * @author jqs + * @date 2023/8/10 23:01 + * @param cityCodes + * @return R<List<Long>> + */ + @PostMapping("/listShopIdByCityCode") + R<List<Long>> listShopIdByCityCode(@RequestBody List<String> cityCodes){ + List<Long> shopIdList = shopService.listShopIdByCityCode(cityCodes); + return R.ok(shopIdList); + } + + @PostMapping("/authShop") + R authShop(){ + shopService.authShop(); + return R.ok(); + } + + /** + * @description 获取今日任务通知列表 + * @author jqs + * @date 2023/8/29 15:03 + * @param + * @return R<List<MgtUserTaskMsgVo>> + */ + @PostMapping("/getTaskMsgList") + R<List<MgtUserTaskMsgVo>> getTaskMsgList(){ + List<MgtUserTaskMsgVo> userTaskMsgVoList = shopService.getTaskMsgList(); + return R.ok(userTaskMsgVoList); + } + } -- Gitblit v1.7.1