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

优化字母车位费用问题

xiaogang лет назад: 4
Родитель
Сommit
ac82dee756

+ 11 - 8
java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java

@@ -262,7 +262,7 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
             } else if ("1101".equals(computingFormula)) { // 租金
                 feeReceiptDetailPo.setArea("");
                 feeReceiptDetailPo.setSquarePrice(roomDto.getRoomRent());
-            }else if ("4004".equals(computingFormula)) {
+            } else if ("4004".equals(computingFormula)) {
             } else if ("5005".equals(computingFormula)) {
                 if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
                 } else {
@@ -322,7 +322,7 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
             } else if ("1101".equals(computingFormula)) { // 租金
                 feeReceiptDetailPo.setArea("");
                 feeReceiptDetailPo.setSquarePrice("0");
-            }else if ("4004".equals(computingFormula)) {
+            } else if ("4004".equals(computingFormula)) {
             } else if ("5005".equals(computingFormula)) {
                 if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
                 } else {
@@ -399,7 +399,7 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
                 }
                 feeReceiptDetailPo.setArea(builtUpArea.doubleValue() + "");
                 feeReceiptDetailPo.setSquarePrice(feeDto.getSquarePrice() + "/" + feeDto.getAdditionalAmount());
-            }else if ("4004".equals(computingFormula)) {
+            } else if ("4004".equals(computingFormula)) {
             } else if ("5005".equals(computingFormula)) {
                 if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
                 } else {
@@ -789,7 +789,7 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
             } 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)) {
+            } else if ("4004".equals(computingFormula)) {
                 feePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAmount()));
             } else if ("5005".equals(computingFormula)) {
                 if (StringUtil.isEmpty(tmpReportFeeDto.getCurDegrees())) {
@@ -841,7 +841,7 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
                 feePrice = new BigDecimal(0);
             } else if ("1101".equals(computingFormula)) { // 租金
                 feePrice = new BigDecimal(0);
-            }else if ("4004".equals(computingFormula)) {
+            } else if ("4004".equals(computingFormula)) {
                 feePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAmount()));
             } else if ("5005".equals(computingFormula)) {
                 if (StringUtil.isEmpty(tmpReportFeeDto.getCurDegrees())) {
@@ -959,6 +959,7 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
             String computingFormula = feeDto.getComputingFormula();
 
             OwnerCarDto ownerCarDto = new OwnerCarDto();
+            ownerCarDto.setCarTypeCd("1001"); //业主车辆
             ownerCarDto.setCommunityId(feeDto.getCommunityId());
             ownerCarDto.setCarId(feeDto.getPayerObjId());
             List<OwnerCarDto> ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto);
@@ -987,7 +988,7 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
             } 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)) {
+            } else if ("4004".equals(computingFormula)) {
                 feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
             } else if ("5005".equals(computingFormula)) {
                 if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
@@ -1055,7 +1056,7 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
             } 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)) {  //动态费用
+            } else if ("4004".equals(computingFormula)) {  //动态费用
                 feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
             } else if ("5005".equals(computingFormula)) {  //(本期度数-上期度数)*单价+附加费
                 if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
@@ -1232,6 +1233,7 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
 
     /**
      * 计算 计费结束时间和 欠费月份(可能存在小数点)
+     *
      * @param feeDto
      * @param ownerCarDto
      * @return
@@ -1318,7 +1320,8 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
 
     /**
      * 计算 两个时间点月份
-     * @param fromDate  开始时间
+     *
+     * @param fromDate 开始时间
      * @param toDate   结束时间
      * @return
      */

+ 1 - 0
service-api/src/main/java/com/java110/api/listener/fee/ListFeeListener.java

@@ -143,6 +143,7 @@ public class ListFeeListener extends AbstractServiceApiListener {
 
     private void computeFeePriceByCar(FeeDto feeDto, double oweMonth) {
         OwnerCarDto ownerCarDto = new OwnerCarDto();
+        ownerCarDto.setCarTypeCd("1001"); //业主车辆
         ownerCarDto.setCommunityId(feeDto.getCommunityId());
         ownerCarDto.setCarId(feeDto.getPayerObjId());
         List<OwnerCarDto> ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto);

+ 1 - 0
service-api/src/main/java/com/java110/api/listener/fee/SaveParkingSpaceCreateFeeListener.java

@@ -118,6 +118,7 @@ public class SaveParkingSpaceCreateFeeListener extends AbstractServiceApiListene
             ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto);
         } else if ("2000".equals(reqJson.getString("locationTypeCd"))) {//车辆
             //ParkingSpaceDto parkingSpaceDto = new ParkingSpaceDto();
+            ownerCarDto.setCarTypeCd("1001"); //1001 业主车辆   1002 成员车辆
             ownerCarDto.setCommunityId(reqJson.getString("communityId"));
             ownerCarDto.setCarId(reqJson.getString("locationObjId"));
             ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto);

+ 1 - 0
service-api/src/main/java/com/java110/api/listener/owner/QueryOwnerCarsListener.java

