1 files added
51 files modified
| | |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.boot.CommandLineRunner; |
| | | import org.springframework.stereotype.Component; |
| | | import redis.clients.jedis.Jedis; |
| | | import redis.clients.jedis.JedisPool; |
| | | import redis.clients.jedis.JedisPoolConfig; |
| | |
| | | * @date 2019年2月25日 |
| | | */ |
| | | |
| | | @Component |
| | | public class RedisClient implements CommandLineRunner { |
| | | |
| | | /** |
| | |
| | | import com.matrix.core.tools.WebUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | /** |
| | |
| | | * @email 935090232@qq.com |
| | | * @date 2018年1月19日 |
| | | */ |
| | | @Component |
| | | public class RedisUserLoginUtils { |
| | | |
| | | @Autowired |
| | |
| | | import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType; |
| | | import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.springframework.util.AntPathMatcher; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.*; |
| | |
| | | |
| | | private static final String EMPTY = ""; |
| | | |
| | | |
| | | /** |
| | | * 查找指定字符串是否匹配指定字符串列表中的任意一个字符串 |
| | | * |
| | | * @param str 指定字符串 |
| | | * @param strs 需要检查的字符串数组 |
| | | * @return 是否匹配 |
| | | */ |
| | | public static boolean matches(String str, List<String> strs) |
| | | { |
| | | if (isBlank(str) || CollectionUtils.isEmpty(strs)) |
| | | { |
| | | return false; |
| | | } |
| | | for (String pattern : strs) |
| | | { |
| | | if (isMatch(pattern, str)) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 判断url是否与规则配置: |
| | | * ? 表示单个字符; |
| | | * * 表示一层路径内的任意字符串,不可跨层级; |
| | | * ** 表示任意层路径; |
| | | * |
| | | * @param pattern 匹配规则 |
| | | * @param url 需要匹配的url |
| | | * @return |
| | | */ |
| | | public static boolean isMatch(String pattern, String url) |
| | | { |
| | | AntPathMatcher matcher = new AntPathMatcher(); |
| | | return matcher.match(pattern, url); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 将字符串中的某些值用指定字符代替 |
| | | * |
| | |
| | | package com.matrix.system.app.action; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.matrix.component.redis.RedisClient; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.*; |
| | | import com.matrix.system.app.authority.AppAuthorityManager; |
| | |
| | | import com.matrix.system.common.authority.strategy.LoginStrategy; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.init.LocalCache; |
| | | import com.matrix.system.common.service.SysUsersService; |
| | | import com.matrix.system.common.tools.PasswordUtil; |
| | | import com.matrix.system.common.tools.UploadUtil; |
| | |
| | | import java.io.IOException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author wzy |
| | |
| | | @Autowired |
| | | private BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | @Autowired |
| | | private RedisClient redisClient; |
| | | |
| | | @Value("${file_storage_path}") |
| | | private String fileStoragePath; |
| | |
| | | user.setSuPassword(null); |
| | | |
| | | String token = UUIDUtil.getRandomID(); |
| | | redisClient.saveValueForever(token, JSONObject.toJSONString(user)); |
| | | LocalCache.save(token, user); |
| | | |
| | | userInfoVo.setId(user.getSuId()); |
| | | userInfoVo.setName(user.getSuName()); |
| | |
| | | return AjaxResult.buildFailInstance("该手机号不存在"); |
| | | } |
| | | |
| | | String codeExist = redisClient.getCachedValue(smsCodeDto.getTelphone()); |
| | | String codeExist = LocalCache.get(smsCodeDto.getTelphone()); |
| | | if (StringUtils.isNotBlank(codeExist)) { |
| | | return AjaxResult.buildFailInstance("请勿重复发送验证码"); |
| | | } |
| | | |
| | | Integer code =(int) ((Math.random() * 9 + 1) * 100000); |
| | | Sms106Send.sendVerifyCode(smsCodeDto.getTelphone(), code.toString(), 2); |
| | | redisClient.saveValue(smsCodeDto.getTelphone(), code.toString(), 120); |
| | | LocalCache.save(smsCodeDto.getTelphone(), code.toString(), 120 * 1000); |
| | | return AjaxResult.buildSuccessInstance("发送成功"); |
| | | } |
| | | |
| | |
| | | return AjaxResult.buildFailInstance("该手机号不存在"); |
| | | } |
| | | |
| | | String code = redisClient.getCachedValue(pwdResetDto.getTelphone()); |
| | | String code = LocalCache.get(pwdResetDto.getTelphone()); |
| | | if (StringUtils.isBlank(code)) { |
| | | return AjaxResult.buildFailInstance("验证码已失效,请重新发送"); |
| | | } |
| | |
| | | |
| | | int i = sysUsersService.updateUserPassword(user.getSuId(), pwd); |
| | | if (i > 0) { |
| | | redisClient.removeObject(pwdResetDto.getTelphone()); |
| | | LocalCache.remove(pwdResetDto.getTelphone()); |
| | | return AjaxResult.buildSuccessInstance("修改成功"); |
| | | } |
| | | return AjaxResult.buildFailInstance("修改失败"); |
| | |
| | | package com.matrix.system.app.action; |
| | | |
| | | import com.matrix.component.redis.RedisClient; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.app.dto.*; |
| | | import com.matrix.system.app.mapper.SysBeauticianStateMapper; |
| | | import com.matrix.system.app.dto.BeauticianDto; |
| | | import com.matrix.system.app.dto.ModifyUserDto; |
| | | import com.matrix.system.app.dto.PwdModifyDto; |
| | | import com.matrix.system.app.dto.UsersQueryDto; |
| | | import com.matrix.system.app.mapper.SysUsersMapper; |
| | | import com.matrix.system.app.mapper.SysWorkBeatuistaffMapper; |
| | | import com.matrix.system.app.vo.BeauticianVo; |
| | | import com.matrix.system.app.vo.UserAchieveVo; |
| | | import com.matrix.system.app.vo.UserInfoDetailVo; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.init.LocalCache; |
| | | import com.matrix.system.common.interceptor.ApiUserLoginInterceptor; |
| | | import com.matrix.system.common.service.SysUsersService; |
| | | import com.matrix.system.common.tools.DataAuthUtil; |
| | | import com.matrix.system.common.tools.PasswordUtil; |
| | | import com.matrix.system.hive.action.BaseController; |
| | | import com.matrix.system.hive.bean.SysBeauticianState; |
| | | import com.matrix.system.hive.bean.SysWorkBeatuistaff; |
| | | import com.matrix.system.hive.service.AchieveNewService; |
| | | import com.matrix.system.hive.service.SysWorkBeatuistaffService; |
| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private SysWorkBeatuistaffService sysWorkBeatuistaffService; |
| | | |
| | | @Autowired |
| | | private RedisClient redisClient; |
| | | @Value("${login_private_key}") |
| | | private String privateKey; |
| | | |
| | |
| | | @GetMapping(value = "/loginOut") |
| | | public AjaxResult loginOut(HttpServletRequest request) { |
| | | String token=ApiUserLoginInterceptor.resolveToken(request,privateKey); |
| | | redisClient.removeObject(token); |
| | | LocalCache.remove(token); |
| | | return AjaxResult.buildSuccessInstance("退出成功"); |
| | | } |
| | | |
| | |
| | | package com.matrix.system.app.authority; |
| | | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.matrix.component.redis.RedisClient; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | |
| | | import com.matrix.system.common.bean.SysFunction; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.init.LocalCache; |
| | | import com.matrix.system.common.service.SysFunctionService; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | private static final int DEFAULT_2 = 2; |
| | | |
| | | @Autowired |
| | | RedisClient redisClient; |
| | | |
| | | @Autowired |
| | | SysFunctionService sysFunctionService; |
| | |
| | | |
| | | |
| | | String redisKey = USER_POWER_REDISKEY_APP + SecureUtil.md5(user.getSuId()+""); |
| | | String cachedValue = redisClient.getCachedValue(redisKey); |
| | | if (StringUtils.isNotBlank(cachedValue)) { |
| | | //从缓存中获取用户权限 |
| | | JSONObject powerMap = JSONUtil.parseObj(cachedValue); |
| | | String userFunctionMapStr = powerMap.get(USERFUNCTION).toString(); |
| | | JSONObject userFunctionMap = JSONUtil.parseObj(userFunctionMapStr); |
| | | Set<String> userFunctionMapKeys = userFunctionMap.keySet(); |
| | | userFunctionMapKeys.forEach(key -> { |
| | | userFunction.put(key, userFunctionMap.get(key, SysFunction.class)); |
| | | }); |
| | | Map<String, Object> cachePowerMap = LocalCache.get(redisKey); |
| | | if (Objects.nonNull(cachePowerMap)) { |
| | | |
| | | String userUrlMappingListStr = powerMap.get(USER_URL_MAPPING).toString(); |
| | | JSONArray userUrlMappingArray = JSONUtil.parseArray(userUrlMappingListStr); |
| | | for (int i = 0; i < userUrlMappingArray.size(); i++) { |
| | | userUrlMapping.add(userUrlMappingArray.get(i, String.class)); |
| | | } |
| | | userFunction = (Map<String, SysFunction>) cachePowerMap.get(USERFUNCTION); |
| | | |
| | | userUrlMapping = (List<String>) cachePowerMap.get(USER_URL_MAPPING); |
| | | |
| | | } else { |
| | | // 获取用户所有权限 |
| | | getUserFunction(user,userFunction, userUrlMapping); |
| | |
| | | Map<String ,Object> powerMap=new HashMap<>(); |
| | | powerMap.put(USERFUNCTION, userFunction); |
| | | powerMap.put(USER_URL_MAPPING, userUrlMapping); |
| | | redisClient.saveValue(redisKey,JSONUtil.parseObj(powerMap,true)); |
| | | LocalCache.save(redisKey,powerMap); |
| | | } |
| | | |
| | | |
| | | // TODO 这里的用户权限应该放到redis缓存中,在拦截器中做权限拦截 |
| | | WebUtil.setSessionAttribute(USERFUNCTION, userFunction); |
| | | WebUtil.setSessionAttribute(USER_URL_MAPPING, userUrlMapping); |
| | | result.putInMap(USERFUNCTION, userFunction); |
| | |
| | | |
| | | @RequestMapping("/getLocalCache") |
| | | public @ResponseBody AjaxResult getLocalCache(String key) { |
| | | Object cache= LocalCache.get(key); |
| | | return AjaxResult.buildSuccessInstance(cache); |
| | | return AjaxResult.buildSuccessInstance(LocalCache.getValues(key)); |
| | | } |
| | | |
| | | |
| | |
| | | package com.matrix.system.common.actions; |
| | | |
| | | import com.matrix.component.redis.RedisClient; |
| | | import com.matrix.core.anotations.RemoveRequestToken; |
| | | import com.matrix.core.anotations.SaveRequestToken; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | |
| | | import com.matrix.system.common.bean.SysRole; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.constance.AppVocabularyCode; |
| | | import com.matrix.system.common.init.LocalCache; |
| | | import com.matrix.system.common.service.SysFunctionService; |
| | | import com.matrix.system.common.service.SysRoleService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private SysFunctionService sysFunctionService; |
| | | |
| | | public static final String BEV = "SYSROLE_BEV"; |
| | | @Autowired |
| | | RedisClient redisClient; |
| | | /** |
| | | * 列表显示 |
| | | * |
| | |
| | | } |
| | | AjaxResult result = modify(sysRoleService, WebUtil.getSessionAttribute(BEV), sysRole, AppVocabularyCode.ROLE); |
| | | WebUtil.removeSessionAttribute(BEV); |
| | | redisClient.batchDel(DefaultAuthorityManager.USER_POWER_REDISKEY); |
| | | LocalCache.batchRemove(DefaultAuthorityManager.USER_POWER_REDISKEY+"*"); |
| | | return result; |
| | | } |
| | | |
| | |
| | | package com.matrix.system.common.authority; |
| | | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.matrix.component.redis.RedisClient; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | |
| | | import com.matrix.system.common.bean.SysFunction; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.init.LocalCache; |
| | | import com.matrix.system.common.service.SysFunctionService; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | **/ |
| | | public static final String USER_URL_MAPPING = "userUrlMapping"; |
| | | |
| | | @Autowired |
| | | RedisClient redisClient; |
| | | |
| | | private DefaultAuthorityManager() { |
| | | } |
| | |
| | | SysUsers sysUser = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | |
| | | String redisKey = USER_POWER_REDISKEY_PC + SecureUtil.md5(sysUser.getSuId() + ""); |
| | | String cachedValue = redisClient.getCachedValue(redisKey); |
| | | if (StringUtils.isNotBlank(cachedValue)) { |
| | | //从缓存中获取用户权限 |
| | | JSONObject powerMap = JSONUtil.parseObj(cachedValue); |
| | | String userFunctionMapStr = powerMap.get(USERFUNCTION).toString(); |
| | | JSONObject userFunctionMap = JSONUtil.parseObj(userFunctionMapStr); |
| | | Set<String> userFunctionMapKeys = userFunctionMap.keySet(); |
| | | userFunctionMapKeys.forEach(key -> { |
| | | userFunction.put(key, userFunctionMap.get(key, SysFunction.class)); |
| | | }); |
| | | String menusFunctionListStr = powerMap.get(MENUSFUNCTION).toString(); |
| | | JSONArray menusFunctionArray = JSONUtil.parseArray(menusFunctionListStr); |
| | | for (int i = 0; i < menusFunctionArray.size(); i++) { |
| | | menuFunction.add(menusFunctionArray.get(i, SysFunction.class)); |
| | | } |
| | | String userUrlMappingListStr = powerMap.get(USER_URL_MAPPING).toString(); |
| | | JSONArray userUrlMappingArray = JSONUtil.parseArray(userUrlMappingListStr); |
| | | for (int i = 0; i < userUrlMappingArray.size(); i++) { |
| | | userUrlMapping.add(userUrlMappingArray.get(i, String.class)); |
| | | } |
| | | Map<String, Object> cachePowerMap = LocalCache.get(redisKey); |
| | | |
| | | if (Objects.nonNull(cachePowerMap)) { |
| | | |
| | | userFunction = (Map<String, SysFunction>) cachePowerMap.get(USERFUNCTION); |
| | | |
| | | menuFunction = (List<SysFunction>) cachePowerMap.get(MENUSFUNCTION); |
| | | |
| | | userUrlMapping = (List<String>) cachePowerMap.get(USER_URL_MAPPING); |
| | | |
| | | } else { |
| | | // 获取用户所有权限 |
| | | getUserFunction(userFunction, menuFunctionMap, userUrlMapping); |
| | |
| | | powerMap.put(USERFUNCTION, userFunction); |
| | | powerMap.put(MENUSFUNCTION, menuFunction); |
| | | powerMap.put(USER_URL_MAPPING, userUrlMapping); |
| | | redisClient.saveValue(redisKey, JSONUtil.parseObj(powerMap, true)); |
| | | //权限信息加入缓存中 |
| | | LocalCache.save(redisKey,powerMap); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | import com.google.common.util.concurrent.ThreadFactoryBuilder; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Iterator; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.Set; |
| | | import java.util.concurrent.*; |
| | | import java.util.concurrent.atomic.AtomicLong; |
| | | import java.util.stream.Collectors; |
| | | |
| | | public class LocalCache { |
| | | |
| | |
| | | |
| | | private static ConcurrentMap<String, Value> localCache = new ConcurrentHashMap(60); |
| | | |
| | | /** |
| | | * 根据key匹配多个缓存值 |
| | | * |
| | | * @param key |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | public static <T> Map<String, T> getValues(String key) { |
| | | return localCache.entrySet().stream() |
| | | .filter(item -> StringUtils.isMatch(key, item.getKey())) |
| | | .map(Map.Entry::getValue) |
| | | .filter(item -> Objects.nonNull(item.value)) |
| | | .collect(Collectors.toMap(Value::getKey, item -> (T) item.value)); |
| | | } |
| | | |
| | | /** |
| | | * 获取本地缓存 |
| | |
| | | * @return |
| | | */ |
| | | public static <T> T get(String key) { |
| | | return (T) localCache.get(key); |
| | | Value value = localCache.get(key); |
| | | if (Objects.nonNull(value)) { |
| | | return (T) value.value; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 删除缓存 |
| | | * |
| | | * @param key |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | public static <T> T remove(String key) { |
| | | Value value = localCache.remove(key); |
| | | if (Objects.nonNull(value)) { |
| | | return (T) value.value; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 批量删除缓存 |
| | | * |
| | | * @param key |
| | | * @return |
| | | */ |
| | | public static int batchRemove(String key) { |
| | | int count = 0; |
| | | Set<Map.Entry<String, Value>> entries = localCache.entrySet(); |
| | | Iterator<Map.Entry<String, Value>> iterator = entries.iterator(); |
| | | while (iterator.hasNext()) { |
| | | Map.Entry<String, Value> next = iterator.next(); |
| | | if (StringUtils.isMatch(key, next.getKey())) { |
| | | remove(next.getKey()); |
| | | count++; |
| | | } |
| | | } |
| | | return count; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param value |
| | | */ |
| | | public static void save(String key, Object value) { |
| | | if (null != localCache.put(key, buildValue(value))) { |
| | | if (null != localCache.put(key, buildValue(key, value))) { |
| | | LogUtil.debug("覆盖原有缓存{}", key); |
| | | } |
| | | } |
| | |
| | | * @param timeOut 毫秒 |
| | | */ |
| | | public static void save(String key, Object value, long timeOut) { |
| | | if (null != localCache.put(key, buildValue(value, timeOut))) { |
| | | if (null != localCache.put(key, buildValue(key, value, timeOut))) { |
| | | LogUtil.debug("覆盖原有缓存{}", key); |
| | | } |
| | | startClearThread(); |
| | | } |
| | | |
| | | /** |
| | | * 重置缓存失效时间 |
| | | * @param key |
| | | */ |
| | | public static void resetExpire(String key) { |
| | | Objects.requireNonNull(key); |
| | | Value value = localCache.get(key); |
| | | if(Objects.nonNull(value)){ |
| | | value.getCreateTime().set(System.currentTimeMillis()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | continue; |
| | | } |
| | | |
| | | boolean isTimeOut = (System.currentTimeMillis() - next.getValue().createTime) > next.getValue().timeOut; |
| | | boolean isTimeOut = (System.currentTimeMillis() - next.getValue().getCreateTime().longValue()) > next.getValue().timeOut; |
| | | if (isTimeOut) { |
| | | Value removed = localCache.remove(next.getKey()); |
| | | LogUtil.debug("清除过期对象:{}", removed.value); |
| | |
| | | } |
| | | |
| | | |
| | | private static Value buildValue(Object value) { |
| | | return buildValue(value, 0); |
| | | private static Value buildValue(String key, Object value) { |
| | | return buildValue(key, value, 0); |
| | | } |
| | | |
| | | |
| | | private static Value buildValue(Object value, long timeOut) { |
| | | private static Value buildValue(String key, Object value, long timeOut) { |
| | | Value instances = new Value(); |
| | | instances.createTime = System.currentTimeMillis(); |
| | | instances.createTime = new AtomicLong(System.currentTimeMillis()); |
| | | instances.key = key; |
| | | instances.value = value; |
| | | instances.timeOut = timeOut; |
| | | return instances; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 缓存对象 |
| | | */ |
| | | @Data |
| | | static class Value { |
| | | |
| | | /** |
| | | * 过期时间,0 表示不过期,单位毫秒 |
| | | */ |
| | | private long timeOut = 0; |
| | | /** |
| | | * 缓存key |
| | | */ |
| | | private String key; |
| | | /** |
| | | * 缓存值 |
| | | */ |
| | |
| | | /** |
| | | * 缓存创建时间 |
| | | */ |
| | | private long createTime; |
| | | private AtomicLong createTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | /** |
| | | * projectName: zq-erp |
| | | * fileName: UserCacheManager.java |
| | | * packageName: com.matrix.system.common.init |
| | | * date: 2021-10-25 16:58 |
| | | * copyright(c) 2021 http://www.hydee.cn/ Inc. All rights reserved. |
| | | */ |
| | | package com.matrix.system.common.init; |
| | | |
| | | import com.matrix.core.constance.SystemErrorCode; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.UUIDUtil; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @version: V1.0 |
| | | * @author: JiangYouYao |
| | | * @className: UserCacheManager |
| | | * @packageName: com.matrix.system.common.init |
| | | * @description: 用户缓存管理 |
| | | * @data: 2021-10-25 16:58 |
| | | **/ |
| | | @Component |
| | | public class UserCacheManager { |
| | | |
| | | @Value("${debug}") |
| | | private String isDebug; |
| | | |
| | | |
| | | /** |
| | | * 判断用户是否已经登录过 |
| | | * |
| | | * @return |
| | | * @author JIANGYOUYAO |
| | | * @email 935090232@qq.com |
| | | * @date 2018年1月19日 |
| | | * 会从http请求投中获取token进行验证 |
| | | */ |
| | | public boolean isUserLogin() { |
| | | String token = getUserToken(); |
| | | if (StringUtils.isNotBlank(token)) { |
| | | return LocalCache.get(token) != null; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 在本地缓存中保存用户信息,并且返回保存的token |
| | | * |
| | | * @author JIANGYOUYAO |
| | | * @email 935090232@qq.com |
| | | * @date 2018年1月19日 |
| | | * @return 返回保存用户信息的token |
| | | */ |
| | | public String saveUserInfo(Object obj) { |
| | | String token = UUIDUtil.getRandomID(); |
| | | LocalCache.save(token, obj); |
| | | return token; |
| | | } |
| | | |
| | | /** |
| | | * 用户退出 |
| | | * |
| | | * @author:吕敬瑛 |
| | | * @date:2018年1月19日下午3:17:14 |
| | | */ |
| | | public void loginOut() { |
| | | LocalCache.remove(getUserToken()); |
| | | } |
| | | |
| | | /** |
| | | * 更新用户缓存 |
| | | */ |
| | | public void updateUserInfo(Object user) { |
| | | LocalCache.save(getUserToken(),user); |
| | | } |
| | | |
| | | /** |
| | | * 获取登录用户信息,如果 获取失败将会抛出异常 |
| | | * |
| | | * @return |
| | | * @author JIANGYOUYAO |
| | | * @email 935090232@qq.com |
| | | * @date 2018年1月19日 |
| | | */ |
| | | public <T> T getLoginUser() { |
| | | String userToken = getUserToken(); |
| | | if (userToken != null) { |
| | | T user = LocalCache.get(userToken); |
| | | if (Objects.nonNull(user)) { |
| | | //重新设置key过期时间 |
| | | LocalCache.resetExpire(userToken); |
| | | return user; |
| | | } else { |
| | | throw new GlobleException(SystemErrorCode.REQUEST_INVALID); |
| | | } |
| | | } else { |
| | | throw new GlobleException(SystemErrorCode.REQUEST_INVALID); |
| | | } |
| | | } |
| | | |
| | | public String getUserToken() { |
| | | String token = WebUtil.getRequest().getHeader("token"); |
| | | // debug模式可以从url参数中获取token |
| | | if (StringUtils.isBlank(token) && "true".equals(isDebug)) { |
| | | if (token == null) { |
| | | token = WebUtil.getRequest().getParameter("token"); |
| | | } |
| | | } |
| | | return token; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.matrix.component.redis.RedisClient; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.LogUtil; |
| | |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.dao.SysUsersDao; |
| | | import com.matrix.system.common.init.LocalCache; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | @Component |
| | | public class ApiUserLoginInterceptor implements HandlerInterceptor { |
| | | |
| | | @Autowired |
| | | private RedisClient redisClient; |
| | | |
| | | @Value("${login_private_key}") |
| | | private String privateKey; |
| | |
| | | return false; |
| | | } |
| | | |
| | | String userStr = redisClient.getCachedValue(token); |
| | | String userStr = LocalCache.get(token); |
| | | // redisClient.resetExpire(token); |
| | | if (StringUtils.isBlank(userStr)) { |
| | | ajaxResult.setInfo("login time out"); |
| | |
| | | package com.matrix.system.common.service.impl; |
| | | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import com.matrix.component.redis.RedisClient; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.constance.SystemErrorCode; |
| | | import com.matrix.core.exception.GlobleException; |
| | |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.constance.AppMessageCode; |
| | | import com.matrix.system.common.dao.SysUsersDao; |
| | | import com.matrix.system.common.init.LocalCache; |
| | | import com.matrix.system.common.service.SysUsersService; |
| | | import com.matrix.system.common.tools.PasswordUtil; |
| | | import com.matrix.system.common.tools.ServiceUtil; |
| | |
| | | private static final String SU_ID = "su_id"; |
| | | |
| | | private static final String SU_ACCOUNT = "su_account"; |
| | | @Autowired |
| | | RedisClient redisClient; |
| | | @Autowired |
| | | private SysUsersDao sysUsersDao; |
| | | |
| | |
| | | //删除用户权限缓存 |
| | | String redisKey=DefaultAuthorityManager.USER_POWER_REDISKEY+ SecureUtil.md5(oldSysUsers.getSuId()+""); |
| | | String redisKeyPc=DefaultAuthorityManager.USER_POWER_REDISKEY_PC+ SecureUtil.md5(oldSysUsers.getSuId()+""); |
| | | redisClient.removeObject(redisKey); |
| | | redisClient.removeObject(redisKeyPc); |
| | | LocalCache.remove(redisKey); |
| | | LocalCache.remove(redisKeyPc); |
| | | |
| | | return MatrixConstance.DML_SUCCESSS; |
| | | } |
| | |
| | | package com.matrix.system.shopXcx.action; |
| | | |
| | | import com.matrix.component.asyncmessage.AsyncMessageManager; |
| | | import com.matrix.component.rabbitmq.RabiitMqTemplate; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil; |
| | | import com.matrix.core.anotations.RemoveRequestToken; |
| | | import com.matrix.core.anotations.SaveRequestToken; |
| | |
| | | private WXShopOrderService wxShopOrderService; |
| | | @Autowired |
| | | private ShopDeliveryInfoDao shopDeliveryInfoDao; |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | @Autowired |
| | | private AsyncMessageManager asyncMessageManager; |
| | | @Autowired |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.component.asyncmessage.AsyncMessageManager; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.component.wechat.externalInterface.protocol.paramProtocol.BrandWCPayRequestData; |
| | | import com.matrix.core.constance.SystemErrorCode; |
| | | import com.matrix.core.exception.GlobleException; |
| | |
| | | |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | |
| | | @Autowired |
| | | ShopCouponRecordDao shopCouponRecordDao; |
| | |
| | | @GetMapping(value = "/getOrderStatusCount") |
| | | @ResponseBody |
| | | public AjaxResult getOrderStatusCount() { |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | AjaxResult result = AjaxResult.buildSuccessInstance( |
| | | shopOrderDao.selectOrderStatusCount(sysVipInfo.getId())); |
| | | return result; |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.tools.AES; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.shopXcx.api.pojo.BindingPhoneNumberPOJO; |
| | |
| | | private SysVipInfoDao sysVipInfoDao; |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | |
| | | |
| | | @Value("${evn}") |
| | |
| | | if (StringUtils.isBlank(bindingPhoneNumber.getPhoneNumber())) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "手机号码不能为空"); |
| | | } |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | |
| | | |
| | | SysVipInfo oldeUser = sysVipInfoDao.selectByPhone(bindingPhoneNumber.getPhoneNumber(), loginUser.getCompanyId()); |
| | |
| | | oldeUser.setAvatarUrl(loginUser.getAvatarUrl()); |
| | | sysVipInfoDao.update(oldeUser); |
| | | sysVipInfoDao.deleteById(loginUser.getId()); |
| | | String token = redisUserLoginUtils.saveUserInfo(oldeUser); |
| | | String token = userCacheManager.saveUserInfo(oldeUser); |
| | | AjaxResult result = AjaxResult.buildSuccessInstance("绑定成功"); |
| | | result.putInMap("token",token); |
| | | result.putInMap("userInfo",oldeUser); |
| | |
| | | @RequestMapping(value = "/deciphering") |
| | | public @ResponseBody |
| | | AjaxResult deciphering(@RequestBody DataDecipheringVo dataDecipheringVo) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | String session_key = loginUser.getSessionKey(); |
| | | LogUtil.debug(dataDecipheringVo.toString()); |
| | | String jsonResult = AES.wxDecrypt(dataDecipheringVo.getEncryptedData(), session_key, dataDecipheringVo.getIv()); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.shopXcx.bean.ShopCollection; |
| | | import com.matrix.system.shopXcx.dao.ShopCollectionDao; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired |
| | | private ShopCollectionDao collectionDao; |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | |
| | | /** |
| | | * 接收保存收藏数据 |
| | |
| | | @PostMapping(value = "/saveCollection") |
| | | public @ResponseBody |
| | | AjaxResult saveCollection(@RequestBody ShopCollection collection) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | collection.setCreateBy(loginUser.getOpenId()); |
| | | collection.setUpdateBy(loginUser.getOpenId()); |
| | | collection.setCollUserid(loginUser.getOpenId()); |
| | |
| | | @ResponseBody |
| | | public AjaxResult deleteByProductId(@PathVariable("collProductid") Integer collProductid){ |
| | | Map<String, Object> deleteMap = new HashMap<>(); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | String collUserid = loginUser.getOpenId(); |
| | | deleteMap.put("collProductid", collProductid); |
| | | deleteMap.put("collUserid", collUserid); |
| | |
| | | @PostMapping("/findCollection") |
| | | @ResponseBody |
| | | public AjaxResult getCollectionByUserId(@RequestBody ShopCollection collection) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | String userId = loginUser.getOpenId(); |
| | | collection.setCollUserid(userId); |
| | | List<ShopCollection> list = collectionDao.selectByUserId(collection); |
| | |
| | | @PostMapping("/findByUserIdAndProid/{collProductid}") |
| | | @ResponseBody |
| | | public AjaxResult findByUserIdAndProid(@PathVariable("collProductid") Integer collProductid) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | String userId = loginUser.getOpenId(); |
| | | List<ShopCollection> list = collectionDao.selectByUserIdAndProid(collProductid,userId); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, list, list.size()); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.component.redis.RedisClient; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.app.authority.AppAuthorityManager; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.system.common.service.SysUsersService; |
| | | import com.matrix.system.hive.bean.SysOrderFlow; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | |
| | | @Autowired |
| | | private AppAuthorityManager authorityManager; |
| | | |
| | | @Autowired |
| | | private RedisClient redisClient; |
| | | |
| | | @Autowired |
| | | private SysVipInfoDao vipInfoDao; |
| | | |
| | | @Autowired |
| | | RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | |
| | | @Autowired |
| | | private SysOrderDao sysOrderDao; |
| | |
| | | }) |
| | | @PostMapping(value = "/findUserOrderList") |
| | | public AjaxResult findUserOrderList(@RequestBody @Validated ErpOrderListDto erpOrderListDto) { |
| | | SysVipInfo vipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo vipInfo = userCacheManager.getLoginUser(); |
| | | |
| | | erpOrderListDto.setVipId(vipInfo.getId()); |
| | | List<ErpOrderDetailVo> rows = sysOrderDao.selectErpOrderList(erpOrderListDto); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.tools.WxacodeUtil; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.shopXcx.api.WeChatApiTools; |
| | | import com.matrix.system.shopXcx.bean.ShopWxAcode; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @RequestMapping(value = "wxapi/getAcode") |
| | | public class WxGetAcodeAction { |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | @Autowired |
| | | WeChatApiTools weChatApiTools; |
| | | /** |
| | |
| | | @PostMapping("/getWxAcode") |
| | | @ResponseBody |
| | | public AjaxResult getWxAcode(@RequestBody ShopWxAcode wxAcode) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | String openId = loginUser.getOpenId(); |
| | | try { |
| | | String wxacodeUrl = WxacodeUtil.getWxacode(wxAcode.getScene(), wxAcode.getPage(), wxAcode.getFileName(), |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.common.bean.CustomerDataDictionary; |
| | | import com.matrix.system.common.dao.CustomerDataDictionaryDao; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | |
| | | import com.matrix.system.common.dao.CustomerDataDictionaryDao; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.shopXcx.bean.ShopInvoice; |
| | | import com.matrix.system.shopXcx.dao.ShopInvoiceDao; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | |
| | | @Autowired |
| | | private ShopInvoiceDao invoiceDao; |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | |
| | | /** |
| | | * 查询发票内容接口 |
| | |
| | | @PostMapping(value = "/saveInvoice") |
| | | public @ResponseBody |
| | | AjaxResult saveInvoice(@RequestBody ShopInvoice shopInvoice) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | shopInvoice.setCreateBy(loginUser.getOpenId()); |
| | | shopInvoice.setUpdateBy(loginUser.getOpenId()); |
| | | shopInvoice.setUserId(loginUser.getOpenId()); |
| | |
| | | @PostMapping("/findProductComment") |
| | | @ResponseBody |
| | | public AjaxResult getProductCommentByUserId(@RequestBody ShopInvoice shopInvoice) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | String userId = loginUser.getOpenId(); |
| | | shopInvoice.setUserId(userId); |
| | | List<ShopInvoice> list = invoiceDao.selectByUserId(shopInvoice); |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.wechat.externalInterface.protocol.paramProtocol.BrandWCPayRequestData; |
| | | import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.system.hive.bean.MoneyCardUse; |
| | | import com.matrix.system.hive.bean.MoneyCardUseFlow; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | |
| | | private MoneyCardUseV2Dao moneyCardUseV2Dao; |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | |
| | | @Autowired |
| | | MoneyCardUseFlowDao moneyCardUseFlowDao; |
| | |
| | | @ApiResponse(code = 200, message = "ok", response = WxMoneyCardUseVO.class) |
| | | }) |
| | | public AjaxResult getUserVipCard() { |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("vip_id", sysVipInfo.getId()); |
| | | queryWrapper.eq("is_vip_car","Y"); |
| | |
| | | @ApiResponse(code = 200, message = "ok", response = WxMoneyCardUseVO.class) |
| | | }) |
| | | public AjaxResult getUserMoneyCardUseList(@RequestBody @Validated BasePageQueryDto pageDto) { |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("vip_id", sysVipInfo.getId()); |
| | | IPage<MoneyCardUse> page = new Page<>(pageDto.getPageNum(), pageDto.getPageSize()); |
| | |
| | | if (total < 0.02) { |
| | | return AjaxResult.buildFailInstance("充值金额最底1元"); |
| | | } |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | MoneyCardUseFlow moneyCardUseFlow = new MoneyCardUseFlow(); |
| | | moneyCardUseFlow.setVipId(sysVipInfo.getId()); |
| | | moneyCardUseFlow.setPayNo(codeService.get32LenNumberCode()); |
| | |
| | | @ApiResponse(code = 200, message = "ok", response = MoneyCardUseFlow.class) |
| | | }) |
| | | public AjaxResult getRechargeList(@RequestBody @Validated MoneyCardUseFlowDto pageDto) { |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | pageDto.setCompanyId(sysVipInfo.getCompanyId()); |
| | | List<MoneyCardUseFlow> dataList = moneyCardUseFlowDao.selectForWxInPage(pageDto); |
| | | return AjaxResult.buildSuccessInstance(dataList); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.score.constant.ScoreSettingConstant; |
| | | import com.matrix.system.score.entity.ScoreVipDetail; |
| | |
| | | @Autowired |
| | | private ShopProductCommentDao productCommentDao; |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | @Autowired |
| | | private ShopOrderDao shopOrderDao; |
| | | |
| | |
| | | @PostMapping(value = "/saveProductComment") |
| | | public @ResponseBody |
| | | AjaxResult saveProductComment(@RequestBody List<ShopProductComment> commentList) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | int flag = 0; |
| | | if(CollectionUtils.isNotEmpty(commentList)){ |
| | | for(ShopProductComment productComment : commentList){ |
| | |
| | | @PostMapping("/findProductComment") |
| | | @ResponseBody |
| | | public AjaxResult getProductCommentByUserId(@RequestBody ShopProductComment productComment) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | String userId = loginUser.getOpenId(); |
| | | productComment.setUserId(userId); |
| | | List<ShopProductComment> list = productCommentDao.selectByUserId(productComment); |
| | |
| | | |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | |
| | | import com.matrix.system.shopXcx.bean.ShopReceiveAddress; |
| | | import com.matrix.system.shopXcx.dao.ShopReceiveAddressDao; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.shopXcx.api.pojo.AddressUntilsPOJO; |
| | | import com.matrix.system.shopXcx.api.tools.AddressUntils; |
| | | import com.matrix.system.shopXcx.bean.ShopReceiveAddress; |
| | | import com.matrix.system.shopXcx.dao.ShopReceiveAddressDao; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | private ShopReceiveAddressDao shopReceiveAddressDao; |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | /** |
| | | * 接收保存收货地址 |
| | | */ |
| | | @PostMapping(value = "/saveReceiveAddress") |
| | | public @ResponseBody |
| | | AjaxResult saveReceiveAddress(@RequestBody ShopReceiveAddress receiveAddress) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | receiveAddress.setCreateBy(loginUser.getOpenId()); |
| | | receiveAddress.setUpdateBy(loginUser.getOpenId()); |
| | | receiveAddress.setAddrUserid(loginUser.getOpenId()); |
| | |
| | | @PostMapping("/findReceiveAddress") |
| | | @ResponseBody |
| | | public AjaxResult getByAddrUserId(@RequestBody ShopReceiveAddress receiveAddress) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | String userId = loginUser.getOpenId(); |
| | | receiveAddress.setAddrUserid(userId); |
| | | List<ShopReceiveAddress> list = shopReceiveAddressDao.selectByModel(receiveAddress); |
| | |
| | | @PostMapping("/findAddrByAddrId/{addrId}") |
| | | @ResponseBody |
| | | public AjaxResult getByAddrId(@PathVariable("addrId") Integer addrId) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | String userId = loginUser.getOpenId(); |
| | | ShopReceiveAddress params = new ShopReceiveAddress(); |
| | | params.setAddrUserid(userId); |
| | |
| | | @PostMapping(value = "/updateReceiveAddress") |
| | | public @ResponseBody |
| | | AjaxResult updateReceiveAddress(@RequestBody ShopReceiveAddress receiveAddress) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | receiveAddress.setCreateBy(loginUser.getOpenId()); |
| | | receiveAddress.setUpdateBy(loginUser.getOpenId()); |
| | | receiveAddress.setAddrUserid(loginUser.getOpenId()); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.tools.WxUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.LogUtil; |
| | |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.dao.CustomerDataDictionaryDao; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.shopXcx.api.service.WxShopRefundRecordService; |
| | | import com.matrix.system.shopXcx.api.tools.SMSTools; |
| | |
| | | @RequestMapping(value = "wxapi/RefundRecord") |
| | | public class WxRefundRecordAction { |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | @Autowired |
| | | private ShopRefundRecordDao refundRecordDao; |
| | | @Autowired |
| | |
| | | @PostMapping(value = "/saveRefundRecord") |
| | | public @ResponseBody |
| | | AjaxResult saveRefundRecord(@RequestBody ShopRefundRecord refundRecord) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | refundRecord.setCreateBy(loginUser.getOpenId()); |
| | | refundRecord.setUpdateBy(loginUser.getOpenId()); |
| | | refundRecord.setUserId(loginUser.getId()); |
| | |
| | | @PostMapping("/findRefundRecord") |
| | | @ResponseBody |
| | | public AjaxResult getRefundRecordByUserId(@RequestBody ShopRefundRecord refundRecord) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | refundRecord.setUserId(loginUser.getId()); |
| | | List<ShopRefundRecord> list = refundRecordDao.selectByRefundUserId(refundRecord); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, list, list.size()); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanApplyDao; |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanOrderDao; |
| | | import com.matrix.system.fenxiao.service.ShopSalesmanApplyService; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.shopXcx.api.dto.SaleOrderDto; |
| | | import com.matrix.system.shopXcx.vo.SalesOrderVo; |
| | | import io.swagger.annotations.Api; |
| | |
| | | ShopSalesmanApplyService shopSalesmanApplyService; |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | |
| | | @Autowired |
| | | private SysVipInfoDao sysVipInfoDao; |
| | |
| | | @ApiResponse(code = 200, message = "ok", response = SalesOrderVo.class) |
| | | }) |
| | | AjaxResult getInvitationuserList(@RequestBody @Validated SaleOrderDto saleOrderDto) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | Page<SalesOrderVo> page=new Page<>(saleOrderDto.getPageNum(),saleOrderDto.getPageSize()); |
| | | if(StringUtils.isBlank(saleOrderDto.getSort())){ |
| | | saleOrderDto.setSort("create_time"); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | |
| | | @Autowired |
| | | private ShopSkuDao shopSkuDao; |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | |
| | | @ApiOperation(value = "查询推广商品", notes = "") |
| | | @PostMapping(value = "/getSalesProductList") |
| | |
| | | shopProduct.setAbleSales(ShopProduct.ABLE_SALES); |
| | | shopProduct.setCompanyId(HostInterceptor.getCompanyId()); |
| | | List<ShopProduct> shopProducts = shopProductDao.selectByModelWx(shopProduct); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectById(sysVipInfo.getSalesmanGrade()); |
| | | shopProducts.forEach(item->{ |
| | | List<ShopSku> shopSkus = shopSkuDao.selectByPid(item.getId()); |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | |
| | | |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | |
| | | @Autowired |
| | | private SysVipInfoDao sysVipInfoDao; |
| | |
| | | @ApiResponse(code = 200, message = "ok", response = ShopRevenueFlow.class) |
| | | }) |
| | | AjaxResult getInvitationuserList(@RequestBody @Validated RevenueFlowDto revenueFlowDto) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | Page<ShopRevenueFlow> page=new Page<>(revenueFlowDto.getPageNum(),revenueFlowDto.getPageSize()); |
| | | revenueFlowDto.setUserId(loginUser.getId()); |
| | | IPage<ShopRevenueFlow> shopSalesmanApplyIPage = revenueFlowDao.selectRevenuFlowList(page, revenueFlowDto); |
| | |
| | | }) |
| | | @Transactional |
| | | AjaxResult withdrawalCash(@RequestBody @Validated WithdrawalCashDto withdrawalCashDto) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | loginUser=sysVipInfoDao.selectById(loginUser.getId()); |
| | | if(withdrawalCashDto.getAmount()<1){ |
| | | return AjaxResult.buildFailInstance("最小提现金额为1元"); |
| | |
| | | //扣除用户剩余提现金额 |
| | | loginUser.setWithdrawalCash(loginUser.getWithdrawalCash()-withdrawalCashDto.getAmount()); |
| | | sysVipInfoDao.update(loginUser); |
| | | redisUserLoginUtils.updateUserInfo(loginUser); |
| | | |
| | | |
| | | userCacheManager.updateUserInfo(loginUser); |
| | | return AjaxResult.buildSuccessInstance("提现成功"); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.tools.ImageUtil; |
| | | import com.matrix.component.tools.WxacodeUtil; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | | import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant; |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanApplyDao; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanApply; |
| | | import com.matrix.system.fenxiao.service.ShopSalesmanApplyService; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.system.shopXcx.api.WeChatApiTools; |
| | | import com.matrix.system.shopXcx.dao.ShopProductDao; |
| | |
| | | import java.awt.*; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.File; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | ShopSalesmanApplyService shopSalesmanApplyService; |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | |
| | | @Autowired |
| | | private SysVipInfoDao sysVipInfoDao; |
| | |
| | | @PostMapping(value = "/applyToBeAnSalesman") |
| | | @Transactional |
| | | public AjaxResult applyToBeAnSalesman(@RequestBody Map<String, String> param) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | Long invitationId=null; |
| | | if(StringUtils.isNotBlank(param.get("invitationId"))){ |
| | | invitationId = Long.parseLong(param.get("invitationId")); |
| | |
| | | } |
| | | ShopSalesmanApply shopSalesmanApply = shopSalesmanApplyService.applyToBeAnSalesman(loginUser.getId(), null, invitationId, ShopSalesmanApply.APPLY_WAY_SELF); |
| | | loginUser = sysVipInfoDao.selectById(loginUser.getId()); |
| | | redisUserLoginUtils.updateUserInfo(loginUser); |
| | | userCacheManager.updateUserInfo(loginUser); |
| | | return AjaxResult.buildSuccessInstance(shopSalesmanApply); |
| | | |
| | | |
| | |
| | | }) |
| | | @GetMapping(value = "/queryApplyProgress") |
| | | public AjaxResult queryApplyProgress() { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | QueryWrapper<ShopSalesmanApply> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("user_id", loginUser.getId()); |
| | | queryWrapper.eq("apply_status", ShopSalesmanApply.APPLY_STATUS_DSH); |
| | |
| | | return AjaxResult.buildFailInstance("请求参数错误"); |
| | | } |
| | | |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | if (invitationId.equals(loginUser.getId())) { |
| | | return AjaxResult.buildSuccessInstance("不能绑定自己"); |
| | | } |
| | |
| | | @PostMapping(value = "/getInvitationPoster") |
| | | AjaxResult getInvitationPoster() { |
| | | try { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | |
| | | String baseSavePath = PropertiesUtil.getString(AppConstance.FILES_TORAGE_PATH); |
| | | // 图片访问URL |
| | |
| | | @ApiResponse(code = 200, message = "ok", response = SalesmanVo.class) |
| | | }) |
| | | AjaxResult getInvitationuserList(@RequestBody BasePageQueryDto pageDto) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | Page<SalesmanVo> page = new Page<>(pageDto.getPageNum(), pageDto.getPageSize()); |
| | | IPage<SalesmanVo> shopSalesmanApplyIPage = salesmanApplyDao.selectInvitationuserInPage(page, loginUser.getId(), pageDto.getKeywords()); |
| | | AjaxResult result = AjaxResult.buildSuccessInstance(shopSalesmanApplyIPage.getRecords()); |
| | |
| | | @ApiResponse(code = 200, message = "ok", response = SalesmanCenterInfo.class) |
| | | }) |
| | | AjaxResult getSalesmanCenterInfo() { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | SalesmanCenterInfo salesmanCenterInfo = salesmanApplyDao.selectSalesmanCenterInfo(loginUser.getId()); |
| | | return AjaxResult.buildSuccessInstance(salesmanCenterInfo); |
| | | } |
| | |
| | | @ApiResponse(code = 200, message = "ok", response = SalesmanApplyCondition.class) |
| | | }) |
| | | AjaxResult getSalesmanApplyCondition() { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | VerificationResult ableToBeAnSalesman = shopSalesmanApplyService.isAbleToBeAnSalesman(loginUser.getId(), loginUser.getCompanyId()); |
| | | SalesmanApplyCondition applyConditionInfo = new SalesmanApplyCondition(); |
| | | applyConditionInfo.setIsAbleApply(ableToBeAnSalesman.isJudgeResult()); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.component.tools.ImageUtil; |
| | | import com.matrix.component.tools.WxacodeUtil; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | |
| | | private ShopProductDao shopProductDao; |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | |
| | | @Autowired |
| | | private ShopShareQrcordDao shareQrcordDao; |
| | |
| | | @RequestMapping(value = "/getProductShareQrcode") |
| | | public @ResponseBody |
| | | AjaxResult getwxacode1(@RequestBody QrcodeVo qrcodeVo) throws Exception { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | loginUser = sysVipInfoDao.selectById(loginUser.getId()); |
| | | //活动类型 |
| | | ShopActivities activities=null; |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | | import com.matrix.system.shopXcx.api.service.WXShopOrderService; |
| | |
| | | private ShopProductDao shopProductDao; |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | |
| | | @Autowired |
| | | private WxShopActivitiesGroupService wxShopActivitiesGroupService; |
| | |
| | | */ |
| | | @GetMapping(value = "/findOwnerGroupBuyInfo/{actId}") |
| | | public AjaxResult findOwnerGroupBuyInfo(@PathVariable("actId") Long actId) { |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | |
| | | // 1、判断该用户在该活动中有没有正在拼团 若有,则返回正在拼团的用户列表,若没有则返回gruoping=1且返回正在拼团的拼团列表, 若加入了团未完成付款,则需要再做设置 |
| | | ShopActivitiesGroupJoin isExsit = shopActivitiesGroupJoinDao.selectIsExistGroupInfoByUserId(actId, sysVipInfo.getOpenId()); |
| | |
| | | */ |
| | | @GetMapping(value = "/findGroupJoinInfo/{gjId}") |
| | | public AjaxResult findGroupJoinInfo(@PathVariable Long gjId) { |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | ShopActivitiesGroupJoin groupJoin = shopActivitiesGroupJoinDao.selectOwnerGroupJoinInfo(gjId); |
| | | int isExist = 2; |
| | | |
| | |
| | | |
| | | @PostMapping(value = "/calPrice") |
| | | public AjaxResult calPrice(@RequestBody CreateGroupBuyDTO createGroupBuyDTO) { |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | ShopActivitiesGroupPrice groupPrice = shopActivitiesGroupPriceDao.selectById(createGroupBuyDTO.getGpId()); |
| | | // 判断参数中gjId是否为空,若为空则为团长开团。再判断团长价是否为空,如果不为空则拥有团长价 |
| | | if (createGroupBuyDTO.getGjId() == null) { |
| | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.activity.dao.ActivitySignAwardSetDao; |
| | |
| | | private ShopActivitiesDao shopActivitiesDao; |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | |
| | | @Autowired |
| | | private ActivitySignAwardSetDao activitySignAwardSetDao; |
| | |
| | | @GetMapping(value = "/getLuckydrawBasicInfo") |
| | | public AjaxResult getLuckydrawBasicInfo() { |
| | | //获取登录人信息 |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | Long companyId = loginUser.getCompanyId(); |
| | | Long userId = loginUser.getId(); |
| | | //获取抽奖活动的信息 |
| | |
| | | @ResponseBody |
| | | @Transactional |
| | | public AjaxResult clickLuckyDraw(@PathVariable("actId") long actId) { |
| | | SysVipInfo user = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo user = userCacheManager.getLoginUser(); |
| | | Long userId = user.getId(); |
| | | Long companyId = user.getCompanyId(); |
| | | /** |
| | |
| | | @GetMapping(value = "scoreLuckyDraw/{actId}") |
| | | @ResponseBody |
| | | public AjaxResult logisticsInsureById(@PathVariable("actId") Long actId) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | Long userId = loginUser.getId(); |
| | | Long companyId = loginUser.getCompanyId(); |
| | | //获取用户总积分 |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | |
| | | private ShopActivitiesSalonAttributeDao shopActivitiesSalonAttributeDao; |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | |
| | | @Autowired |
| | | private ShopActivitiesSalonRecordDao shopActivitiesSalonRecordDao; |
| | |
| | | */ |
| | | @GetMapping(value = "/findSalonInfoById/{id}") |
| | | public AjaxResult findSalonInfoById(@PathVariable("id") Long id) { |
| | | SysVipInfo user = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo user = userCacheManager.getLoginUser(); |
| | | ShopActivities shopActivities = shopActivitiesDao.selectSalonActivityById(id); |
| | | ShopActivitiesSalonRecord salonRecord = shopActivitiesSalonRecordDao.selectSalonRecordByUserIdAndActId(user.getOpenId(), id); |
| | | AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("获取成功"); |
| | |
| | | @PostMapping(value = "/joinSalonActivity") |
| | | @Transactional |
| | | public AjaxResult joinSalonActivity(@RequestBody CreateSalonDTO salonDTO) { |
| | | SysVipInfo user = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo user = userCacheManager.getLoginUser(); |
| | | |
| | | ShopActivities shopActivities = shopActivitiesDao.selectById(salonDTO.getActId()); |
| | | if (shopActivities == null) { |
| | |
| | | */ |
| | | @RequestMapping(value = "/findSalonListByUser") |
| | | public AjaxResult findSalonListByUser(@RequestBody SalonVO salonVO) { |
| | | SysVipInfo user = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo user = userCacheManager.getLoginUser(); |
| | | salonVO.setUserId(user.getOpenId()); |
| | | List<ShopActivities> list = shopActivitiesDao.selectSalonActivityByUser(salonVO); |
| | | return AjaxResult.buildSuccessInstance(list); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.shopXcx.api.service.WXShopOrderService; |
| | | import com.matrix.system.shopXcx.api.service.WxShopActivitiesSecKillService; |
| | |
| | | private WxShopActivitiesSecKillService wxShopActvitiesSecKillService; |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @PostMapping(value = "/calSecKillPrice") |
| | | public AjaxResult calSecKillPrice(@RequestBody SecKillVO secKillVO) { |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | ShopActivitiesSeckillInfo seckillInfo = shopActivitiesSeckillInfoDao.selectById(secKillVO.getId()); |
| | | if (seckillInfo == null) { |
| | | return AjaxResult.buildFailInstance("参数有误"); |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.activity.dao.ActivitySignAwardSetDao; |
| | |
| | | private ShopActivitiesDao shopActivitiesDao; |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | |
| | | @Autowired |
| | | private ActivitySignAwardSetDao activitySignAwardSetDao; |
| | |
| | | @GetMapping(value = "/getSignBasicInfo") |
| | | public AjaxResult getSignBasicInfo() { |
| | | //获取登录人信息 |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | Long companyId = loginUser.getCompanyId(); |
| | | Long userId = loginUser.getId(); |
| | | //获取签到活动的信息 |
| | |
| | | @ResponseBody |
| | | public AjaxResult getSignRecord(@PathVariable("actId") long actId,@PathVariable("month") String dateStr) { |
| | | //获取登录人信息 |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | Long companyId = loginUser.getCompanyId(); |
| | | Long userId = loginUser.getId(); |
| | | Date date = DateUtil.parse(dateStr); |
| | |
| | | @ResponseBody |
| | | @Transactional |
| | | public AjaxResult clickSign(@PathVariable("actId") long actId) { |
| | | SysVipInfo user = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo user = userCacheManager.getLoginUser(); |
| | | Long userId = user.getId(); |
| | | Long companyId = user.getCompanyId(); |
| | | /** |
| | |
| | | @ApiResponse(code = 200, message = "ok", response = SignAwardListVo.class) |
| | | }) |
| | | public AjaxResult getSignAwardList(@RequestBody @Validated SignAwardDto signAwardDto) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | Page<SalesOrderVo> page=new Page<>(signAwardDto.getPageNum(),signAwardDto.getPageSize()); |
| | | if(StringUtils.isBlank(signAwardDto.getSort())){ |
| | | signAwardDto.setSort("create_time"); |
| | |
| | | @ApiResponse(code = 200, message = "ok", response = SeeAwardTextVo.class) |
| | | }) |
| | | public AjaxResult seeAwardText(@RequestBody @Validated SeeAwardTextDto seeAwardTextDto) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | seeAwardTextDto.setUserId(loginUser.getId()); |
| | | seeAwardTextDto.setCompanyId(loginUser.getCompanyId()); |
| | | SeeAwardTextVo seeAwardTextVO = activitySignReceiveRecordDao.selectSeeAwardTextVOById(seeAwardTextDto); |
| | |
| | | @ApiResponse(code = 200, message = "ok", response = SeeAwardTextVo.class) |
| | | }) |
| | | public AjaxResult logisticsInsure(@RequestBody @Validated SeeAwardTextDto seeAwardTextDto) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | seeAwardTextDto.setUserId(loginUser.getId()); |
| | | seeAwardTextDto.setCompanyId(loginUser.getCompanyId()); |
| | | SeeAwardTextVo seeAwardTextVO = activitySignReceiveRecordDao.selectSeeAwardTextVOById(seeAwardTextDto); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | |
| | | @Autowired |
| | | private ShopCouponDao shopCouponDao; |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | |
| | | /** |
| | | * 获取可以领取的优惠券 |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanGrade; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.CustomerDataDictionaryDao; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanGrade; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.shopXcx.api.service.WxShopCouponService; |
| | | import com.matrix.system.shopXcx.bean.*; |
| | | import com.matrix.system.shopXcx.dao.*; |
| | |
| | | private ShopArticleDao shopArticleDao; |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | |
| | | @Autowired |
| | | WxShopCouponService shopCouponService; |
| | |
| | | @RequestMapping(value = "/getProductById/{shopId}/{id}") |
| | | @ResponseBody |
| | | public AjaxResult getProductById(@PathVariable Long shopId, @PathVariable("id") Integer id) { |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | ShopProduct shopProduct = shopProductDao.selectById(id); |
| | | if (shopProduct == null) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "没有查询到商品"); |
| | |
| | | |
| | | |
| | | |
| | | if (redisUserLoginUtils.isUserLogin()) { |
| | | if (userCacheManager.isUserLogin()) { |
| | | //查询产品适配的优惠券 |
| | | result.putInMap("couponList", shopCouponService.getCouponListByProductId(id)); |
| | | //查询产品是否被用户收藏 |
| | | result.putInMap("checkCollect", CollectionUtils.isNotEmpty(collectionDao.selectByUserIdAndProid(id, redisUserLoginUtils.getLoginUser(SysVipInfo.class).getOpenId()))); |
| | | SysVipInfo user=userCacheManager.getLoginUser(); |
| | | result.putInMap("checkCollect", CollectionUtils.isNotEmpty(collectionDao.selectByUserIdAndProid(id, user.getOpenId()))); |
| | | } else { |
| | | result.putInMap("checkCollect", false); |
| | | } |
| | |
| | | * @param shopProduct |
| | | */ |
| | | private void saveSearchHistroy(@RequestBody ShopProduct shopProduct) { |
| | | SysVipInfo bigUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo bigUser = userCacheManager.getLoginUser(); |
| | | ShopSearchRecord searchBean = new ShopSearchRecord(); |
| | | if (StringUtils.isNotBlank(shopProduct.getTitle())) { |
| | | searchBean.setSearchType(AppConstance.SEARCH_TYPE); |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.score.dao.ScoreUseRecordDao; |
| | | import com.matrix.system.score.dao.ScoreVipDetailDao; |
| | |
| | | public class WxShopScoreAction { |
| | | |
| | | @Autowired |
| | | RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | |
| | | @Autowired |
| | | ScoreUseRecordDao scoreUseRecordDao; |
| | |
| | | @ApiResponse(code = 200, message = "ok", response = ScoreUseRecordVo.class) |
| | | }) |
| | | AjaxResult getFlowList(@RequestBody @Validated ScoreFlowDto scoreFlowDto) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | Page<ScoreUseRecordVo> page=new Page<>(scoreFlowDto.getPageNum(),scoreFlowDto.getPageSize()); |
| | | scoreFlowDto.setVipId(loginUser.getId()); |
| | | IPage<ScoreUseRecordVo> shopScoreRecord = scoreUseRecordDao.selectFlowList(page, scoreFlowDto); |
| | |
| | | @ApiResponse(code = 200, message = "ok", response = AjaxResult.class) |
| | | }) |
| | | AjaxResult getUserScore() { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | AjaxResult result=AjaxResult.buildSuccessInstance(scoreVipDetailDao.selectUserTotalScore(loginUser.getId())); |
| | | return result; |
| | | } |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.core.constance.SystemErrorCode; |
| | | import com.matrix.core.constance.SystemMessageCode; |
| | | import com.matrix.core.exception.GlobleException; |
| | |
| | | @Autowired |
| | | private ShopShoppingCartDao shoppingCartDao; |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | |
| | | @Autowired |
| | | WxShopCouponService shopCouponService; |
| | |
| | | @PostMapping("/findShoppingCart") |
| | | @ResponseBody |
| | | public AjaxResult getShoppingCartByUserId(@RequestBody ShopShoppingCart shoppingCart) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | List<ShopShoppingCart> list = shoppingCartDao.selectByCartUserId(shoppingCart.getShopId(),loginUser.getId()); |
| | | List<ShopCartVo> shopCartVoList = shoppingCartService.buildShopCart(list); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, shopCartVoList, shopCartVoList.size()); |
| | |
| | | public |
| | | @ResponseBody |
| | | AjaxResult getUserCartCount(@PathVariable("shopId") Long shopId) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | Integer userCartCount = shoppingCartDao.selectUserCartCount(shopId, loginUser.getId()); |
| | | if (userCartCount == null) { |
| | | userCartCount = 0; |
| | |
| | | |
| | | shoppingCart.setCartProductId(sku.getpId()); |
| | | |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | shoppingCart.setCreateBy(loginUser.getOpenId()); |
| | | shoppingCart.setUpdateBy(loginUser.getOpenId()); |
| | | shoppingCart.setCartUserId(loginUser.getId()); |
| | |
| | | @ResponseBody |
| | | public AjaxResult updateCartAllSelected(@PathVariable("isSelected") Integer isSelected, |
| | | @PathVariable("shopId") Long shopId) { |
| | | SysVipInfo user = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo user = userCacheManager.getLoginUser(); |
| | | shoppingCartDao.updateAllSelected(user.getOpenId(), shopId, isSelected); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "修改成功"); |
| | | } |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.StringUtils; |
| | |
| | | private SysVipInfoDao vipInfoDao; |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | |
| | | @Autowired |
| | | private ShopProductDao shopProductDao; |
| | | |
| | | @RequestMapping(value = "/showSkinList") |
| | | public @ResponseBody AjaxResult showSkinList(@RequestBody SkinCheckDTO skinCheckDTO) { |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | PaginationVO pageVo = new PaginationVO(); |
| | | pageVo.setLimit(skinCheckDTO.getLimit()); |
| | | pageVo.setOffset(skinCheckDTO.getOffset()); |
| | |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.component.tools.HttpCurlUtil; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.LogUtil; |
| | |
| | | @Autowired |
| | | BusParameterSettingsDao busParameterSettingsDao; |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | @Autowired |
| | | ShopSalesmanApplyDao salesmanApplyDao; |
| | | |
| | |
| | | } |
| | | // 存放redis |
| | | sysVipInfo.setLevelCard(null); |
| | | String token = redisUserLoginUtils.saveUserInfo(sysVipInfo); |
| | | String token = userCacheManager.saveUserInfo(sysVipInfo); |
| | | LogUtil.info("用户token={}", token); |
| | | res.putInMap("token", token); |
| | | res.putInMap("userInfo", sysVipInfo); |
| | |
| | | @RequestMapping(value = "/findUserInfo") |
| | | public @ResponseBody |
| | | AjaxResult findUserInfo() { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | SysVipInfo sysVipInfo = sysVipInfoService.findById(loginUser.getId()); |
| | | sysVipInfo.setPointAll(scoreVipDetailDao.selectUserTotalScore(loginUser.getId())); |
| | | sysVipInfo.setBalance(moneyCardUseDao.selectVipCardTotalMoney(loginUser.getId())); |
| | |
| | | public @ResponseBody |
| | | AjaxResult saveUserInfo(@RequestBody XcxUserSaveUserInfoDto xcxUserSaveUserInfoDto) { |
| | | |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | SysVipInfo sysVipInfo = new SysVipInfo(); |
| | | sysVipInfo.setId(loginUser.getId()); |
| | | |
| | |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.system.shopXcx.dao.ShopSearchRecordDao; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | private ShopSearchRecordDao shopSearchRecordDao; |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | |
| | | /** |
| | | * 查询搜索记录 |
| | |
| | | @RequestMapping(value = "/getSearchRecordList") |
| | | @ResponseBody |
| | | public AjaxResult getSearchRecordList(){ |
| | | SysVipInfo bigUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo bigUser = userCacheManager.getLoginUser(); |
| | | if(bigUser == null){ |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL,"用户未授权"); |
| | | } |
| | |
| | | @RequestMapping(value = "/deleteSearchRecord") |
| | | @ResponseBody |
| | | public AjaxResult deleteSearchRecord(){ |
| | | SysVipInfo bigUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo bigUser = userCacheManager.getLoginUser(); |
| | | shopSearchRecordDao.deleteByUserId(bigUser.getOpenId()); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS,"删除成功"); |
| | | } |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.VerifyResult; |
| | |
| | | private SysBeauticianStateService sysBeauticianStateService; |
| | | |
| | | @Autowired |
| | | RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | |
| | | @Autowired |
| | | ShopProductDao productDao; |
| | |
| | | @RequestMapping(value = "/createServiceOrder") |
| | | public @ResponseBody |
| | | AjaxResult createServiceOrder(@RequestBody Onlinebooking onlinebooking) { |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | SysVipInfo vipInfo = vipInfoDao.selectByPhone(sysVipInfo.getPhone(),HostInterceptor.getCompanyId()); |
| | | SysProjUse sysProjUse = projUseDao.selectById(Long.parseLong(onlinebooking.getProductId() + "")); |
| | | Date yyTime = DateUtil.stringToDate(onlinebooking.getTimeStr(), DateUtil.DATE_FORMAT_MM); |
| | |
| | | @PostMapping(value = "/getServiceOrderList") |
| | | @ResponseBody |
| | | public AjaxResult findServiceOrderList(@RequestBody @Validated ErpServiceOrderListDto orderListDto) { |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | orderListDto.setVipId(sysVipInfo.getId()); |
| | | List<ErpServiceOrderListVo> apiServiceOrderListInPage = projServicesDao.findWxServiceOrderList(orderListDto); |
| | | return AjaxResult.buildSuccessInstance(apiServiceOrderListInPage,"查询成功"); |
| | |
| | | package com.matrix.system.shopXcx.api.service; |
| | | |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | |
| | | @Autowired |
| | | private ShopShoppingCartDao shoppingCartDao; |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | |
| | | @Autowired |
| | | WxShopCouponService shopCouponService; |
| | |
| | | package com.matrix.system.shopXcx.api.service; |
| | | |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.shopXcx.api.vo.ShopCartBillVo; |
| | |
| | | @Autowired |
| | | private ShopShoppingCartDao shoppingCartDao; |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | |
| | | @Autowired |
| | | WxShopCouponService shopCouponService; |
| | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.component.tools.WxUtils; |
| | | import com.matrix.component.wechat.externalInterface.protocol.paramProtocol.BrandWCPayRequestData; |
| | | import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil; |
| | |
| | | @Autowired |
| | | private WxShopOrderUtil wxShopOrderUtil; |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | @Autowired |
| | | private WeixinServiceUtil weixinServiceUtil; |
| | | @Autowired |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public ShopOrder createShopOrder(ShopOrderDto shopOrderDto) throws Exception { |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | |
| | | |
| | | |
| | |
| | | //支付总积分 |
| | | Integer scoreCount=0; |
| | | |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | |
| | | //计算购物车中物品的优惠信息 |
| | | List<OrderItemDto> orderItemDtos = shopOrderDto.getOrderItemList() |
| | |
| | | */ |
| | | @Override |
| | | public AjaxResult getMyOrderInfo(OrderInfoQueryPOJO orderInfoQueryPOJO) { |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | orderInfoQueryPOJO.setSort("update_time"); |
| | | if (orderInfoQueryPOJO.getOffset() >= 1) { |
| | | orderInfoQueryPOJO.setOffset((orderInfoQueryPOJO.getOffset() - 1) * orderInfoQueryPOJO.getLimit()); |
| | |
| | | */ |
| | | @Override |
| | | public AjaxResult getOrderInfoById(Integer orderId) { |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | ShopOrder shopOrder = shopOrderDao.selectOrderInfoById(sysVipInfo.getId(), orderId); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, Arrays.asList(shopOrder)); |
| | | } |
| | |
| | | } |
| | | if (shopOrder.getDiscountAmount() != null && shopOrder.getDiscountAmount().compareTo(BigDecimal.ZERO) > 0) { |
| | | ShopCouponRecord shopCouponRecord = new ShopCouponRecord(); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | shopCouponRecord.setUserId(sysVipInfo.getId()); |
| | | shopCouponRecord.setOrderId(orderId); |
| | | List<ShopCouponRecord> recordList = shopCouponRecordDao.selectByModel(shopCouponRecord); |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.component.tools.WxUtils; |
| | | import com.matrix.component.wechat.externalInterface.protocol.paramProtocol.BrandWCPayRequestData; |
| | | import com.matrix.core.exception.GlobleException; |
| | |
| | | private ShopActivitiesGroupInfoDao shopActivitiesGroupInfoDao; |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | |
| | | @Autowired |
| | | private ShopActivitiesGroupPriceDao shopActivitiesGroupPriceDao; |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult createGroupBuy(CreateGroupBuyDTO createGroupBuyDTO) throws Exception { |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | |
| | | ShopActivitiesGroupPrice groupPrice = shopActivitiesGroupPriceDao.selectById(createGroupBuyDTO.getGpId()); |
| | | ShopActivitiesGroupInfo groupInfo = shopActivitiesGroupInfoDao.selectGroupInfoByActId(groupPrice.getActId()); |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public AjaxResult joinGroupBuy(CreateGroupBuyDTO createGroupBuyDTO) throws Exception { |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | |
| | | // TODO 需判断拼团结束时间以及当前拼团是否已满员 |
| | | |
| | |
| | | if (shopReceiveAddress == null) { |
| | | throw new GlobleException("请选择正确的收获地址"); |
| | | } |
| | | SysVipInfo user=redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo user=userCacheManager.getLoginUser(); |
| | | ShopOrder shopOrder = new ShopOrder(); |
| | | shopOrder.setCompanyId(user.getCompanyId()); |
| | | shopOrder.setStoreId(Integer.parseInt(createGroupBuyDTO.getShopId().toString())); |
| | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.component.tools.WxUtils; |
| | | import com.matrix.component.wechat.externalInterface.protocol.paramProtocol.BrandWCPayRequestData; |
| | | import com.matrix.core.exception.GlobleException; |
| | |
| | | @Autowired |
| | | private ShopOrderDetailsDao shopOrderDetailsDao; |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | @Autowired |
| | | private ShopActivitiesSeckillRecordDao shopActivitiesSeckillRecordDao; |
| | | |
| | | @Override |
| | | public AjaxResult createSecKillOrder(CreateSecKillDTO secKillDTO) throws Exception { |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | ShopActivitiesSeckillInfo seckillInfo = shopActivitiesSeckillInfoDao.selectById(secKillDTO.getId()); |
| | | if (seckillInfo == null) { |
| | | return AjaxResult.buildFailInstance("秒杀不存在"); |
| | |
| | | } |
| | | |
| | | private ShopOrder createOrder(CreateSecKillDTO secKillDTO) { |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | ShopReceiveAddress shopReceiveAddress = shopReceiveAddressDao.selectById(secKillDTO.getAddressId()); |
| | | if (shopReceiveAddress == null) { |
| | | throw new GlobleException("请选择正确的收获地址"); |
| | |
| | | package com.matrix.system.shopXcx.api.service.impl; |
| | | |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.LogUtil; |
| | |
| | | @Autowired |
| | | private WxShopOrderUtil wxShopOrderUtil; |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | @Autowired |
| | | private ShopCouponDao shopCouponDao; |
| | | @Autowired |
| | |
| | | List<CouponReceiveInfoVO> shopCoupons = new ArrayList<>(); |
| | | |
| | | |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | //1.找到用户所有的优惠券 |
| | | List<CouponReceiveInfoVO> userAllCoupon = shopCouponRecordDao.selectMyCouponByStatus(companyId, sysVipInfo.getId(), AppConstance.MY_COUPON_NOT_USE, |
| | | null); |
| | |
| | | */ |
| | | @Override |
| | | public AjaxResult getUsableCoupon(PaginationVO pageVo) { |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | boolean newPeople = wxShopCouponUtil.verifyIsNewPeople(sysVipInfo.getId()); |
| | | List<ShopCoupon> list = shopCouponDao.selectUsableCoupon(newPeople, sysVipInfo.getOpenId(), pageVo); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, list); |
| | |
| | | @Override |
| | | public AjaxResult receiveCoupon(Integer couponId) { |
| | | ShopCoupon shopCoupon = shopCouponDao.selectById(couponId); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | |
| | | // 如果没有找到该优惠券 |
| | | if (shopCoupon == null) { |
| | |
| | | */ |
| | | @Override |
| | | public AjaxResult getMyCouponInfoByStatus(Long companyId, Integer status, PaginationVO pageVo) { |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | // 如果查询使用或未使用状态的优惠券列表 |
| | | if (AppConstance.MY_COUPON_USE.equals(status) || AppConstance.MY_COUPON_NOT_USE.equals(status)) { |
| | | List<CouponReceiveInfoVO> list = shopCouponRecordDao.selectMyCouponByStatus(companyId,sysVipInfo.getId(), status, |
| | |
| | | attrIds.addAll(ids); |
| | | } |
| | | } |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | List<ShopCoupon> list = shopCouponDao.selectUsableCouponByProductInfo(sysVipInfo.getOpenId(), productId, |
| | | attrIds); |
| | | return list; |
| | |
| | | */ |
| | | @Override |
| | | public AjaxResult getCouponListByTag(String tag, Long companyId) { |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = userCacheManager.getLoginUser(); |
| | | boolean newPeople = wxShopCouponUtil.verifyIsNewPeople(sysVipInfo.getId()); |
| | | List<ShopCoupon> couponList = shopCouponDao.selectCouponListByTag(newPeople, sysVipInfo.getOpenId(), tag,companyId); |
| | | AjaxResult res = new AjaxResult(AjaxResult.STATUS_SUCCESS, couponList); |
| | |
| | | package com.matrix.system.shopXcx.api.tools; |
| | | |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.system.shopXcx.api.service.WxShopMemberDayService; |
| | | import com.matrix.system.shopXcx.bean.ShopOrder; |
| | | import com.matrix.system.shopXcx.dao.ShopCouponRecordDao; |
| | |
| | | @Autowired |
| | | private ShopOrderDao shopOrderDao; |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | @Autowired |
| | | private ShopCouponRecordDao shopCouponRecordDao; |
| | | @Autowired |
| | |
| | | |
| | | #线上测试环境 |
| | | # |
| | | spring.datasource.username=ct_test |
| | | spring.datasource.password=123456 |
| | | spring.datasource.url=jdbc:mysql://120.27.238.55:3306/hive_test_meidu?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 |
| | | #spring.datasource.username=ct_test |
| | | #spring.datasource.password=123456 |
| | | #spring.datasource.url=jdbc:mysql://120.27.238.55:3306/hive_test_meidu?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 |
| | | |
| | | #spring.datasource.username=xc_shop |
| | | #spring.datasource.password=xc_shop123!@# |
| | |
| | | #spring.datasource.url=jdbc:mysql://47.111.134.136/db_meidu_prd?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 |
| | | |
| | | |
| | | #spring.datasource.username=root |
| | | #spring.datasource.password=root |
| | | #spring.datasource.url=jdbc:mysql://127.0.0.1:3306/md_test_local?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 |
| | | spring.datasource.username=root |
| | | spring.datasource.password=root |
| | | spring.datasource.url=jdbc:mysql://127.0.0.1:3306/md_test_local?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 |
| | | |
| | | |
| | | spring.datasource.type=com.alibaba.druid.pool.DruidDataSource |
| | |
| | | |
| | | |
| | | #rabbitMQ配置 |
| | | rabbitmq.host=47.111.134.136 |
| | | rabbitmq.port=5672 |
| | | rabbitmq.username=hivequeue |
| | | rabbitmq.password=hivequeueadmin |
| | | #rabbitmq.host=47.111.134.136 |
| | | #rabbitmq.port=5672 |
| | | #rabbitmq.username=hivequeue |
| | | #rabbitmq.password=hivequeueadmin |
| | | useRabbit=false |
| | | |
| | | server.session.timeout=120 |
| | |
| | | maxUploadSize=10485760 |
| | | |
| | | #Matser\u7684ip\u5730\u5740 |
| | | redis.hostname=120.27.238.55 |
| | | #redis.hostname=120.27.238.55 |
| | | #\u7AEF\u53E3\u53F7 |
| | | redis.port=6379 |
| | | #redis.port=6379 |
| | | #\u5982\u679C\u6709\u5BC6\u7801 |
| | | redis.password=xcong123 |
| | | #redis.password=xcong123 |
| | | #\u5BA2\u6237\u7AEF\u8D85\u65F6\u65F6\u95F4\u5355\u4F4D\u662F\u6BEB\u79D2 \u9ED8\u8BA4\u662F2000 |
| | | redis.timeout=10000 |
| | | redis.database=2 |
| | | redis_time_out=1800000 |
| | | #redis.timeout=10000 |
| | | #redis.database=2 |
| | | #redis_time_out=1800000 |
| | | cookie_time_out=36000 |
| | | |
| | | #APP登录公钥 |
| | |
| | | package com.matrix; |
| | | |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.matrix.component.redis.RedisClient; |
| | | import com.matrix.system.common.bean.SysFunction; |
| | | import com.matrix.system.hive.bean.MoneyCardUse; |
| | | import com.matrix.system.hive.dao.MoneyCardUseDao; |
| | | import com.matrix.system.hive.service.imp.SysVipInfoServiceImpl; |
| | |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 测试类示例 |
| | |
| | | @Autowired |
| | | SysVipInfoServiceImpl sysVipInfoService; |
| | | |
| | | @Autowired |
| | | RedisClient redisClient; |
| | | |
| | | |
| | | @Autowired |
| | |
| | | @Test |
| | | public void testRedis() { |
| | | |
| | | List<SysFunction> fnList = new ArrayList<>(); |
| | | /*List<SysFunction> fnList = new ArrayList<>(); |
| | | fnList.add(new SysFunction()); |
| | | |
| | | Map map = new HashMap(); |
| | | map.put("a", fnList); |
| | | redisClient.saveMapValue("map", map); |
| | | |
| | | */ |
| | | |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void testRedis2() { |
| | | /* |
| | | |
| | | String map = redisClient.getCachedValue("map"); |
| | | JSONObject json = JSONUtil.parseObj(map); |
| | |
| | | SysFunction sysFunction = jsonArray.get(i, SysFunction.class); |
| | | System.out.println(sysFunction.getHasThisFn()); |
| | | } |
| | | */ |
| | | |
| | | |
| | | |