Просмотр исходного кода

优化 加入租金和 套内面积功能

java110 лет назад: 4
Родитель
Сommit
beecbfa716

+ 28 - 0
java110-bean/src/main/java/com/java110/dto/report/ReportFeeDto.java

@@ -92,6 +92,10 @@ public class ReportFeeDto extends PageDto implements Serializable {
     private String storeName;
     private String storeTypeCd;
 
+    private String roomSubType;
+    private String roomRent;
+    private String roomArea;
+
 
 
 
@@ -510,4 +514,28 @@ public class ReportFeeDto extends PageDto implements Serializable {
     public void setMwPrice(String mwPrice) {
         this.mwPrice = mwPrice;
     }
+
+    public String getRoomSubType() {
+        return roomSubType;
+    }
+
+    public void setRoomSubType(String roomSubType) {
+        this.roomSubType = roomSubType;
+    }
+
+    public String getRoomRent() {
+        return roomRent;
+    }
+
+    public void setRoomRent(String roomRent) {
+        this.roomRent = roomRent;
+    }
+
+    public String getRoomArea() {
+        return roomArea;
+    }
+
+    public void setRoomArea(String roomArea) {
+        this.roomArea = roomArea;
+    }
 }

+ 70 - 7
java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java

@@ -256,7 +256,13 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
             } else if ("2002".equals(computingFormula)) { // 固定费用
                 feeReceiptDetailPo.setArea("");
                 feeReceiptDetailPo.setSquarePrice(feeDto.getAdditionalAmount());
-            } else if ("4004".equals(computingFormula)) {
+            } else if ("3003".equals(computingFormula)) { // 固定费用
+                feeReceiptDetailPo.setArea(roomDtos.get(0).getRoomArea());
+                feeReceiptDetailPo.setSquarePrice(feeDto.getSquarePrice() + "/" + feeDto.getAdditionalAmount());
+            } else if ("1101".equals(computingFormula)) { // 租金
+                feeReceiptDetailPo.setArea("");
+                feeReceiptDetailPo.setSquarePrice(roomDto.getRoomRent());
+            }else if ("4004".equals(computingFormula)) {
             } else if ("5005".equals(computingFormula)) {
                 if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
                 } else {
@@ -310,7 +316,13 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
             } else if ("2002".equals(computingFormula)) { // 固定费用
                 feeReceiptDetailPo.setArea("");
                 feeReceiptDetailPo.setSquarePrice(feeDto.getAdditionalAmount());
-            } else if ("4004".equals(computingFormula)) {
+            } else if ("3003".equals(computingFormula)) { // 固定费用
+                feeReceiptDetailPo.setArea("");
+                feeReceiptDetailPo.setSquarePrice("0");
+            } else if ("1101".equals(computingFormula)) { // 租金
+                feeReceiptDetailPo.setArea("");
+                feeReceiptDetailPo.setSquarePrice("0");
+            }else if ("4004".equals(computingFormula)) {
             } else if ("5005".equals(computingFormula)) {
                 if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
                 } else {
@@ -372,7 +384,21 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
             } else if ("2002".equals(computingFormula)) { // 固定费用
                 feeReceiptDetailPo.setArea("");
                 feeReceiptDetailPo.setSquarePrice(feeDto.getAdditionalAmount());
-            } else if ("4004".equals(computingFormula)) {
+            } else if ("3003".equals(computingFormula)) { // 固定费用
+                BigDecimal builtUpArea = new BigDecimal(0);
+                for (ContractRoomDto tmpContractRoomDto : contractRoomDtos) {
+                    builtUpArea = builtUpArea.add(new BigDecimal(Double.parseDouble(tmpContractRoomDto.getRoomArea())));
+                }
+                feeReceiptDetailPo.setArea(builtUpArea.doubleValue() + "");
+                feeReceiptDetailPo.setSquarePrice(feeDto.getSquarePrice() + "/" + feeDto.getAdditionalAmount());
+            } else if ("1101".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());
+            }else if ("4004".equals(computingFormula)) {
             } else if ("5005".equals(computingFormula)) {
                 if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
                 } else {
@@ -754,7 +780,15 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
                 //feePrice = Double.parseDouble(feeDto.getAdditionalAmount());
                 BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAdditionalAmount()));
                 feePrice = additionalAmount.setScale(2, BigDecimal.ROUND_HALF_EVEN);
