|
@@ -586,7 +586,7 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
|
|
|
// 保存数据
|
|
|
TransactionUtil.execute(() -> {
|
|
|
orderSkuService.updateBatchById(list);
|
|
|
- save(workOrder);
|
|
|
+ saveOrUpdate(workOrder);
|
|
|
workOrderDetailService.saveBatch(workOrderDetailList);
|
|
|
});
|
|
|
|
|
@@ -861,15 +861,20 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
|
|
|
workOrder.setUseRatio(fixationStrategy.getUseRatio());
|
|
|
workOrder.setMaxLength(fixationStrategy.getMaxLength());
|
|
|
|
|
|
- orderSkuService.updateBatchById(notSchedulingSku);
|
|
|
- save(workOrder);
|
|
|
- workOrderDetailService.saveBatch(workOrderDetailList);
|
|
|
+ if (!notSchedulingSku.isEmpty()) {
|
|
|
+ orderSkuService.updateBatchById(notSchedulingSku);
|
|
|
+ }
|
|
|
+ updateById(workOrder);
|
|
|
+ workOrderDetailService.saveOrUpdateBatch(workOrderDetailList);
|
|
|
}
|
|
|
// 非固定尺寸排版
|
|
|
else {
|
|
|
List<Long> orderSkuIdList = workOrderDetailList.stream().map(WorkOrderDetail::getOrderSkuId).collect(Collectors.toList());
|
|
|
- Map<Long, OrderSku> map = orderSkuService.listByIds(orderSkuIdList).stream()
|
|
|
- .collect(Collectors.toMap(BaseIdPo::getId, Function.identity(), (t1, t2) -> t1));
|
|
|
+ Map<Long, OrderSku> map = new HashMap<>();
|
|
|
+ if (!orderSkuIdList.isEmpty()) {
|
|
|
+ map = orderSkuService.listByIds(orderSkuIdList).stream()
|
|
|
+ .collect(Collectors.toMap(BaseIdPo::getId, Function.identity(), (t1, t2) -> t1));
|
|
|
+ }
|
|
|
|
|
|
for (WorkOrderDetail workOrderDetail : workOrderDetailList) {
|
|
|
OrderSku orderSku = map.get(workOrderDetail.getOrderSkuId());
|