|
@@ -227,6 +227,18 @@ public class RepairSaleService {
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
}
|
|
}
|
|
List<PriceList> priceLists = priceListService.getByRepairId(repairId);
|
|
List<PriceList> priceLists = priceListService.getByRepairId(repairId);
|
|
|
|
+ Set<Integer> collect = priceLists.stream().map(PriceList::getPartId).collect(Collectors.toSet());
|
|
|
|
+ HashMap<Integer,Part> partHashMap = new HashMap<>();
|
|
|
|
+ if(collect.size() >0){
|
|
|
|
+ List<Part> parts = partService.listByIds(collect);
|
|
|
|
+ parts.forEach(entity -> partHashMap.put(entity.getPartId(),entity));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for (PriceList priceList : priceLists) {
|
|
|
|
+ if(priceList.getPartId() != null && partHashMap.get(priceList.getPartId()) !=null) {
|
|
|
|
+ priceList.setPartUnit(partHashMap.get(priceList.getPartId()).getPartUnit());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
List<RepairLog> repairLogs = repairLogService.getByRepairIdAndStatus(repairId, RepairStatusEnum.TO_BE_CONFIRMED.status());
|
|
List<RepairLog> repairLogs = repairLogService.getByRepairIdAndStatus(repairId, RepairStatusEnum.TO_BE_CONFIRMED.status());
|
|
PriceListVo priceListVo = new PriceListVo();
|
|
PriceListVo priceListVo = new PriceListVo();
|
|
priceListVo.setPriceLists(priceLists);
|
|
priceListVo.setPriceLists(priceLists);
|