-            } else if ("4004".equals(computingFormula)) {
+            } else if ("3003".equals(computingFormula)) { // 固定费用
+                BigDecimal squarePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getSquarePrice()));
+                BigDecimal builtUpArea = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getRoomArea()));
+                BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAdditionalAmount()));
+                feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_EVEN);
+            } else if ("1101".equals(computingFormula)) { // 租金
+                BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getRoomRent()));
+                feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN);
+            }else if ("4004".equals(computingFormula)) {
                 feePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAmount()));
             } else if ("5005".equals(computingFormula)) {
                 if (StringUtil.isEmpty(tmpReportFeeDto.getCurDegrees())) {
@@ -801,7 +835,12 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
                 //feePrice = Double.parseDouble(feeDto.getAdditionalAmount());
                 BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAdditionalAmount()));
                 feePrice = additionalAmount.setScale(2, BigDecimal.ROUND_HALF_EVEN);
-            } else if ("4004".equals(computingFormula)) {
+            } else if ("3003".equals(computingFormula)) { // 固定费用
+                //feePrice = Double.parseDouble(feeDto.getAdditionalAmount());
+                feePrice = new BigDecimal(0);
+            } else if ("1101".equals(computingFormula)) { // 租金
+                feePrice = new BigDecimal(0);
+            }else if ("4004".equals(computingFormula)) {
                 feePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAmount()));
             } else if ("5005".equals(computingFormula)) {
                 if (StringUtil.isEmpty(tmpReportFeeDto.getCurDegrees())) {
@@ -870,6 +909,14 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
                 //feePrice = Double.parseDouble(feeDto.getAdditionalAmount());
                 BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
                 feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN);
+            } else if ("3003".equals(computingFormula)) { // 固定费用
+                BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getSquarePrice()));
+                BigDecimal builtUpArea = new BigDecimal(Double.parseDouble(roomDto.getRoomArea()));
+                BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
+                feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_EVEN);
+            } else if ("1101".equals(computingFormula)) { // 租金
+                BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(roomDto.getRoomRent()));
+                feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN);
             } else if ("4004".equals(computingFormula)) {  //动态费用
                 feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
             } else if ("5005".equals(computingFormula)) {  //(本期度数-上期度数)*单价+附加费
@@ -931,7 +978,15 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
                 //feePrice = Double.parseDouble(feeDto.getAdditionalAmount());
                 BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
                 feePrice = additionalAmount.setScale(2, BigDecimal.ROUND_HALF_EVEN);
-            } else if ("4004".equals(computingFormula)) {
+            } else if ("3003".equals(computingFormula)) { // 固定费用
+                BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getSquarePrice()));
+                BigDecimal builtUpArea = new BigDecimal(Double.parseDouble(roomDto.getRoomArea()));
+                BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
+                feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_EVEN);
+            } else if ("1101".equals(computingFormula)) { // 租金
+                BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(roomDto.getRoomRent()));
+                feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN);
+            }else if ("4004".equals(computingFormula)) {
                 feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
             } else if ("5005".equals(computingFormula)) {
                 if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
@@ -991,7 +1046,15 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
 //                BigDecimal roomDount = new BigDecimal(contractRoomDtos.size());
 //                additionalAmount = additionalAmount.multiply(roomDount);
                 feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN);
