Showing
1 changed file
with
3 additions
and
43 deletions
| ... | ... | @@ -236,18 +236,6 @@ public class ShipmentsPlanDetailServiceImpl extends BaseMpServiceImpl<ShipmentsP |
| 236 | 236 | orderInfoMap = orderInfoList.stream().collect(Collectors.toMap(PurchaseOrderInfo::getId, Function.identity())); |
| 237 | 237 | } |
| 238 | 238 | } |
| 239 | - | |
| 240 | - // 获取补货单数据 | |
| 241 | - List<ReplenishmentOrderLine> replenishmentOrderLineList = replenishmentOrderLineService.listByShipmentDate(dateList); | |
| 242 | - Map<String, ReplenishmentOrder> replenishmentOrderMap = new HashMap<>(); | |
| 243 | - if (CollectionUtils.isNotEmpty(replenishmentOrderLineList)) { | |
| 244 | - List<String> replenishmentOrderIdList = replenishmentOrderLineList.stream().map(ReplenishmentOrderLine::getReplenishmentOrderId).collect(Collectors.toList()); | |
| 245 | - List<ReplenishmentOrder> replenishmentOrderList = replenishmentOrderService.listByIds(replenishmentOrderIdList); | |
| 246 | - if (CollectionUtils.isNotEmpty(replenishmentOrderList)) { | |
| 247 | - replenishmentOrderMap = replenishmentOrderList.stream().collect(Collectors.toMap(ReplenishmentOrder::getId, Function.identity())); | |
| 248 | - } | |
| 249 | - } | |
| 250 | - | |
| 251 | 239 | for (Workshop workshop : workshopList) { |
| 252 | 240 | // 生成发货计划 |
| 253 | 241 | ShipmentsPlan plan = new ShipmentsPlan(); |
| ... | ... | @@ -259,8 +247,8 @@ public class ShipmentsPlanDetailServiceImpl extends BaseMpServiceImpl<ShipmentsP |
| 259 | 247 | |
| 260 | 248 | shipmentsPlanService.getBaseMapper().insert(plan); |
| 261 | 249 | // 生成发货计划明细 |
| 262 | - List<ShipmentsPlanDetail> planDetails = new ArrayList<>(); | |
| 263 | 250 | if (CollectionUtils.isNotEmpty(orderLineList)) { |
| 251 | + List<ShipmentsPlanDetail> planDetails = new ArrayList<>(); | |
| 264 | 252 | for (PurchaseOrderLine line : orderLineList) { |
| 265 | 253 | ShipmentsPlanDetail detail = new ShipmentsPlanDetail(); |
| 266 | 254 | detail.setId(IdUtil.getId()); |
| ... | ... | @@ -284,38 +272,10 @@ public class ShipmentsPlanDetailServiceImpl extends BaseMpServiceImpl<ShipmentsP |
| 284 | 272 | |
| 285 | 273 | planDetails.add(detail); |
| 286 | 274 | } |
| 287 | - } | |
| 288 | - // 补货单生成发货单明细 | |
| 289 | - if (CollectionUtils.isNotEmpty(replenishmentOrderLineList)) { | |
| 290 | - for (ReplenishmentOrderLine replenishmentOrderLine : replenishmentOrderLineList) { | |
| 291 | - ReplenishmentOrder replenishmentOrder = replenishmentOrderMap.get(replenishmentOrderLine.getReplenishmentOrderId()); | |
| 292 | - if (replenishmentOrder == null) { | |
| 293 | - continue; | |
| 294 | - } | |
| 295 | - | |
| 296 | - if (!workshop.getId().equals(replenishmentOrder.getWorkshopId())) { | |
| 297 | - continue; | |
| 298 | - } | |
| 299 | - | |
| 300 | - ShipmentsPlanDetail detail = new ShipmentsPlanDetail(); | |
| 301 | - detail.setId(IdUtil.getId()); | |
| 302 | - detail.setPlanId(plan.getId()); | |
| 303 | - detail.setOrderId(replenishmentOrder.getId()); | |
| 304 | - detail.setOrderSpecId(replenishmentOrderLine.getId()); | |
| 305 | - detail.setShipmentsDate(replenishmentOrderLine.getConfirmedDeliveryDate()); | |
| 306 | - detail.setPreShipments(afTomorrow.equals(replenishmentOrderLine.getConfirmedDeliveryDate())); | |
| 307 | - detail.setDelFlag(Boolean.FALSE); | |
| 308 | - | |
| 309 | - detail.setCreateById("1"); | |
| 310 | - detail.setUpdateById("1"); | |
| 311 | - | |
| 312 | - planDetails.add(detail); | |
| 275 | + if (CollectionUtils.isNotEmpty(planDetails)) { | |
| 276 | + getBaseMapper().batchAdd(planDetails); | |
| 313 | 277 | } |
| 314 | 278 | } |
| 315 | - | |
| 316 | - if (CollectionUtils.isNotEmpty(planDetails)) { | |
| 317 | - getBaseMapper().batchAdd(planDetails); | |
| 318 | - } | |
| 319 | 279 | } |
| 320 | 280 | } |
| 321 | 281 | ... | ... |