Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dist.1.3.0
汤建军 10 months ago
parent
commit
43b7fcce11
  1. 3
      blade-biz-common/src/main/java/org/springblade/common/component/MockLoginService.java
  2. 9
      blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java
  3. 19
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/aspect/JobAnnotationAspect.java
  4. 18
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/aspect/JobAnnotationAspect.java
  5. 2
      blade-service/logpm-business/src/main/java/com/logpm/business/aspect/ChangeAsyncAnnotationAspect.java
  6. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBillLadingAppController.java
  7. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/aspect/ChangeAsyncAnnotationAspect.java
  8. 15
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/RabbitMqConfiguration.java
  9. 45
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/BillLadingScanDataQueueHandler.java
  10. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  11. 18
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/aspect/JobAnnotationAspect.java
  12. 18
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/interceptor/LocalServerLoginAccountsInterceptor.java
  13. 18
      blade-service/logpm-factory-data/logpm-factory-data-linsy/src/main/java/com/logpm/factorydata/linsy/interceptor/LocalServerLoginAccountsInterceptor.java
  14. 18
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/interceptor/LocalServerLoginAccountsInterceptor.java
  15. 18
      blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/aspect/JobAnnotationAspect.java
  16. 18
      blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/interceptor/LocalServerLoginAccountsInterceptor.java
  17. 18
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/interceptor/LocalServerLoginAccountsInterceptor.java
  18. 18
      blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/interceptor/LocalServerLoginAccountsInterceptor.java
  19. 2
      blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomNodeDataPushListener.java
  20. 19
      blade-service/logpm-factory/src/main/java/com/logpm/factory/aspect/JobAnnotationAspect.java
  21. 18
      blade-service/logpm-factory/src/main/java/com/logpm/factory/interceptor/LocalServerLoginAccountsInterceptor.java
  22. 18
      blade-service/logpm-patch/src/main/java/com/logpm/patch/aspect/JobAnnotationAspect.java
  23. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/aspect/ChangeAsyncAnnotationAspect.java
  24. 19
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/config/interceptor/LocalServerLoginAccountsInterceptor.java
  25. 6
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseTrayTypeMapper.xml

3
blade-biz-common/src/main/java/org/springblade/common/component/MockLoginService.java

