From 05683f2b2bdbdbe21cf17ad523c21ab338bd1c54 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期二, 19 七月 2022 21:49:55 +0800
Subject: [PATCH] 优化添加设备 功能

---
 java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java b/java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java
index f727b5b..f331270 100755
--- a/java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java
+++ b/java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java
@@ -434,15 +434,15 @@
                 for (ContractRoomDto tmpContractRoomDto : contractRoomDtos) {
                     builtUpArea = builtUpArea.add(new BigDecimal(Double.parseDouble(tmpContractRoomDto.getRoomRent())));
                 }
-                feeReceiptDetailPo.setArea(builtUpArea.doubleValue() + "");
-                feeReceiptDetailPo.setSquarePrice(feeDto.getSquarePrice() + "/" + feeDto.getAdditionalAmount());
+                feeReceiptDetailPo.setArea("");
+                feeReceiptDetailPo.setSquarePrice(builtUpArea.doubleValue() + "");
             } else if ("1102".equals(computingFormula)) { // 绉熼噾
                 BigDecimal builtUpArea = new BigDecimal(0);
                 for (ContractRoomDto tmpContractRoomDto : contractRoomDtos) {
                     builtUpArea = builtUpArea.add(new BigDecimal(Double.parseDouble(tmpContractRoomDto.getRoomRent())));
                 }
-                feeReceiptDetailPo.setArea(builtUpArea.doubleValue() + "");
-                feeReceiptDetailPo.setSquarePrice(feeDto.getSquarePrice() + "/" + feeDto.getAdditionalAmount());
+                feeReceiptDetailPo.setArea("");
+                feeReceiptDetailPo.setSquarePrice(builtUpArea.doubleValue() + "");
             }else if ("4004".equals(computingFormula)) {
             } else if ("5005".equals(computingFormula)) {
                 if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
@@ -1518,7 +1518,9 @@
             //鍒ゆ柇褰撳墠璐圭敤鏄笉鏄鍏ヨ垂鐢�
             oweMonth = 1.0;
         }else if(FeeDto.FEE_FLAG_CYCLE_ONCE.equals(feeDto.getFeeFlag())){
-            maxEndTime = feeDto.getDeadlineTime();
+            if(feeDto.getDeadlineTime() != null) {
+                maxEndTime = feeDto.getDeadlineTime();
+            }
             Date billEndTime = DateUtil.getCurrentDate();
             //寤鸿处鏃堕棿
             Date startDate = feeDto.getStartTime();
@@ -1877,7 +1879,7 @@
         Date date = getTargetEndTime(cycle,endTime);
         feeDto.setDeadlineTime(date);
         dealRentRate(feeDto);
-        feeDto.setFeeTotalPrice(Double.parseDouble(feeDto.getAmountOwed()));
+
     }
 
     /**
@@ -1887,10 +1889,6 @@
      */
     public void dealRentRate(FeeDto feeDto) {
         if (!FeeConfigDto.COMPUTING_FORMULA_RANT_RATE.equals(feeDto.getComputingFormula())) {
-            return;
-        }
-
-        if (!FeeDto.STATE_DOING.equals(feeDto.getState())) {
             return;
         }
 
@@ -1917,11 +1915,16 @@
                     rateCycle = Integer.parseInt(tmpFeeAttrDto.getValue());
                 }
                 if (FeeAttrDto.SPEC_CD_RATE_START_TIME.equals(tmpFeeAttrDto.getSpecCd())) {
+                    feeDto.setRateStartTime(tmpFeeAttrDto.getValue());
                     rateStartTime = DateUtil.getDateFromString(tmpFeeAttrDto.getValue(), DateUtil.DATE_FORMATE_STRING_B);
                 }
             }
         } catch (Exception e) {
             logger.error("绉熼噾閫掑寮傚父", e);
+            return;
+        }
+
+        if (!FeeDto.STATE_DOING.equals(feeDto.getState())) {
             return;
         }
 
@@ -1968,6 +1971,7 @@
 
         firstAmount = firstAmount.add(oweAmountDec);
         feeDto.setAmountOwed(firstAmount.doubleValue() + "");
+        feeDto.setFeeTotalPrice(firstAmount.doubleValue());
     }
 }
 

--
Gitblit v1.8.0