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/IDistributionReservationService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java index 01da232f5..1b220436d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java @@ -253,7 +253,6 @@ public interface IDistributionReservationService extends BaseService{ 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/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index d19d685b3..cda6b9753 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -963,7 +963,7 @@ public class DistributionDeliveryListServiceImpl 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 p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); - signStatus = distributionParcelListEntities.stream().allMatch(p->p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())); +// signStatus = distributionParcelListEntities.stream().allMatch(p->p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())); stockUpStatus = distributionParcelListEntities.stream().allMatch(p->p.getOrderPackageStockupStatus().equals(OrderPackageStockupStatusConstant.yibeihu.getValue())); } if (Func.isNotEmpty(disStockListDetailEntities)){ loadStatus = disStockListDetailEntities.stream().allMatch(p -> p.getStockLockingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); - signStatus = disStockListDetailEntities.stream().anyMatch(p->p.getStockSignfoStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())); +// signStatus = disStockListDetailEntities.stream().anyMatch(p->p.getStockSignfoStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())); stockUpStatus = disStockListDetailEntities.stream().allMatch(p->p.getStockStatus().equals(OrderPackageStockupStatusConstant.yibeihu.getValue())); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java index 0dbf2e974..680a95cf9 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java @@ -3152,20 +3152,20 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl 1){ log.error("##############异常签收包件在其他车次进行装车reservationId:{}", loadscanEntityList.stream().map(DistributionLoadscanEntity::getReservationId).map(String::valueOf).collect(Collectors.joining(","))); - return Resp.scanFail("操作失败", "包件已出库"); + return Resp.scanFail("操作失败", "该包件已在其它车次进行装车"); } } if (Func.isNotEmpty(loadscanEntity)) { - if (loadscanEntity.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())) { - return Resp.scanFail("重复操作!!", "重复操作"); + if (LoadScanSigningStatusConstant.yiqianshou.getValue().equals(loadscanEntity.getSignforState())) { + return Resp.scanFail("重复操作!!", "重复扫码"); } } String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getNickName()+"扫描异常签收,装车方式:补录装车,配送车次号:"+distributionDeliveryListEntity.getTrainNumber()+"预约任务号:"+reservationEntity.getReservationCode(); @@ -3179,6 +3179,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl waybillNos = addList.stream().map(TrunklineCarsOrderDTO::getWaybillNo).collect(Collectors.toList()); + + if(waybillNos.isEmpty()){ + log.warn("##########saveNew: 运单有变动,请重新做计划"); + throw new CustomerException(400, "运单有变动,请重新做计划"); + } + + List freezeOrAbolishWaybillList = warehouseWaybillClient.findFreezeOrAbolishByWaybillNos(waybillNos); if (!CollUtil.isEmpty(freezeOrAbolishWaybillList)) { log.warn("##########saveNew: 运单有变动,请重新做计划"); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillPackageServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillPackageServiceImpl.java index dbf47014e..4986d4508 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillPackageServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillPackageServiceImpl.java @@ -168,7 +168,12 @@ public class TrunklineWaybillPackageServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); queryWrapper.eq("order_package_code",orderPackageCode) .eq("is_deleted",0); - TrunklineWaybillPackageEntity waybillPackageEntity = baseMapper.selectOne(queryWrapper); + List trunklineWaybillPackageEntities = baseMapper.selectList(queryWrapper); + if(trunklineWaybillPackageEntities.isEmpty()){ + continue; + } + TrunklineWaybillPackageEntity waybillPackageEntity = trunklineWaybillPackageEntities.get(0); + if(Objects.isNull(waybillPackageEntity)){ continue; }