Browse Source

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

dev
陈龙 3 days ago
parent
commit
ea1e1f91a1
  1. 18
      blade-service/logpm-factory-data/logpm-factory-data-paterson/src/main/java/com/logpm/factorydata/paterson/interceptor/FactoryAccountsInterceptor.java
  2. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/config/MybatisPlusConfig.java
  3. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/TrunklinePickupMapper.xml

18
blade-service/logpm-factory-data/logpm-factory-data-paterson/src/main/java/com/logpm/factorydata/paterson/interceptor/FactoryAccountsInterceptor.java

@ -1,6 +1,9 @@
package com.logpm.factorydata.paterson.interceptor;
import cn.hutool.core.codec.Base64;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.digest.MD5;
@ -35,7 +38,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.time.Instant;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
@ -93,13 +95,23 @@ public class FactoryAccountsInterceptor implements HandlerInterceptor {
FactoryAuthVO authVO = jpFactoryShipmentService.findFactoryAuth(companyCode);
if (ObjectUtil.isNotEmpty(authVO)) {
Long authTime1 = authVO.getAuthTime();
long secondTimestamp = Instant.now().getEpochSecond();
// 验证时间 不能大于5秒
long secondTimestamp = DateUtil.current();
DateTime currentDate = DateUtil.date();
// 验证时间
if (secondTimestamp - authTime > authTime1) {
log.info("##########preHandle: 时间戳过期");
returnJson(response, JSONObject.toJSONString(R.fail("认证不通过,时间戳过期")));
return false;
}
// 将 authTime 转换为时间并与当前时间比较
DateTime authDateTime = DateUtil.date(authTime); // 将时间戳转换为 DateTime
// 将 authTime 转换为时间并与当前时间比较
long timeDifferenceInSeconds = DateUtil.between(authDateTime, currentDate, DateUnit.MS);
if (timeDifferenceInSeconds > authTime1) {
log.info("##########preHandle: 认证时间过期");
returnJson(response, JSONObject.toJSONString(R.fail("认证不通过,认证时间过期")));
return false;
}
// 验证签名
String auth = authVO.getAppKey();
String md5Hex = Base64.encode(MD5.create().digestHex(params + auth + authTime)).toUpperCase();

2
blade-service/logpm-report/src/main/java/com/logpm/report/config/MybatisPlusConfig.java

@ -63,7 +63,7 @@ public class MybatisPlusConfig implements WebMvcConfigurer {
AnnotationAwareOrderComparator.sort(queryInterceptorArray);
paginationInterceptor.setQueryInterceptors(queryInterceptorArray);
}
paginationInterceptor.setMaxLimit(mybatisPlusProperties.getPageLimit());
paginationInterceptor.setMaxLimit(-1L);
paginationInterceptor.setOverflow(mybatisPlusProperties.getOverflow());
paginationInterceptor.setOptimizeJoin(mybatisPlusProperties.getOptimizeJoin());
paginationInterceptor.setDbType(DbType.MYSQL);

2
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/TrunklinePickupMapper.xml

@ -295,7 +295,7 @@
when ifnull(ldsa.type_service, '1') = '4' then '三方中转' end as type_service,
count(distinct t.order_code) orderNum, sum(t.quantity) num
from logpm_distribution_parcel_list t
join logpm_distribution_stock_article ldsa on ldsa.order_code = t.order_code and ldsa.is_deleted = 0
join logpm_distribution_stock_article ldsa on ldsa.id = t.stock_article_id and ldsa.is_deleted = 0
left join logpm_warehouse_warehouse lww on lww.id = t.warehouse_id
where t.warehouse_entry_time_end >= #{query.startCreateTime} and t.warehouse_entry_time_end <= #{query.endCreateTime}
and t.is_transfer = 0 and ldsa.type_service != '2'

Loading…
Cancel
Save