@ -19,7 +19,8 @@ public class MockLoginService {
public JSONObject mockToken(String tenantId,String account) {
String url = "http://" + LauncherConstant.loginAddr(Objects.requireNonNull(environment.getActiveProfiles()[0])) + "/blade-auth/oauth/token";
HttpRequest urlRequest = HttpRequest.post(url);
urlRequest.header("Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
// urlRequest.header("Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
urlRequest.header("Authorization", "Basic bG9jYWw6bG9jYWxfc2VjcmV0");
urlRequest.header("Tenant-Id", "627683");
Map<String, Object> params = new HashMap<>();

9
blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java

@ -226,4 +226,13 @@ public interface RabbitConstant {
/****************老系统推送打托数据 start *************************/
/****************自提扫描信息处理 start *************************/
String SELF_PICKUP_SCAN_QUEUE = "self_pickup_scan_queue" + ModuleNameConstant.DEVAUTH;
String SELF_PICKUP_SCAN_EXCHANGE = "self_pickup_scan_exchange" + ModuleNameConstant.DEVAUTH;
String SELF_PICKUP_SCAN_ROUTING = "self_pickup_scan_routing" + ModuleNameConstant.DEVAUTH;
/****************自提扫描信息处理 start *************************/
}

19
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/aspect/JobAnnotationAspect.java

@ -9,6 +9,7 @@ import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.component.MockLoginService;
import org.springblade.common.constant.LauncherConstant;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.redis.lock.LockType;
@ -34,6 +35,8 @@ public class JobAnnotationAspect {
private final Environment environment;
private final RedisLockClient redisLockClient;
private final MockLoginService mockLoginService;
@Around("@annotation(com.xxl.job.core.handler.annotation.XxlJob)")
public Object xxlJobAnnotationMethods(ProceedingJoinPoint joinPoint) throws Throwable {
@ -45,7 +48,7 @@ public class JobAnnotationAspect {
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("Blade-Auth","bearer "+jsonObject.get("access_token") );
httpHeaders.add( "Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
httpHeaders.add( "Authorization", "Basic bG9jYWw6bG9jYWxfc2VjcmV0");
ThreadLocalUtil.put("bladeContext", httpHeaders);
DynamicDataSourceContextHolder.push(jsonObject.getString("tenant_id"));
@ -68,19 +71,7 @@ public class JobAnnotationAspect {
if(flag){
data =bladeRedis.get(CacheNames.LOCAL_SERVER_USER+account);
if(Objects.isNull(data)){
String url = "http://"+ LauncherConstant.loginAddr(Objects.requireNonNull(environment.getActiveProfiles()[0]))+"/blade-auth/oauth/token";
HttpRequest urlRequest = HttpRequest.post(url);
urlRequest.header("Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
urlRequest.header("Tenant-Id", "627683");
Map<String, Object> params = new HashMap<>();
params.put("grant_type", "local_server");
params.put("scope", "all");
params.put("username", account);
params.put("tenantId", "627683");
HttpResponse execute = urlRequest.form(params).execute();
String body = execute.body();
data = JSONObject.parseObject(body);
data = mockLoginService.mockToken("627683",account);
bladeRedis.setEx(CacheNames.LOCAL_SERVER_USER+account,data,3200L);
redisLockClient.unLock("local_server_user", LockType.FAIR);
}

18
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/aspect/JobAnnotationAspect.java

@ -9,6 +9,7 @@ import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.component.MockLoginService;
import org.springblade.common.constant.LauncherConstant;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.redis.lock.LockType;
@ -33,6 +34,7 @@ public class JobAnnotationAspect {
private final BladeRedis bladeRedis;
private final Environment environment;
private final RedisLockClient redisLockClient;
private final MockLoginService mockLoginService;
@Around("@annotation(com.xxl.job.core.handler.annotation.XxlJob)")
public Object xxlJobAnnotationMethods(ProceedingJoinPoint joinPoint) throws Throwable {
@ -45,7 +47,7 @@ public class JobAnnotationAspect {
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("Blade-Auth","bearer "+jsonObject.get("access_token") );
httpHeaders.add( "Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
httpHeaders.add( "Authorization", "Basic bG9jYWw6bG9jYWxfc2VjcmV0");
ThreadLocalUtil.put("bladeContext", httpHeaders);
DynamicDataSourceContextHolder.push(jsonObject.getString("tenant_id"));
@ -68,19 +70,7 @@ public class JobAnnotationAspect {
if(flag){
data =bladeRedis.get(CacheNames.LOCAL_SERVER_USER+account);
if(Objects.isNull(data)){
String url = "http://"+ LauncherConstant.loginAddr(Objects.requireNonNull(environment.getActiveProfiles()[0]))+"/blade-auth/oauth/token";
HttpRequest urlRequest = HttpRequest.post(url);
urlRequest.header("Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
urlRequest.header("Tenant-Id", "627683");
Map<String, Object> params = new HashMap<>();
params.put("grant_type", "local_server");
params.put("scope", "all");
params.put("username", account);
params.put("tenantId", "627683");
HttpResponse execute = urlRequest.form(params).execute();
String body = execute.body();
data = JSONObject.parseObject(body);
data = mockLoginService.mockToken("627683",account);
bladeRedis.setEx(CacheNames.LOCAL_SERVER_USER+account,data,3200L);
redisLockClient.unLock("local_server_user", LockType.FAIR);
}

2
blade-service/logpm-business/src/main/java/com/logpm/business/aspect/ChangeAsyncAnnotationAspect.java

@ -90,7 +90,7 @@ public class ChangeAsyncAnnotationAspect {
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("Blade-Auth","bearer "+data.get("access_token") );
httpHeaders.add( "Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
httpHeaders.add( "Authorization", "Basic bG9jYWw6bG9jYWxfc2VjcmV0");
ThreadLocalUtil.put("bladeContext", httpHeaders);
DynamicDataSourceContextHolder.push(data.getString("tenant_id"));

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBillLadingAppController.java

@ -137,7 +137,7 @@ public class DistributionBillLadingAppController extends BladeController {
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
String coding = distrilbutionBillLading.get("coding").toString();
warehouseUpdownTypeClient.downPackageOrDelTray(coding, myCurrentWarehouse.getId(),"签收下架解托");
// warehouseUpdownTypeClient.downPackageOrDelTray(coding, myCurrentWarehouse.getId(),"签收下架解托");
}else if("1".equals(type)){
//todo 这里需要增加对备货库存品的下架逻辑 但是备货是会进行下架的
log.warn("库存品下架的逻辑");

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/aspect/ChangeAsyncAnnotationAspect.java

@ -92,7 +92,7 @@ public class ChangeAsyncAnnotationAspect {
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("Blade-Auth","bearer "+data.get("access_token") );
httpHeaders.add( "Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
httpHeaders.add( "Authorization", "Basic bG9jYWw6bG9jYWxfc2VjcmV0");
ThreadLocalUtil.put("bladeContext", httpHeaders);
DynamicDataSourceContextHolder.push(data.getString("tenant_id"));

15
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/RabbitMqConfiguration.java

@ -203,6 +203,19 @@ public class RabbitMqConfiguration {
return BindingBuilder.bind(businessInConversionQueue).to(businessInConversionExchange).with(RabbitConstant.BUSINESS_IN_CONVERSION_DATA_ROUTING).noargs();
}
@Bean
public Queue selfPickupScanQueue() {
return new Queue(RabbitConstant.SELF_PICKUP_SCAN_QUEUE, true);
}
@Bean
public CustomExchange selfPickupScanExchange() {
Map<String, Object> args = Maps.newHashMap();
args.put("x-delayed-type", "direct");
return new CustomExchange(RabbitConstant.SELF_PICKUP_SCAN_EXCHANGE, "x-delayed-message", true, false, args);
}
@Bean
public Binding selfPickupScanBinding(Queue selfPickupScanQueue, CustomExchange selfPickupScanExchange) {
return BindingBuilder.bind(selfPickupScanQueue).to(selfPickupScanExchange).with(RabbitConstant.SELF_PICKUP_SCAN_ROUTING).noargs();
}
}

45
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/BillLadingScanDataQueueHandler.java

@ -0,0 +1,45 @@
package com.logpm.distribution.receiver;
import cn.hutool.core.util.ObjectUtil;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import com.rabbitmq.client.Channel;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.messaging.Message;
import org.springframework.stereotype.Component;
import java.util.Map;
import java.util.Objects;
@Slf4j
@RabbitListener(queues = RabbitConstant.SELF_PICKUP_SCAN_QUEUE)
@Component
@AllArgsConstructor
public class BillLadingScanDataQueueHandler {
private final IWarehouseUpdownTypeClient warehouseUpdownTypeClient;
@RabbitHandler
public void billLadingScanDataHandler(Map map, Message message, Channel channel) {
log.info("自提订单扫描数据接收成功");
Object o = map.get("coding");
Object warehouseIdObj = map.get("warehouseId");
if (!ObjectUtil.isAllEmpty(o, warehouseIdObj)) {
String coding = Objects.toString(o);
Long warehouseId = (Long) warehouseIdObj;
warehouseUpdownTypeClient.downPackageOrDelTray(coding, warehouseId, "签收下架解托");
}else{
log.warn("自提订单扫描数据接收失败");
}
}
}

11
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

@ -3130,6 +3130,17 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
return Resp.scanFail("当前订单,包件不存在!!", "当前订单,包件不存在!!");
}
Map<String,Object> mapState = new HashMap<>();
mapState.put("coding",coding);
mapState.put("warehouseId",myCurrentWarehouse.getId());
rabbitTemplate.convertAndSend(RabbitConstant.SELF_PICKUP_SCAN_EXCHANGE, RabbitConstant.SELF_PICKUP_SCAN_ROUTING, mapState, message -> {
message.getMessageProperties()
.setHeader("x-delay", 3000);
return message;
});
return Resp.scanSuccess("签收成功", "签收成功");
}

18
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/aspect/JobAnnotationAspect.java

@ -9,6 +9,7 @@ import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.component.MockLoginService;
import org.springblade.common.constant.LauncherConstant;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.redis.lock.LockType;
@ -33,6 +34,7 @@ public class JobAnnotationAspect {
private final BladeRedis bladeRedis;
private final Environment environment;
private final RedisLockClient redisLockClient;
private final MockLoginService mockLoginService;
@Around("@annotation(com.xxl.job.core.handler.annotation.XxlJob)")
public Object xxlJobAnnotationMethods(ProceedingJoinPoint joinPoint) throws Throwable {
@ -45,7 +47,7 @@ public class JobAnnotationAspect {
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("Blade-Auth","bearer "+jsonObject.get("access_token") );
httpHeaders.add( "Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
httpHeaders.add( "Authorization", "Basic bG9jYWw6bG9jYWxfc2VjcmV0");
ThreadLocalUtil.put("bladeContext", httpHeaders);
DynamicDataSourceContextHolder.push(jsonObject.getString("tenant_id"));
@ -68,19 +70,7 @@ public class JobAnnotationAspect {
if(flag){
data =bladeRedis.get(CacheNames.LOCAL_SERVER_USER+account);
if(Objects.isNull(data)){
String url = "http://"+ LauncherConstant.loginAddr(Objects.requireNonNull(environment.getActiveProfiles()[0]))+"/blade-auth/oauth/token";
HttpRequest urlRequest = HttpRequest.post(url);
urlRequest.header("Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
urlRequest.header("Tenant-Id", "627683");
Map<String, Object> params = new HashMap<>();
params.put("grant_type", "local_server");
params.put("scope", "all");
params.put("username", account);
params.put("tenantId", "627683");
HttpResponse execute = urlRequest.form(params).execute();
String body = execute.body();
data = JSONObject.parseObject(body);
data = mockLoginService.mockToken("627683",account);
bladeRedis.setEx(CacheNames.LOCAL_SERVER_USER+account,data,3200L);
redisLockClient.unLock("local_server_user", LockType.FAIR);
}

18
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/interceptor/LocalServerLoginAccountsInterceptor.java

@ -7,6 +7,7 @@ import com.logpm.factorydata.jinpai.wrapper.CustomHttpServletRequestWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.component.MockLoginService;
import org.springblade.common.constant.LauncherConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.redis.cache.BladeRedis;
@ -32,6 +33,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
private final BladeRedis bladeRedis;
private final Environment environment;
private final MockLoginService mockLoginService;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws CustomerException {
@ -41,19 +43,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
String account ="shujutongbu";
JSONObject data =bladeRedis.get(CacheNames.LOCAL_SERVER_USER+account);
if(Objects.isNull(data)){
String url = "http://"+ LauncherConstant.loginAddr(Objects.requireNonNull(environment.getActiveProfiles()[0]))+"/blade-auth/oauth/token";
HttpRequest urlRequest = HttpRequest.post(url);
urlRequest.header("Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
urlRequest.header("Tenant-Id", "627683");
Map<String, Object> params = new HashMap<>();
params.put("grant_type", "local_server");
params.put("scope", "all");
params.put("username", account);
params.put("tenantId", "627683");
HttpResponse execute = urlRequest.form(params).execute();
String body = execute.body();
data = JSONObject.parseObject(body);
data = mockLoginService.mockToken("627683",account);
bladeRedis.setEx(CacheNames.LOCAL_SERVER_USER+account,data,3200L);
}
@ -65,7 +55,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
wrappedRequest.addHeader("Blade-Auth", "bearer "+data.getString("access_token"));
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("Blade-Auth","bearer "+data.get("access_token") );
httpHeaders.add( "Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
httpHeaders.add( "Authorization", "Basic bG9jYWw6bG9jYWxfc2VjcmV0");
ThreadLocalUtil.put("bladeContext", httpHeaders);

18
blade-service/logpm-factory-data/logpm-factory-data-linsy/src/main/java/com/logpm/factorydata/linsy/interceptor/LocalServerLoginAccountsInterceptor.java

@ -7,6 +7,7 @@ import com.logpm.factorydata.linsy.wrapper.CustomHttpServletRequestWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.component.MockLoginService;
import org.springblade.common.constant.LauncherConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.redis.cache.BladeRedis;
@ -32,6 +33,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
private final BladeRedis bladeRedis;
private final Environment environment;
private final MockLoginService mockLoginService;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws CustomerException {
@ -41,19 +43,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
String account ="shujutongbu";
JSONObject data =bladeRedis.get(CacheNames.LOCAL_SERVER_USER+account);
if(Objects.isNull(data)){
String url = "http://"+ LauncherConstant.loginAddr(Objects.requireNonNull(environment.getActiveProfiles()[0]))+"/blade-auth/oauth/token";
HttpRequest urlRequest = HttpRequest.post(url);
urlRequest.header("Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
urlRequest.header("Tenant-Id", "627683");
Map<String, Object> params = new HashMap<>();
params.put("grant_type", "local_server");
params.put("scope", "all");
params.put("username", account);
params.put("tenantId", "627683");
HttpResponse execute = urlRequest.form(params).execute();
String body = execute.body();
data = JSONObject.parseObject(body);
data = mockLoginService.mockToken("627683",account);
bladeRedis.setEx(CacheNames.LOCAL_SERVER_USER+account,data,3200L);
}
@ -65,7 +55,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
wrappedRequest.addHeader("Blade-Auth", "bearer "+data.getString("access_token"));
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("Blade-Auth","bearer "+data.get("access_token") );
httpHeaders.add( "Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
httpHeaders.add( "Authorization", "Basic bG9jYWw6bG9jYWxfc2VjcmV0");
ThreadLocalUtil.put("bladeContext", httpHeaders);

18
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/interceptor/LocalServerLoginAccountsInterceptor.java

@ -7,6 +7,7 @@ import com.logpm.factorydata.mwh.wrapper.CustomHttpServletRequestWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.component.MockLoginService;
import org.springblade.common.constant.LauncherConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.redis.cache.BladeRedis;
@ -32,6 +33,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
private final BladeRedis bladeRedis;
private final Environment environment;
private final MockLoginService mockLoginService;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws CustomerException {
@ -41,19 +43,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
String account ="shujutongbu";
JSONObject data =bladeRedis.get(CacheNames.LOCAL_SERVER_USER+account);
if(Objects.isNull(data)){
String url = "http://"+ LauncherConstant.loginAddr(Objects.requireNonNull(environment.getActiveProfiles()[0]))+"/blade-auth/oauth/token";
HttpRequest urlRequest = HttpRequest.post(url);
urlRequest.header("Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
urlRequest.header("Tenant-Id", "627683");
Map<String, Object> params = new HashMap<>();
params.put("grant_type", "local_server");
params.put("scope", "all");
params.put("username", account);
params.put("tenantId", "627683");
HttpResponse execute = urlRequest.form(params).execute();
String body = execute.body();
data = JSONObject.parseObject(body);
data = mockLoginService.mockToken("627683",account);
bladeRedis.setEx(CacheNames.LOCAL_SERVER_USER+account,data,3200L);
}
@ -65,7 +55,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
wrappedRequest.addHeader("Blade-Auth", "bearer "+data.getString("access_token"));
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("Blade-Auth","bearer "+data.get("access_token") );
httpHeaders.add( "Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
httpHeaders.add( "Authorization", "Basic bG9jYWw6bG9jYWxfc2VjcmV0");
ThreadLocalUtil.put("bladeContext", httpHeaders);

18
blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/aspect/JobAnnotationAspect.java

@ -9,6 +9,7 @@ import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.component.MockLoginService;
import org.springblade.common.constant.LauncherConstant;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.redis.lock.LockType;
@ -33,6 +34,7 @@ public class JobAnnotationAspect {
private final BladeRedis bladeRedis;
private final Environment environment;
private final RedisLockClient redisLockClient;
private final MockLoginService mockLoginService;
@Around("@annotation(com.xxl.job.core.handler.annotation.XxlJob)")
public Object xxlJobAnnotationMethods(ProceedingJoinPoint joinPoint) throws Throwable {
@ -45,7 +47,7 @@ public class JobAnnotationAspect {
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("Blade-Auth","bearer "+jsonObject.get("access_token") );
httpHeaders.add( "Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
httpHeaders.add( "Authorization", "Basic bG9jYWw6bG9jYWxfc2VjcmV0");
ThreadLocalUtil.put("bladeContext", httpHeaders);
DynamicDataSourceContextHolder.push(jsonObject.getString("tenant_id"));
@ -68,19 +70,7 @@ public class JobAnnotationAspect {
if(flag){
data =bladeRedis.get(CacheNames.LOCAL_SERVER_USER+account);
if(Objects.isNull(data)){
String url = "http://"+ LauncherConstant.loginAddr(Objects.requireNonNull(environment.getActiveProfiles()[0]))+"/blade-auth/oauth/token";
HttpRequest urlRequest = HttpRequest.post(url);
urlRequest.header("Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
urlRequest.header("Tenant-Id", "627683");
Map<String, Object> params = new HashMap<>();
params.put("grant_type", "local_server");
params.put("scope", "all");
params.put("username", account);
params.put("tenantId", "627683");
HttpResponse execute = urlRequest.form(params).execute();
String body = execute.body();
data = JSONObject.parseObject(body);
data = mockLoginService.mockToken("627683",account);
bladeRedis.setEx(CacheNames.LOCAL_SERVER_USER+account,data,3200L);
redisLockClient.unLock("local_server_user", LockType.FAIR);
}

18
blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/interceptor/LocalServerLoginAccountsInterceptor.java

@ -7,6 +7,7 @@ import com.logpm.factorydata.olo.wrapper.CustomHttpServletRequestWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.component.MockLoginService;
import org.springblade.common.constant.LauncherConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.redis.cache.BladeRedis;
@ -32,6 +33,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
private final BladeRedis bladeRedis;
private final Environment environment;
private final MockLoginService mockLoginService;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws CustomerException {
@ -41,19 +43,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
String account ="shujutongbu";
JSONObject data =bladeRedis.get(CacheNames.LOCAL_SERVER_USER+account);
if(Objects.isNull(data)){
String url = "http://"+ LauncherConstant.loginAddr(Objects.requireNonNull(environment.getActiveProfiles()[0]))+"/blade-auth/oauth/token";
HttpRequest urlRequest = HttpRequest.post(url);
urlRequest.header("Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
urlRequest.header("Tenant-Id", "627683");
Map<String, Object> params = new HashMap<>();
params.put("grant_type", "local_server");
params.put("scope", "all");
params.put("username", account);
params.put("tenantId", "627683");
HttpResponse execute = urlRequest.form(params).execute();
String body = execute.body();
data = JSONObject.parseObject(body);
data = mockLoginService.mockToken("627683",account);
bladeRedis.setEx(CacheNames.LOCAL_SERVER_USER+account,data,3200L);
}
@ -65,7 +55,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
wrappedRequest.addHeader("Blade-Auth", "bearer "+data.getString("access_token"));
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("Blade-Auth","bearer "+data.get("access_token") );
httpHeaders.add( "Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
httpHeaders.add( "Authorization", "Basic bG9jYWw6bG9jYWxfc2VjcmV0");
ThreadLocalUtil.put("bladeContext", httpHeaders);

18
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/interceptor/LocalServerLoginAccountsInterceptor.java

@ -7,6 +7,7 @@ import com.logpm.factorydata.suofeiya.wrapper.CustomHttpServletRequestWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.component.MockLoginService;
import org.springblade.common.constant.LauncherConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.redis.cache.BladeRedis;
@ -32,6 +33,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
private final BladeRedis bladeRedis;
private final Environment environment;
private final MockLoginService mockLoginService;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws CustomerException {
@ -41,19 +43,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
String account ="shujutongbu";
JSONObject data =bladeRedis.get(CacheNames.LOCAL_SERVER_USER+account);
if(Objects.isNull(data)){
String url = "http://"+ LauncherConstant.loginAddr(Objects.requireNonNull(environment.getActiveProfiles()[0]))+"/blade-auth/oauth/token";
HttpRequest urlRequest = HttpRequest.post(url);
urlRequest.header("Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
urlRequest.header("Tenant-Id", "627683");
Map<String, Object> params = new HashMap<>();
params.put("grant_type", "local_server");
params.put("scope", "all");
params.put("username", account);
params.put("tenantId", "627683");
HttpResponse execute = urlRequest.form(params).execute();
String body = execute.body();
data = JSONObject.parseObject(body);
data = mockLoginService.mockToken("627683",account);
bladeRedis.setEx(CacheNames.LOCAL_SERVER_USER+account,data,3200L);
}
@ -65,7 +55,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
wrappedRequest.addHeader("Blade-Auth", "bearer "+data.getString("access_token"));
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("Blade-Auth","bearer "+data.get("access_token") );
httpHeaders.add( "Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
httpHeaders.add( "Authorization", "Basic bG9jYWw6bG9jYWxfc2VjcmV0");
ThreadLocalUtil.put("bladeContext", httpHeaders);

18
blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/interceptor/LocalServerLoginAccountsInterceptor.java

@ -7,6 +7,7 @@ import com.logpm.factorydata.zbom.wrapper.CustomHttpServletRequestWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.component.MockLoginService;
import org.springblade.common.constant.LauncherConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.redis.cache.BladeRedis;
@ -32,6 +33,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
private final BladeRedis bladeRedis;
private final Environment environment;
private final MockLoginService mockLoginService;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws CustomerException {
@ -41,19 +43,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
String account ="shujutongbu";
JSONObject data =bladeRedis.get(CacheNames.LOCAL_SERVER_USER+account);
if(Objects.isNull(data)){
String url = "http://"+ LauncherConstant.loginAddr(Objects.requireNonNull(environment.getActiveProfiles()[0]))+"/blade-auth/oauth/token";
HttpRequest urlRequest = HttpRequest.post(url);
urlRequest.header("Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
urlRequest.header("Tenant-Id", "627683");
Map<String, Object> params = new HashMap<>();
params.put("grant_type", "local_server");
params.put("scope", "all");
params.put("username", account);
params.put("tenantId", "627683");
HttpResponse execute = urlRequest.form(params).execute();
String body = execute.body();
data = JSONObject.parseObject(body);
data = mockLoginService.mockToken("627683",account);
bladeRedis.setEx(CacheNames.LOCAL_SERVER_USER+account,data,3200L);
}
@ -65,7 +55,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
wrappedRequest.addHeader("Blade-Auth", "bearer "+data.getString("access_token"));
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("Blade-Auth","bearer "+data.get("access_token") );
httpHeaders.add( "Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
httpHeaders.add( "Authorization", "Basic bG9jYWw6bG9jYWxfc2VjcmV0");
ThreadLocalUtil.put("bladeContext", httpHeaders);

2
blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomNodeDataPushListener.java

@ -41,6 +41,7 @@ import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
@ -88,6 +89,7 @@ public class ZbomNodeDataPushListener {
exchange = @Exchange(name = FactoryDataConstants.Mq.Exchanges.NODE_DATA_PUSH, type = ExchangeTypes.TOPIC),
key = FactoryDataConstants.Mq.RoutingKeys.ZBOM_NODE_DATA_PUSH
))
@Transactional(rollbackFor = Exception.class)
public void nodeDataPush(String msg) {
// {"brand":"ZBOM","node":"TRANSFER_WAREHOUSE_DEPART","operator":"","operatorTime":"","content":[{"packageCode":"1423090693445"}]}
log.info("zb接收到节点数据推送:{}", msg);

19
blade-service/logpm-factory/src/main/java/com/logpm/factory/aspect/JobAnnotationAspect.java

@ -9,6 +9,7 @@ import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.component.MockLoginService;
import org.springblade.common.constant.LauncherConstant;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.redis.lock.LockType;
@ -33,7 +34,7 @@ public class JobAnnotationAspect {
private final BladeRedis bladeRedis;
private final Environment environment;
private final RedisLockClient redisLockClient;
private final MockLoginService mockLoginService;
@Around("@annotation(com.xxl.job.core.handler.annotation.XxlJob)")
public Object xxlJobAnnotationMethods(ProceedingJoinPoint joinPoint) throws Throwable {
@ -45,7 +46,7 @@ public class JobAnnotationAspect {
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("Blade-Auth","bearer "+jsonObject.get("access_token") );
httpHeaders.add( "Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
httpHeaders.add( "Authorization", "Basic bG9jYWw6bG9jYWxfc2VjcmV0");
ThreadLocalUtil.put("bladeContext", httpHeaders);
DynamicDataSourceContextHolder.push(jsonObject.getString("tenant_id"));
@ -68,19 +69,7 @@ public class JobAnnotationAspect {
if(flag){
data =bladeRedis.get(CacheNames.LOCAL_SERVER_USER+account);
if(Objects.isNull(data)){
String url = "http://"+ LauncherConstant.loginAddr(Objects.requireNonNull(environment.getActiveProfiles()[0]))+"/blade-auth/oauth/token";
HttpRequest urlRequest = HttpRequest.post(url);
urlRequest.header("Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
urlRequest.header("Tenant-Id", "627683");
Map<String, Object> params = new HashMap<>();
params.put("grant_type", "local_server");
params.put("scope", "all");
params.put("username", account);
params.put("tenantId", "627683");
HttpResponse execute = urlRequest.form(params).execute();
String body = execute.body();
data = JSONObject.parseObject(body);
data = mockLoginService.mockToken("627683",account);
bladeRedis.setEx(CacheNames.LOCAL_SERVER_USER+account,data,3200L);
redisLockClient.unLock("local_server_user", LockType.FAIR);
}

18
blade-service/logpm-factory/src/main/java/com/logpm/factory/interceptor/LocalServerLoginAccountsInterceptor.java

@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.component.MockLoginService;
import org.springblade.common.constant.LauncherConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.wrapper.CustomHttpServletRequestWrapper;
@ -36,6 +37,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
private final BladeRedis bladeRedis;
private final Environment environment;
private final RedisLockClient redisLockClient;
private final MockLoginService mockLoginService;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws CustomerException {
@ -50,19 +52,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
if(flag){
data =bladeRedis.get(CacheNames.LOCAL_SERVER_USER+account);
if(Objects.isNull(data)){
String url = "http://"+ LauncherConstant.loginAddr(Objects.requireNonNull(environment.getActiveProfiles()[0]))+"/blade-auth/oauth/token";
HttpRequest urlRequest = HttpRequest.post(url);
urlRequest.header("Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
urlRequest.header("Tenant-Id", "627683");
Map<String, Object> params = new HashMap<>();
params.put("grant_type", "local_server");
params.put("scope", "all");
params.put("username", account);
params.put("tenantId", "627683");
HttpResponse execute = urlRequest.form(params).execute();
String body = execute.body();
data = JSONObject.parseObject(body);
data = mockLoginService.mockToken("627683",account);
bladeRedis.setEx(CacheNames.LOCAL_SERVER_USER+account,data,3200L);
redisLockClient.unLock("local_server_user", LockType.FAIR);
}
@ -77,7 +67,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
wrappedRequest.addHeader("Blade-Auth", "bearer "+data.getString("access_token"));
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("Blade-Auth","bearer "+data.get("access_token") );
httpHeaders.add( "Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
httpHeaders.add( "Authorization", "Basic bG9jYWw6bG9jYWxfc2VjcmV0");
ThreadLocalUtil.put("bladeContext", httpHeaders);

18
blade-service/logpm-patch/src/main/java/com/logpm/patch/aspect/JobAnnotationAspect.java

@ -9,6 +9,7 @@ import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.component.MockLoginService;
import org.springblade.common.constant.LauncherConstant;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.redis.lock.LockType;
@ -33,6 +34,7 @@ public class JobAnnotationAspect {
private final BladeRedis bladeRedis;
private final Environment environment;
private final RedisLockClient redisLockClient;
private final MockLoginService mockLoginService;
@Around("@annotation(com.xxl.job.core.handler.annotation.XxlJob)")
public Object xxlJobAnnotationMethods(ProceedingJoinPoint joinPoint) throws Throwable {
@ -45,7 +47,7 @@ public class JobAnnotationAspect {
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("Blade-Auth","bearer "+jsonObject.get("access_token") );
httpHeaders.add( "Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
httpHeaders.add( "Authorization", "Basic bG9jYWw6bG9jYWxfc2VjcmV0");
ThreadLocalUtil.put("bladeContext", httpHeaders);
DynamicDataSourceContextHolder.push(jsonObject.getString("tenant_id"));
@ -68,19 +70,7 @@ public class JobAnnotationAspect {
if(flag){
data =bladeRedis.get(CacheNames.LOCAL_SERVER_USER+account);
if(Objects.isNull(data)){
String url = "http://"+ LauncherConstant.loginAddr(Objects.requireNonNull(environment.getActiveProfiles()[0]))+"/blade-auth/oauth/token";
HttpRequest urlRequest = HttpRequest.post(url);
urlRequest.header("Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
urlRequest.header("Tenant-Id", "627683");
Map<String, Object> params = new HashMap<>();
params.put("grant_type", "local_server");
params.put("scope", "all");
params.put("username", account);
params.put("tenantId", "627683");
HttpResponse execute = urlRequest.form(params).execute();
String body = execute.body();
data = JSONObject.parseObject(body);
data = mockLoginService.mockToken("627683",account);
bladeRedis.setEx(CacheNames.LOCAL_SERVER_USER+account,data,3200L);
redisLockClient.unLock("local_server_user", LockType.FAIR);
}

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/aspect/ChangeAsyncAnnotationAspect.java

@ -90,7 +90,7 @@ public class ChangeAsyncAnnotationAspect {
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("Blade-Auth","bearer "+data.get("access_token") );
httpHeaders.add( "Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
httpHeaders.add( "Authorization", "Basic bG9jYWw6bG9jYWxfc2VjcmV0");
ThreadLocalUtil.put("bladeContext", httpHeaders);
DynamicDataSourceContextHolder.push(data.getString("tenant_id"));

19
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/config/interceptor/LocalServerLoginAccountsInterceptor.java

@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.component.MockLoginService;
import org.springblade.common.constant.LauncherConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.wrapper.CustomHttpServletRequestWrapper;
@ -34,8 +35,8 @@ import java.util.concurrent.TimeUnit;
public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapter {
private final BladeRedis bladeRedis;
private final Environment environment;
private final RedisLockClient redisLockClient;
private final MockLoginService mockLoginService;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws CustomerException {
@ -49,19 +50,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
if(flag){
data =bladeRedis.get(CacheNames.LOCAL_SERVER_USER+account);
if(Objects.isNull(data)){
String url = "http://"+ LauncherConstant.loginAddr(Objects.requireNonNull(environment.getActiveProfiles()[0]))+"/blade-auth/oauth/token";
HttpRequest urlRequest = HttpRequest.post(url);
urlRequest.header("Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
urlRequest.header("Tenant-Id", "627683");
Map<String, Object> params = new HashMap<>();
params.put("grant_type", "local_server");
params.put("scope", "all");
params.put("username", account);
params.put("tenantId", "627683");
HttpResponse execute = urlRequest.form(params).execute();
String body = execute.body();
data = JSONObject.parseObject(body);
data = mockLoginService.mockToken("627683",account);
bladeRedis.setEx(CacheNames.LOCAL_SERVER_USER+account,data,3200L);
redisLockClient.unLock("local_server_user", LockType.FAIR);
}
@ -76,7 +65,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
wrappedRequest.addHeader("Blade-Auth", "bearer "+data.getString("access_token"));
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("Blade-Auth","bearer "+data.get("access_token") );
httpHeaders.add( "Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
httpHeaders.add( "Authorization", "Basic bG9jYWw6bG9jYWxfc2VjcmV0");
ThreadLocalUtil.put("bladeContext", httpHeaders);

6
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseTrayTypeMapper.xml

@ -116,10 +116,10 @@
<update id="updateAllNumTrayTypeId" >
update logpm_warehouse_tray_type
set total_num = #{enterNum},
set total_num = #{orderNum},
order_total_num = #{orderTotalNum},
stock_num = #{enterNum},
stock_total_num = #{orderTotalNum}
stock_num = #{stockNum},
stock_total_num = #{stockTotalNum}
where id = #{trayTypeId}
</update>

Loading…
Cancel
Save