From 38b7741d060048ebfd7be48cbc5980eeaeba287b Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期三, 16 六月 2021 19:10:12 +0800
Subject: [PATCH] 加入抄表动态单价功能

---
 java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java |   85 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 84 insertions(+), 1 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 d1d9a06..2650e09 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
@@ -279,6 +279,15 @@
             } else if ("7007".equals(computingFormula)) { //鑷畾涔夊叕寮�
                 feeReceiptDetailPo.setArea(roomDtos.get(0).getBuiltUpArea());
                 feeReceiptDetailPo.setSquarePrice(feeDto.getComputingFormulaText());
+            }else if ("9009".equals(computingFormula)) {
+                if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
+                } else {
+                    BigDecimal curDegree = new BigDecimal(Double.parseDouble(feeDto.getCurDegrees()));
+                    BigDecimal preDegree = new BigDecimal(Double.parseDouble(feeDto.getPreDegrees()));
+                    BigDecimal sub = curDegree.subtract(preDegree).setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                    feeReceiptDetailPo.setArea(sub.doubleValue() + "");
+                    feeReceiptDetailPo.setSquarePrice(feeDto.getMwPrice() + "/" + feeDto.getAdditionalAmount());
+                }
             } else {
             }
         } else if (FeeDto.PAYER_OBJ_TYPE_CAR.equals(feeDto.getPayerObjType())) {//杞︿綅鐩稿叧
@@ -331,7 +340,16 @@
                 }
                 feeReceiptDetailPo.setArea(parkingSpaceDtos.get(0).getArea());
                 feeReceiptDetailPo.setSquarePrice(feeDto.getComputingFormulaText());
-            } else {
+            } else if ("9009".equals(computingFormula)) {
+                if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
+                } else {
+                    BigDecimal curDegree = new BigDecimal(Double.parseDouble(feeDto.getCurDegrees()));
+                    BigDecimal preDegree = new BigDecimal(Double.parseDouble(feeDto.getPreDegrees()));
+                    BigDecimal sub = curDegree.subtract(preDegree).setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                    feeReceiptDetailPo.setArea(sub.doubleValue() + "");
+                    feeReceiptDetailPo.setSquarePrice(feeDto.getMwPrice() + "/" + feeDto.getAdditionalAmount());
+                }
+            }else {
             }
         }
     }
@@ -696,6 +714,19 @@
                 feePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAmount()));
             } else if ("7007".equals(computingFormula)) { //鑷畾涔夊叕寮�
                 feePrice = computeRoomCustomizeFormula(BeanConvertUtil.covertBean(tmpReportFeeDto, FeeDto.class), BeanConvertUtil.covertBean(reportRoomDto, RoomDto.class));
+            }else if ("9009".equals(computingFormula)) {
+                if (StringUtil.isEmpty(tmpReportFeeDto.getCurDegrees())) {
+                    //throw new IllegalArgumentException("鎶勮〃鏁版嵁寮傚父");
+                } else {
+                    BigDecimal curDegree = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getCurDegrees()));
+                    BigDecimal preDegree = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getPreDegrees()));
+                    BigDecimal squarePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getMwPrice()));
+                    BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAdditionalAmount()));
+                    BigDecimal sub = curDegree.subtract(preDegree);
+                    feePrice = sub.multiply(squarePrice)
+                            .add(additionalAmount)
+                            .setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                }
             } else {
                 throw new IllegalArgumentException("鏆備笉鏀寔璇ョ被鍏紡");
             }
@@ -730,6 +761,19 @@
                 feePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAmount()));
             } else if ("7007".equals(computingFormula)) { //鑷畾涔夊叕寮�
                 feePrice = computeCarCustomizeFormula(BeanConvertUtil.covertBean(tmpReportFeeDto, FeeDto.class), BeanConvertUtil.covertBean(reportCarDto, OwnerCarDto.class));
+            }else if ("9009".equals(computingFormula)) {
+                if (StringUtil.isEmpty(tmpReportFeeDto.getCurDegrees())) {
+                    throw new IllegalArgumentException("鎶勮〃鏁版嵁寮傚父");
+                } else {
+                    BigDecimal curDegree = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getCurDegrees()));
+                    BigDecimal preDegree = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getPreDegrees()));
+                    BigDecimal squarePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getMwPrice()));
+                    BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAdditionalAmount()));
+                    BigDecimal sub = curDegree.subtract(preDegree);
+                    feePrice = sub.multiply(squarePrice)
+                            .add(additionalAmount)
+                            .setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                }
             } else {
                 throw new IllegalArgumentException("鏆備笉鏀寔璇ョ被鍏紡");
             }
