| | |
| | | package com.java110.fee.feeMonth; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.core.log.LoggerFactory; |
| | | import com.java110.core.smo.IComputeFeeSMO; |
| | | import com.java110.dto.fee.FeeDetailDto; |
| | | import com.java110.dto.fee.FeeDto; |
| | | import com.java110.dto.payFeeDetailMonth.PayFeeDetailMonthDto; |
| | | import com.java110.dto.payFeeDetailMonth.PayFeeMonthOwnerDto; |
| | | import com.java110.dto.payFee.PayFeeMonthOwnerDto; |
| | | import com.java110.intf.fee.*; |
| | | import com.java110.po.payFeeDetailMonth.PayFeeDetailMonthPo; |
| | | import com.java110.intf.report.IGeneratorOweFeeInnerServiceSMO; |
| | | import com.java110.po.payFee.PayFeeDetailMonthPo; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.ListUtil; |
| | | import org.slf4j.Logger; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private IComputeFeeSMO computeFeeSMOImpl; |
| | | |
| | | public static final int DEFAULT_DEAL_COUNT = 200; |
| | | @Autowired |
| | | private IGeneratorOweFeeInnerServiceSMO generatorOweFeeInnerServiceSMOImpl; |
| | | |
| | | public static final int DEFAULT_DEAL_COUNT = 1000; |
| | | |
| | | /** |
| | | * 1.0 定时任务离散 小区数据 离散为 月数据 |
| | |
| | | @Async |
| | | @Override |
| | | public void doGeneratorOrRefreshAllFeeMonth(String communityId) { |
| | | |
| | | //todo 清理 pay_fee_detail_month |
| | | PayFeeDetailMonthPo payFeeDetailMonthPo = new PayFeeDetailMonthPo(); |
| | | payFeeDetailMonthPo.setCommunityId(communityId); |
| | | payFeeDetailMonthInnerServiceSMOImpl.deletePayFeeDetailMonth(payFeeDetailMonthPo); |
| | | |
| | | |
| | | FeeDto feeDto = new FeeDto(); |
| | |
| | | List<FeeDto> tmpFeeDtos = feeInnerServiceSMOImpl.queryFees(feeDto); |
| | | |
| | | Assert.listOnlyOne(tmpFeeDtos, "费用不存在"); |
| | | |
| | | feeDto = tmpFeeDtos.get(0); |
| | | //todo 查询 缴费明细 |
| | | FeeDetailDto feeDetailDto = new FeeDetailDto(); |
| | | feeDetailDto.setCommunityId(feeDto.getCommunityId()); |
| | |
| | | doGeneratorOrRefreshFeeMonth(tmpFeeDtos.get(0), communityId); |
| | | } |
| | | |
| | | /** |
| | | * 生成多个费用 并 离散到月 |
| | | * |
| | | * @param feeIds |
| | | * @param communityId |
| | | */ |
| | | @Override |
| | | @Async |
| | | public void doGeneratorFeeMonths(List<String> feeIds, String communityId) { |
| | | for (String feeId : feeIds) { |
| | | doGeneratorOrRefreshFeeMonth(feeId, communityId); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Async |
| | | public void doGeneratorOweFees(List<String> feeIds, String communityId) { |
| | | for (String feeId : feeIds) { |
| | | // todo 查询费用 |
| | | FeeDto feeDto = new FeeDto(); |
| | | feeDto.setCommunityId(communityId); |
| | | feeDto.setFeeId(feeId); |
| | | List<FeeDto> tmpFeeDtos = feeInnerServiceSMOImpl.queryFees(feeDto); |
| | | |
| | | if(ListUtil.isNull(tmpFeeDtos)){ |
| | | continue; |
| | | } |
| | | generatorOweFeeInnerServiceSMOImpl.computeOweFee(tmpFeeDtos.get(0)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | private void maxMonthDateToDeadlineTimeData(FeeDto feeDto, PayFeeMonthOwnerDto payFeeMonthOwnerDto, Double feePrice) { |
| | | |
| | | //todo 处理已经交过费的记录处理 |
| | | payFeeMonthHelp.waitDispersedFeeDetail(feeDto, payFeeMonthOwnerDto); |
| | | payFeeMonthHelp.waitDispersedFeeDetail(feeDto, payFeeMonthOwnerDto, feePrice); |
| | | |
| | | |
| | | //todo 处理 endTime 到 deadlineTime 的费用 |
| | | Date deadlineTime = computeFeeSMOImpl.getDeadlineTime(feeDto); |
| | | payFeeMonthHelp.waitDispersedOweFee(feeDto,payFeeMonthOwnerDto,feePrice,deadlineTime); |
| | | payFeeMonthHelp.waitDispersedOweFee(feeDto, payFeeMonthOwnerDto, feePrice, deadlineTime); |
| | | |
| | | } |
| | | |