Переглянути джерело

Merge branch 'master' of http://git.homecommunity.cn/supervip/MicroCommunity

java110 5 роки тому
батько
коміт
55c346cd82

+ 1 - 0
java110-core/src/main/java/com/java110/core/smo/IComputeFeeSMO.java

@@ -138,5 +138,6 @@ public interface IComputeFeeSMO {
     double getReportFeePrice(ReportFeeDto tmpReportFeeDto, ReportRoomDto reportRoomDto, ReportCarDto reportCarDto);
 
     void computeEveryOweFee(FeeDto tmpFeeDto);
+
     void computeEveryOweFee(FeeDto tmpFeeDto, RoomDto roomDto);
 }

+ 58 - 0
java110-db/src/main/resources/mapper/report/ReportCommunityServiceDaoImplMapper.xml

@@ -78,5 +78,63 @@
         </if>
     </select>
 
+    <!-- 查询小区信息 add by wuxw 2018-07-03 -->
+    <select id="getCommunitys" parameterType="Map" resultType="Map">
+        select t.address,t.nearby_landmarks,t.nearby_landmarks nearbyLandmarks,
+        t.city_code,t.city_code cityCode,t.name,t.status_cd,t.status_cd statusCd,t.tel,
+        t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.map_y,t.map_y mapY,
+        t.map_x,t.map_x mapX,t.state,ca.area_code areaCode,ca.area_name areaName,
+        ca.parent_area_code parentAreaCode,ca.parent_area_name parentAreaName,
+        t.community_area communityArea
+        from s_community t,city_area ca
+        where t.status_cd = '0'
+        and t.city_code = ca.area_code
+        and ca.status_cd = '0'
+        <if test="address !=null and address != ''">
+            and t.address= #{address}
+        </if>
+        <if test="nearbyLandmarks !=null and nearbyLandmarks != ''">
+            and t.nearby_landmarks= #{nearbyLandmarks}
+        </if>
+        <if test="cityCode !=null and cityCode != ''">
+            and t.city_code= #{cityCode}
+        </if>
+        <if test="name !=null and name != ''">
+            and t.name like concat('%',#{name},'%')
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="communityIds !=null">
+            and t.community_id in
+            <foreach collection="communityIds" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="mapY !=null and mapY != ''">
+            and t.map_y= #{mapY}
+        </if>
+        <if test="mapX !=null and mapX != ''">
+            and t.map_x= #{mapX}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
+        order by t.create_time ASC
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
+
+    </select>
+
+
+
+
 
 </mapper>

+ 80 - 0
java110-db/src/main/resources/mapper/report/ReportFeeServiceDaoImplMapper.xml

@@ -95,5 +95,85 @@
         </if>
     </select>
 
+    <!-- 查询费用配置信息 add by wuxw 2018-07-03 -->
+    <select id="getFeeConfigs" parameterType="com.java110.dto.fee.FeeConfigDto"
+            resultType="com.java110.dto.fee.FeeConfigDto">
+        select t.fee_type_cd,t.fee_type_cd feeTypeCd,t.computing_formula,t.computing_formula
+        computingFormula,t.additional_amount,t.additional_amount additionalAmount,t.status_cd,t.status_cd
+        statusCd,t.square_price,t.square_price squarePrice,t.is_default,t.is_default isDefault,t.config_id,t.config_id
+        configId,t.fee_flag,t.fee_flag feeFlag,t.fee_name,t.fee_name feeName,t.start_time,t.start_time
+        startTime,t.end_time,t.end_time endTime,t.community_id,t.community_id communityId,
+        td1.name feeTypeCdName,td2.name feeFlagName,t.bill_type billType,t.bill_type,td3.name billTypeName,
+        t.payment_cd,t.payment_cycle,t.payment_cd paymentCd,t.payment_cycle paymentCycle,
+        t.computing_formula_text,t.computing_formula_text computingFormulaText
+        from pay_fee_config t,t_dict td1,t_dict td2,t_dict td3
+        where 1 =1
+        and t.fee_type_cd = td1.status_cd
+        and td1.table_name = 'pay_fee_config'
+        and td1.table_columns = 'fee_type_cd'
+        and t.fee_flag = td2.status_cd
+        and td2.table_name = 'pay_fee_config'
+        and td2.table_columns = 'fee_flag'
+        and t.bill_type = td3.status_cd
+        and td3.table_name = 'pay_fee_config'
+        and td3.table_columns = 'bill_type'
+        <if test="feeTypeCd !=null and feeTypeCd != ''">
+            and t.fee_type_cd= #{feeTypeCd}
+        </if>
+        <if test="computingFormula !=null and computingFormula != ''">
+            and t.computing_formula= #{computingFormula}
+        </if>
+        <if test="additionalAmount !=null and additionalAmount != ''">
+            and t.additional_amount= #{additionalAmount}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="squarePrice !=null and squarePrice != ''">
+            and t.square_price= #{squarePrice}
+        </if>
+        <if test="isDefault !=null and isDefault != ''">
+            and t.is_default= #{isDefault}
+        </if>
+        <if test="configId !=null and configId != ''">
+            and t.config_id= #{configId}
+        </if>
+        <if test="feeFlag !=null and feeFlag != ''">
+            and t.fee_flag= #{feeFlag}
+        </if>
+        <if test="feeName !=null and feeName != ''">
+            and t.fee_name like '%${feeName}%'
+        </if>
+        <if test="startTime !=null ">
+            and t.start_time= #{startTime}
+        </if>
+        <if test="endTime !=null ">
+            and t.end_time= #{endTime}
+        </if>
+        <if test="valid !=null and valid == 1">
+            and t.end_time &gt; now()
+        </if>
+        <if test="curTime !=null ">
+            and t.end_time &gt; #{curTime}
+            and t.start_time &lt; #{curTime}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="paymentCd !=null and paymentCd != ''">
+            and t.payment_cd= #{paymentCd}
+        </if>
+        <if test="paymentCycle !=null and paymentCycle != ''">
+            and t.payment_cycle= #{paymentCycle}
+        </if>
+        <if test="billType !=null and billType != ''">
+            and t.bill_type= #{billType}
+        </if>
+        order by t.create_time desc
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
+    </select>
+
 
 </mapper>

+ 27 - 0
java110-interface/src/main/java/com/java110/intf/report/IGeneratorOweFeeInnerServiceSMO.java

@@ -0,0 +1,27 @@
+package com.java110.intf.report;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.po.reportFeeMonthStatistics.ReportFeeMonthStatisticsPo;
+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;
+
+/**
+ * @ClassName IGeneratorFeeMonthStatisticsInnerServiceSMO
+ * @Description TODO
+ * @Author wuxw
+ * @Date 2020/10/15 21:51
+ * @Version 1.0
+ * add by wuxw 2020/10/15
+ **/
+@FeignClient(name = "report-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/generatorOweFeeInnerServiceSMOApi")
+public interface IGeneratorOweFeeInnerServiceSMO {
+
+
+
+    @RequestMapping(value = "/generatorOweData", method = RequestMethod.POST)
+    public int generatorOweData(@RequestBody ReportFeeMonthStatisticsPo reportFeeMonthStatisticsPo);
+
+}

+ 21 - 0
service-job/src/main/java/com/java110/job/task/fee/GenerateOweFeeTemplate.java

@@ -6,8 +6,10 @@ import com.java110.dto.community.CommunityDto;
 import com.java110.dto.fee.FeeAttrDto;
 import com.java110.dto.fee.FeeConfigDto;
 import com.java110.dto.fee.FeeDto;
+import com.java110.dto.logSystemError.LogSystemErrorDto;
 import com.java110.dto.reportOweFee.ReportOweFeeDto;
 import com.java110.dto.task.TaskDto;
+import com.java110.intf.common.ILogSystemErrorInnerServiceSMO;
 import com.java110.intf.community.IParkingSpaceInnerServiceSMO;
 import com.java110.intf.community.IRoomInnerServiceSMO;
 import com.java110.intf.fee.IFeeConfigInnerServiceSMO;
@@ -17,8 +19,11 @@ import com.java110.intf.report.IReportOweFeeInnerServiceSMO;
 import com.java110.intf.user.IOwnerCarInnerServiceSMO;
 import com.java110.intf.user.IOwnerRoomRelInnerServiceSMO;
 import com.java110.job.quartz.TaskSystemQuartz;
+import com.java110.po.logSystemError.LogSystemErrorPo;
 import com.java110.po.reportOweFee.ReportOweFeePo;
+import com.java110.service.smo.ISaveSystemErrorSMO;
 import com.java110.utils.util.DateUtil;
+import com.java110.utils.util.ExceptionUtil;
 import com.java110.utils.util.StringUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
@@ -64,6 +69,12 @@ public class GenerateOweFeeTemplate extends TaskSystemQuartz {
     @Autowired
     private IComputeFeeSMO computeFeeSMOImpl;
 
+    @Autowired
+    private ILogSystemErrorInnerServiceSMO logSystemErrorInnerServiceSMOImpl;
+
+    @Autowired
+    private ISaveSystemErrorSMO saveSystemErrorSMOImpl;
+
     @Override
     protected void process(TaskDto taskDto) throws Exception {
 
@@ -93,6 +104,11 @@ public class GenerateOweFeeTemplate extends TaskSystemQuartz {
             try {
                 GenerateOweFeeByFeeConfig(taskDto, tmpFeeConfigDto);
             } catch (Exception 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);
             }
         }
@@ -123,6 +139,11 @@ public class GenerateOweFeeTemplate extends TaskSystemQuartz {
             try {
                 generateFee(tmpFeeDto, feeConfigDto);
             } catch (Exception 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);
             }
         }

+ 39 - 0
service-job/src/main/java/com/java110/job/task/report/GenerateOweFeeNewTemplate.java

@@ -0,0 +1,39 @@
+package com.java110.job.task.report;
+
+import com.java110.dto.task.TaskDto;
+import com.java110.intf.report.IGeneratorOweFeeInnerServiceSMO;
+import com.java110.job.quartz.TaskSystemQuartz;
+import com.java110.po.reportFeeMonthStatistics.ReportFeeMonthStatisticsPo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * @ClassName GenerateOwnerBillTemplate
+ * @Description TODO  房屋费用账单生成
+ * @Author wuxw
+ * @Date 2020/6/4 8:33
+ * @Version 1.0
+ * add by wuxw 2020/6/4
+ **/
+@Component
+public class GenerateOweFeeNewTemplate extends TaskSystemQuartz {
+    private static final Logger logger = LoggerFactory.getLogger(GenerateOweFeeNewTemplate.class);
+
+    @Autowired
+    private IGeneratorOweFeeInnerServiceSMO generatorOweFeeInnerServiceSMOImpl;
+
+
+    @Override
+    protected void process(TaskDto taskDto) throws Exception {
+        GenerateFeeYearStatistic(taskDto);
+    }
+
+    private void GenerateFeeYearStatistic(TaskDto taskDto) {
+        ReportFeeMonthStatisticsPo reportFeeMonthStatisticsPo = new ReportFeeMonthStatisticsPo();
+        generatorOweFeeInnerServiceSMOImpl.generatorOweData(reportFeeMonthStatisticsPo);
+    }
+
+
+}

+ 7 - 1
service-report/src/main/java/com/java110/report/ReportServiceApplicationStart.java

@@ -37,7 +37,13 @@ import java.nio.charset.Charset;
 @EnableDiscoveryClient
 @Java110ListenerDiscovery(listenerPublishClass = BusinessServiceDataFlowEventPublishing.class,
         basePackages = {"com.java110.report.listener"})
-@EnableFeignClients(basePackages = {"com.java110.intf.user","com.java110.intf.order"})
+@EnableFeignClients(basePackages = {"com.java110.intf.user",
+        "com.java110.intf.order",
+        "com.java110.intf.common",
+        "com.java110.intf.store",
+        "com.java110.intf.user",
+        "com.java110.intf.fee",
+        "com.java110.intf.community"})
 public class ReportServiceApplicationStart {
 
     private static Logger logger = LoggerFactory.getLogger(ReportServiceApplicationStart.class);

+ 9 - 0
service-report/src/main/java/com/java110/report/dao/IReportCommunityServiceDao.java

@@ -1,9 +1,11 @@
 package com.java110.report.dao;
 
+import com.java110.dto.community.CommunityDto;
 import com.java110.dto.report.ReportCarDto;
 import com.java110.dto.report.ReportRoomDto;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @ClassName ICommunityServiceDao
@@ -45,4 +47,11 @@ public interface IReportCommunityServiceDao {
      * @return
      */
     List<ReportCarDto> getCarParkingSpace(ReportCarDto reportCarDto);
+
+    /**
+     * 查询 房屋 楼栋 单元 和 业主 信息
+     *
+     * @return
+     */
+    List<Map> getCommunitys(Map communityDto);
 }

+ 8 - 0
service-report/src/main/java/com/java110/report/dao/IReportFeeServiceDao.java

@@ -1,10 +1,12 @@
 package com.java110.report.dao;
 
+import com.java110.dto.fee.FeeConfigDto;
 import com.java110.dto.report.ReportFeeDetailDto;
 import com.java110.dto.report.ReportFeeDto;
 import com.java110.dto.report.ReportRoomDto;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @ClassName ICommunityServiceDao
@@ -29,6 +31,12 @@ public interface IReportFeeServiceDao {
      */
     List<ReportFeeDto> getFees(ReportFeeDto reportFeeDto);
 
+    /**
+     * 查询 房屋 楼栋 单元 和 业主 信息
+     * @return
+     */
+    List<Map> getFeeConfigs(Map reportFeeDto);
+
     /**
      * 实收费用查询
      * @param reportFeeDetailDto

+ 10 - 0
service-report/src/main/java/com/java110/report/dao/impl/ReportCommunityServiceDaoImpl.java

@@ -2,6 +2,7 @@ package com.java110.report.dao.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.dto.community.CommunityDto;
 import com.java110.dto.report.ReportCarDto;
 import com.java110.dto.report.ReportRoomDto;
 import com.java110.report.dao.IReportCommunityServiceDao;
@@ -72,4 +73,13 @@ public class ReportCommunityServiceDaoImpl extends BaseServiceDao implements IRe
 
         return carDtos;
     }
+
+    @Override
+    public List<Map> getCommunitys(Map communityDto) {
+        logger.debug("查询getCommunitys信息 入参 info : {}", JSONObject.toJSONString(communityDto));
+
+        List<Map> communityDtos = sqlSessionTemplate.selectList("reportCommunityServiceDaoImpl.getCommunitys", communityDto);
+
+        return communityDtos;
+    }
 }

+ 10 - 0
service-report/src/main/java/com/java110/report/dao/impl/ReportFeeServiceDaoImpl.java

@@ -2,6 +2,7 @@ package com.java110.report.dao.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.dto.fee.FeeConfigDto;
 import com.java110.dto.report.ReportFeeDetailDto;
 import com.java110.dto.report.ReportFeeDto;
 import com.java110.report.dao.IReportFeeServiceDao;
@@ -46,6 +47,15 @@ public class ReportFeeServiceDaoImpl extends BaseServiceDao implements IReportFe
         return roomDtos;
     }
 
+    @Override
+    public List<Map> getFeeConfigs(Map reportFeeDto) {
+        logger.debug("getFeeConfigs 入参 info : {}", JSONObject.toJSONString(reportFeeDto));
+
+        List<Map> feeConfigDtos = sqlSessionTemplate.selectList("reportFeeServiceDaoImpl.getFeeConfigs", reportFeeDto);
+
+        return feeConfigDtos;
+    }
+
     @Override
     public double getFeeReceivedAmount(ReportFeeDetailDto reportFeeDetailDto) {
         logger.debug("查询实收费用 入参 info : {}", JSONObject.toJSONString(reportFeeDetailDto));

+ 197 - 0
service-report/src/main/java/com/java110/report/smo/impl/GeneratorOweFeeInnerServiceSMOImpl.java

@@ -0,0 +1,197 @@
+package com.java110.report.smo.impl;
+
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.core.smo.IComputeFeeSMO;
+import com.java110.dto.community.CommunityDto;
+import com.java110.dto.fee.FeeAttrDto;
+import com.java110.dto.fee.FeeConfigDto;
+import com.java110.dto.fee.FeeDto;
+import com.java110.dto.logSystemError.LogSystemErrorDto;
+import com.java110.dto.report.ReportFeeDto;
+import com.java110.dto.reportOweFee.ReportOweFeeDto;
+import com.java110.intf.report.IGeneratorOweFeeInnerServiceSMO;
+import com.java110.intf.user.IOwnerCarInnerServiceSMO;
+import com.java110.po.logSystemError.LogSystemErrorPo;
+import com.java110.po.reportFeeMonthStatistics.ReportFeeMonthStatisticsPo;
+import com.java110.po.reportOweFee.ReportOweFeePo;
+import com.java110.report.dao.IReportCommunityServiceDao;
+import com.java110.report.dao.IReportFeeServiceDao;
+import com.java110.report.dao.IReportFeeYearCollectionDetailServiceDao;
+import com.java110.report.dao.IReportFeeYearCollectionServiceDao;
+import com.java110.report.dao.IReportOweFeeServiceDao;
+import com.java110.service.smo.ISaveSystemErrorSMO;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.utils.util.DateUtil;
+import com.java110.utils.util.ExceptionUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName GeneratorFeeMonthStatisticsInnerServiceSMOImpl
+ * @Description TODO
+ * @Author wuxw
+ * @Date 2020/10/15 21:53
+ * @Version 1.0
+ * add by wuxw 2020/10/15
+ **/
+@RestController
+public class GeneratorOweFeeInnerServiceSMOImpl implements IGeneratorOweFeeInnerServiceSMO {
+    private static final Logger logger = LoggerFactory.getLogger(GeneratorOweFeeInnerServiceSMOImpl.class);
+
+    //默认 处理房屋数量
+    private static final int DEFAULT_DEAL_ROOM_COUNT = 1000;
+
+    private static final String RECEIVED_TIME = "RECEIVED_TIME";
+    private static final String RECEIVED_TIME_START = "START";
+    private static final String RECEIVED_TIME_END = "END";
+
+    @Autowired
+    private IReportFeeYearCollectionServiceDao reportFeeYearCollectionServiceDaoImpl;
+
+    @Autowired
+    private IReportFeeYearCollectionDetailServiceDao reportFeeYearCollectionDetailServiceDaoImpl;
+
+    @Autowired
+    private IReportCommunityServiceDao reportCommunityServiceDaoImpl;
+
+    @Autowired
+    private IReportFeeServiceDao reportFeeServiceDaoImpl;
+
+    @Autowired
+    private IComputeFeeSMO computeFeeSMOImpl;
+
+    @Autowired
+    private IOwnerCarInnerServiceSMO ownerCarInnerServiceSMOImpl;
+
+    @Autowired
+    private ISaveSystemErrorSMO saveSystemErrorSMOImpl;
+
+    @Autowired
+    private IReportOweFeeServiceDao reportOweFeeServiceDaoImpl;
+
+    @Override
+    public int generatorOweData(@RequestBody ReportFeeMonthStatisticsPo reportFeeMonthStatisticsPo) {
+
+        CommunityDto communityDto = new CommunityDto();
+
+        List<CommunityDto> communityDtos = BeanConvertUtil.covertBeanList(
+                reportCommunityServiceDaoImpl.getCommunitys(BeanConvertUtil.beanCovertMap(communityDto)), CommunityDto.class);
+
+        for (CommunityDto tmpCommunityDto : communityDtos) {
+            reportFeeMonthStatisticsPo.setCommunityId(tmpCommunityDto.getCommunityId());
+            doGeneratorData(reportFeeMonthStatisticsPo);
+        }
+        return 0;
+    }
+
+    @Async
+    private void doGeneratorData(ReportFeeMonthStatisticsPo reportFeeMonthStatisticsPo) {
+        String communityId = reportFeeMonthStatisticsPo.getCommunityId();
+
+        Assert.hasLength(communityId, "未包含小区信息");
+
+        //查询费用项
+        FeeConfigDto feeConfigDto = new FeeConfigDto();
+        feeConfigDto.setCommunityId(communityId);
+
+        List<FeeConfigDto> feeConfigDtos = BeanConvertUtil.covertBeanList(reportFeeServiceDaoImpl.getFeeConfigs(
+                BeanConvertUtil.beanCovertMap(feeConfigDto)), FeeConfigDto.class);
+
+        for (FeeConfigDto tmpFeeConfigDto : feeConfigDtos) {
+            try {
+                GenerateOweFeeByFeeConfig(tmpFeeConfigDto);
+            } catch (Exception 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);
+            }
+        }
+
+    }
+
+    /**
+     * 按费用项来出账
+     *
+     * @param feeConfigDto
+     */
+    private void GenerateOweFeeByFeeConfig(FeeConfigDto feeConfigDto) throws Exception {
+
+        //当前费用项是否
+
+        ReportFeeDto feeDto = new ReportFeeDto();
+        feeDto.setConfigId(feeConfigDto.getConfigId());
+        feeDto.setCommunityId(feeConfigDto.getCommunityId());
+        List<ReportFeeDto> feeDtos = reportFeeServiceDaoImpl.getFees(feeDto);
+
+        //没有关联费用
+        if (feeDto == null || feeDtos.size() < 1) {
+            return;
+        }
+        for (ReportFeeDto tmpFeeDto : feeDtos) {
+            try {
+                generateFee(tmpFeeDto, feeConfigDto);
+            } catch (Exception 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);
+            }
+        }
+
+    }
+
+    /**
+     * 生成 费用
+     *
+     * @param reportFeeDto
+     */
+    private void generateFee(ReportFeeDto reportFeeDto, FeeConfigDto feeConfigDto) {
+
+        FeeDto feeDto = BeanConvertUtil.covertBean(reportFeeDto, FeeDto.class);
+        //刷入欠费金额
+        computeFeeSMOImpl.computeEveryOweFee(feeDto);
+
+        //保存数据
+        ReportOweFeePo reportOweFeePo = new ReportOweFeePo();
+        reportOweFeePo.setAmountOwed(feeDto.getFeePrice() + "");
+        reportOweFeePo.setCommunityId(feeDto.getCommunityId());
+        reportOweFeePo.setConfigId(feeConfigDto.getConfigId());
+        reportOweFeePo.setConfigName(feeConfigDto.getFeeName());
+        reportOweFeePo.setDeadlineTime(DateUtil.getFormatTimeString(feeDto.getDeadlineTime(), DateUtil.DATE_FORMATE_STRING_A));
+        reportOweFeePo.setEndTime(DateUtil.getFormatTimeString(feeDto.getEndTime(), DateUtil.DATE_FORMATE_STRING_A));
+        reportOweFeePo.setFeeId(feeDto.getFeeId());
+        reportOweFeePo.setFeeName(feeDto.getFeeName());
+        reportOweFeePo.setOwnerId(FeeAttrDto.getFeeAttrValue(feeDto, FeeAttrDto.SPEC_CD_OWNER_ID));
+        reportOweFeePo.setOwnerName(FeeAttrDto.getFeeAttrValue(feeDto, FeeAttrDto.SPEC_CD_OWNER_NAME));
+        reportOweFeePo.setOwnerTel(FeeAttrDto.getFeeAttrValue(feeDto, FeeAttrDto.SPEC_CD_OWNER_LINK));
+        reportOweFeePo.setPayerObjId(feeDto.getPayerObjId());
+        reportOweFeePo.setPayerObjName(computeFeeSMOImpl.getFeeObjName(feeDto));
+        reportOweFeePo.setPayerObjType(feeDto.getPayerObjType());
+        reportOweFeePo.setUpdateTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
+        ReportOweFeeDto reportOweFeeDto = new ReportOweFeeDto();
+        reportOweFeeDto.setFeeId(feeDto.getFeeId());
+        reportOweFeeDto.setPayerObjId(feeDto.getPayerObjId());
+        List<Map> reportOweFeeDtos = reportOweFeeServiceDaoImpl.queryReportAllOweFees(BeanConvertUtil.beanCovertMap(reportOweFeeDto));
+        if (reportOweFeeDtos == null || reportOweFeeDtos.size() < 1) {
+            reportOweFeePo.setOweId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_oweId));
+            reportOweFeeServiceDaoImpl.saveReportOweFeeInfo(BeanConvertUtil.beanCovertMap(reportOweFeePo));
+        } else {
+            reportOweFeePo.setOweId(reportOweFeeDtos.get(0).get("oweId").toString());
+            reportOweFeeServiceDaoImpl.updateReportOweFeeInfo(BeanConvertUtil.beanCovertMap(reportOweFeePo));
+        }
+    }
+
+}