@@ -104,6 +104,7 @@ public class QueryOwnerCarsListener extends AbstractServiceApiDataFlowListener {
 
         if (total > 0) {
             OwnerCarDto ownerCarDto = BeanConvertUtil.covertBean(reqJson, OwnerCarDto.class);
+            ownerCarDto.setCarTypeCd("1001"); //业主车辆
             ownerCarDtoList = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto);
 
             //小区20条时刷房屋和车位信息

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

@@ -136,6 +136,7 @@ public class QueryOweFeeImpl implements IQueryOweFee {
 
         } else if (FeeDto.PAYER_OBJ_TYPE_CAR.equals(feeDto.getPayerObjType())) {//车位相关
             OwnerCarDto ownerCarDto = new OwnerCarDto();
+            ownerCarDto.setCarTypeCd("1001"); //业主车辆
             ownerCarDto.setCommunityId(feeDto.getCommunityId());
             ownerCarDto.setCarId(feeDto.getPayerObjId());
             List<OwnerCarDto> ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto);

+ 19 - 6
service-report/src/main/java/com/java110/report/bmo/reportOweFee/impl/GetReportOweFeeBMOImpl.java

@@ -1,5 +1,6 @@
 package com.java110.report.bmo.reportOweFee.impl;
 
+import com.java110.dto.PageDto;
 import com.java110.dto.reportOweFee.ReportOweFeeDto;
 import com.java110.dto.reportOweFee.ReportOweFeeItemDto;
 import com.java110.intf.report.IReportOweFeeInnerServiceSMO;
@@ -34,15 +35,28 @@ public class GetReportOweFeeBMOImpl implements IGetReportOweFeeBMO {
 
         int count = reportOweFeeInnerServiceSMOImpl.queryReportOweFeesCount(reportOweFeeDto);
 
-        List<ReportOweFeeDto> reportOweFeeDtos = null;
+        List<ReportOweFeeDto> reportOweFeeDtos = new ArrayList<>();
         if (count > 0) {
-            reportOweFeeDtos = reportOweFeeInnerServiceSMOImpl.queryReportOweFees(reportOweFeeDto);
-            refreshReportOwe(reportOweFeeDtos, reportOweFeeDto.getConfigIds());
+            reportOweFeeDto.setPage(PageDto.DEFAULT_PAGE);
+            List<ReportOweFeeDto> reportOweFees = reportOweFeeInnerServiceSMOImpl.queryReportOweFees(reportOweFeeDto);
+            refreshReportOwe(reportOweFees, reportOweFeeDto.getConfigIds());
+            for (ReportOweFeeDto reportOweFee : reportOweFees) {
+                //获取欠费总金额
+                String amountOwed = reportOweFee.getAmountOwed();
+                if (!StringUtil.isEmpty(amountOwed)) {
+                    double amountOwedMoney = Double.parseDouble(amountOwed);
+                    if (amountOwedMoney > 0.0) {
+                        reportOweFeeDtos.add(reportOweFee);
+                    } else {
+                        continue;
+                    }
+                }
+            }
         } else {
             reportOweFeeDtos = new ArrayList<>();
         }
 
-        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reportOweFeeDto.getRow()), count, reportOweFeeDtos);
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) reportOweFeeDtos.size() / (double) reportOweFeeDto.getRow()), reportOweFeeDtos.size(), reportOweFeeDtos);
 
         ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
 
@@ -57,7 +71,6 @@ public class GetReportOweFeeBMOImpl implements IGetReportOweFeeBMO {
      */
     @Override
     public ResponseEntity<String> getAllFees(ReportOweFeeDto reportOweFeeDto) {
-        //
         List<ReportOweFeeDto> allReportOweFeeDtos = reportOweFeeInnerServiceSMOImpl.queryReportAllOweFees(reportOweFeeDto);
         if (allReportOweFeeDtos == null || allReportOweFeeDtos.size() < 1) {
             return ResultVo.createResponseEntity(allReportOweFeeDtos);
@@ -208,7 +221,7 @@ public class GetReportOweFeeBMOImpl implements IGetReportOweFeeBMO {
                 oldAmount = oldAmount.add(new BigDecimal(Double.parseDouble(reportOweFeeDto.getAmountOwed()))).setScale(2, BigDecimal.ROUND_HALF_EVEN);
                 reportOweFeeItemDto.setAmountOwed(oldAmount.doubleValue() + "");
             }
-            if(!StringUtil.isEmpty(reportOweFeeDto.getOwnerName()) && StringUtil.isEmpty(oldReportOweFeeDto.getOwnerName())) {
+            if (!StringUtil.isEmpty(reportOweFeeDto.getOwnerName()) && StringUtil.isEmpty(oldReportOweFeeDto.getOwnerName())) {
                 oldReportOweFeeDto.setOwnerName(reportOweFeeDto.getOwnerName());
             }
             oldReportOweFeeDto.setUpdateTime(reportOweFeeDto.getUpdateTime());