-            } else if ("4004".equals(computingFormula)) {  //动态费用
+            } else if ("3003".equals(computingFormula)) { // 固定费用
+                BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getSquarePrice()));
+                BigDecimal builtUpArea = new BigDecimal(Double.parseDouble(roomDto.getRoomArea()));
+                BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
+                feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_EVEN);
+            } else if ("1101".equals(computingFormula)) { // 租金
+                BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(roomDto.getRoomRent()));
+                feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN);
+            }else if ("4004".equals(computingFormula)) {  //动态费用
                 feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
             } else if ("5005".equals(computingFormula)) {  //(本期度数-上期度数)*单价+附加费
                 if (StringUtil.isEmpty(feeDto.getCurDegrees())) {

+ 2 - 1
java110-db/src/main/resources/mapper/report/ReportCommunityServiceDaoImplMapper.xml

@@ -23,7 +23,8 @@
         select t.apartment,t.built_up_area builtUpArea,t.community_id communityId,t.create_time createTime,
         t.fee_coefficient feeCoefficient,t.layer,t.room_id roomId,t.room_num roomNum,t.section,
         t.state,bu.unit_id unitId,bu.unit_num unitNum,ff.floor_id floorId,ff.floor_num floorNum,
-        bo.age,bo.id_card idCard,bo.link,bo.member_id memberId,bo.`name`,bo.`name` ownerName,bo.owner_id ownerId,t.room_type roomType
+        bo.age,bo.id_card idCard,bo.link,bo.member_id memberId,bo.`name`,bo.`name` ownerName,bo.owner_id ownerId,t.room_type roomType,
+        t.room_sub_type roomSubType,t.room_rent roomRent,t.room_area roomArea
         from building_room t
         INNER JOIN building_unit bu on t.unit_id = bu.unit_id and bu.status_cd = '0'
         inner join f_floor ff on bu.floor_id = ff.floor_id and ff.status_cd = '0'

+ 13 - 1
service-fee/src/main/java/com/java110/fee/bmo/impl/QueryFeeByAttrImpl.java

@@ -89,6 +89,10 @@ public class QueryFeeByAttrImpl implements IQueryFeeByAttr {
 
             BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
             feePrice = additionalAmount.setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
+        }else if ("3003".equals(computingFormula)) { // 固定费用
+            feePrice = 0;
+        } else if ("1101".equals(computingFormula)) { // 租金
+            feePrice = 0;
         } else if ("4004".equals(computingFormula)) {
             feePrice = Double.parseDouble(feeDto.getAmount());
         } else {
@@ -125,7 +129,15 @@ public class QueryFeeByAttrImpl implements IQueryFeeByAttr {
         } else if ("2002".equals(computingFormula)) { // 固定费用
             BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
             feePrice = additionalAmount.setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
-        } else if ("4004".equals(computingFormula)) {
+        } else if ("3003".equals(computingFormula)) { // 固定费用
+            BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getSquarePrice()));
+            BigDecimal builtUpArea = new BigDecimal(Double.parseDouble(roomDto.getRoomArea()));
+            BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
+            feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_EVEN).doubleValue();
+        } else if ("1101".equals(computingFormula)) { // 租金
+            BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(roomDto.getRoomRent()));
+            feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN).doubleValue();
+        }else if ("4004".equals(computingFormula)) {
             feePrice = Double.parseDouble(feeDto.getAmount());
         } else {
             feePrice = -1.00;

+ 12 - 0
service-fee/src/main/java/com/java110/fee/bmo/impl/QueryOweFeeImpl.java

@@ -402,6 +402,10 @@ public class QueryOweFeeImpl implements IQueryOweFee {
 
             BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
             feePrice = additionalAmount.setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
+        } else if ("3003".equals(computingFormula)) { // 固定费用
+            feePrice = 0.0;
+        } else if ("1101".equals(computingFormula)) { // 租金
+            feePrice = 0.0;
         } else if ("4004".equals(computingFormula)) {
             feePrice = Double.parseDouble(feeDto.getAmount());
         } else if ("5005".equals(computingFormula)) {
@@ -513,6 +517,14 @@ public class QueryOweFeeImpl implements IQueryOweFee {
         } else if ("2002".equals(computingFormula)) { // 固定费用
             BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
             feePrice = additionalAmount.setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
+        } else if ("3003".equals(computingFormula)) { // 固定费用
+            BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getSquarePrice()));
+            BigDecimal builtUpArea = new BigDecimal(Double.parseDouble(tmpRoomDto.getRoomArea()));
+            BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
+            feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_EVEN).doubleValue();
+        } else if ("1101".equals(computingFormula)) { // 租金
+            BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(tmpRoomDto.getRoomRent()));
+            feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN).doubleValue();
         } else if ("4004".equals(computingFormula)) {
             feePrice = Double.parseDouble(feeDto.getAmount());
         } else if ("5005".equals(computingFormula)) {

+ 12 - 0
service-job/src/main/java/com/java110/job/task/fee/GenerateBillTemplate.java

@@ -437,6 +437,14 @@ public class GenerateBillTemplate extends TaskSystemQuartz {
         } else if ("2002".equals(computingFormula)) { // 固定费用
             BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
             feePrice = additionalAmount.setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
+        } else if ("3003".equals(computingFormula)) { // 固定费用
+            BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getSquarePrice()));
+            BigDecimal builtUpArea = new BigDecimal(Double.parseDouble(roomDto.getRoomArea()));
+            BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
+            feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_EVEN).doubleValue();
+        } else if ("1101".equals(computingFormula)) { // 租金
+            BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(roomDto.getRoomRent()));
+            feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN).doubleValue();
         } else {
             feePrice = -1.00;
         }
@@ -473,6 +481,10 @@ public class GenerateBillTemplate extends TaskSystemQuartz {
         } else if ("2002".equals(computingFormula)) { // 固定费用
             BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
             feePrice = additionalAmount.setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
+        } else if ("3003".equals(computingFormula)) { // 固定费用
+            feePrice = 0;
+        } else if ("1101".equals(computingFormula)) { // 租金
+            feePrice = 0;
         } else {
             feePrice = -1.00;
         }