@@ -788,6 +832,19 @@
                 feePrice = computeRoomCustomizeFormula(feeDto, roomDto);
             } else if ("8008".equals(computingFormula)) {  //鎵嬪姩鍔ㄦ�佽垂鐢�
                 feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
+            } else if ("9009".equals(computingFormula)) {  //(鏈湡搴︽暟-涓婃湡搴︽暟)*鍔ㄦ�佸崟浠�+闄勫姞璐�
+                if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
+                    //throw new IllegalArgumentException("鎶勮〃鏁版嵁寮傚父");
+                } else {
+                    BigDecimal curDegree = new BigDecimal(Double.parseDouble(feeDto.getCurDegrees()));
+                    BigDecimal preDegree = new BigDecimal(Double.parseDouble(feeDto.getPreDegrees()));
+                    BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getMwPrice()));
+                    BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
+                    BigDecimal sub = curDegree.subtract(preDegree);
+                    feePrice = sub.multiply(squarePrice)
+                            .add(additionalAmount)
+                            .setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                }
             } else {
                 throw new IllegalArgumentException("鏆備笉鏀寔璇ョ被鍏紡");
             }
@@ -834,6 +891,19 @@
                 feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
             } else if ("7007".equals(computingFormula)) { //鑷畾涔夊叕寮�
                 feePrice = computeCarCustomizeFormula(feeDto, ownerCarDtos.get(0));
+            } else if ("9009".equals(computingFormula)) {  //(鏈湡搴︽暟-涓婃湡搴︽暟)*鍔ㄦ�佸崟浠�+闄勫姞璐�
+                if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
+                    //throw new IllegalArgumentException("鎶勮〃鏁版嵁寮傚父");
+                } else {
+                    BigDecimal curDegree = new BigDecimal(Double.parseDouble(feeDto.getCurDegrees()));
+                    BigDecimal preDegree = new BigDecimal(Double.parseDouble(feeDto.getPreDegrees()));
+                    BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getMwPrice()));
+                    BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
+                    BigDecimal sub = curDegree.subtract(preDegree);
+                    feePrice = sub.multiply(squarePrice)
+                            .add(additionalAmount)
+                            .setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                }
             } else {
                 throw new IllegalArgumentException("鏆備笉鏀寔璇ョ被鍏紡");
             }
@@ -883,6 +953,19 @@
                 feePrice = computeContractCustomizeFormula(feeDto, contractRoomDtos);
             } else if ("8008".equals(computingFormula)) {  //鎵嬪姩鍔ㄦ�佽垂鐢�
                 feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
+            } else if ("9009".equals(computingFormula)) {  //(鏈湡搴︽暟-涓婃湡搴︽暟)*鍔ㄦ�佸崟浠�+闄勫姞璐�
+                if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
+                    //throw new IllegalArgumentException("鎶勮〃鏁版嵁寮傚父");
+                } else {
+                    BigDecimal curDegree = new BigDecimal(Double.parseDouble(feeDto.getCurDegrees()));
+                    BigDecimal preDegree = new BigDecimal(Double.parseDouble(feeDto.getPreDegrees()));
+                    BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getMwPrice()));
+                    BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
+                    BigDecimal sub = curDegree.subtract(preDegree);
+                    feePrice = sub.multiply(squarePrice)
+                            .add(additionalAmount)
+                            .setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                }
             } else {
                 throw new IllegalArgumentException("鏆備笉鏀寔璇ョ被鍏紡");
             }

--
Gitblit v1.8.0