From 2a64d07105534c37c7f4fd852763b95001a6dfb2 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Thu, 30 May 2024 18:29:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=82=E9=85=8D=E8=AE=A1=E5=88=92=E3=80=81?= =?UTF-8?q?=E5=B8=82=E9=85=8D=E5=8F=96=E6=B6=88=E6=97=A5=E5=BF=97=E6=8E=A8?= =?UTF-8?q?=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../distribution/config/RedissonConfig.java | 72 ++++---- .../impl/DistributionAsyncServiceImpl.java | 2 +- .../DistributionReservationServiceImpl.java | 164 ++++++++---------- 3 files changed, 113 insertions(+), 125 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/RedissonConfig.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/RedissonConfig.java index 197c8e04d..394536540 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/RedissonConfig.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/RedissonConfig.java @@ -1,36 +1,36 @@ -//package com.logpm.distribution.config; -// -//import org.redisson.Redisson; -//import org.redisson.config.Config; -//import org.springblade.core.redis.cache.BladeRedis; -//import org.springblade.core.tool.utils.SpringUtil; -//import org.springframework.context.annotation.Bean; -//import org.springframework.context.annotation.Configuration; -//import org.springframework.data.redis.connection.RedisConnectionFactory; -//import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; -//import org.springframework.stereotype.Component; -// -//@Configuration -//public class RedissonConfig { -// -// @Bean -// public Redisson redisson() { -// // 单机模式 -// Config config = new Config(); -// -// BladeRedis bean = SpringUtil.getBean(BladeRedis.class); -// -// RedisConnectionFactory connectionFactory = bean.getRedisTemplate().getConnectionFactory(); -// -// LettuceConnectionFactory factory = (LettuceConnectionFactory) connectionFactory; -// -// String hostName = factory.getHostName(); -// int port = factory.getPort(); -// String password = factory.getPassword(); -// -// config.useSingleServer().setAddress("redis://"+hostName+":"+port).setDatabase(1); -// config.useSingleServer().setPassword(password); -// return (Redisson) Redisson.create(config); -// } -// -//} +package com.logpm.distribution.config; + +import org.redisson.Redisson; +import org.redisson.config.Config; +import org.springblade.core.redis.cache.BladeRedis; +import org.springblade.core.tool.utils.SpringUtil; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; +import org.springframework.stereotype.Component; + +@Configuration +public class RedissonConfig { + + @Bean + public Redisson redisson() { + // 单机模式 + Config config = new Config(); + + BladeRedis bean = SpringUtil.getBean(BladeRedis.class); + + RedisConnectionFactory connectionFactory = bean.getRedisTemplate().getConnectionFactory(); + + LettuceConnectionFactory factory = (LettuceConnectionFactory) connectionFactory; + + String hostName = factory.getHostName(); + int port = factory.getPort(); + String password = factory.getPassword(); + + config.useSingleServer().setAddress("redis://"+hostName+":"+port).setDatabase(1); + config.useSingleServer().setPassword(password); + return (Redisson) Redisson.create(config); + } + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java index e60feac43..2280ed7dd 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java @@ -2986,7 +2986,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { distributionReservationPackageEntities.forEach(rp->{ String content = "包件在"+warehouse.getName()+"由"+ AuthUtil.getUser().getNickName()+"转车次任务,操作方式:批量预约任务转配送,车次号:"+trainNumber; JSONObject trunklinePackageTrackLog= new JSONObject(); - trunklinePackageTrackLog.put("tenantId",rp.getTenantId()); + trunklinePackageTrackLog.put("tenantId",AuthUtil.getTenantId()); trunklinePackageTrackLog.put("createTime",new Date()); trunklinePackageTrackLog.put("createUser",user.getUserId()); trunklinePackageTrackLog.put("updateUser",user.getUserId()); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java index 201cd430d..a783b4f27 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java @@ -1375,7 +1375,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl packageVOList = distributionReservationPackageMapper.selectPackageVOList(reservationEntity.getId(), s.getId()); s.setPackageList(DistributionParcelListWrapper.build().listVO(packageVOList)); + s.setReservationNum(pageVOList.size()); } else { List parcelNumberVOS = baseMapper.selectReservationZeroOrderDetail(s.getId(), Long.parseLong(reservationId)); s.setParcelNumberVOS(parcelNumberVOS); @@ -1445,10 +1446,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl mallId = new ArrayList<>(); HashSet storeName = new HashSet<>(); HashSet receivingUnit = new HashSet<>(); - List addOrderPackageCodes = new ArrayList<>(); - List cancelOrderPackageCodes = new ArrayList<>(); - List addPackageLog = new ArrayList<>(); - List cancelPackageLog = new ArrayList<>(); + List aaa = new ArrayList<>(); newStockArticle.forEach((k, v) -> { List packageLockIds = new ArrayList<>(); if (Func.isEmpty(oldStockArticle.get(k))) { @@ -1475,22 +1473,21 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl ids = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + parcelListEntity.getOrderCode()); @@ -1708,7 +1712,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl>>>>>>>>>>>>>>>>>>推送新增日志"); - trunklinePackageTrackLogClient.addPackageTrackLog(addPackageLog); - } if (Func.isNotEmpty(oldStockArticle)) { oldStockArticle.forEach((i, j) -> { //这里就是需要进行取消的订单信息 DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(i); - DistributionReservationStockarticleEntity reservationStockarticleEntity = j.get(0); if (reservationStockarticleEntity.getIsZero().equals(IsOrNoConstant.no.getValue())) { reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue()); @@ -1846,22 +1840,21 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl>>>>>>>>>>>>>>>>>>推送取消日志"); - trunklinePackageTrackLogClient.addPackageTrackLog(cancelPackageLog); + if (!aaa.isEmpty()) { + trunklinePackageTrackLogClient.addPackageTrackLog(aaa); } //库存品修改 //查询出原来的库存品信息 @@ -2614,7 +2606,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl 0) { - List orderPackageCodes = new ArrayList<>(); List aaa = new ArrayList<>(); reservationStockarticleEntityList.forEach(rs -> { rs.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue()); @@ -2638,24 +2629,21 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl