java110 %!s(int64=5) %!d(string=hai) anos
pai
achega
5b795387f8

+ 18 - 0
java110-bean/src/main/java/com/java110/dto/feeReceipt/FeeReceiptDetailDto.java

@@ -30,6 +30,8 @@ public class FeeReceiptDetailDto extends PageDto implements Serializable {
     private String squarePrice;
     private String remark;
     private String feeFlag;
+    private String preDegrees;
+    private String curDegrees;
 
 
     private Date createTime;
@@ -173,4 +175,20 @@ public class FeeReceiptDetailDto extends PageDto implements Serializable {
     public void setDetailIds(String[] detailIds) {
         this.detailIds = detailIds;
     }
+
+    public String getPreDegrees() {
+        return preDegrees;
+    }
+
+    public void setPreDegrees(String preDegrees) {
+        this.preDegrees = preDegrees;
+    }
+
+    public String getCurDegrees() {
+        return curDegrees;
+    }
+
+    public void setCurDegrees(String curDegrees) {
+        this.curDegrees = curDegrees;
+    }
 }

+ 61 - 4
java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java

@@ -279,7 +279,7 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
             } else if ("7007".equals(computingFormula)) { //自定义公式
                 feeReceiptDetailPo.setArea(roomDtos.get(0).getBuiltUpArea());
                 feeReceiptDetailPo.setSquarePrice(feeDto.getComputingFormulaText());
-            }else if ("9009".equals(computingFormula)) {
+            } else if ("9009".equals(computingFormula)) {
                 if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
                 } else {
                     BigDecimal curDegree = new BigDecimal(Double.parseDouble(feeDto.getCurDegrees()));
@@ -349,7 +349,64 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
                     feeReceiptDetailPo.setArea(sub.doubleValue() + "");
                     feeReceiptDetailPo.setSquarePrice(feeDto.getMwPrice() + "/" + feeDto.getAdditionalAmount());
                 }
-            }else {
+            } else {
+            }
+        } else if (FeeDto.PAYER_OBJ_TYPE_CONTRACT.equals(feeDto.getPayerObjType())) {//车位相关
+            String computingFormula = feeDto.getComputingFormula();
+            ContractRoomDto contractRoomDto = new ContractRoomDto();
+            contractRoomDto.setContractId(feeDto.getPayerObjId());
+            contractRoomDto.setCommunityId(feeDto.getCommunityId());
+            List<ContractRoomDto> contractRoomDtos = contractRoomInnerServiceSMOImpl.queryContractRooms(contractRoomDto);
+            if (contractRoomDtos == null || contractRoomDtos.size() != 1) {
+                return;
+            }
+            if ("1001".equals(computingFormula)) { //面积*单价+附加费
+                BigDecimal builtUpArea = new BigDecimal(0);
+                for (ContractRoomDto tmpContractRoomDto : contractRoomDtos) {
+                    builtUpArea = builtUpArea.add(new BigDecimal(Double.parseDouble(tmpContractRoomDto.getBuiltUpArea())));
+                }
+                feeReceiptDetailPo.setArea(builtUpArea.doubleValue() + "");
+                feeReceiptDetailPo.setSquarePrice(feeDto.getSquarePrice() + "/" + feeDto.getAdditionalAmount());
+            } else if ("2002".equals(computingFormula)) { // 固定费用
+                feeReceiptDetailPo.setArea("");
+                feeReceiptDetailPo.setSquarePrice(feeDto.getAdditionalAmount());
+            } else if ("4004".equals(computingFormula)) {
+            } else if ("5005".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.getSquarePrice() + "/" + feeDto.getAdditionalAmount());
+                }
+            } else if ("6006".equals(computingFormula)) {
+                String value = "";
+                List<FeeAttrDto> feeAttrDtos = feeDto.getFeeAttrDtos();
+                for (FeeAttrDto feeAttrDto : feeAttrDtos) {
+                    if (feeAttrDto.getSpecCd().equals(FeeAttrDto.SPEC_CD_PROXY_CONSUMPTION)) {
+                        value = feeAttrDto.getValue();
+                    }
+                }
+                feeReceiptDetailPo.setArea(value);
+                feeReceiptDetailPo.setSquarePrice(feeDto.getSquarePrice() + "/" + feeDto.getAdditionalAmount());
+            } else if ("7007".equals(computingFormula)) { //自定义公式
+                BigDecimal builtUpArea = new BigDecimal(0);
+                for (ContractRoomDto tmpContractRoomDto : contractRoomDtos) {
+                    builtUpArea = builtUpArea.add(new BigDecimal(Double.parseDouble(tmpContractRoomDto.getBuiltUpArea())));
+                }
+                feeReceiptDetailPo.setArea(builtUpArea.doubleValue() + "");
+                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 {
             }
         }
     }
@@ -714,7 +771,7 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
                 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)) {
+            } else if ("9009".equals(computingFormula)) {
                 if (StringUtil.isEmpty(tmpReportFeeDto.getCurDegrees())) {
                     //throw new IllegalArgumentException("抄表数据异常");
                 } else {
@@ -761,7 +818,7 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
                 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)) {
+            } else if ("9009".equals(computingFormula)) {
                 if (StringUtil.isEmpty(tmpReportFeeDto.getCurDegrees())) {
                     throw new IllegalArgumentException("抄表数据异常");
                 } else {

+ 2 - 1
java110-db/src/main/resources/mapper/fee/FeeReceiptDetailServiceDaoImplMapper.xml

@@ -32,11 +32,12 @@
         select t.area,t.amount,t.fee_name,t.fee_name feeName,t.detail_id,t.detail_id detailId,t.start_time,t.start_time
         startTime,t.status_cd,t.status_cd statusCd,t.end_time,t.end_time endTime,t.community_id,t.community_id
         communityId,t.receipt_id,t.receipt_id receiptId,t.fee_id,t.fee_id feeId,t.cycle,t.square_price squarePrice,
-        pfd.remark,pf.fee_flag feeFlag
+        pfd.remark,pf.fee_flag feeFlag,mw.pre_degrees preDegrees,mw.cur_degrees curDegrees
         from fee_receipt_detail t
         left join pay_fee_detail pfd on t.detail_id = pfd.detail_id and pfd.status_cd = '0' and t.community_id =
         pfd.community_id
         left join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' and t.community_id = pf.community_id
+        LEFT JOIN meter_water mw on t.fee_id = mw.fee_id and mw.status_cd = '0' and t.community_id = mw.community_id
         where 1 =1
 
         <if test="area !=null and area != ''">