From 4ddf8b517a730a7cf5d60ff1755f3e38b98fda01 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期五, 20 十二月 2024 15:03:46 +0800 Subject: [PATCH] 合并代码 --- ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/AppUserServiceImpl.java | 36 ++++++++++++++++++++++++++++-------- 1 files changed, 28 insertions(+), 8 deletions(-) diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/AppUserServiceImpl.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/AppUserServiceImpl.java index ec7c38a..cf8db83 100644 --- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/AppUserServiceImpl.java +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/AppUserServiceImpl.java @@ -3,6 +3,8 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.account.api.model.AppUserShop; import com.ruoyi.account.api.model.UserChangeLog; @@ -31,8 +33,10 @@ import com.ruoyi.system.api.feignClient.SysUserClient; import com.ruoyi.system.api.model.LoginUser; import org.apache.logging.log4j.core.util.UuidUtil; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import javax.annotation.Resource; import java.math.BigDecimal; @@ -89,13 +93,10 @@ @Resource private UserPointService userPointService; - - - - - - - + @Autowired + private AppUserMapper appUserMapper; + + /** * 小程序一键登录 * @param appletLogin @@ -200,7 +201,7 @@ //校验验证码获取评率(1分钟5次) String key = smsCode.getType() + "&" + smsCode.getPhone(); Map<String, Object> cacheMap = redisService.getCacheMap(key); - if(null != cacheMap){ + if(null != cacheMap && cacheMap.size() > 0){ Integer number = Integer.valueOf(cacheMap.get("number").toString()) + 1; Long startTime = Long.valueOf(cacheMap.get("startTime").toString()); if(number > 5 && (System.currentTimeMillis() - startTime) < 60000){ @@ -654,4 +655,23 @@ } } } + + @Override + public IPage<AppUser> getAppuserPage(Integer pageNum, Integer pageSize, AppUser appUser) { + if (StringUtils.isNotEmpty(appUser.getShopName())){ + R<Set<Integer>> shopR = shopClient.getShopIdByName(appUser.getShopName()); + if (R.isSuccess(shopR)){ + Set<Integer> shopIds = shopR.getData(); + if (!CollectionUtils.isEmpty(shopIds)){ + appUser.setShopIds(shopIds); + } + } + } + return appUserMapper.getAppuserPage(new Page<>(pageNum, pageSize), appUser); + } + @Override + public IPage<AppUser> getAppuserPage1(Integer pageNum, Integer pageSize, AppUser appUser,Integer objectId,List<Long> userIds) { + + return appUserMapper.getAppuserPage1(new Page<>(pageNum, pageSize), appUser,objectId,userIds); + } } -- Gitblit v1.7.1