java110
2022-06-27 73080529e72816d1496693b17e3af506f675ef22
优化加入 递增功能
7个文件已修改
116 ■■■■ 已修改文件
java110-bean/src/main/java/com/java110/dto/fee/FeeAttrDto.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/fee/FeeConfigDto.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-fee/src/main/java/com/java110/fee/bmo/impl/QueryFeeByAttrImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-fee/src/main/java/com/java110/fee/bmo/impl/QueryOweFeeImpl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-fee/src/main/java/com/java110/fee/cmd/fee/SaveRoomCreateFeeCmd.java 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-job/src/main/java/com/java110/job/task/fee/GenerateBillTemplate.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/fee/FeeAttrDto.java
@@ -31,6 +31,18 @@
    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');
     */
java110-bean/src/main/java/com/java110/dto/fee/FeeConfigDto.java
@@ -34,6 +34,7 @@
    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";
java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java
@@ -283,6 +283,9 @@
            } 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 @@
            } 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();
@@ -344,6 +350,9 @@
                feeReceiptDetailPo.setArea("");
                feeReceiptDetailPo.setSquarePrice("0");
            } 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)) {
@@ -423,7 +432,14 @@
                }
                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 @@
            } 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 @@
                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 @@
                    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 @@
                    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 @@
                    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())) {
service-fee/src/main/java/com/java110/fee/bmo/impl/QueryFeeByAttrImpl.java
@@ -93,6 +93,8 @@
            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 @@
        } 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 {
service-fee/src/main/java/com/java110/fee/bmo/impl/QueryOweFeeImpl.java
@@ -448,6 +448,8 @@
            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 @@
        } 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)) {
service-fee/src/main/java/com/java110/fee/cmd/fee/SaveRoomCreateFeeCmd.java
@@ -79,13 +79,7 @@
        //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"));
@@ -109,6 +103,23 @@
                throw new IllegalArgumentException("结束时间错误" + reqJson.getString("endTime"));
            }
        }
        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 @@
                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()));
service-job/src/main/java/com/java110/job/task/fee/GenerateBillTemplate.java
@@ -445,7 +445,10 @@
        } 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 @@
            feePrice = 0;
        } else if ("1101".equals(computingFormula)) { // 租金
            feePrice = 0;
        } else if ("1102".equals(computingFormula)) { // 租金
            feePrice = 0;
        } else {
            feePrice = -1.00;
        }