|
|
@@ -137,29 +137,30 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
|
|
|
param.setCompanyIdList(companyIdList);
|
|
|
}
|
|
|
Page<FeeAuditVo> page = baseMapper.queryPage(param.getPage(), param);
|
|
|
- // 循环每条数据,查询 ins_fee_orders 并计算权益金额
|
|
|
- if (CollUtil.isNotEmpty(page.getRecords())) {
|
|
|
- Map<String, String> allCompanyHierarchyPaths = esmInsCompanyClient.getAllCompanyHierarchyPaths();
|
|
|
- for (FeeAuditVo feeAuditVo : page.getRecords()) {
|
|
|
- String allCompany = allCompanyHierarchyPaths.get(Objects.toString(feeAuditVo.getCompanyId(),""));
|
|
|
- feeAuditVo.setCompanyALlName(allCompany);
|
|
|
- // 查询订单的 ins_fee_orders 数据
|
|
|
- InsFeeOrders insFeeOrders = feeOrdersService.getById(feeAuditVo.getOrderNo());
|
|
|
- if (insFeeOrders != null) {
|
|
|
- // 权益金额 = (交强出口费用 + 商业出口费用 + 驾意出口费用) - (交强出口留点费用 + 商业出口留点费用 + 驾意出口留点费用)
|
|
|
- BigDecimal exportTotal = Optional.ofNullable(insFeeOrders.getJqExportPremium()).orElse(BigDecimal.ZERO)
|
|
|
- .add(Optional.ofNullable(insFeeOrders.getSyExportPremium()).orElse(BigDecimal.ZERO))
|
|
|
- .add(Optional.ofNullable(insFeeOrders.getJyExportPremium()).orElse(BigDecimal.ZERO));
|
|
|
-
|
|
|
- BigDecimal exportKeepPointTotal = Optional.ofNullable(insFeeOrders.getJqExportKeepPointPremium()).orElse(BigDecimal.ZERO)
|
|
|
- .add(Optional.ofNullable(insFeeOrders.getSyExportKeepPointPremium()).orElse(BigDecimal.ZERO))
|
|
|
- .add(Optional.ofNullable(insFeeOrders.getJyExportKeepPointPremium()).orElse(BigDecimal.ZERO));
|
|
|
-
|
|
|
- BigDecimal equityAmount = exportTotal.subtract(exportKeepPointTotal);
|
|
|
- feeAuditVo.setEquityAmount(equityAmount);
|
|
|
- }else{
|
|
|
- feeAuditVo.setEquityAmount(BigDecimal.ZERO);
|
|
|
- }
|
|
|
+ if(CollUtil.isEmpty(page.getRecords())){
|
|
|
+ return page;
|
|
|
+ }
|
|
|
+ Map<String, String> allCompanyHierarchyPaths = esmInsCompanyClient.getAllCompanyHierarchyPaths();
|
|
|
+ for (FeeAuditVo feeAuditVo : page.getRecords()) {
|
|
|
+ String allCompany = allCompanyHierarchyPaths.get(Objects.toString(feeAuditVo.getCompanyId(),""));
|
|
|
+ feeAuditVo.setCompanyALlName(allCompany);
|
|
|
+ // 循环每条数据,查询 ins_fee_orders 并计算权益金额
|
|
|
+ // 查询订单的 ins_fee_orders 数据
|
|
|
+ InsFeeOrders insFeeOrders = feeOrdersService.getById(feeAuditVo.getOrderNo());
|
|
|
+ if (insFeeOrders != null) {
|
|
|
+ // 权益金额 = (交强出口费用 + 商业出口费用 + 驾意出口费用) - (交强出口留点费用 + 商业出口留点费用 + 驾意出口留点费用)
|
|
|
+ BigDecimal exportTotal = Optional.ofNullable(insFeeOrders.getJqExportPremium()).orElse(BigDecimal.ZERO)
|
|
|
+ .add(Optional.ofNullable(insFeeOrders.getSyExportPremium()).orElse(BigDecimal.ZERO))
|
|
|
+ .add(Optional.ofNullable(insFeeOrders.getJyExportPremium()).orElse(BigDecimal.ZERO));
|
|
|
+
|
|
|
+ BigDecimal exportKeepPointTotal = Optional.ofNullable(insFeeOrders.getJqExportKeepPointPremium()).orElse(BigDecimal.ZERO)
|
|
|
+ .add(Optional.ofNullable(insFeeOrders.getSyExportKeepPointPremium()).orElse(BigDecimal.ZERO))
|
|
|
+ .add(Optional.ofNullable(insFeeOrders.getJyExportKeepPointPremium()).orElse(BigDecimal.ZERO));
|
|
|
+
|
|
|
+ BigDecimal equityAmount = exportTotal.subtract(exportKeepPointTotal);
|
|
|
+ feeAuditVo.setEquityAmount(equityAmount);
|
|
|
+ }else{
|
|
|
+ feeAuditVo.setEquityAmount(BigDecimal.ZERO);
|
|
|
}
|
|
|
}
|
|
|
|