Commit 2cea7a0b authored by tangwei's avatar tangwei

修改bigzcode

parent 15380d69
...@@ -14,6 +14,7 @@ import org.aspectj.lang.JoinPoint; ...@@ -14,6 +14,7 @@ import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Before;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
...@@ -32,6 +33,8 @@ public class PersonIdentifyAspect { ...@@ -32,6 +33,8 @@ public class PersonIdentifyAspect {
RedisUtils redisUtils; RedisUtils redisUtils;
@Autowired @Autowired
private IOrgUsrService orgUsrService; private IOrgUsrService orgUsrService;
@Value("${logic}")
Boolean logic;
@Before(value = "@annotation(com.yeejoin.amos.boot.module.common.api.core.framework.PersonIdentify) && @annotation(permission)") @Before(value = "@annotation(com.yeejoin.amos.boot.module.common.api.core.framework.PersonIdentify) && @annotation(permission)")
public void personIdentity(JoinPoint joinPoint, PersonIdentify permission) throws PermissionException { public void personIdentity(JoinPoint joinPoint, PersonIdentify permission) throws PermissionException {
...@@ -41,12 +44,19 @@ public class PersonIdentifyAspect { ...@@ -41,12 +44,19 @@ public class PersonIdentifyAspect {
UserDto userDto = orgUsrService.getUserParentInfo(userId); UserDto userDto = orgUsrService.getUserParentInfo(userId);
ReginParams.PersonIdentity personIdentity = new ReginParams.PersonIdentity(); ReginParams.PersonIdentity personIdentity = new ReginParams.PersonIdentity();
// TODO 没有绑定机场单位的人员,则赋值不存在的bizOrgCode,规避查询出所有数据 // TODO 没有绑定机场单位的人员,则赋值不存在的bizOrgCode,规避查询出所有数据
personIdentity.setBizOrgCode(StringUtils.isEmpty(userDto.getBizOrgCode()) ? "-1" : userDto.getBizOrgCode()); // personIdentity.setBizOrgCode(StringUtils.isEmpty(userDto.getBizOrgCode()) ? "-1" : userDto.getBizOrgCode());
personIdentity.setCompanyId(userDto.getCompanyId()); personIdentity.setCompanyId(userDto.getCompanyId());
personIdentity.setCompanyName(userDto.getCompanyName()); personIdentity.setCompanyName(userDto.getCompanyName());
personIdentity.setPersonSeq(userDto.getPersonSeq()); personIdentity.setPersonSeq(userDto.getPersonSeq());
personIdentity.setPersonName(userDto.getPersonName()); personIdentity.setPersonName(userDto.getPersonName());
personIdentity.setIdentityType(userDto.getIdentityType()); personIdentity.setIdentityType(userDto.getIdentityType());
//电力默认走公司权限
if (!logic){
personIdentity.setBizOrgCode(StringUtils.isEmpty(userDto.getCompanyBizOrgCode()) ? "-1" : userDto.getCompanyBizOrgCode());
}else{
personIdentity.setBizOrgCode(StringUtils.isEmpty(userDto.getBizOrgCode()) ? "-1" : userDto.getBizOrgCode());
}
personIdentity.setCompanyBizOrgCode(userDto.getCompanyBizOrgCode()); personIdentity.setCompanyBizOrgCode(userDto.getCompanyBizOrgCode());
reginParam.setPersonIdentity(personIdentity); reginParam.setPersonIdentity(personIdentity);
redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParam)); redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParam));
......
...@@ -14,6 +14,7 @@ import org.aspectj.lang.annotation.Aspect; ...@@ -14,6 +14,7 @@ import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -38,6 +39,9 @@ public class PersonIdentifyAspect { ...@@ -38,6 +39,9 @@ public class PersonIdentifyAspect {
@Autowired @Autowired
private JcsFeign jcsFeignClient; private JcsFeign jcsFeignClient;
@Value("${logic}")
Boolean logic;
@Pointcut("execution(public * com.*.equipmanage.controller..*(..))") @Pointcut("execution(public * com.*.equipmanage.controller..*(..))")
public void userDate() { public void userDate() {
...@@ -60,6 +64,11 @@ public class PersonIdentifyAspect { ...@@ -60,6 +64,11 @@ public class PersonIdentifyAspect {
// ReginParams.PersonIdentity personIdentity = (ReginParams.PersonIdentity) Bean.mapToBean((Map<String, Object>) responseModel.getResult(), ReginParams.PersonIdentity.class); // ReginParams.PersonIdentity personIdentity = (ReginParams.PersonIdentity) Bean.mapToBean((Map<String, Object>) responseModel.getResult(), ReginParams.PersonIdentity.class);
String s = JSONObject.toJSONString(responseModel.getResult()); String s = JSONObject.toJSONString(responseModel.getResult());
ReginParams.PersonIdentity personIdentity = JSONObject.parseObject(s, ReginParams.PersonIdentity.class); ReginParams.PersonIdentity personIdentity = JSONObject.parseObject(s, ReginParams.PersonIdentity.class);
//电力默认走公司权限
if (!logic){
personIdentity.setBizOrgCode(StringUtils.isEmpty(personIdentity.getCompanyBizOrgCode()) ? "-1" : personIdentity.getCompanyBizOrgCode());
}
reginParam.setPersonIdentity(personIdentity); reginParam.setPersonIdentity(personIdentity);
redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParam)); redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParam));
} }
......
...@@ -9,10 +9,12 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; ...@@ -9,10 +9,12 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.maintenance.business.feign.JCSFeignClient; import com.yeejoin.amos.maintenance.business.feign.JCSFeignClient;
import com.yeejoin.amos.maintenance.exception.PermissionException; import com.yeejoin.amos.maintenance.exception.PermissionException;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.lang.JoinPoint; import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Before;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -36,6 +38,8 @@ public class PersonIdentifyAspect { ...@@ -36,6 +38,8 @@ public class PersonIdentifyAspect {
RedisUtils redisUtils; RedisUtils redisUtils;
@Autowired @Autowired
JCSFeignClient jcsFeignClient; JCSFeignClient jcsFeignClient;
@Value("${logic}")
Boolean logic;
@Before(value = "@annotation(com.yeejoin.amos.maintenance.core.framework.PersonIdentify) && @annotation(permission)") @Before(value = "@annotation(com.yeejoin.amos.maintenance.core.framework.PersonIdentify) && @annotation(permission)")
...@@ -49,6 +53,12 @@ public class PersonIdentifyAspect { ...@@ -49,6 +53,12 @@ public class PersonIdentifyAspect {
throw new RuntimeException(responseModel.getDevMessage()); throw new RuntimeException(responseModel.getDevMessage());
} }
ReginParams.PersonIdentity personIdentity = (ReginParams.PersonIdentity) Bean.mapToBean((Map<String, Object>) responseModel.getResult(), ReginParams.PersonIdentity.class); ReginParams.PersonIdentity personIdentity = (ReginParams.PersonIdentity) Bean.mapToBean((Map<String, Object>) responseModel.getResult(), ReginParams.PersonIdentity.class);
//电力默认走公司权限
if (!logic){
personIdentity.setBizOrgCode(StringUtils.isEmpty(personIdentity.getCompanyBizOrgCode()) ? "-1" : personIdentity.getCompanyBizOrgCode());
}
reginParam.setPersonIdentity(personIdentity); reginParam.setPersonIdentity(personIdentity);
redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParam)); redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParam));
} }
......
...@@ -15,6 +15,7 @@ import org.aspectj.lang.annotation.Aspect; ...@@ -15,6 +15,7 @@ import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -39,6 +40,8 @@ public class PersonIdentifyAspect { ...@@ -39,6 +40,8 @@ public class PersonIdentifyAspect {
@Autowired @Autowired
private JcsFeignClient jcsFeignClient; private JcsFeignClient jcsFeignClient;
@Value("${logic}")
Boolean logic;
@Pointcut("execution(public * com.yeejoin.amos.*.business.controller..*(..))") @Pointcut("execution(public * com.yeejoin.amos.*.business.controller..*(..))")
public void userDate() { public void userDate() {
...@@ -69,6 +72,11 @@ public class PersonIdentifyAspect { ...@@ -69,6 +72,11 @@ public class PersonIdentifyAspect {
String s = JSONObject.toJSONString(responseModel.getResult()); String s = JSONObject.toJSONString(responseModel.getResult());
ReginParams.PersonIdentity personIdentity = JSONObject.parseObject(s, ReginParams.PersonIdentity.class); ReginParams.PersonIdentity personIdentity = JSONObject.parseObject(s, ReginParams.PersonIdentity.class);
// ReginParams.PersonIdentity personIdentity = (ReginParams.PersonIdentity) Bean.mapToBean((Map<String, Object>) responseModel.getResult(), ReginParams.PersonIdentity.class); // ReginParams.PersonIdentity personIdentity = (ReginParams.PersonIdentity) Bean.mapToBean((Map<String, Object>) responseModel.getResult(), ReginParams.PersonIdentity.class);
//电力默认走公司权限
if (!logic){
personIdentity.setBizOrgCode(StringUtils.isEmpty(personIdentity.getCompanyBizOrgCode()) ? "-1" : personIdentity.getCompanyBizOrgCode());
}
reginParam.setPersonIdentity(personIdentity); reginParam.setPersonIdentity(personIdentity);
redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParam)); redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParam));
......
...@@ -9,17 +9,18 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; ...@@ -9,17 +9,18 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.supervision.business.feign.JCSFeignClient; import com.yeejoin.amos.supervision.business.feign.JCSFeignClient;
import com.yeejoin.amos.supervision.exception.PermissionException; import com.yeejoin.amos.supervision.exception.PermissionException;
import org.apache.commons.lang.StringUtils;
import org.aspectj.lang.JoinPoint; import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Before;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -36,6 +37,8 @@ public class PersonIdentifyAspect { ...@@ -36,6 +37,8 @@ public class PersonIdentifyAspect {
RedisUtils redisUtils; RedisUtils redisUtils;
@Autowired @Autowired
JCSFeignClient jcsFeignClient; JCSFeignClient jcsFeignClient;
@Value("${logic}")
Boolean logic;
@Before(value = "@annotation(com.yeejoin.amos.supervision.core.framework.PersonIdentify) && @annotation(permission)") @Before(value = "@annotation(com.yeejoin.amos.supervision.core.framework.PersonIdentify) && @annotation(permission)")
public void personIdentity(JoinPoint joinPoint, PersonIdentify permission) throws PermissionException { public void personIdentity(JoinPoint joinPoint, PersonIdentify permission) throws PermissionException {
...@@ -61,6 +64,10 @@ public class PersonIdentifyAspect { ...@@ -61,6 +64,10 @@ public class PersonIdentifyAspect {
personIdentity.setCompanyId((String) other.get("sequenceNbr")); personIdentity.setCompanyId((String) other.get("sequenceNbr"));
personIdentity.setCompanyName((String) other.get("bizOrgName")); personIdentity.setCompanyName((String) other.get("bizOrgName"));
} }
//电力默认走公司权限
if (!logic){
personIdentity.setBizOrgCode(StringUtils.isEmpty(personIdentity.getCompanyBizOrgCode()) ? "-1" : personIdentity.getCompanyBizOrgCode());
}
// ReginParams.PersonIdentity personIdentity = (ReginParams.PersonIdentity) Bean.mapToBean((Map<String, Object>) result.get(0), ReginParams.PersonIdentity.class); // ReginParams.PersonIdentity personIdentity = (ReginParams.PersonIdentity) Bean.mapToBean((Map<String, Object>) result.get(0), ReginParams.PersonIdentity.class);
reginParam.setPersonIdentity(personIdentity); reginParam.setPersonIdentity(personIdentity);
......
...@@ -126,4 +126,7 @@ management.security.enabled=true ...@@ -126,4 +126,7 @@ management.security.enabled=true
management.endpoint.health.show-details=always management.endpoint.health.show-details=always
spring.security.user.name=admin spring.security.user.name=admin
spring.security.user.password=a1234560 spring.security.user.password=a1234560
stationCode=LSHLZ1bZAJU645Pgl7 stationCode=LSHLZ1bZAJU645Pgl7
\ No newline at end of file
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
\ No newline at end of file
...@@ -103,5 +103,7 @@ redis.cache.failure.time=10800 ...@@ -103,5 +103,7 @@ redis.cache.failure.time=10800
#now.gateway.address=http://172.16.10.72:10005/ #now.gateway.address=http://172.16.10.72:10005/
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
...@@ -23,3 +23,5 @@ mybatis-plus.mapper-locations=classpath:mapper/* ...@@ -23,3 +23,5 @@ mybatis-plus.mapper-locations=classpath:mapper/*
redis.cache.failure.time=10800 redis.cache.failure.time=10800
management.endpoints.enabled-by-default=false management.endpoints.enabled-by-default=false
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
...@@ -65,3 +65,5 @@ Knowledgebase.fegin.name=AMOS-API-KNOWLEDGEBASE ...@@ -65,3 +65,5 @@ Knowledgebase.fegin.name=AMOS-API-KNOWLEDGEBASE
## 消防救援保障部ID ## 消防救援保障部ID
fire-rescue=1432549862557130753 fire-rescue=1432549862557130753
management.endpoints.enabled-by-default=false management.endpoints.enabled-by-default=false
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
...@@ -67,4 +67,7 @@ eureka.instance.metadata-map.management.context-path=${server.servlet.context-pa ...@@ -67,4 +67,7 @@ eureka.instance.metadata-map.management.context-path=${server.servlet.context-pa
eureka.instance.status-page-url-path=/actuator/info eureka.instance.status-page-url-path=/actuator/info
eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/swagger-ui.html eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/swagger-ui.html
management.endpoints.enabled-by-default=false management.endpoints.enabled-by-default=false
\ No newline at end of file
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
...@@ -27,3 +27,5 @@ rule.award="\u65BD\u5DE5\u5B89\u5168\u9884\u63A7/award" ...@@ -27,3 +27,5 @@ rule.award="\u65BD\u5DE5\u5B89\u5168\u9884\u63A7/award"
#server.ssl.key-store-type=JKS #server.ssl.key-store-type=JKS
login.environment=dev login.environment=dev
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
...@@ -73,4 +73,7 @@ eureka.instance.metadata-map.management.context-path=${server.servlet.context-pa ...@@ -73,4 +73,7 @@ eureka.instance.metadata-map.management.context-path=${server.servlet.context-pa
eureka.instance.status-page-url-path=/actuator/info eureka.instance.status-page-url-path=/actuator/info
eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/swagger-ui.html eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/swagger-ui.html
management.endpoints.enabled-by-default=false management.endpoints.enabled-by-default=false
\ No newline at end of file
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
...@@ -5,3 +5,5 @@ spring.profiles.active=dev ...@@ -5,3 +5,5 @@ spring.profiles.active=dev
spring.jackson.time-zone=GMT+8 spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.serialization.write-dates-as-timestamps=true spring.jackson.serialization.write-dates-as-timestamps=true
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
...@@ -6,3 +6,5 @@ spring.jackson.time-zone=GMT+8 ...@@ -6,3 +6,5 @@ spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.serialization.write-dates-as-timestamps=true spring.jackson.serialization.write-dates-as-timestamps=true
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
...@@ -35,3 +35,7 @@ spring.redis.lettuce.pool.max-wait=-1 ...@@ -35,3 +35,7 @@ spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10 spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=0 spring.redis.lettuce.pool.min-idle=0
spring.redis.expire.time=300 spring.redis.expire.time=300
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment