|
|
|
@ -1327,11 +1327,12 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
|
|
|
|
|
*/ |
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
public boolean getOrder(List<DistributionStockArticleEntity> orderList, Long id) { |
|
|
|
|
//收集需要进行订单维护的数据
|
|
|
|
|
//查询已有的数据
|
|
|
|
|
List<DistrilbutionBillStockEntity> list = distrilbutionBillStockService.list(Wrappers.<DistrilbutionBillStockEntity>query().lambda() |
|
|
|
|
.eq(DistrilbutionBillStockEntity::getBillLadingId, id) |
|
|
|
|
.apply("order_status in ( 1,2)") |
|
|
|
|
.or(wp -> wp.eq(DistrilbutionBillStockEntity::getBillLadingId, id).apply("order_status in ( 1,2)")) |
|
|
|
|
.apply("order_status in ( 1,3)") |
|
|
|
|
.or(wp -> wp.eq(DistrilbutionBillStockEntity::getBillLadingId, id).apply("order_status in ( 1,3)")) |
|
|
|
|
); |
|
|
|
|
List<DistrilbutionBillStockEntity> deList = new ArrayList<>(); |
|
|
|
|
list.forEach(i -> { |
|
|
|
@ -1356,7 +1357,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
List<String> sStock = new ArrayList<>(); //取消
|
|
|
|
|
|
|
|
|
|
List<Long> cancelOrderIds = new ArrayList<>(); |
|
|
|
|
//删除提货订单状态
|
|
|
|
|
deList.forEach(i -> { |
|
|
|
|
//查询数据是否已备货
|
|
|
|
@ -1370,6 +1371,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
|
|
|
|
|
stockArticleEntity.setStockupStatus(StockupStatusConstant.weibeihuo.getValue()); |
|
|
|
|
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue()); |
|
|
|
|
distributionStockArticleService.updateById(stockArticleEntity); |
|
|
|
|
cancelOrderIds.add(i.getStockArticleId()); |
|
|
|
|
} |
|
|
|
|
i.setOrderStatus("3"); |
|
|
|
|
distrilbutionBillStockService.updateById(i); |
|
|
|
@ -1449,6 +1451,23 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
|
|
|
|
|
billLading.setConsignee("4"); |
|
|
|
|
baseMapper.updateById(billLading); |
|
|
|
|
} |
|
|
|
|
if (!cancelOrderIds.isEmpty()){ |
|
|
|
|
List<DistributionStockArticleEntity> distributionStockArticleEntities = distributionStockArticleService.listByIds(cancelOrderIds); |
|
|
|
|
if (Func.isEmpty(distributionStockArticleEntities)){ |
|
|
|
|
log.info("#####################查询订单失败,orderIds:{}",cancelOrderIds); |
|
|
|
|
} |
|
|
|
|
String orderCodes = distributionStockArticleEntities.stream().map(DistributionStockArticleEntity::getOrderCode).collect(Collectors.joining(",")); |
|
|
|
|
List<Long> collect = distributionStockArticleEntities.stream().map(DistributionStockArticleEntity::getWarehouseId).distinct().collect(Collectors.toList()); |
|
|
|
|
if (collect.isEmpty()){ |
|
|
|
|
log.info("#####################订单列表warehouseId字段缺失,orderIds:{}",cancelOrderIds); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
if (collect.size()>1){ |
|
|
|
|
log.info("#####################自提操作多个仓库订单,orderIds:{}",cancelOrderIds); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(orderCodes,collect.get(0)); |
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|