Selaa lähdekoodia

refactor(消费服务): 修正缓存数据解析逻辑

1. 引入`JsonUtils`工具类,将缓存中的JSON字符串解析为`RemoteCardVo`对象,确保数据正确性。
autumnal_wind 11 kuukautta sitten
vanhempi
commit
a311ff80a5

+ 2 - 1
ruoyi-server/ruoyi-server-consume/src/main/java/org/dromara/server/consume/business/EmployeeBusiness.java

@@ -14,6 +14,7 @@ import org.dromara.common.core.constant.CacheNames;
 import org.dromara.common.core.domain.model.ErrorInfo;
 import org.dromara.common.core.domain.model.ErrorResult;
 import org.dromara.common.core.enums.ResultCodeEnum;
+import org.dromara.common.json.utils.JsonUtils;
 import org.dromara.common.redis.utils.RedisUtils;
 import org.dromara.server.consume.domain.vo.yc.*;
 import org.dromara.system.api.RemoteDeptService;
@@ -65,7 +66,7 @@ public class EmployeeBusiness {
 
         // RemoteCardVo remoteCardVo = remoteCardService.queryMainCardByUserId(userAccountVo.getUserId());
         String userId = String.valueOf(userAccountVo.getUserId());
-        RemoteCardVo remoteCardVo = RedisUtils.getCacheMapValue(CacheNames.PT_USER_CARD_USER_ID, userId);
+        RemoteCardVo remoteCardVo = JsonUtils.parseObject(String.valueOf(RedisUtils.getCacheMapValue(CacheNames.PT_USER_CARD_USER_ID, userId)), RemoteCardVo.class);
         UserCardVo userCardVo = new UserCardVo();
         Long cardNo = 0L;
         if (ObjectUtil.isNotEmpty(remoteCardVo)) {