|
@@ -3,11 +3,15 @@ package com.qmth.distributed.print.auth;
|
|
import com.qmth.boot.core.security.model.AccessEntity;
|
|
import com.qmth.boot.core.security.model.AccessEntity;
|
|
import com.qmth.boot.tools.signature.SignatureType;
|
|
import com.qmth.boot.tools.signature.SignatureType;
|
|
import com.qmth.teachcloud.common.contant.SpringContextHolder;
|
|
import com.qmth.teachcloud.common.contant.SpringContextHolder;
|
|
|
|
+import com.qmth.teachcloud.common.entity.BasicSchool;
|
|
|
|
+import com.qmth.teachcloud.common.entity.SysUser;
|
|
import com.qmth.teachcloud.common.entity.TBSession;
|
|
import com.qmth.teachcloud.common.entity.TBSession;
|
|
|
|
+import com.qmth.teachcloud.common.service.CommonCacheService;
|
|
import com.qmth.teachcloud.common.util.RedisUtil;
|
|
import com.qmth.teachcloud.common.util.RedisUtil;
|
|
|
|
|
|
import java.util.Collection;
|
|
import java.util.Collection;
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
|
|
+import java.util.StringJoiner;
|
|
|
|
|
|
public class DistributedPrintSession implements AccessEntity {
|
|
public class DistributedPrintSession implements AccessEntity {
|
|
|
|
|
|
@@ -58,6 +62,18 @@ public class DistributedPrintSession implements AccessEntity {
|
|
public String getLogName() {
|
|
public String getLogName() {
|
|
RedisUtil redisUtil = SpringContextHolder.getBean(RedisUtil.class);
|
|
RedisUtil redisUtil = SpringContextHolder.getBean(RedisUtil.class);
|
|
TBSession tbSession = (TBSession) redisUtil.getUserSession(identity);
|
|
TBSession tbSession = (TBSession) redisUtil.getUserSession(identity);
|
|
- return identity;
|
|
|
|
|
|
+ StringJoiner stringJoiner = new StringJoiner("_");
|
|
|
|
+ if (Objects.nonNull(tbSession)) {
|
|
|
|
+ CommonCacheService commonCacheService = SpringContextHolder.getBean(CommonCacheService.class);
|
|
|
|
+ if (Objects.nonNull(tbSession.getSchoolId())) {
|
|
|
|
+ BasicSchool basicSchool = commonCacheService.schoolCache(tbSession.getSchoolId());
|
|
|
|
+ stringJoiner.add("{" + basicSchool.getId() + "}").add("{" + basicSchool.getName() + "}");
|
|
|
|
+ }
|
|
|
|
+ if (Objects.nonNull(tbSession.getIdentity())) {
|
|
|
|
+ SysUser sysUser = commonCacheService.userCache(Long.parseLong(tbSession.getIdentity()));
|
|
|
|
+ stringJoiner.add("{" + sysUser.getLoginName() + "}").add("{" + tbSession.getType() + "}");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return stringJoiner.toString();
|
|
}
|
|
}
|
|
}
|
|
}
|