| | |
| | | // 判断ding 信息是否存在 |
| | | boolean hasDing = redisTemplate.hasKey("ding"); |
| | | if (hasDing) { |
| | | log.info("redis正常有消息"); |
| | | String dingStr = redisTemplate.opsForValue().get("ding"); |
| | | JSONObject dingObj = JSONObject.parseObject(dingStr); |
| | | String getToken = dingObj.getString("token"); |
| | |
| | | DingUserInfo dingUserInfo = BeanUtil.toBean(resObj, DingUserInfo.class); |
| | | String accId = DingEncodeUtil.getMD5(resObj.getString("employeeCode").getBytes()); |
| | | dingUserInfo.setUserId(Long.parseLong(accId)); |
| | | String employeeCode = resObj.getString("employeeCode"); |
| | | JSONArray users = getAccountId(Arrays.asList(employeeCode)); |
| | | JSONObject jsonObject = users.getJSONObject(0); |
| | | String accountId = jsonObject.getString("accountId"); |
| | | dingUserInfo.setAccountId(Long.parseLong(accountId)); |
| | | |
| | | return dingUserInfo; |
| | | } |
| | | } |