| | |
| | | |
| | | List<ApiPurchaseApplyDataVo> purchaseApplys = null; |
| | | if (count > 0) { |
| | | purchaseApplys = BeanConvertUtil.covertBeanList(purchaseApplyInnerServiceSMOImpl.queryPurchaseApplys(purchaseApplyDto), ApiPurchaseApplyDataVo.class); |
| | | List<String> orderIds = new ArrayList<>(); |
| | | for( ApiPurchaseApplyDataVo apiPurchaseApplyDataVo : purchaseApplys){ |
| | | orderIds.add(apiPurchaseApplyDataVo.getApplyOrderId()); |
| | | } |
| | | //明细列表 |
| | | PurchaseApplyDetailDto purchaseApplyDetailDto = new PurchaseApplyDetailDto(); |
| | | purchaseApplyDetailDto.setApplyOrderIds(orderIds); |
| | | List<PurchaseApplyDetailVo> purchaseApplyDetailVos = BeanConvertUtil.covertBeanList(purchaseApplyInnerServiceSMOImpl.queryPurchaseApplyDetails(purchaseApplyDetailDto), PurchaseApplyDetailVo.class); |
| | | |
| | | for( ApiPurchaseApplyDataVo apiPurchaseApplyDataVo : purchaseApplys){ |
| | | List<PurchaseApplyDetailVo> applyDetailList = new ArrayList<>(); |
| | | for( PurchaseApplyDetailVo purchaseApplyDetailVo : purchaseApplyDetailVos){ |
| | | if(apiPurchaseApplyDataVo.getApplyOrderId().equals(purchaseApplyDetailVo.getApplyOrderId())){ |
| | | applyDetailList.add(purchaseApplyDetailVo); |
| | | } |
| | | } |
| | | apiPurchaseApplyDataVo.setPurchaseApplyDetailVo(applyDetailList); |
| | | } |
| | | List<PurchaseApplyDto> purchaseApplyDtos = purchaseApplyInnerServiceSMOImpl.queryPurchaseApplyAndDetails(purchaseApplyDto); |
| | | purchaseApplys = BeanConvertUtil.covertBeanList(purchaseApplyDtos, ApiPurchaseApplyDataVo.class); |
| | | for( ApiPurchaseApplyDataVo apiPurchaseApplyDataVo : purchaseApplys){ |
| | | List<PurchaseApplyDetailVo> applyDetailList = apiPurchaseApplyDataVo.getPurchaseApplyDetailVo(); |
| | | StringBuffer resNames = new StringBuffer(); |
| | | BigDecimal totalPrice = new BigDecimal(0); |
| | | for( PurchaseApplyDetailVo purchaseApplyDetailVo : applyDetailList){ |
| | | resNames.append(purchaseApplyDetailVo.getResName()+";"); |
| | | BigDecimal price = new BigDecimal(purchaseApplyDetailVo.getPrice()); |
| | | BigDecimal quantity = new BigDecimal(purchaseApplyDetailVo.getQuantity()); |
| | | totalPrice = totalPrice.add(price.multiply(quantity)); |
| | | if(applyDetailList.size() > 0){ |
| | | StringBuffer resNames = new StringBuffer(); |
| | | BigDecimal totalPrice = new BigDecimal(0); |
| | | for( PurchaseApplyDetailVo purchaseApplyDetailVo : applyDetailList){ |
| | | resNames.append(purchaseApplyDetailVo.getResName()+";"); |
| | | BigDecimal price = new BigDecimal(purchaseApplyDetailVo.getPrice()); |
| | | BigDecimal quantity = new BigDecimal(purchaseApplyDetailVo.getQuantity()); |
| | | totalPrice = totalPrice.add(price.multiply(quantity)); |
| | | } |
| | | apiPurchaseApplyDataVo.setResourceNames(resNames.toString()); |
| | | apiPurchaseApplyDataVo.setTotalPrice(totalPrice.toString()); |
| | | } |
| | | apiPurchaseApplyDataVo.setResourceNames(resNames.toString()); |
| | | apiPurchaseApplyDataVo.setTotalPrice(totalPrice.toString()); |
| | | } |
| | | } else { |
| | | purchaseApplys = new ArrayList<>(); |