|
|
|
@ -16,6 +16,7 @@ import com.dreamchaser.depository_manage.security.pool.HandlesOtherFunctionalThr |
|
|
|
import com.dreamchaser.depository_manage.security.pool.RedisPool; |
|
|
|
import com.dreamchaser.depository_manage.service.*; |
|
|
|
import com.dreamchaser.depository_manage.service.impl.QyWxOperationService; |
|
|
|
import com.dreamchaser.depository_manage.utils.EncryptionAlgorithmUtil; |
|
|
|
import com.dreamchaser.depository_manage.utils.Md5; |
|
|
|
import com.dreamchaser.depository_manage.utils.ObjectFormatUtil; |
|
|
|
import com.dreamchaser.depository_manage.utils.QyWxXMLUtils; |
|
|
|
@ -264,18 +265,15 @@ public class QyWxOperationController { |
|
|
|
String userId = jsonObject.getString("userid"); |
|
|
|
if (errCode == 0) { |
|
|
|
// 如果成功获取userid
|
|
|
|
Map<String, Object> portInfo = PublicConfig.findUserByQyWxUserId(userId); |
|
|
|
UserByPort userByPort = (UserByPort) portInfo.get("user"); |
|
|
|
|
|
|
|
String key = (String) portInfo.get("key"); |
|
|
|
String token = (String) portInfo.get("token"); |
|
|
|
// Map<String, Object> portInfo = PublicConfig.findUserByQyWxUserId(userId);
|
|
|
|
// UserByPort userByPort = (UserByPort) portInfo.get("user");
|
|
|
|
UserByPort userByPort = userService.findUserByWorkWechat(userId); |
|
|
|
EncryptionAlgorithmUtil encryptionAlgorithmUtils = new EncryptionAlgorithmUtil(); |
|
|
|
Map<String, String> userKeyAndUserToken = encryptionAlgorithmUtils.getUserKeyAndUserToken(userByPort); |
|
|
|
String key = userKeyAndUserToken.get("key"); |
|
|
|
String token = userKeyAndUserToken.get("token"); |
|
|
|
if (userByPort != null) { |
|
|
|
// 如果数据库中存在该用户
|
|
|
|
// 获取当前用户所在主部门
|
|
|
|
Long maindeparment = userByPort.getMaindeparment(); |
|
|
|
if (maindeparment == 309) { |
|
|
|
userByPort.setMaindeparment(userByPort.getAdminorg()); |
|
|
|
} |
|
|
|
// 设置放入时间
|
|
|
|
userByPort.setInstant(Instant.now()); |
|
|
|
AuthenticationTokenPool.addUserToken(token, userByPort); |
|
|
|
|