Browse Source

商配订单限制增加

dist.1.3.0
汤建军 8 months ago
parent
commit
065044f6fd
  1. 18
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreContactServiceImpl.java
  2. 12
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

18
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 org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* 基础门店联系人表 服务实现类 * 基础门店联系人表 服务实现类
@ -61,14 +62,15 @@ public class BasicdataStoreContactServiceImpl extends BaseServiceImpl<BasicdataS
List<BasicdataStoreContactEntity> storeContactEntities = baseMapper.selectList(Wrappers.<BasicdataStoreContactEntity>query().lambda() List<BasicdataStoreContactEntity> storeContactEntities = baseMapper.selectList(Wrappers.<BasicdataStoreContactEntity>query().lambda()
.eq(BasicdataStoreContactEntity::getShopId, basicdataStoreContact.getShopId()) .eq(BasicdataStoreContactEntity::getShopId, basicdataStoreContact.getShopId())
); );
storeContactEntities.forEach( i ->{ List<Long> ids = storeContactEntities.stream().filter(f -> !f.getId().equals(basicdataStoreContact.getId())).map(BasicdataStoreContactEntity::getId).collect(Collectors.toList());
if(i.getShopId().equals(basicdataStoreContact.getShopId())){ if (!ids.isEmpty()) {
this.updateById(basicdataStoreContact); this.update(Wrappers.<BasicdataStoreContactEntity>update().lambda()
}else{ .in(BasicdataStoreContactEntity::getId,ids)
i.setDefaultType(false); .set(BasicdataStoreContactEntity::getDefaultType,false)
this.updateById(i); );
} }
}); this.updateById(basicdataStoreContact);
return true; return true;
}catch (Exception e){ }catch (Exception e){
log.info("报错信息:{}",e.getMessage()); log.info("报错信息:{}",e.getMessage());

12
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -3214,13 +3214,13 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (Func.isEmpty(oldOrder.get(s.getId()))) { if (Func.isEmpty(oldOrder.get(s.getId()))) {
DistributionReservationStockarticleEntity reservationStockarticleEntity = new DistributionReservationStockarticleEntity(); DistributionReservationStockarticleEntity reservationStockarticleEntity = new DistributionReservationStockarticleEntity();
if (s.getIsZero().equals(IsOrNoConstant.no.getValue())) { if (s.getIsZero().equals(IsOrNoConstant.no.getValue())) {
if (Func.isNotEmpty(reservationEntity) && reservationEntity.getSigningStatus().equals(ReservationSigningStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "司机完成签收,无法追加订单");
}
//新增订单 //新增订单
List<DistributionParcelListDTO> packageListInfo = s.getPackageListInfo(); List<DistributionParcelListDTO> packageListInfo = s.getPackageListInfo();
if (Func.isNotEmpty(packageListInfo)) { 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 -> { packageListInfo.forEach(p -> {
orderPackageNum.getAndAdd(p.getQuantity()); orderPackageNum.getAndAdd(p.getQuantity());
DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity(); DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity();
@ -3239,6 +3239,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
logs.add(js); logs.add(js);
}); });
} else { } else {
if (Func.isNotEmpty(reservationEntity) && reservationEntity.getSigningStatus().equals(ReservationSigningStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "司机完成签收,无法追加订单");
}
//查询该订单下的所有包件信息并插入该计划中 //查询该订单下的所有包件信息并插入该计划中
//添加该订单下可操作包件至计划中 //添加该订单下可操作包件至计划中
//没有进行包件选择 默认添加可配送的所有包件 //没有进行包件选择 默认添加可配送的所有包件

Loading…
Cancel
Save