java110 лет назад: 3
Родитель
Сommit
73080529e7

+ 12 - 0
java110-bean/src/main/java/com/java110/dto/fee/FeeAttrDto.java

@@ -31,6 +31,18 @@ public class FeeAttrDto extends PageDto implements Serializable {
     public static final String SPEC_CD_CAR_INOUT_ID = "390011";//车辆进场编号
     public static final String SPEC_CD_PAY_OBJECT_NAME = "390012";//付费对象名称
     public static final String SPEC_CD_COMBO_ID = "390013";//费用套餐ID
+    public static final String SPEC_CD_RATE_CYCLE = "390014";//递增周期
+    public static final String SPEC_CD_RATE = "390015";//递增率
+    public static final String SPEC_CD_RATE_START_TIME = "390016";//递增开始时间
+
+    /**
+     * INSERT INTO `tt`.`t_dict` ( `status_cd`, `name`, `description`, `create_time`, `table_name`, `table_columns`)
+     * VALUES ( '390014', '递增周期', '递增周期', '2020-01-30 17:09:43', 'pay_fee_attrs', 'spec_cd');
+     * INSERT INTO `tt`.`t_dict` ( `status_cd`, `name`, `description`, `create_time`, `table_name`, `table_columns`)
+     * VALUES ( '390015', '递增率', '递增率', '2020-01-30 17:09:43', 'pay_fee_attrs', 'spec_cd');
+     * INSERT INTO `tt`.`t_dict` ( `status_cd`, `name`, `description`, `create_time`, `table_name`, `table_columns`)
+     * VALUES ( '390016', '递增开始时间', '递增开始时间', '2020-01-30 17:09:43', 'pay_fee_attrs', 'spec_cd');
+     */
 
 
 

+ 1 - 0
java110-bean/src/main/java/com/java110/dto/fee/FeeConfigDto.java

@@ -34,6 +34,7 @@ public class FeeConfigDto extends PageDto implements Serializable {
     public static final String CONFIG_ID_GOODS = "930000000000000000";//商品费用项
 
     public static final String COMPUTING_FORMULA_TEMP_CAR = "9999";
+    public static final String COMPUTING_FORMULA_RANT_RATE = "1102"; // 租金递增
 
     public static final String PAYMENT_CD_PRE = "1200";
     public static final String PAYMENT_CD_AFTER = "2100";

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

@@ -283,6 +283,9 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
             } else if ("1101".equals(computingFormula)) { // 租金
                 feeReceiptDetailPo.setArea("");
                 feeReceiptDetailPo.setSquarePrice(roomDto.getRoomRent());
+            }  else if ("1102".equals(computingFormula)) { // 租金
+                feeReceiptDetailPo.setArea("");
+                feeReceiptDetailPo.setSquarePrice(roomDto.getRoomRent());
             } else if ("4004".equals(computingFormula)) {
             } else if ("5005".equals(computingFormula)) {
                 if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
@@ -318,7 +321,10 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
             } else if ("1101".equals(computingFormula)) { //租金
                 feeReceiptDetailPo.setArea(roomDtos.get(0).getBuiltUpArea());
                 feeReceiptDetailPo.setSquarePrice(roomDtos.get(0).getRoomRent());
-            } else {
+            } else if ("1102".equals(computingFormula)) { //租金
+                feeReceiptDetailPo.setArea(roomDtos.get(0).getBuiltUpArea());
+                feeReceiptDetailPo.setSquarePrice(roomDtos.get(0).getRoomRent());
+            }else {
             }
         } else if (FeeDto.PAYER_OBJ_TYPE_CAR.equals(feeDto.getPayerObjType())) {//车位相关
             String computingFormula = feeDto.getComputingFormula();
@@ -346,6 +352,9 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
             } else if ("1101".equals(computingFormula)) { // 租金
                 feeReceiptDetailPo.setArea("");
                 feeReceiptDetailPo.setSquarePrice("0");
+            } else if ("1102".equals(computingFormula)) { // 租金(递增)
+                feeReceiptDetailPo.setArea("");
+                feeReceiptDetailPo.setSquarePrice("0");
             } else if ("4004".equals(computingFormula)) {
             } else if ("5005".equals(computingFormula)) {
                 if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
@@ -423,7 +432,14 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
                 }
                 feeReceiptDetailPo.setArea(builtUpArea.doubleValue() + "");
                 feeReceiptDetailPo.setSquarePrice(feeDto.getSquarePrice() + "/" + feeDto.getAdditionalAmount());
