Browse Source

商配订单限制增加

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

16
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<BasicdataS
List<BasicdataStoreContactEntity> storeContactEntities = baseMapper.selectList(Wrappers.<BasicdataStoreContactEntity>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<Long> ids = storeContactEntities.stream().filter(f -> !f.getId().equals(basicdataStoreContact.getId())).map(BasicdataStoreContactEntity::getId).collect(Collectors.toList());
if (!ids.isEmpty()) {
this.update(Wrappers.<BasicdataStoreContactEntity>update().lambda()
.in(BasicdataStoreContactEntity::getId,ids)
.set(BasicdataStoreContactEntity::getDefaultType,false)
);
}
});
this.updateById(basicdataStoreContact);
return true;
}catch (Exception e){
log.info("报错信息:{}",e.getMessage());

10
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()))) {
DistributionReservationStockarticleEntity reservationStockarticleEntity = new DistributionReservationStockarticleEntity();
if (s.getIsZero().equals(IsOrNoConstant.no.getValue())) {
//新增订单
List<DistributionParcelListDTO> 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() + "司机完成签收,无法追加订单");
}
//新增订单
List<DistributionParcelListDTO> packageListInfo = s.getPackageListInfo();
if (Func.isNotEmpty(packageListInfo)) {
packageListInfo.forEach(p -> {
orderPackageNum.getAndAdd(p.getQuantity());
DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity();
@ -3239,6 +3239,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
logs.add(js);
});
} 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