Sfoglia il codice sorgente

优化定时任务

wuxw 2 anni fa
parent
commit
1dfbfae46d

+ 50 - 0
java110-interface/src/main/java/com/java110/intf/fee/IRuleGeneratorPayFeeBillV1InnerServiceSMO.java

@@ -0,0 +1,50 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.intf.fee;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.payFeeRule.PayFeeRuleDto;
+import com.java110.po.payFeeRule.PayFeeRulePo;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.util.List;
+
+/**
+ * 类表述: 服务之前调用的接口类,不对外提供接口能力 只用于接口建调用
+ * add by 吴学文 at 2023-10-18 18:08:44 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@FeignClient(name = "fee-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/RuleGeneratorPayFeeBillV1Api")
+public interface IRuleGeneratorPayFeeBillV1InnerServiceSMO {
+
+    /**
+     * 将小区里的费用批量转换为一次性费用
+     *
+     * @param communityId 小区ID
+     * @return 大于1 转换成功 0 转换失败
+     */
+    @RequestMapping(value = "/savePayFeeRule", method = RequestMethod.POST)
+    int covertCommunityPayFee(@RequestBody String communityId);
+
+
+}

+ 1 - 1
service-acct/src/main/java/com/java110/acct/cmd/parkingCoupon/SaveParkingCouponCarCmd.java

@@ -160,7 +160,7 @@ public class SaveParkingCouponCarCmd extends Cmd {
                 throw new CmdException("优惠券递减失败");
             }
         } finally {
-            DistributedLock.releaseDistributedLock(requestId, key);
+            DistributedLock.releaseDistributedLock(key,requestId);
         }
 
         ParkingCouponCarPo parkingCouponCarPo = BeanConvertUtil.covertBean(reqJson, ParkingCouponCarPo.class);

+ 61 - 0
service-fee/src/main/java/com/java110/fee/smo/impl/RuleGeneratorPayFeeBillV1InnerServiceSMOImpl.java

@@ -0,0 +1,61 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.fee.smo.impl;
+
+
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.dto.PageDto;
+import com.java110.dto.payFeeRule.PayFeeRuleDto;
+import com.java110.fee.convertOnce.ICycleConvertOnceFee;
+import com.java110.fee.dao.IPayFeeRuleV1ServiceDao;
+import com.java110.intf.fee.IPayFeeRuleV1InnerServiceSMO;
+import com.java110.intf.fee.IRuleGeneratorPayFeeBillV1InnerServiceSMO;
+import com.java110.po.payFeeRule.PayFeeRulePo;
+import com.java110.utils.util.BeanConvertUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 类表述: 服务之前调用的接口实现类,不对外提供接口能力 只用于接口建调用
+ * add by 吴学文 at 2023-10-18 18:08:44 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@RestController
+public class RuleGeneratorPayFeeBillV1InnerServiceSMOImpl extends BaseServiceSMO implements IRuleGeneratorPayFeeBillV1InnerServiceSMO {
+
+    @Autowired
+    private ICycleConvertOnceFee cycleConvertOnceFeeImpl;
+
+
+    /**
+     * 将小区里的费用批量转换为一次性费用
+     *
+     * @param communityId 小区ID
+     * @return 大于1 转换成功 0 转换失败
+     */
+    @Override
+    public int covertCommunityPayFee(@RequestBody String communityId) {
+        return cycleConvertOnceFeeImpl.covertCommunityPayFee(communityId);
+    }
+}

+ 16 - 332
service-job/src/main/java/com/java110/job/task/fee/GenerateBillProTemplate.java

@@ -1,5 +1,6 @@
 package com.java110.job.task.fee;
 
+import com.java110.core.factory.CommunitySettingFactory;
 import com.java110.core.factory.GenerateCodeFactory;
 import com.java110.core.smo.IComputeFeeSMO;
 import com.java110.dto.room.RoomDto;
