Showing
1 changed file
with
23 additions
and
21 deletions
| ... | ... | @@ -391,30 +391,32 @@ public class OrderChangeRecordServiceImpl extends BaseMpServiceImpl<OrderChangeR |
| 391 | 391 | vo.setOrderNoPrecise(record.getOrderNo()); |
| 392 | 392 | vo.setType("PRODUCTION"); |
| 393 | 393 | List<OrderDetailReport> query = orderDetailReportService.query(vo); |
| 394 | - OrderDetailReport orderDetailReport = query.get(0); | |
| 395 | - //先全部冲红 | |
| 396 | - QueryPurchaseOrderLineVo vo1 = new QueryPurchaseOrderLineVo(); | |
| 397 | - vo1.setPurchaseOrderId(record.getOrderId()); | |
| 398 | - List<PurchaseOrderLine> purchaseOrderLineList = purchaseOrderLineService.query(vo1); | |
| 399 | - PurchaseOrderInfo purchaseOrderInfo = purchaseOrderInfoService.findById(record.getOrderId()); | |
| 400 | - ContractDistributorStandard standard = contractDistributorStandardService.findById(purchaseOrderInfo.getContractId()); | |
| 401 | - if (CollectionUtils.isNotEmpty(purchaseOrderLineList)) { | |
| 402 | - for (PurchaseOrderLine line : purchaseOrderLineList) { | |
| 403 | - createOrderDetailReport(line, orderDetailReport, purchaseOrderInfo, standard,"offset" | |
| 404 | - , purchaseOrderInfo.getContractCreateById()); | |
| 394 | + if (CollectionUtils.isNotEmpty(query)) { | |
| 395 | + OrderDetailReport orderDetailReport = query.get(0); | |
| 396 | + //先全部冲红 | |
| 397 | + QueryPurchaseOrderLineVo vo1 = new QueryPurchaseOrderLineVo(); | |
| 398 | + vo1.setPurchaseOrderId(record.getOrderId()); | |
| 399 | + List<PurchaseOrderLine> purchaseOrderLineList = purchaseOrderLineService.query(vo1); | |
| 400 | + PurchaseOrderInfo purchaseOrderInfo = purchaseOrderInfoService.findById(record.getOrderId()); | |
| 401 | + ContractDistributorStandard standard = contractDistributorStandardService.findById(purchaseOrderInfo.getContractId()); | |
| 402 | + if (CollectionUtils.isNotEmpty(purchaseOrderLineList)) { | |
| 403 | + for (PurchaseOrderLine line : purchaseOrderLineList) { | |
| 404 | + createOrderDetailReport(line, orderDetailReport, purchaseOrderInfo, standard, "offset" | |
| 405 | + , purchaseOrderInfo.getContractCreateById()); | |
| 406 | + } | |
| 405 | 407 | } |
| 406 | - } | |
| 407 | - List<PurchaseOrderLine> afterChangeSpecList = record.getAfterChangeSpecList(); | |
| 408 | - if (CollectionUtils.isNotEmpty(afterChangeSpecList)) { | |
| 409 | - orderInfo.setStockUpCompanyName(purchaseOrderInfo.getStockUpCompanyName()); | |
| 410 | - for (PurchaseOrderLine line : afterChangeSpecList) { | |
| 411 | - createOrderDetailReport(line, orderDetailReport, orderInfo, standard, null | |
| 412 | - , purchaseOrderInfo.getContractCreateById()); | |
| 408 | + List<PurchaseOrderLine> afterChangeSpecList = record.getAfterChangeSpecList(); | |
| 409 | + if (CollectionUtils.isNotEmpty(afterChangeSpecList)) { | |
| 410 | + orderInfo.setStockUpCompanyName(purchaseOrderInfo.getStockUpCompanyName()); | |
| 411 | + for (PurchaseOrderLine line : afterChangeSpecList) { | |
| 412 | + createOrderDetailReport(line, orderDetailReport, orderInfo, standard, null | |
| 413 | + , purchaseOrderInfo.getContractCreateById()); | |
| 414 | + } | |
| 413 | 415 | } |
| 416 | + purchaseOrderInfoService.update(orderInfo); | |
| 417 | + // 更新订货单物料行数据 | |
| 418 | + purchaseOrderLineService.update(record.getOrderId(), record.getAfterChangeSpecList()); | |
| 414 | 419 | } |
| 415 | - purchaseOrderInfoService.update(orderInfo); | |
| 416 | - // 更新订货单物料行数据 | |
| 417 | - purchaseOrderLineService.update(record.getOrderId(), record.getAfterChangeSpecList()); | |
| 418 | 420 | } |
| 419 | 421 | |
| 420 | 422 | @Override | ... | ... |