|
...
|
...
|
@@ -24,6 +24,7 @@ import com.lframework.xingyun.sc.service.order.PurchaseOrderLineService; |
|
24
|
24
|
import com.lframework.xingyun.sc.service.paytype.OrderPayTypeService;
|
|
25
|
25
|
import com.lframework.xingyun.sc.service.purchase.PurchaseOrderService;
|
|
26
|
26
|
import com.lframework.xingyun.sc.service.purchase.ReceiveSheetService;
|
|
|
27
|
+import com.lframework.xingyun.sc.service.shipments.ShipmentsPlanDetailService;
|
|
27
|
28
|
import com.lframework.xingyun.sc.service.stock.adjust.StockAdjustReasonService;
|
|
28
|
29
|
import com.lframework.xingyun.sc.service.stock.take.PreTakeStockSheetService;
|
|
29
|
30
|
import com.lframework.xingyun.sc.service.stock.take.TakeStockPlanService;
|
|
...
|
...
|
@@ -36,6 +37,7 @@ import io.swagger.annotations.Api; |
|
36
|
37
|
import io.swagger.annotations.ApiOperation;
|
|
37
|
38
|
|
|
38
|
39
|
import java.util.*;
|
|
|
40
|
+import java.util.function.Function;
|
|
39
|
41
|
import java.util.stream.Collectors;
|
|
40
|
42
|
import javax.annotation.Resource;
|
|
41
|
43
|
import javax.validation.Valid;
|
|
...
|
...
|
@@ -87,6 +89,8 @@ public class ScSelectorController extends DefaultBaseController { |
|
87
|
89
|
private SysUserDeptService sysUserDeptService;
|
|
88
|
90
|
@Resource
|
|
89
|
91
|
private SysDeptService sysDeptService;
|
|
|
92
|
+ @Resource
|
|
|
93
|
+ private ShipmentsPlanDetailService shipmentsPlanDetailService;
|
|
90
|
94
|
|
|
91
|
95
|
|
|
92
|
96
|
/**
|
|
...
|
...
|
@@ -321,17 +325,36 @@ public class ScSelectorController extends DefaultBaseController { |
|
321
|
325
|
if (CollectionUtils.isEmpty(orderLineList)) {
|
|
322
|
326
|
return InvokeResultBuilder.success(result);
|
|
323
|
327
|
}
|
|
|
328
|
+ List<String> orderSpecIds = new ArrayList<>();
|
|
324
|
329
|
Map<String, List<PurchaseOrderLine>> orderLineMap = new HashMap<>();
|
|
325
|
330
|
for (PurchaseOrderLine orderLine : orderLineList) {
|
|
326
|
331
|
String orderId = orderLine.getPurchaseOrderId();
|
|
327
|
332
|
List<PurchaseOrderLine> list = orderLineMap.computeIfAbsent(orderId, k -> new ArrayList<>());
|
|
328
|
333
|
list.add(orderLine);
|
|
|
334
|
+
|
|
|
335
|
+ orderSpecIds.add(orderLine.getId());
|
|
|
336
|
+ }
|
|
|
337
|
+ // 获取发货明细数据
|
|
|
338
|
+ Map<String, ShipmentsPlanDetail> shipmentsDetailMap = new HashMap<>();
|
|
|
339
|
+ List<ShipmentsPlanDetail> shipmentsDetails = shipmentsPlanDetailService.listBySpecIds(orderSpecIds);
|
|
|
340
|
+ if (CollectionUtils.isNotEmpty(shipmentsDetails)) {
|
|
|
341
|
+ shipmentsDetailMap = shipmentsDetails.stream().collect(Collectors.toMap(ShipmentsPlanDetail::getOrderSpecId
|
|
|
342
|
+ , Function.identity(), (v1, v2) -> v1));
|
|
329
|
343
|
}
|
|
330
|
344
|
for (GetPurchaseOrderInfoBo orderInfoBo : result) {
|
|
331
|
345
|
String orderId = orderInfoBo.getId();
|
|
332
|
346
|
List<PurchaseOrderLine> lineList = orderLineMap.get(orderId);
|
|
333
|
347
|
//生产人员不展示价格
|
|
334
|
348
|
processPrice(lineList);
|
|
|
349
|
+ // 实发数
|
|
|
350
|
+ if (CollectionUtils.isNotEmpty(lineList)) {
|
|
|
351
|
+ for (PurchaseOrderLine orderLine : lineList) {
|
|
|
352
|
+ ShipmentsPlanDetail detail = shipmentsDetailMap.get(orderLine.getId());
|
|
|
353
|
+ if (detail != null) {
|
|
|
354
|
+ orderLine.setActualShipmentQuantity(detail.getActualShipmentQuantity());
|
|
|
355
|
+ }
|
|
|
356
|
+ }
|
|
|
357
|
+ }
|
|
335
|
358
|
orderInfoBo.setPurchaseOrderLineList(lineList);
|
|
336
|
359
|
}
|
|
337
|
360
|
return InvokeResultBuilder.success(result);
|
...
|
...
|
|