Commit f230c1b1 by 谢海旭

v5.7.0版本 飞行督导-后台:登录用户信息获取

1 parent 5d9d55fd
......@@ -17,5 +17,11 @@
<artifactId>rpc-dj-supervisor-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rop-common</artifactId>
<version>5.3.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package cn.com.glsx.dj.supervisor.config;
import cn.com.glsx.dj.supervisor.interceptor.ThreadLocalCacheInterceptor;
import com.rop.RopServlet;
import com.rop.config.InterceptorHolder;
import org.oreframework.boot.autoconfigure.rop.metadata.RopProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
@ConditionalOnClass({RopServlet.class})
@EnableConfigurationProperties({RopProperty.class})
public class OperaeLogAutoConfigure {
@Bean
public InterceptorHolder threadLocalCacheInterceptor() {
return new InterceptorHolder(new ThreadLocalCacheInterceptor());
}
}
package cn.com.glsx.dj.supervisor.controller;
import cn.com.glsx.dj.smartcarlife.dto.LoginUserDTO;
import cn.com.glsx.dj.supervisor.dto.ExcellentCaseDetailDTO;
import cn.com.glsx.dj.supervisor.dto.ExcellentCaseReviewQueryDTO;
import cn.com.glsx.dj.supervisor.dto.ExcellentCaseReviewReqDTO;
......@@ -7,7 +8,6 @@ import cn.com.glsx.dj.supervisor.remote.ExcellentCaseReviewRemote;
import cn.com.glsx.dj.supervisor.request.ExcellentCaseReviewQueryRequest;
import cn.com.glsx.dj.supervisor.request.ExcellentCaseReviewRequest;
import cn.com.glsx.dj.supervisor.utils.CommonUtil;
import cn.com.glsx.dj.supervisor.utils.LoginUserDTO;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.rop.response.RopResponse;
......@@ -17,10 +17,11 @@ import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* 优秀案例审核控制器
* <p>
......
package cn.com.glsx.dj.supervisor.interceptor;
import cn.com.glsx.dj.supervisor.utils.ThreadLocalCache;
import com.rop.AbstractInterceptor;
import com.rop.RopRequestContext;
public class ThreadLocalCacheInterceptor extends AbstractInterceptor{
@Override
public void beforeService(RopRequestContext ropRequestContext) {
super.beforeService(ropRequestContext);
ThreadLocalCache.setRopRequestContext(ropRequestContext);
}
@Override
public void beforeResponse(RopRequestContext ropRequestContext) {
super.beforeResponse(ropRequestContext);
ThreadLocalCache.removeRopRequestContext();
}
@Override
public int getOrder() {
return Integer.MIN_VALUE;
}
}
package cn.com.glsx.dj.supervisor.utils;
import cn.com.glsx.dj.smartcarlife.dto.LoginUserDTO;
import cn.com.glsx.dj.supervisor.constant.RopConstants;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
......
package cn.com.glsx.dj.supervisor.utils;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.List;
import lombok.Data;
import lombok.ToString;
/**
* @Title: LoginUserDTO.java !!!所有改动必须同步修改rop-common项目同名类
* @Description: 嘀加智享车生活rop登录用户信息
* @author caiym
* @date 2020年12月08日 10:29
* @version V1.0.0
* @Company: didihu.com.cn
* @Copyright Copyright (c) 2020
*/
@Data
@ToString
public class LoginUserDTO implements Serializable{
private static final long serialVersionUID = -3255611510352134004L;
/** 有效的账号状态 **/
public static final int ENABLED_STATUS = 2;
public static final int ADMIN = 1;
@ApiModelProperty(notes = "登录类型2.员工 1.商户")
private Integer userType;
@ApiModelProperty(notes = "用户名")
private String loginAccout;
@ApiModelProperty(notes = "姓名")
private String userName;
private String merchantName;
private Integer bussinessId;
private Integer accountLevel;
private Integer status;
@ApiModelProperty(notes = "商户号")
private Integer merchantId;
private String phone;
private String openId;
@ApiModelProperty(notes = "渠道类型")
private String channelType;
@ApiModelProperty(notes = "商户模式 1.集团版 2.门店版")
private Integer merchantModel;
@ApiModelProperty(notes = "是否超管(1:是否,0:否)")
private Integer isAdmin;
@ApiModelProperty(notes = "sap编码")
private String sapCode;
@ApiModelProperty(notes = "企微id")
private String entmicroId;
@ApiModelProperty(notes = "账号唯一id")
private String uuid;
@ApiModelProperty(notes = "头像")
private String staffAvatar;
private Byte loginSource = LoginSourceTypeEnum.D_PLUS.getValue();
@ApiModelProperty(notes = "登录角色 3-区域督导 4-广联销售")
private Integer loginRole;
@ApiModelProperty(notes = "广联数科下角色名称")
private String roleName;
/**
* 用户数据权限商户ID
*/
private List<Integer> permissionMerchantIds;
private List<String> merchantAccountList;
@ApiModelProperty(notes = "登录角色在2.1业务角色权限导流方商户ID")
private List<Integer> scene0PermissionMerchantIds;
@ApiModelProperty(notes = "登录角色在1.1业务角色权限导流方商户ID")
private List<Integer> scene1PermissionMerchantIds;
public boolean isEnabled(){
if(this.status != null && this.status == ENABLED_STATUS){
return true;
}
return false;
}
public boolean curIsAdmin(){
if(this.isAdmin != null && this.isAdmin == ADMIN){
return true;
}
return false;
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!