From 3dfbf2598ab5b16ff76a99c7b75c889e261a08bb Mon Sep 17 00:00:00 2001
From: xiaogang <905166056@qq.com>
Date: 星期五, 20 八月 2021 18:00:58 +0800
Subject: [PATCH] 1、收银台费用计算后台计算2、优化显示细节问题

---
 service-api/src/main/java/com/java110/api/listener/fee/ListFeeListener.java |   25 +++++++++++++++++--------
 1 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/service-api/src/main/java/com/java110/api/listener/fee/ListFeeListener.java b/service-api/src/main/java/com/java110/api/listener/fee/ListFeeListener.java
index cc4a7ac..e156f79 100755
--- a/service-api/src/main/java/com/java110/api/listener/fee/ListFeeListener.java
+++ b/service-api/src/main/java/com/java110/api/listener/fee/ListFeeListener.java
@@ -17,6 +17,7 @@
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
 import com.java110.utils.util.DateUtil;
+import com.java110.utils.util.StringUtil;
 import com.java110.vo.api.fee.ApiFeeDataVo;
 import com.java110.vo.api.fee.ApiFeeVo;
 import org.slf4j.Logger;
@@ -92,12 +93,20 @@
 
         int count = feeInnerServiceSMOImpl.queryFeesCount(feeDto);
 
-        List<ApiFeeDataVo> fees = null;
+        List<ApiFeeDataVo> fees = new ArrayList<>();
 
         if (count > 0) {
             List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto);//鏌ヨ璐圭敤椤圭洰
             computeFeePrice(feeDtos);//璁$畻璐圭敤
-            fees = BeanConvertUtil.covertBeanList(feeDtos, ApiFeeDataVo.class);
+            List<ApiFeeDataVo> apiFeeDataVos = BeanConvertUtil.covertBeanList(feeDtos, ApiFeeDataVo.class);
+            for (ApiFeeDataVo apiFeeDataVo : apiFeeDataVos) {
+                //鑾峰彇浠樿垂瀵硅薄绫诲瀷
+                String payerObjType = apiFeeDataVo.getPayerObjType();
+                if (!StringUtil.isEmpty(payerObjType) && payerObjType.equals("6666")) {
+                    apiFeeDataVo.setCarTypeCd("1001");
+                }
+                fees.add(apiFeeDataVo);
+            }
             freshFeeAttrs(fees, feeDtos);
         } else {
             fees = new ArrayList<>();
@@ -159,8 +168,8 @@
         }
         String computingFormula = feeDto.getComputingFormula();
         double feePrice = 0.00;
-        feePrice = computeFeeSMOImpl.getFeePrice(feeDto);
-        feeDto.setFeePrice(feePrice);
+        Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDto);
+        feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString()));
         BigDecimal curFeePrice = new BigDecimal(feeDto.getFeePrice());
         curFeePrice = curFeePrice.multiply(new BigDecimal(oweMonth));
         feeDto.setAmountOwed(curFeePrice.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue() + "");
@@ -181,8 +190,8 @@
     private void computeFeePriceByRoom(FeeDto feeDto, double oweMonth) {
         String computingFormula = feeDto.getComputingFormula();
         double feePrice = 0.00;
-        feePrice = computeFeeSMOImpl.getFeePrice(feeDto);
-        feeDto.setFeePrice(feePrice);
+        Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDto);
+        feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString()));
         BigDecimal curFeePrice = new BigDecimal(feeDto.getFeePrice());
         curFeePrice = curFeePrice.multiply(new BigDecimal(oweMonth));
         feeDto.setAmountOwed(curFeePrice.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue() + "");
@@ -203,8 +212,8 @@
     private void computeFeePriceByContract(FeeDto feeDto, double oweMonth) {
         String computingFormula = feeDto.getComputingFormula();
         double feePrice = 0.00;
-        feePrice = computeFeeSMOImpl.getFeePrice(feeDto);
-        feeDto.setFeePrice(feePrice);
+        Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDto);
+        feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString()));
         BigDecimal curFeePrice = new BigDecimal(feeDto.getFeePrice());
         curFeePrice = curFeePrice.multiply(new BigDecimal(oweMonth));
         feeDto.setAmountOwed(curFeePrice.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue() + "");

--
Gitblit v1.8.0