Commit a437906e85e9636ac0f89b272efba36065eb69c6
1 parent
451672c6
feat: ERP升级
1、订单列表返回invoiceNo字段
Showing
2 changed files
with
34 additions
and
1 deletions
src/main/java/com/order/erp/domain/vo/order/OrderBaseInfoVO.java
src/main/java/com/order/erp/service/order/impl/OrderBaseInfoServiceImpl.java
... | ... | @@ -110,6 +110,9 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
110 | 110 | @Resource |
111 | 111 | private SystemSettingService systemSettingService; |
112 | 112 | |
113 | + @Resource | |
114 | + private InvoiceBillMappingService invoiceBillMappingService; | |
115 | + | |
113 | 116 | /** |
114 | 117 | * 通过ID查询单条数据 |
115 | 118 | * <p> |
... | ... | @@ -191,6 +194,9 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
191 | 194 | // 填充质检信息 |
192 | 195 | fillInspectionStageInfo(resultVOList); |
193 | 196 | |
197 | + // 填充发票信息 | |
198 | + fillInvoiceNo(resultVOList); | |
199 | + | |
194 | 200 | if (locked) { |
195 | 201 | // 填充字段锁定信息 |
196 | 202 | fillLockFields(resultVOList); |
... | ... | @@ -246,7 +252,6 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
246 | 252 | // 填充质检信息 |
247 | 253 | fillInspectionStageInfo(resultVOList); |
248 | 254 | } |
249 | - | |
250 | 255 | if (CollectionUtils.isNotEmpty(resultVOList)) { |
251 | 256 | List<Map<String, Object>> list = buildExportMapVOS(resultVOList, lockFieldVO); |
252 | 257 | if (CollectionUtils.isNotEmpty(list)) { |
... | ... | @@ -827,6 +832,30 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
827 | 832 | /** |
828 | 833 | * @param orderInfoResultVOList |
829 | 834 | */ |
835 | + private void fillInvoiceNo(List<OrderInfoResultVO> orderInfoResultVOList) { | |
836 | + if (CollectionUtils.isEmpty(orderInfoResultVOList)) { | |
837 | + return; | |
838 | + } | |
839 | + | |
840 | + Set<Long> orderIds = orderInfoResultVOList.stream().map(OrderInfoResultVO::getId).collect(Collectors.toSet()); | |
841 | + List<InvoiceBillMappingDO> invoiceBillMappingDOS = invoiceBillMappingService.list(new LambdaQueryWrapper<InvoiceBillMappingDO>() | |
842 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
843 | + .in(InvoiceBillMappingDO::getOrderId, orderIds)); | |
844 | + if (CollectionUtils.isEmpty(invoiceBillMappingDOS)) { | |
845 | + return; | |
846 | + } | |
847 | + Map<Long, InvoiceBillMappingDO> invoiceBillMappingDOMap = invoiceBillMappingDOS.stream().collect(Collectors.toMap(InvoiceBillMappingDO::getOrderId, Function.identity(), (v1, v2) -> v1)); | |
848 | + orderInfoResultVOList.forEach(result -> { | |
849 | + if (invoiceBillMappingDOMap.containsKey(result.getId())) { | |
850 | + InvoiceBillMappingDO invoiceBillMappingDO = invoiceBillMappingDOMap.get(result.getId()); | |
851 | + result.setInvoiceNo(invoiceBillMappingDO.getInvoiceNo()); | |
852 | + } | |
853 | + }); | |
854 | + } | |
855 | + | |
856 | + /** | |
857 | + * @param orderInfoResultVOList | |
858 | + */ | |
830 | 859 | private void fillReportInfo(List<OrderInfoResultVO> orderInfoResultVOList) { |
831 | 860 | if (CollectionUtils.isEmpty(orderInfoResultVOList)) { |
832 | 861 | return; | ... | ... |