Commit 0ee93a924973be4672ce4928eb8a9927d8e9678d
Merge remote-tracking branch 'origin/master_cj_zq' into master_cj_zq
Showing
2 changed files
with
64 additions
and
2 deletions
| @@ -360,6 +360,67 @@ public class ScSelectorController extends DefaultBaseController { | @@ -360,6 +360,67 @@ public class ScSelectorController extends DefaultBaseController { | ||
| 360 | return InvokeResultBuilder.success(result); | 360 | return InvokeResultBuilder.success(result); |
| 361 | } | 361 | } |
| 362 | 362 | ||
| 363 | + /** | ||
| 364 | + * 根据ID加载订货单数据(补货单专用) | ||
| 365 | + */ | ||
| 366 | + @ApiOperation("根据ID加载订货单数据") | ||
| 367 | + @PostMapping("/replenishment/order/load") | ||
| 368 | + public InvokeResult<List<GetPurchaseOrderInfoBo>> loadReplenishmentOrderInfo(@RequestBody(required = false) List<String> ids) { | ||
| 369 | + if (CollectionUtil.isEmpty(ids)) { | ||
| 370 | + return InvokeResultBuilder.success(CollectionUtil.emptyList()); | ||
| 371 | + } | ||
| 372 | + List<PurchaseOrderInfo> orderInfoList = orderInfoService.findById(ids); | ||
| 373 | + if (CollectionUtils.isEmpty(orderInfoList)) { | ||
| 374 | + return new InvokeResult<>(); | ||
| 375 | + } | ||
| 376 | + List<GetPurchaseOrderInfoBo> result = new ArrayList<>(); | ||
| 377 | + List<String> orderIds = new ArrayList<>(); | ||
| 378 | + for (PurchaseOrderInfo orderInfo : orderInfoList) { | ||
| 379 | + GetPurchaseOrderInfoBo orderInfoBo = new GetPurchaseOrderInfoBo(orderInfo); | ||
| 380 | + result.add(orderInfoBo); | ||
| 381 | + | ||
| 382 | + orderIds.add(orderInfo.getId()); | ||
| 383 | + } | ||
| 384 | + // 获取物料行数据 | ||
| 385 | + List<PurchaseOrderLine> orderLineList = orderLineService.listByOrderIds(orderIds, true); | ||
| 386 | + if (CollectionUtils.isEmpty(orderLineList)) { | ||
| 387 | + return InvokeResultBuilder.success(result); | ||
| 388 | + } | ||
| 389 | + List<String> orderSpecIds = new ArrayList<>(); | ||
| 390 | + Map<String, List<PurchaseOrderLine>> orderLineMap = new HashMap<>(); | ||
| 391 | + for (PurchaseOrderLine orderLine : orderLineList) { | ||
| 392 | + String orderId = orderLine.getPurchaseOrderId(); | ||
| 393 | + List<PurchaseOrderLine> list = orderLineMap.computeIfAbsent(orderId, k -> new ArrayList<>()); | ||
| 394 | + list.add(orderLine); | ||
| 395 | + | ||
| 396 | + orderSpecIds.add(orderLine.getId()); | ||
| 397 | + } | ||
| 398 | + // 获取发货明细数据 | ||
| 399 | + Map<String, ShipmentsPlanDetail> shipmentsDetailMap = new HashMap<>(); | ||
| 400 | + List<ShipmentsPlanDetail> shipmentsDetails = shipmentsPlanDetailService.listBySpecIds(orderSpecIds); | ||
| 401 | + if (CollectionUtils.isNotEmpty(shipmentsDetails)) { | ||
| 402 | + shipmentsDetailMap = shipmentsDetails.stream().collect(Collectors.toMap(ShipmentsPlanDetail::getOrderSpecId | ||
| 403 | + , Function.identity(), (v1, v2) -> v1)); | ||
| 404 | + } | ||
| 405 | + for (GetPurchaseOrderInfoBo orderInfoBo : result) { | ||
| 406 | + String orderId = orderInfoBo.getId(); | ||
| 407 | + List<PurchaseOrderLine> lineList = orderLineMap.get(orderId); | ||
| 408 | + //生产人员不展示价格 | ||
| 409 | + processPrice(lineList); | ||
| 410 | + // 实发数 | ||
| 411 | + if (CollectionUtils.isNotEmpty(lineList)) { | ||
| 412 | + for (PurchaseOrderLine orderLine : lineList) { | ||
| 413 | + ShipmentsPlanDetail detail = shipmentsDetailMap.get(orderLine.getId()); | ||
| 414 | + if (detail != null) { | ||
| 415 | + orderLine.setActualShipmentQuantity(detail.getActualShipmentQuantity()); | ||
| 416 | + } | ||
| 417 | + } | ||
| 418 | + } | ||
| 419 | + orderInfoBo.setPurchaseOrderLineList(lineList); | ||
| 420 | + } | ||
| 421 | + return InvokeResultBuilder.success(result); | ||
| 422 | + } | ||
| 423 | + | ||
| 363 | //生产人员不展示价格,根据部门判断(生产管理科、精轧一车间、精轧车间、品质管理科),需要生产的控制价格 | 424 | //生产人员不展示价格,根据部门判断(生产管理科、精轧一车间、精轧车间、品质管理科),需要生产的控制价格 |
| 364 | public void processPrice(List<PurchaseOrderLine> purchaseOrderLineList) { | 425 | public void processPrice(List<PurchaseOrderLine> purchaseOrderLineList) { |
| 365 | if (CollectionUtils.isEmpty(purchaseOrderLineList)) { | 426 | if (CollectionUtils.isEmpty(purchaseOrderLineList)) { |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/controller/ledger/FundCoordinationController.java
| @@ -290,10 +290,11 @@ public class FundCoordinationController extends DefaultBaseController { | @@ -290,10 +290,11 @@ public class FundCoordinationController extends DefaultBaseController { | ||
| 290 | bo1.setTimeout(String.valueOf(daysBetween)); | 290 | bo1.setTimeout(String.valueOf(daysBetween)); |
| 291 | } | 291 | } |
| 292 | //协调办理日期 | 292 | //协调办理日期 |
| 293 | - if (receipt.getCoordinateDate() != null) { | 293 | + if (receipt.getCoordinateDate() != null && !receipt.getCoordinateDate().isBefore(LocalDate.now())) { |
| 294 | bo1.setCoordinateHandleDate(receipt.getCoordinateDate()); | 294 | bo1.setCoordinateHandleDate(receipt.getCoordinateDate()); |
| 295 | } | 295 | } |
| 296 | - if (receipt.getCoordinateDate() != null && bo1.getDueDate() != null) { | 296 | + if (receipt.getCoordinateDate() != null && !receipt.getCoordinateDate().isBefore(LocalDate.now()) |
| 297 | + && bo1.getDueDate() != null) { | ||
| 297 | //实际超时(协调办理日期-应办理日期) | 298 | //实际超时(协调办理日期-应办理日期) |
| 298 | long daysBetween = ChronoUnit.DAYS.between(bo1.getDueDate(), receipt.getCoordinateDate()); | 299 | long daysBetween = ChronoUnit.DAYS.between(bo1.getDueDate(), receipt.getCoordinateDate()); |
| 299 | bo1.setActualTimeout(String.valueOf(daysBetween)); | 300 | bo1.setActualTimeout(String.valueOf(daysBetween)); |