@@ -14,6 +15,7 @@ import com.java110.intf.community.IRoomInnerServiceSMO;
 import com.java110.intf.fee.IFeeConfigInnerServiceSMO;
 import com.java110.intf.fee.IFeeDetailInnerServiceSMO;
 import com.java110.intf.fee.IFeeInnerServiceSMO;
+import com.java110.intf.fee.IRuleGeneratorPayFeeBillV1InnerServiceSMO;
 import com.java110.intf.user.IOwnerCarInnerServiceSMO;
 import com.java110.intf.user.IOwnerRoomRelInnerServiceSMO;
 import com.java110.job.quartz.TaskSystemQuartz;
@@ -34,8 +36,9 @@ import java.util.List;
 import java.util.Map;
 
 /**
- * @ClassName GenerateOwnerBillTemplate
- * @Description TODO  房屋费用账单生成
+ * 根据 pay_fee_rule 生成 pay_fee 账单
+ * 只有小区设置了 按月生成费用 为ON是有效
+ *
  * @Author wuxw
  * @Date 2020/6/4 8:33
  * @Version 1.0
@@ -43,42 +46,15 @@ import java.util.Map;
  **/
 @Component
 public class GenerateBillProTemplate extends TaskSystemQuartz {
-    private static final String TASK_ATTR_BILL_TYPE = "10002"; // 出账类型
-
-    private static final String TASK_ATTR_VALUE_MONTH = "002"; //按月出账
-
-    private static final String TASK_ATTR_VALUE_DAY = "003"; //按日出账
-
-    private static final String TASK_ATTR_VALUE_YEAR = "001"; //按年出账
 
     private static final String TASK_ATTR_VALUE_ONCE_MONTH = "005"; //一次性按月出账
 
-    @Autowired
-    private IFeeConfigInnerServiceSMO feeConfigInnerServiceSMOImpl;
-
-    @Autowired
-    private IFeeInnerServiceSMO feeInnerServiceSMOImpl;
-
-    @Autowired
-    private IFeeDetailInnerServiceSMO feeDetailInnerServiceSMOImpl;
-
-    @Autowired
-    private IRoomInnerServiceSMO roomInnerServiceSMOImpl;
-
-    @Autowired
-    private IOwnerRoomRelInnerServiceSMO ownerRoomRelInnerServiceSMOImpl;
-
-    @Autowired
-    private IParkingSpaceInnerServiceSMO parkingSpaceInnerServiceSMOImpl;
-
-    @Autowired
-    private IOwnerCarInnerServiceSMO ownerCarInnerServiceSMOImpl;
 
     @Autowired
-    private IComputeFeeSMO computeFeeSMOImpl;
+    private ISaveSystemErrorSMO saveSystemErrorSMOImpl;
 
     @Autowired
-    private ISaveSystemErrorSMO saveSystemErrorSMOImpl;
+    private IRuleGeneratorPayFeeBillV1InnerServiceSMO ruleGeneratorPayFeeBillV1InnerServiceSMOImpl;
 
 
     @Override
@@ -89,8 +65,8 @@ public class GenerateBillProTemplate extends TaskSystemQuartz {
 
         for (CommunityDto communityDto : communityDtos) {
             try {
-                GenerateBill(taskDto, communityDto);
-            }catch (Throwable e){
+                doRuleCreatePayFeeBill(taskDto, communityDto);
+            } catch (Throwable e) {
 
                 LogSystemErrorPo logSystemErrorPo = new LogSystemErrorPo();
                 logSystemErrorPo.setErrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_errId));
@@ -104,313 +80,21 @@ public class GenerateBillProTemplate extends TaskSystemQuartz {
     }
 
     /**
-     * 根据小区生成账单
-     *
-     * @param communityDto
-     */
-    private void GenerateBill(TaskDto taskDto, CommunityDto communityDto) {
-
-        //查询费用项
-        FeeConfigDto feeConfigDto = new FeeConfigDto();
-        feeConfigDto.setCommunityId(communityDto.getCommunityId());
-        feeConfigDto.setBillType(getCurTaskAttr(taskDto, TASK_ATTR_BILL_TYPE).getValue());
-
-        if (StringUtil.isEmpty(feeConfigDto.getBillType())) {
-            throw new IllegalArgumentException("配置错误 未拿到属性值");
-        }
-        List<FeeConfigDto> feeConfigDtos = feeConfigInnerServiceSMOImpl.queryFeeConfigs(feeConfigDto);
-
-        for (FeeConfigDto tmpFeeConfigDto : feeConfigDtos) {
-            try {
-                GenerateBillByFeeConfig(taskDto, tmpFeeConfigDto);
-            } catch (Throwable e) {
-                LogSystemErrorPo logSystemErrorPo = new LogSystemErrorPo();
-                logSystemErrorPo.setErrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_errId));
-                logSystemErrorPo.setErrType(LogSystemErrorDto.ERR_TYPE_JOB);
-                logSystemErrorPo.setMsg(ExceptionUtil.getStackTrace(e));
-                saveSystemErrorSMOImpl.saveLog(logSystemErrorPo);
-                logger.error("费用出账失败" + tmpFeeConfigDto.getConfigId(), e);
-            }
-        }
-
-
-    }
-
-    /**
-     * 按费用项来出账
+     * 根据 pay_fee_rule 产生 账单
      *
      * @param taskDto
-     * @param feeConfigDto
-     */
-    private void GenerateBillByFeeConfig(TaskDto taskDto, FeeConfigDto feeConfigDto) throws Exception {
-
-        //当前费用项是否
-        BillDto tmpBillDto = new BillDto();
-        tmpBillDto.setCurBill("T");
-        tmpBillDto.setConfigId(feeConfigDto.getConfigId());
-        tmpBillDto.setCommunityId(feeConfigDto.getCommunityId());
-        Date startTime = getDefaultStartTime(feeConfigDto.getBillType());
-        tmpBillDto.setCurBillTime(DateUtil.getFormatTimeString(startTime, DateUtil.DATE_FORMATE_STRING_A));
-        List<BillDto> billDtos = feeInnerServiceSMOImpl.queryBills(tmpBillDto);
-
-        //Assert.listOnlyOne(billDtos, "当前存在多个有效账单" + feeConfigDto.getConfigId());
-        if (billDtos != null && billDtos.size() > 0) {
-            throw new TaskTemplateException(ResponseConstant.RESULT_CODE_ERROR, "已经出过账了");
-        }
-
-        String billId = GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_billId);
-        BillDto billDto = new BillDto();
-        billDto.setBillId(billId);
-        billDto.setBillName(feeConfigDto.getFeeName() + "-" + DateUtil.getFormatTimeString(new Date(), DateUtil.DATE_FORMATE_STRING_H));
-        billDto.setBillTime(DateUtil.getFormatTimeString(new Date(), DateUtil.DATE_FORMATE_STRING_B));
-        billDto.setCommunityId(feeConfigDto.getCommunityId());
-        billDto.setConfigId(feeConfigDto.getConfigId());
-        billDto.setCurBill("T");
-        //查询历史有效账单
-        tmpBillDto = new BillDto();
-        tmpBillDto.setCurBill("T");
-        tmpBillDto.setConfigId(feeConfigDto.getConfigId());
-        tmpBillDto.setCommunityId(feeConfigDto.getCommunityId());
-        billDtos = feeInnerServiceSMOImpl.queryBills(tmpBillDto);
-
-        startTime = (billDtos == null || billDtos.size() < 1) ? getDefaultStartTime(feeConfigDto.getBillType())
-                : DateUtil.getDateFromString(billDtos.get(0).getBillTime(), DateUtil.DATE_FORMATE_STRING_A);
-
-        FeeDto feeDto = new FeeDto();
-        feeDto.setConfigId(feeConfigDto.getConfigId());
-        feeDto.setCommunityId(feeConfigDto.getCommunityId());
-        List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto);
-
-        //没有关联费用不做出账
-        if (feeDto == null || feeDtos.size() < 1) {
-            return;
-        }
-        billDto.setReceivable("0");
-        billDto.setReceipts("0");
-        billDto.setCurReceivable("0");
-        for (FeeDto tmpFeeDto : feeDtos) {
-            try {
-                generateFee(startTime, tmpFeeDto, billDto, feeConfigDto);
-            } catch (Throwable e) {
-                LogSystemErrorPo logSystemErrorPo = new LogSystemErrorPo();
-                logSystemErrorPo.setErrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_errId));
-                logSystemErrorPo.setErrType(LogSystemErrorDto.ERR_TYPE_JOB);
-                logSystemErrorPo.setMsg(ExceptionUtil.getStackTrace(e));
-                saveSystemErrorSMOImpl.saveLog(logSystemErrorPo);
-                logger.error("生成费用失败", e);
-            }
-        }
-
-
-        //生成本次账单
-        Date billEndTime = DateUtil.getCurrentDate();
-        billDto.setRemark(DateUtil.getFormatTimeString(startTime, DateUtil.DATE_FORMATE_STRING_A) +
-                "-" + DateUtil.getFormatTimeString(billEndTime, DateUtil.DATE_FORMATE_STRING_A) + "账单数据");
-        feeInnerServiceSMOImpl.insertBill(billDto);
-
-    }
-
-    /**
-     * 生成 费用
-     *
-     * @param feeDto
-     */
-    private void generateFee(Date startTime, FeeDto feeDto, BillDto billDto, FeeConfigDto feeConfigDto) {
-
-        if (FeeDto.STATE_FINISH.equals(feeDto.getState())) { //判断是否缴费结束
-            return;
-        }
-
-        // 当前时间 - 开始时间  = 月份
-        // 月份/ 周期 = 轮数(向上取整)
-        // 轮数 * 周期 * 30 + 开始时间 = 目标 到期时间
-        // 到期时间 >= 目标到期时间===>结束
-        // 目标到期时间 - 到期时间 = 欠费月份
-        // 月份 * 每月单价 = 欠费金额
-
-        Map<String, Object> targetEndDateAndOweMonth = computeFeeSMOImpl.getTargetEndDateAndOweMonth(feeDto);
-        Date targetEndDate = (Date) targetEndDateAndOweMonth.get("targetEndDate");
-        double oweMonth = (double) targetEndDateAndOweMonth.get("oweMonth");
-
-        //当前时间
-        Date billEndTime = DateUtil.getCurrentDate();
-
-        //缴费周期
-        long paymentCycle = Long.parseLong(feeConfigDto.getPaymentCycle());
-
-
-        //说明没有欠费
-        if (oweMonth <= 0.0) {
-            return;
-        }
-        Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDto);
-        feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString()));
-        if (feeDto.getFeePrice() <= 0) {
-            return;//这个没有欠费可算
-        }
-
-        BillOweFeeDto billOweFeeDto = new BillOweFeeDto();
-        billOweFeeDto.setOweId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_oweId));
-        billOweFeeDto.setFeeId(feeDto.getFeeId());
-        billOweFeeDto.setBillId(billDto.getBillId());
-        BigDecimal curFeePrice = new BigDecimal(feeDto.getFeePrice());
-        curFeePrice = curFeePrice.multiply(new BigDecimal(paymentCycle));
-        billOweFeeDto.setAmountOwed(curFeePrice.doubleValue() + "");
-        BigDecimal feePrice = new BigDecimal(feeDto.getFeePrice());
-        feePrice = feePrice.multiply(new BigDecimal(oweMonth));
-
-        billOweFeeDto.setBillAmountOwed(feePrice.doubleValue() + "");
-        billOweFeeDto.setFeeEndTime(DateUtil.getFormatTimeString(feeDto.getEndTime(), DateUtil.DATE_FORMATE_STRING_A));
-        billOweFeeDto.setCommunityId(feeDto.getCommunityId());
-        billOweFeeDto.setPayerObjType(feeDto.getPayerObjType());
-        billOweFeeDto.setState("1000");
-        billOweFeeDto.setDeadlineTime(DateUtil.getFormatTimeString(targetEndDate, DateUtil.DATE_FORMATE_STRING_A));
-        if (FeeDto.PAYER_OBJ_TYPE_ROOM.equals(feeDto.getPayerObjType())) {
-            getRoomInfo(billOweFeeDto, feeDto);
-        } else {
-            getParkingSpaceInfo(billOweFeeDto, feeDto);
-        }
-
-        feeInnerServiceSMOImpl.insertBillOweFees(billOweFeeDto);
-
-        double recFee = StringUtil.isEmpty(billDto.getReceivable()) ? 0.0 : Double.parseDouble(billDto.getReceivable());
-
-        BigDecimal recFeeBig = new BigDecimal(recFee);
-        BigDecimal newRecFee = recFeeBig.add(feePrice);
-
-        //应收
-        billDto.setReceivable(newRecFee.doubleValue() + "");
-
-        //当期应收
-        double curRecFee = StringUtil.isEmpty(billDto.getCurReceivable()) ? 0.0 : Double.parseDouble(billDto.getCurReceivable());
-        BigDecimal curRecFeeBig = new BigDecimal(curRecFee);
-        BigDecimal curNewRecFee = curRecFeeBig.add(curFeePrice);
-        billDto.setCurReceivable(curNewRecFee.doubleValue() + "");
-
-        FeeDetailDto feeDetailDto = new FeeDetailDto();
-        feeDetailDto.setFeeId(feeDto.getFeeId());
-        feeDetailDto.setCommunityId(feeDto.getCommunityId());
-        feeDetailDto.setStartTime(startTime);
-        feeDetailDto.setEndTime(billEndTime);
-        List<FeeDetailDto> feeDetailDtos = feeDetailInnerServiceSMOImpl.queryFeeDetails(feeDetailDto);
-
-        double curReceiptFee = StringUtil.isEmpty(billDto.getReceipts()) ? 0.0 : Double.parseDouble(billDto.getReceipts());
-        BigDecimal curReceipts = new BigDecimal(curReceiptFee);
-        if (feeDetailDtos != null && feeDetailDtos.size() > 0) {
-            for (FeeDetailDto tmpFeeDetailDto : feeDetailDtos) {
-                BigDecimal recAmount = new BigDecimal(Double.parseDouble(tmpFeeDetailDto.getReceivedAmount()));
-                curReceipts = recAmount.add(curReceipts);
-            }
-        }
-        billDto.setReceipts(curReceipts.doubleValue() + "");
-    }
-
-    /**
-     * 查询车位信息
-     *
-     * @param billOweFeeDto
-     * @param feeDto
+     * @param communityDto
      */
