|
|
|
@ -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; |
|
|
|
|
} |
|
|
|
@ -631,6 +645,17 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
//新发车单数据
|
|
|
|
|
ReceivingOrderEntity receivingOrderEntity = new ReceivingOrderEntity(); |
|
|
|
|
receivingOrderEntity.setCode(code); |
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<ReceivingOrderEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
lambdaQueryWrapper.eq(ReceivingOrderEntity::getCode,code); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<ReceivingOrderEntity> receivingOrderEntities = receivingOrderMapper.selectList(lambdaQueryWrapper); |
|
|
|
|
if(ObjectUtils.isNotNull(receivingOrderEntities)){ |
|
|
|
|
log.info(">>>>>>>>>>>>>>>>>>>>>>> 收货单已存在 {} ",code); |
|
|
|
|
return ; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String type = valueObject.getString("Type"); |
|
|
|
|
if ("中转".equals(type)) { |
|
|
|
|
receivingOrderEntity.setType(1); |
|
|
|
@ -796,6 +821,12 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
factoryOrderEntity.setReceiptStatus(0); |
|
|
|
|
factoryOrderEntity.setPushStatus(0); |
|
|
|
|
factoryOrderEntity.setTurnStatus(0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean save = factoryOrderService.save(factoryOrderEntity); |
|
|
|
|
if (!save) { |
|
|
|
|
log.warn("############handleData: 保存订单失败 selfCode={}", selfCode); |
|
|
|
@ -807,7 +838,10 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
|
|
|
|
|
String packageCode = packageEntity.getString("Code"); |
|
|
|
|
QueryWrapper<FactoryPackageEntity> packageEntityQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
packageEntityQueryWrapper.eq("code", packageCode); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FactoryPackageEntity factoryPackageEntity = factoryPackageService.getOne(packageEntityQueryWrapper); |
|
|
|
|
|
|
|
|
|
if (Objects.isNull(factoryPackageEntity)) { |
|
|
|
|
factoryPackageEntity = new FactoryPackageEntity(); |
|
|
|
|
factoryPackageEntity.setOrderId(orderId); |
|
|
|
|