From 379442097e738f8c4cf4fcf0b0e30d25ac95d92b Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Wed, 15 Jan 2025 15:45:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=A4=A7=E5=B1=8F=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/entity/LargeScreenDataEntity.java | 6 +- .../report/aspect/JobAnnotationAspect.java | 79 ++++++++++++++ .../config/InterceptorAdapterConfig.java | 33 ++++++ .../com/logpm/report/config/XxlJobConfig.java | 74 +++++++++++++ .../controller/LargeScreenController.java | 32 +++--- .../LocalServerLoginAccountsInterceptor.java | 100 ++++++++++++++++++ .../report/job/LargeScreenQueryXxlJob.java | 18 +++- .../mapper/largeScreen/BillingDataMapper.xml | 2 +- .../httpImpl/BillingDataServiceImpl.java | 15 ++- .../httpImpl/BinLocationServiceImpl.java | 3 +- .../httpImpl/BusinessRationServiceImpl.java | 3 +- .../httpImpl/CarsLoadDataServiceImpl.java | 3 +- .../httpImpl/DeliveryDataServiceImpl.java | 3 +- .../httpImpl/MapWarehouseServiceImpl.java | 3 +- .../httpImpl/NodeDataServiceImpl.java | 3 +- .../httpImpl/TrunkDataServiceImpl.java | 3 +- 16 files changed, 343 insertions(+), 37 deletions(-) create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/aspect/JobAnnotationAspect.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/config/InterceptorAdapterConfig.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/config/XxlJobConfig.java create mode 100644 blade-service/logpm-report/src/main/java/com/logpm/report/interceptor/LocalServerLoginAccountsInterceptor.java diff --git a/blade-service-api/logpm-report-api/src/main/java/com/logpm/report/entity/LargeScreenDataEntity.java b/blade-service-api/logpm-report-api/src/main/java/com/logpm/report/entity/LargeScreenDataEntity.java index a5504d82a..7184163da 100644 --- a/blade-service-api/logpm-report-api/src/main/java/com/logpm/report/entity/LargeScreenDataEntity.java +++ b/blade-service-api/logpm-report-api/src/main/java/com/logpm/report/entity/LargeScreenDataEntity.java @@ -13,7 +13,6 @@ import java.util.Map; @Data @TableName("logpm_large_screen_data") @EqualsAndHashCode(callSuper = true) -@AllArgsConstructor public class LargeScreenDataEntity extends TenantEntity { /** 预留1 */ @@ -33,9 +32,6 @@ public class LargeScreenDataEntity extends TenantEntity { private String reserve5 ; @ApiModelProperty(name = "数据",notes = "") - private Map data; + private String data; - public LargeScreenDataEntity(Map data) { - this.data = data; - } } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/aspect/JobAnnotationAspect.java b/blade-service/logpm-report/src/main/java/com/logpm/report/aspect/JobAnnotationAspect.java new file mode 100644 index 000000000..2b1b888cf --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/aspect/JobAnnotationAspect.java @@ -0,0 +1,79 @@ +package com.logpm.report.aspect; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; +import lombok.AllArgsConstructor; +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.core.redis.cache.BladeRedis; +import org.springblade.core.redis.lock.LockType; +import org.springblade.core.redis.lock.RedisLockClient; +import org.springblade.core.tool.utils.ThreadLocalUtil; +import org.springframework.core.env.Environment; +import org.springframework.http.HttpHeaders; +import org.springframework.mock.web.MockHttpServletRequest; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import java.util.Objects; +import java.util.concurrent.TimeUnit; + +@Aspect +@Component +@AllArgsConstructor +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 { + + + JSONObject jsonObject = mockLogin(); + MockHttpServletRequest mockRequest = new MockHttpServletRequest(); + mockRequest.addHeader("Blade-Auth", "bearer "+jsonObject.get("access_token")); + RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(mockRequest)); + + HttpHeaders httpHeaders = new HttpHeaders(); + httpHeaders.add("Blade-Auth","bearer "+jsonObject.get("access_token") ); + httpHeaders.add( "Authorization", "Basic bG9jYWw6bG9jYWxfc2VjcmV0"); + ThreadLocalUtil.put("bladeContext", httpHeaders); + + DynamicDataSourceContextHolder.push(jsonObject.getString("tenant_id")); + // 执行原方法 + Object result = joinPoint.proceed(); + // 在方法执行后,从数据源上下文中移除租户ID + DynamicDataSourceContextHolder.poll(); + + return result; + + + } + + private JSONObject mockLogin() throws InterruptedException { + String account ="shujutongbu"; + String tenantId ="627683"; + String key =CacheNames.LOCAL_SERVER_USER+tenantId+":"+account; + String lockKey =key+":lock"; + JSONObject data =bladeRedis.get(key); + if(Objects.isNull(data)){ + boolean flag = redisLockClient.tryLock(lockKey, LockType.FAIR, 5000, 10000, TimeUnit.MILLISECONDS); + if(flag){ + data =bladeRedis.get(key); + if(Objects.isNull(data)){ + data = mockLoginService.mockToken(tenantId,account); + bladeRedis.setEx(key,data,2591990L); + redisLockClient.unLock(lockKey, LockType.FAIR); + } + } + } + return data; + } + + +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/config/InterceptorAdapterConfig.java b/blade-service/logpm-report/src/main/java/com/logpm/report/config/InterceptorAdapterConfig.java new file mode 100644 index 000000000..5e14bc4a0 --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/config/InterceptorAdapterConfig.java @@ -0,0 +1,33 @@ +package com.logpm.report.config; + + +import com.logpm.report.interceptor.LocalServerLoginAccountsInterceptor; +import lombok.AllArgsConstructor; +import org.springblade.common.component.MockLoginService; +import org.springblade.core.redis.cache.BladeRedis; +import org.springblade.core.redis.lock.RedisLockClient; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +/** + * 为所有的的 + */ +@Configuration +@AllArgsConstructor +public class InterceptorAdapterConfig implements WebMvcConfigurer { + + + private final BladeRedis redis; + + private final RedisLockClient redisLockClient; + private final MockLoginService mockLoginService; + + + @Override + public void addInterceptors(InterceptorRegistry interceptorRegistry) { + + interceptorRegistry.addInterceptor(new LocalServerLoginAccountsInterceptor(redis,redisLockClient,mockLoginService)).addPathPatterns("/largeScreen/**").order(1); + + } +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/config/XxlJobConfig.java b/blade-service/logpm-report/src/main/java/com/logpm/report/config/XxlJobConfig.java new file mode 100644 index 000000000..4949d6a9d --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/config/XxlJobConfig.java @@ -0,0 +1,74 @@ +package com.logpm.report.config; + +import com.xxl.job.core.executor.impl.XxlJobSpringExecutor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * xxl-job config + * + * @author xuxueli 2017-04-28 + */ +@Configuration(proxyBeanMethods = false) +public class XxlJobConfig { + private final Logger logger = LoggerFactory.getLogger(XxlJobConfig.class); + + @Value("${xxl.job.admin.addresses}") + private String adminAddresses; + + @Value("${xxl.job.executor.appname}") + private String appName; + + @Value("${xxl.job.executor.ip}") + private String ip; + + @Value("${xxl.job.executor.port}") + private int port; + + @Value("${xxl.job.accessToken}") + private String accessToken; + + @Value("${xxl.job.executor.logpath}") + private String logPath; + + @Value("${xxl.job.executor.logretentiondays}") + private int logRetentionDays; + + + @Bean + public XxlJobSpringExecutor xxlJobExecutor() { + logger.info(">>>>>>>>>>> xxl-job config init."); + XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor(); + xxlJobSpringExecutor.setAdminAddresses(adminAddresses); + xxlJobSpringExecutor.setAppName(appName); + xxlJobSpringExecutor.setIp(ip); + xxlJobSpringExecutor.setPort(port); + xxlJobSpringExecutor.setAccessToken(accessToken); + xxlJobSpringExecutor.setLogPath(logPath); + xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays); + + return xxlJobSpringExecutor; + } + + /** + * 针对多网卡、容器内部署等情况,可借助 "spring-cloud-commons" 提供的 "InetUtils" 组件灵活定制注册IP; + * + * 1、引入依赖: + * + * org.springframework.cloud + * spring-cloud-commons + * ${version} + * + * + * 2、配置文件,或者容器启动变量 + * spring.cloud.inetutils.preferred-networks: 'xxx.xxx.xxx.' + * + * 3、获取IP + * String ip_ = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); + */ + + +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/controller/LargeScreenController.java b/blade-service/logpm-report/src/main/java/com/logpm/report/controller/LargeScreenController.java index 46f3c33f8..05153bd8d 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/controller/LargeScreenController.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/controller/LargeScreenController.java @@ -37,22 +37,22 @@ public class LargeScreenController{ public LargeScreenController( // 正式使用是使用这个 -// @Qualifier(value = "mapWarehouseServiceHttp") IMapWarehouseService mapWarehouseService, -// @Qualifier(value = "billingDataServiceHttp") IBillingDataService billingDataService, -// @Qualifier(value = "carsLoadDataServiceHttp") ICarsLoadDataService carsLoadDataService, -// @Qualifier(value = "nodeDataServiceHttp") INodeDataService nodeData, -// @Qualifier(value = "binLocationServiceHttp") IBinLocationService binLocation, -// @Qualifier(value = "trunkDataServiceHttp") ITrunkDataService trunkData, -// @Qualifier(value = "deliveryDataServiceHttp") IDeliveryDataService deliveryDataService, -// @Qualifier(value = "businessRationServiceHttp") IBusinessRationService businessRatio - IMapWarehouseService mapWarehouseService, - IBillingDataService billingDataService, - ICarsLoadDataService carsLoadDataService, - INodeDataService nodeData, - IBinLocationService binLocation, - ITrunkDataService trunkData, - IDeliveryDataService deliveryDataService, - IBusinessRationService businessRatio + @Qualifier(value = "mapWarehouseServiceHttp") IMapWarehouseService mapWarehouseService, + @Qualifier(value = "billingDataServiceHttp") IBillingDataService billingDataService, + @Qualifier(value = "carsLoadDataServiceHttp") ICarsLoadDataService carsLoadDataService, + @Qualifier(value = "nodeDataServiceHttp") INodeDataService nodeData, + @Qualifier(value = "binLocationServiceHttp") IBinLocationService binLocation, + @Qualifier(value = "trunkDataServiceHttp") ITrunkDataService trunkData, + @Qualifier(value = "deliveryDataServiceHttp") IDeliveryDataService deliveryDataService, + @Qualifier(value = "businessRationServiceHttp") IBusinessRationService businessRatio +// IMapWarehouseService mapWarehouseService, +// IBillingDataService billingDataService, +// ICarsLoadDataService carsLoadDataService, +// INodeDataService nodeData, +// IBinLocationService binLocation, +// ITrunkDataService trunkData, +// IDeliveryDataService deliveryDataService, +// IBusinessRationService businessRatio ) { this.mapWarehouseService = mapWarehouseService; this.billingDataService = billingDataService; diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/interceptor/LocalServerLoginAccountsInterceptor.java b/blade-service/logpm-report/src/main/java/com/logpm/report/interceptor/LocalServerLoginAccountsInterceptor.java new file mode 100644 index 000000000..3ebef4fcb --- /dev/null +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/interceptor/LocalServerLoginAccountsInterceptor.java @@ -0,0 +1,100 @@ +package com.logpm.report.interceptor; + +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.exception.CustomerException; +import org.springblade.common.wrapper.CustomHttpServletRequestWrapper; +import org.springblade.core.redis.cache.BladeRedis; +import org.springblade.core.redis.lock.LockType; +import org.springblade.core.redis.lock.RedisLockClient; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.StringUtil; +import org.springblade.core.tool.utils.ThreadLocalUtil; +import org.springframework.http.HttpHeaders; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; +import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Objects; +import java.util.concurrent.TimeUnit; + +@Log4j2 +@AllArgsConstructor +public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapter { + + private final BladeRedis bladeRedis; + private final RedisLockClient redisLockClient; + private final MockLoginService mockLoginService; + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws CustomerException { + + + try { + CustomHttpServletRequestWrapper wrappedRequest = new CustomHttpServletRequestWrapper(request); + String account ="shujutongbu"; + String tenantId = request.getHeader("tenantId"); + tenantId = StringUtil.isBlank(tenantId)?"627683":tenantId; + String key =CacheNames.LOCAL_SERVER_USER+tenantId+":"+account; + String lockKey =key+":lock"; + JSONObject data =bladeRedis.get(key); + if(Objects.isNull(data)){ + boolean flag = redisLockClient.tryLock(lockKey, LockType.FAIR, 5000, 10000, TimeUnit.MILLISECONDS); + if(flag){ + data =bladeRedis.get(key); + if(Objects.isNull(data)){ + data = mockLoginService.mockToken(tenantId,account); + bladeRedis.setEx(key,data,2591990L); + redisLockClient.unLock(lockKey, LockType.FAIR); + } + } + } + + // 修改或添加header + + // 发送登录请求 + log.info("##########preHandle: request={}", request); + + 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 bG9jYWw6bG9jYWxfc2VjcmV0"); + ThreadLocalUtil.put("bladeContext", httpHeaders); + + + // 用包装后的request替换原始request + request = wrappedRequest; + RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(request)); + return true; + } catch (Exception e) { + returnJson(response, JSONObject.toJSONString(R.fail(500, "服务异常,请联系管理员"))); + return false; + } + } + + private void returnJson(HttpServletResponse response, String json) { + PrintWriter writer = null; + response.setCharacterEncoding("UTF-8"); + response.setContentType("application/json"); + try { + writer = response.getWriter(); + writer.print(json); + + } catch (IOException e) { + System.out.println(e.getMessage()); + } finally { + if (writer != null) { + writer.close(); + } + } + } + + +} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/job/LargeScreenQueryXxlJob.java b/blade-service/logpm-report/src/main/java/com/logpm/report/job/LargeScreenQueryXxlJob.java index 39a5bfd99..4ecac78f4 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/job/LargeScreenQueryXxlJob.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/job/LargeScreenQueryXxlJob.java @@ -1,15 +1,19 @@ package com.logpm.report.job; +import com.alibaba.fastjson.JSON; +import com.baomidou.dynamic.datasource.annotation.DS; import com.logpm.report.entity.LargeScreenDataEntity; import com.logpm.report.mapper.largeScreen.LargeScreenDataMapper; import com.logpm.report.service.largeScreen.*; import com.logpm.report.vo.largeScreen.XxlJobQueryVO; +import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.handler.annotation.XxlJob; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; import org.springframework.stereotype.Component; +import java.util.Date; import java.util.HashMap; /** @@ -34,9 +38,8 @@ public class LargeScreenQueryXxlJob { /** * 数据查询 */ - @XxlJob("LargeScreenQuery") - public void query() - { + @XxlJob("largeScreenexExcute") + public ReturnT largeScreenexExcute(String param) { XxlJobQueryVO xxlJobQueryVO = new XxlJobQueryVO(); xxlJobQueryVO.setMapWarehouse(mapWarehouseService.list()); xxlJobQueryVO.setBillingData(billingDataService.getBillingData()); @@ -64,7 +67,14 @@ public class LargeScreenQueryXxlJob { data.put("deliveryData", xxlJobQueryVO.getDeliveryData()); data.put("deliveryYearData", xxlJobQueryVO.getDeliveryYearData()); data.put("businessRatio", xxlJobQueryVO.getBusinessRatio()); + LargeScreenDataEntity largeScreenDataEntity = new LargeScreenDataEntity(); + largeScreenDataEntity.setData(JSON.toJSONString(data)); + largeScreenDataEntity.setCreateTime(new Date()); + largeScreenDataEntity.setUpdateTime(new Date()); + largeScreenDataEntity.setIsDeleted(0); + largeScreenDataEntity.setStatus(1); + largeScreenDataMapper.insert(largeScreenDataEntity); - largeScreenDataMapper.insert(new LargeScreenDataEntity(data)); + return ReturnT.SUCCESS; } } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BillingDataMapper.xml b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BillingDataMapper.xml index 61ada2f67..5668e02f0 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BillingDataMapper.xml +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BillingDataMapper.xml @@ -8,7 +8,7 @@ sum(d.volume) as volume, count(d.id) as value from logpm_platform.logpm_warehouse_waybill as w - INNER JOIN logpm_platform.logpm_trunkline_advance_detail as d on w.waybill_no = d.waybill_no + INNER JOIN logpm_platform.logpm_trunkline_advance_detail as d on w.id = d.waybill_id where w.freeze_status = 0 and w.create_time BETWEEN #{startTime} and #{endTime} diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java index 199f082f7..8ef679eb4 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java @@ -1,6 +1,7 @@ package com.logpm.report.service.largeScreen.httpImpl; import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.logpm.report.entity.LargeScreenDataEntity; import com.logpm.report.mapper.largeScreen.BillingDataMapper; @@ -35,7 +36,7 @@ public class BillingDataServiceImpl implements IBillingDataService { LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime)); - XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData()); + XxlJobQueryVO init = JSON.parseObject(largeScreenDataEntity.getData(), XxlJobQueryVO.class); return init.getBillingData(); } @@ -44,9 +45,15 @@ public class BillingDataServiceImpl implements IBillingDataService { public List getWarehouseBillingData() { LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime)); - XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData()); + XxlJobQueryVO init = JSON.parseObject(largeScreenDataEntity.getData(), XxlJobQueryVO.class); - return init.getWarehouseBillingData(); + List warehouseBillingData = init.getWarehouseBillingData(); + + // 按照开单件数 倒序排列 + warehouseBillingData.sort((o1, o2) -> o2.getValue() - o1.getValue()); + + + return warehouseBillingData; } @Override @@ -56,7 +63,7 @@ public class BillingDataServiceImpl implements IBillingDataService { if (largeScreenDataEntity == null) { return new ArrayList<>(); } - XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData()); + XxlJobQueryVO init = JSON.parseObject(largeScreenDataEntity.getData(), XxlJobQueryVO.class); return init.getMonthBillingData(); } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BinLocationServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BinLocationServiceImpl.java index 8ad9f44e8..d17540caf 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BinLocationServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BinLocationServiceImpl.java @@ -1,5 +1,6 @@ package com.logpm.report.service.largeScreen.httpImpl; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.logpm.report.entity.LargeScreenDataEntity; import com.logpm.report.mapper.largeScreen.BinLocationMapper; @@ -25,7 +26,7 @@ public class BinLocationServiceImpl implements IBinLocationService { if (largeScreenDataEntity == null) { return new BinLocationDataVO(); } - XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData()); + XxlJobQueryVO init = JSON.parseObject(largeScreenDataEntity.getData(), XxlJobQueryVO.class); return init.getBinLocationData(); } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BusinessRationServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BusinessRationServiceImpl.java index d0d58f29b..72a479800 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BusinessRationServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BusinessRationServiceImpl.java @@ -1,5 +1,6 @@ package com.logpm.report.service.largeScreen.httpImpl; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.logpm.report.entity.LargeScreenDataEntity; import com.logpm.report.mapper.largeScreen.BusinessRatioMapper; @@ -27,7 +28,7 @@ public class BusinessRationServiceImpl implements IBusinessRationService { if (largeScreenDataEntity == null) { return new BusinessRatioDataVO(); } - XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData()); + XxlJobQueryVO init = JSON.parseObject(largeScreenDataEntity.getData(), XxlJobQueryVO.class); return init.getBusinessRatio(); } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/CarsLoadDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/CarsLoadDataServiceImpl.java index 1cf7df6eb..9f12a2688 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/CarsLoadDataServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/CarsLoadDataServiceImpl.java @@ -1,5 +1,6 @@ package com.logpm.report.service.largeScreen.httpImpl; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.logpm.report.entity.LargeScreenDataEntity; import com.logpm.report.mapper.largeScreen.CarsLoadDataMapper; @@ -39,7 +40,7 @@ public class CarsLoadDataServiceImpl implements ICarsLoadDataService { return new ArrayList<>(); } - XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData()); + XxlJobQueryVO init = JSON.parseObject(largeScreenDataEntity.getData(), XxlJobQueryVO.class); return isDelivery.equals(1) ? init.getCareerLineDeliveryData() diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/DeliveryDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/DeliveryDataServiceImpl.java index 262f30952..f69f4b7e1 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/DeliveryDataServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/DeliveryDataServiceImpl.java @@ -1,5 +1,6 @@ package com.logpm.report.service.largeScreen.httpImpl; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.logpm.report.entity.LargeScreenDataEntity; import com.logpm.report.mapper.largeScreen.DeliveryDataMapper; @@ -29,7 +30,7 @@ public class DeliveryDataServiceImpl implements IDeliveryDataService { return new DeliveryDataVO(); } - XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData()); + XxlJobQueryVO init = JSON.parseObject(largeScreenDataEntity.getData(), XxlJobQueryVO.class); return isYear.equals(1) ? init.getDeliveryYearData() diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/MapWarehouseServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/MapWarehouseServiceImpl.java index a6e2fb633..f7ca72970 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/MapWarehouseServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/MapWarehouseServiceImpl.java @@ -1,6 +1,7 @@ package com.logpm.report.service.largeScreen.httpImpl; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.logpm.report.entity.LargeScreenDataEntity; import com.logpm.report.mapper.largeScreen.LargeScreenDataMapper; @@ -35,7 +36,7 @@ public class MapWarehouseServiceImpl implements IMapWarehouseService { if (largeScreenDataEntity == null) { return new ArrayList<>(); } - XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData()); + XxlJobQueryVO init = JSON.parseObject(largeScreenDataEntity.getData(), XxlJobQueryVO.class); return init.getMapWarehouse(); } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/NodeDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/NodeDataServiceImpl.java index d25bfd48d..1c77d8e43 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/NodeDataServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/NodeDataServiceImpl.java @@ -1,5 +1,6 @@ package com.logpm.report.service.largeScreen.httpImpl; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.logpm.report.entity.LargeScreenDataEntity; import com.logpm.report.mapper.largeScreen.LargeScreenDataMapper; @@ -25,7 +26,7 @@ public class NodeDataServiceImpl implements INodeDataService { if (largeScreenDataEntity == null) { return new NodeDataVO(); } - XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData()); + XxlJobQueryVO init = JSON.parseObject(largeScreenDataEntity.getData(), XxlJobQueryVO.class); return init.getNodeData(); } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/TrunkDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/TrunkDataServiceImpl.java index badb6a50a..4bc3357b3 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/TrunkDataServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/TrunkDataServiceImpl.java @@ -1,5 +1,6 @@ package com.logpm.report.service.largeScreen.httpImpl; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.logpm.report.entity.LargeScreenDataEntity; import com.logpm.report.mapper.largeScreen.LargeScreenDataMapper; @@ -30,7 +31,7 @@ public class TrunkDataServiceImpl implements ITrunkDataService { return new TrunkDataVO(); } - XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData()); + XxlJobQueryVO init = JSON.parseObject(largeScreenDataEntity.getData(), XxlJobQueryVO.class); return init.getTrunkData(); }