Browse Source

1.提交修复bug分支

newStockUp
pref_mail@163.com 1 year ago
parent
commit
acc8b01cde
  1. 6
      blade-biz-common/src/main/java/org/springblade/common/constant/RedisKeyConstant.java
  2. 14
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java

6
blade-biz-common/src/main/java/org/springblade/common/constant/RedisKeyConstant.java

@ -3,4 +3,10 @@ package org.springblade.common.constant;
public class RedisKeyConstant {
/**
* 欧派入库扫描缓存key
*/
public static final String cache_oupai_key ="cache:oupai-key:";
}

14
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java

@ -24,10 +24,12 @@ import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.io.IOUtils;
import org.jetbrains.annotations.NotNull;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.RedisKeyConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
import org.springblade.common.utils.FileLogsUtil;
import org.springblade.core.oss.model.BladeFile;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.resource.feign.IOssClient;
@ -85,6 +87,9 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
@Autowired
private IOpPackagePushLogService opPackagePushLogService;
@Autowired
private BladeRedis bladeRedis;
@Override
public String saveOuPaiFactoryOrderDTOByCarCarNumber(String code) {
@ -288,11 +293,20 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
public Boolean checkReceivingOrder(String code) {
Boolean isUpdate = false;
String o = bladeRedis.get(RedisKeyConstant.cache_oupai_key + code);
if(code.equals(o)){
return true;
}
LambdaQueryWrapper<ReceivingOrderEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ReceivingOrderEntity::getCode, code);
List<ReceivingOrderEntity> receivingOrderEntities = receivingOrderMapper.selectList(lambdaQueryWrapper);
if (ObjectUtils.isNotNull(receivingOrderEntities)) {
isUpdate = true;
// 加入缓存
bladeRedis.setEx(RedisKeyConstant.cache_oupai_key+code,code,60*60*60L);
}
return isUpdate;
}

Loading…
Cancel
Save