Browse Source

feat(all): 索菲亚工厂

1 增加华之韵物流对接
pre-production
zhaoqiaobo 3 weeks ago
parent
commit
adccc27ece
  1. 6
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/interceptor/FactoryAccountsInterceptor.java
  2. 2
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/pros/FactoryDataSuoFeiYaProperties.java
  3. 6
      blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/impl/DeliveryNoteServiceImpl.java

6
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/interceptor/FactoryAccountsInterceptor.java

@ -134,12 +134,14 @@ public class FactoryAccountsInterceptor implements HandlerInterceptor {
request = wrappedRequest;
RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(request));
return true;
} else {
returnJson(response, JSONObject.toJSONString(R.fail(1, "认证不通过,配置缺失")));
return false;
}
}else{
} else {
returnJson(response, JSONObject.toJSONString(R.fail(1, "缺少参数 companyCode")));
return false;
}
return false;
} catch (Exception e) {
e.printStackTrace();
returnJson(response, JSONObject.toJSONString(R.fail(5, "服务异常,请联系管理员")));

2
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/pros/FactoryDataSuoFeiYaProperties.java

@ -18,7 +18,7 @@ public class FactoryDataSuoFeiYaProperties {
private String auth;
/** auth过期时间 */
private Long authTime;
private Long authTime = 5L;
/** 回传配置 */
private PushProperties push;

6
blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/impl/DeliveryNoteServiceImpl.java

@ -254,13 +254,13 @@ public class DeliveryNoteServiceImpl extends BaseServiceImpl<DeliveryNoteMapper,
public FactoryAuthVO findFactoryAuth(String companyCode) {
// redis 缓存数据 缓存时间 1天
if (StrUtil.isNotBlank(companyCode)) {
String key = StrUtil.format("factory-data:suofeiya:", companyCode);
String key = "factory-data:suofeiya:" + companyCode;
String json = bladeRedis.get(key);
if (StrUtil.isNotBlank(json)) {
return JSONUtil.toBean(json, FactoryAuthVO.class);
} else {
List<FactoryAuthVO> factoryAuth = baseMapper.findFactoryAuth(companyCode);
if(CollUtil.isNotEmpty(factoryAuth)){
if (CollUtil.isNotEmpty(factoryAuth)) {
FactoryAuthVO authVO = factoryAuth.get(0);
bladeRedis.setEx(key, JSONUtil.toJsonStr(authVO), Duration.ofDays(1));
return authVO;
@ -274,7 +274,7 @@ public class DeliveryNoteServiceImpl extends BaseServiceImpl<DeliveryNoteMapper,
public FactoryAuthVO findFactoryAuthByTenantCode(String tenantId) {
// redis 缓存数据 缓存时间 1天
if (StrUtil.isNotBlank(tenantId)) {
String key = StrUtil.format("factory-data:suofeiya:tenant-code:", tenantId);
String key = "factory-data:suofeiya:tenant-code:" + tenantId;
String json = bladeRedis.get(key);
if (StrUtil.isNotBlank(json)) {
return JSONUtil.toBean(json, FactoryAuthVO.class);

Loading…
Cancel
Save