-            } else if ("4004".equals(computingFormula)) {
+            } 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());
+            }else if ("4004".equals(computingFormula)) {
             } else if ("5005".equals(computingFormula)) {
                 if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
                 } else {
@@ -821,6 +837,9 @@ 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_UP);
+            }  else if ("1102".equals(computingFormula)) { // 租金
+                BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getRoomRent()));
+                feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_UP);
             } else if ("4004".equals(computingFormula)) {
                 feePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAmount()));
             } else if ("5005".equals(computingFormula)) {
@@ -873,7 +892,9 @@ 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 ("1102".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())) {
@@ -1011,6 +1032,13 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
                     BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
                     feeTotalPrice = additionalAmount.multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
                 }
+            }else if ("1102".equals(computingFormula)) { // 租金
+                BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(roomDto.getRoomRent()));
+                feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_UP);
+                if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                    BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                    feeTotalPrice = additionalAmount.multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                }
             } else if ("4004".equals(computingFormula)) {  //动态费用
                 feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
                 if (!StringUtil.isEmpty(feeDto.getCycle())) {
@@ -1125,7 +1153,14 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
                     BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
                     feeTotalPrice = additionalAmount.multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
                 }
-            } else if ("4004".equals(computingFormula)) {
+            }  else if ("1102".equals(computingFormula)) { // 租金
+                BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(roomDto.getRoomRent()));
+                feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_UP);
+                if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                    BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                    feeTotalPrice = additionalAmount.multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                }
+            }else if ("4004".equals(computingFormula)) {
                 feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
                 if (!StringUtil.isEmpty(feeDto.getCycle())) {
                     BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
@@ -1231,6 +1266,13 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
                     BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
                     feeTotalPrice = additionalAmount.multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
                 }
+            }else if ("1102".equals(computingFormula)) { // 租金
+                BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(roomDto.getRoomRent()));
+                feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_UP);
+                if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                    BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                    feeTotalPrice = additionalAmount.multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                }
             } else if ("4004".equals(computingFormula)) {  //动态费用
                 feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
                 if (!StringUtil.isEmpty(feeDto.getCycle())) {

+ 5 - 0
service-fee/src/main/java/com/java110/fee/bmo/impl/QueryFeeByAttrImpl.java

@@ -93,6 +93,8 @@ public class QueryFeeByAttrImpl implements IQueryFeeByAttr {
             feePrice = 0;
         } else if ("1101".equals(computingFormula)) { // 租金
             feePrice = 0;
+        } else if ("1102".equals(computingFormula)) { // 租金
+            feePrice = 0;
         } else if ("4004".equals(computingFormula)) {
             feePrice = Double.parseDouble(feeDto.getAmount());
         } else {
@@ -137,6 +139,9 @@ public class QueryFeeByAttrImpl implements IQueryFeeByAttr {
         } else if ("1101".equals(computingFormula)) { // 租金
             BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(roomDto.getRoomRent()));
             feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN).doubleValue();
+        } else if ("1102".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 {

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

@@ -448,6 +448,8 @@ public class QueryOweFeeImpl implements IQueryOweFee {
             feePrice = 0.0;
         } else if ("1101".equals(computingFormula)) { // 租金
             feePrice = 0.0;
+        }else if ("1102".equals(computingFormula)) { // 租金
+            feePrice = 0.0;
         } else if ("4004".equals(computingFormula)) {
             feePrice = Double.parseDouble(feeDto.getAmount());
         } else if ("5005".equals(computingFormula)) {
@@ -567,7 +569,10 @@ public class QueryOweFeeImpl implements IQueryOweFee {
         } 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)) {
+        } else if ("1102".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)) {
 

+ 28 - 6
service-fee/src/main/java/com/java110/fee/cmd/fee/SaveRoomCreateFeeCmd.java

@@ -79,13 +79,7 @@ public class SaveRoomCreateFeeCmd extends Cmd {
         //Assert.hasKeyAndValue(reqJson, "startTime", "未包含收费其实时间");
         //Assert.hasKeyAndValue(reqJson, "billType", "未包含出账类型");
         Assert.hasKeyAndValue(reqJson, "storeId", "未包含商户ID");
-    }
 
-    @Override
-    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
-        String userId = cmdDataFlowContext.getReqHeaders().get(CommonConstant.USER_ID);
-        reqJson.put("userId", userId);
-        List<RoomDto> roomDtos = null;
         FeeConfigDto feeConfigDto = new FeeConfigDto();
         feeConfigDto.setCommunityId(reqJson.getString("communityId"));
         feeConfigDto.setConfigId(reqJson.getString("configId"));
@@ -110,6 +104,23 @@ public class SaveRoomCreateFeeCmd extends Cmd {
             }
         }
 
+        if (FeeConfigDto.COMPUTING_FORMULA_RANT_RATE.equals(feeConfigDtos.get(0).getComputingFormula())){
+            Assert.hasKeyAndValue(reqJson, "rateCycle", "未包含递增周期");
+            Assert.hasKeyAndValue(reqJson, "rate", "未包含递增率");
+            Assert.hasKeyAndValue(reqJson, "rateStartTime", "未包含递增开始时间");
+            reqJson.put("configComputingFormula",feeConfigDtos.get(0).getComputingFormula());
+        }
+
+
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+        String userId = cmdDataFlowContext.getReqHeaders().get(CommonConstant.USER_ID);
+        reqJson.put("userId", userId);
+        List<RoomDto> roomDtos = null;
+
+
         //生成批次号
         generatorBatch(reqJson);
         //判断收费范围
@@ -223,6 +234,17 @@ public class SaveRoomCreateFeeCmd extends Cmd {
                 feeAttrsPos.add(feeBMOImpl.addFeeAttr(reqJson, context, FeeAttrDto.SPEC_CD_OWNER_LINK, roomDtos.get(roomIndex).getLink()));
                 feeAttrsPos.add(feeBMOImpl.addFeeAttr(reqJson, context, FeeAttrDto.SPEC_CD_OWNER_NAME, roomDtos.get(roomIndex).getOwnerName()));
             }
+
+            //定制开发 加入
+            //1、对合同约定的租金递增比例、递增年限各不相同的问题,支持按合同到期日期设租金递增比例。
+            //2、能自动设置递增的租金实行自动计算当月的租金。
+            if(reqJson.containsKey("configComputingFormula")
+                    && FeeConfigDto.COMPUTING_FORMULA_RANT_RATE.equals(reqJson.getString("configComputingFormula"))){
+                feeAttrsPos.add(feeBMOImpl.addFeeAttr(reqJson, context, FeeAttrDto.SPEC_CD_RATE_CYCLE, reqJson.getString("rateCycle")));
+                feeAttrsPos.add(feeBMOImpl.addFeeAttr(reqJson, context, FeeAttrDto.SPEC_CD_RATE, reqJson.getString("rate")));
+                feeAttrsPos.add(feeBMOImpl.addFeeAttr(reqJson, context, FeeAttrDto.SPEC_CD_RATE_START_TIME, reqJson.getString("rateStartTime")));
+            }
+
             //付费对象名称
             feeAttrsPos.add(feeBMOImpl.addFeeAttr(reqJson, context, FeeAttrDto.SPEC_CD_PAY_OBJECT_NAME,
                     roomDtos.get(roomIndex).getFloorNum() + "-" + roomDtos.get(roomIndex).getUnitNum() + "-" + roomDtos.get(roomIndex).getRoomNum()));

+ 6 - 1
service-job/src/main/java/com/java110/job/task/fee/GenerateBillTemplate.java

@@ -445,7 +445,10 @@ public class GenerateBillTemplate extends TaskSystemQuartz {
         } else if ("1101".equals(computingFormula)) { // 租金
             BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(roomDto.getRoomRent()));
             feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN).doubleValue();
-        } else {
+        }  else if ("1102".equals(computingFormula)) { // 租金
+            BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(roomDto.getRoomRent()));
+            feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN).doubleValue();
+        }else {
             feePrice = -1.00;
         }
 
@@ -485,6 +488,8 @@ public class GenerateBillTemplate extends TaskSystemQuartz {
             feePrice = 0;
         } else if ("1101".equals(computingFormula)) { // 租金
             feePrice = 0;
+        } else if ("1102".equals(computingFormula)) { // 租金
+            feePrice = 0;
         } else {
             feePrice = -1.00;
         }