-    private void getParkingSpaceInfo(BillOweFeeDto billOweFeeDto, FeeDto feeDto) {
-
-
-        OwnerCarDto ownerCarDto = new OwnerCarDto();
-        ownerCarDto.setWithOwner(true);
-        ownerCarDto.setCarId(feeDto.getPayerObjId());
-        ownerCarDto.setCommunityId(feeDto.getCommunityId());
-
-        List<OwnerCarDto> ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto);
-
-
-        if (ownerCarDtos == null || ownerCarDtos.size() < 1) {
-            //房屋可能被删除了
-            billOweFeeDto.setOwnerId("1");
-            billOweFeeDto.setOwnerName("未知");
-            billOweFeeDto.setOwnerTel("19999999999");
-            return;
-        }
+    private void doRuleCreatePayFeeBill(TaskDto taskDto, CommunityDto communityDto) {
 
-        billOweFeeDto.setPayerObjName(ownerCarDtos.get(0).getCarNum());
-        billOweFeeDto.setOwnerId(ownerCarDtos.get(0).getOwnerId());
-        billOweFeeDto.setOwnerName(ownerCarDtos.get(0).getOwnerName());
-        billOweFeeDto.setOwnerTel(ownerCarDtos.get(0).getLink());
-    }
-
-    /**
-     * 查询房屋信息
-     *
-     * @param billOweFeeDto
-     * @param feeDto
-     */
-    private void getRoomInfo(BillOweFeeDto billOweFeeDto, FeeDto feeDto) {
-        RoomDto roomDto = new RoomDto();
-        roomDto.setRoomId(feeDto.getPayerObjId());
-        roomDto.setCommunityId(feeDto.getCommunityId());
-        List<RoomDto> roomDtos = roomInnerServiceSMOImpl.queryRooms(roomDto);
+        String value = CommunitySettingFactory.getValue(communityDto.getCommunityId(), "PAY_FEE_MONTH");
 
-        if (roomDtos == null || roomDtos.size() < 1) {
-            //房屋可能被删除了
-            billOweFeeDto.setOweId("1");
-            billOweFeeDto.setOwnerId("-1");
-            billOweFeeDto.setOwnerName("未知");
-            billOweFeeDto.setOwnerTel("19999999999");
-            billOweFeeDto.setPayerObjName("未知");
+        //todo 小区没有按月缴费 skip
+        if (!"ON".equals(value)) {
             return;
         }
 
-        RoomDto tmpRoomDto = roomDtos.get(0);
-        if (RoomDto.ROOM_TYPE_ROOM.equals(tmpRoomDto.getRoomType())) {
-            billOweFeeDto.setPayerObjName(tmpRoomDto.getFloorNum() + "栋" + tmpRoomDto.getUnitNum() + "单元" + tmpRoomDto.getRoomNum() + "室");
-        } else {
-            billOweFeeDto.setPayerObjName(tmpRoomDto.getFloorNum() + "栋" + tmpRoomDto.getRoomNum() + "室");
-        }
-
-        OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto();
-        ownerRoomRelDto.setByOwnerInfo(true);
-        ownerRoomRelDto.setRoomId(tmpRoomDto.getRoomId());
-        ownerRoomRelDto.setCommunityId(feeDto.getCommunityId());
-        List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelInnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto);
-
-        if (ownerRoomRelDtos == null || ownerRoomRelDtos.size() < 1) {
-            //房屋可能被删除了
-            billOweFeeDto.setOweId("1");
-            billOweFeeDto.setOwnerId("-1");
-            billOweFeeDto.setOwnerName("未知");
-            billOweFeeDto.setOwnerTel("19999999999");
-            return;
-        }
-
-        billOweFeeDto.setOwnerId(ownerRoomRelDtos.get(0).getOwnerId());
-        billOweFeeDto.setOwnerName(ownerRoomRelDtos.get(0).getOwnerName());
-        billOweFeeDto.setOwnerTel(ownerRoomRelDtos.get(0).getLink());
-
-    }
-
-    private Date getDefaultStartTime(String billType) {
-        Calendar calendar = Calendar.getInstance();
-        calendar.setTime(new Date());
-        if (billType.equals(TASK_ATTR_VALUE_MONTH)) {
-            calendar.add(Calendar.MONTH, -1);
-            return calendar.getTime();
-        }
-
-        if (billType.equals(TASK_ATTR_VALUE_DAY)) {
-            calendar.add(Calendar.DATE, -1);
-            return calendar.getTime();
-        }
-
-        if (billType.equals(TASK_ATTR_VALUE_DAY)) {
-            calendar.add(Calendar.DATE, -1);
-            return calendar.getTime();
-        }
-
-        if (billType.equals(TASK_ATTR_VALUE_YEAR)) {
-            calendar.add(Calendar.YEAR, -1);
-            return calendar.getTime();
-        }
-
-        return calendar.getTime();
-
+        ruleGeneratorPayFeeBillV1InnerServiceSMOImpl.covertCommunityPayFee(communityDto.getCommunityId());
     }