From 065044f6fdb730c9edbc30e0243a0f5fe4e89846 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Wed, 5 Jun 2024 12:18:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E9=85=8D=E8=AE=A2=E5=8D=95=E9=99=90?= =?UTF-8?q?=E5=88=B6=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/BasicdataStoreContactServiceImpl.java | 18 ++++++++++-------- .../DistributionDeliveryListServiceImpl.java | 12 ++++++++---- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreContactServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreContactServiceImpl.java index 197affb4d..f7bc5cfc9 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreContactServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreContactServiceImpl.java @@ -29,6 +29,7 @@ import org.springblade.core.mp.base.BaseServiceImpl; import org.springframework.stereotype.Service; import java.util.List; +import java.util.stream.Collectors; /** * 基础门店联系人表 服务实现类 @@ -61,14 +62,15 @@ public class BasicdataStoreContactServiceImpl extends BaseServiceImpl storeContactEntities = baseMapper.selectList(Wrappers.query().lambda() .eq(BasicdataStoreContactEntity::getShopId, basicdataStoreContact.getShopId()) ); - storeContactEntities.forEach( i ->{ - if(i.getShopId().equals(basicdataStoreContact.getShopId())){ - this.updateById(basicdataStoreContact); - }else{ - i.setDefaultType(false); - this.updateById(i); - } - }); + List ids = storeContactEntities.stream().filter(f -> !f.getId().equals(basicdataStoreContact.getId())).map(BasicdataStoreContactEntity::getId).collect(Collectors.toList()); + if (!ids.isEmpty()) { + this.update(Wrappers.update().lambda() + .in(BasicdataStoreContactEntity::getId,ids) + .set(BasicdataStoreContactEntity::getDefaultType,false) + ); + } + this.updateById(basicdataStoreContact); + return true; }catch (Exception e){ log.info("报错信息:{}",e.getMessage()); 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 d25e00d97..2041cc106 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 @@ -3214,13 +3214,13 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl packageListInfo = s.getPackageListInfo(); if (Func.isNotEmpty(packageListInfo)) { + if (Func.isNotEmpty(reservationEntity) && reservationEntity.getSigningStatus().equals(ReservationSigningStatusConstant.yiqianshou.getValue())) { + log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId()); + throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "司机完成签收,无法追加订单"); + } packageListInfo.forEach(p -> { orderPackageNum.getAndAdd(p.getQuantity()); DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity(); @@ -3239,6 +3239,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl