| | |
| | | package com.java110.report.smo.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.core.smo.IComputeFeeSMO; |
| | | import com.java110.dto.RoomDto; |
| | | 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.ReportCarDto; |
| | | import com.java110.dto.report.ReportFeeDetailDto; |
| | | import com.java110.dto.report.ReportFeeDto; |
| | | import com.java110.dto.report.ReportRoomDto; |
| | | import com.java110.dto.reportFeeMonthStatistics.ReportFeeMonthStatisticsDto; |
| | | import com.java110.dto.reportFeeYearCollection.ReportFeeYearCollectionDto; |
| | | import com.java110.dto.reportFeeYearCollectionDetail.ReportFeeYearCollectionDetailDto; |
| | | import com.java110.dto.reportOweFee.ReportOweFeeDto; |
| | | import com.java110.dto.task.TaskDto; |
| | | import com.java110.intf.report.IGeneratorFeeYearStatisticsInnerServiceSMO; |
| | | import com.java110.intf.community.ICommunityInnerServiceSMO; |
| | | 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.reportFeeYearCollection.ReportFeeYearCollectionPo; |
| | | import com.java110.po.reportFeeYearCollectionDetail.ReportFeeYearCollectionDetailPo; |
| | | import com.java110.po.reportOweFee.ReportOweFeePo; |
| | | import com.java110.report.dao.IReportCommunityServiceDao; |
| | | import com.java110.report.dao.IReportFeeServiceDao; |
| | |
| | | import com.java110.report.dao.IReportFeeYearCollectionServiceDao; |
| | | import com.java110.report.dao.IReportOweFeeServiceDao; |
| | | import com.java110.service.smo.ISaveSystemErrorSMO; |
| | | import com.java110.utils.cache.CommonCache; |
| | | 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 com.java110.utils.util.ListUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.utils.util.*; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import com.java110.core.log.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.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.util.Calendar; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | @Autowired |
| | | private IReportOweFeeServiceDao reportOweFeeServiceDaoImpl; |
| | | |
| | | @Autowired |
| | | private ICommunityInnerServiceSMO communityInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public int generatorOweData(@RequestBody ReportFeeMonthStatisticsPo reportFeeMonthStatisticsPo) { |
| | | |
| | | doGeneratorData(reportFeeMonthStatisticsPo); |
| | | CommunityDto communityDto = new CommunityDto(); |
| | | |
| | | // List<CommunityDto> communityDtos = BeanConvertUtil.covertBeanList( |
| | | // reportCommunityServiceDaoImpl.getCommunitys(BeanConvertUtil.beanCovertMap(communityDto)), CommunityDto.class); |
| | | |
| | | List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto); |
| | | |
| | | for (CommunityDto tmpCommunityDto : communityDtos) { |
| | | reportFeeMonthStatisticsPo.setCommunityId(tmpCommunityDto.getCommunityId()); |
| | | doGeneratorData(reportFeeMonthStatisticsPo); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | |
| | | |
| | | Assert.hasLength(communityId, "未包含小区信息"); |
| | | |
| | | // |
| | | feeDataFiltering(communityId); |
| | | |
| | | //查询费用项 |
| | | FeeConfigDto feeConfigDto = new FeeConfigDto(); |
| | | feeConfigDto.setCommunityId(communityId); |
| | | |
| | | List<FeeConfigDto> feeConfigDtos = reportFeeServiceDaoImpl.getFeeConfigs(feeConfigDto); |
| | | List<FeeConfigDto> feeConfigDtos = BeanConvertUtil.covertBeanList(reportFeeServiceDaoImpl.getFeeConfigs( |
| | | BeanConvertUtil.beanCovertMap(feeConfigDto)), FeeConfigDto.class); |
| | | |
| | | for (FeeConfigDto tmpFeeConfigDto : feeConfigDtos) { |
| | | try { |
| | |
| | | } |
| | | |
| | | } |
| | | private void feeDataFiltering(String communityId) { |
| | | |
| | | Map reportFeeDto = new HashMap(); |
| | | reportFeeDto.put("communityId", communityId); |
| | | List<Map> feeDtos = reportOweFeeServiceDaoImpl.queryInvalidOweFee(reportFeeDto); |
| | | |
| | | List<String> feeIds = new ArrayList<>(); |
| | | for (Map feeDto : feeDtos) { |
| | | if (!feeDto.containsKey("feeId") || StringUtil.isNullOrNone(feeDto.get("feeId"))) { |
| | | continue; |
| | | } |
| | | |
| | | feeIds.add(feeDto.get("feeId").toString()); |
| | | |
| | | if (feeIds.size() >= 50) { |
| | | reportFeeDto.put("feeIds", feeIds); |
| | | reportOweFeeServiceDaoImpl.deleteInvalidFee(reportFeeDto); |
| | | feeIds = new ArrayList<>(); |
| | | } |
| | | } |
| | | reportFeeDto.put("feeIds", feeIds); |
| | | if (feeIds.size() > 0) { |
| | | reportOweFeeServiceDaoImpl.deleteInvalidFee(reportFeeDto); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 按费用项来出账 |
| | |
| | | List<ReportFeeDto> feeDtos = reportFeeServiceDaoImpl.getFees(feeDto); |
| | | |
| | | //没有关联费用 |
| | | if (feeDto == null || feeDtos.size() < 1) { |
| | | if (feeDtos == null || feeDtos.size() < 1) { |
| | | return; |
| | | } |
| | | for (ReportFeeDto tmpFeeDto : feeDtos) { |
| | |
| | | */ |
| | | private void generateFee(ReportFeeDto reportFeeDto, FeeConfigDto feeConfigDto) { |
| | | |
| | | FeeDto feeDto = BeanConvertUtil.covertBean(reportFeeDto,FeeDto.class); |
| | | FeeDto feeDto = BeanConvertUtil.covertBean(reportFeeDto, FeeDto.class); |
| | | //刷入欠费金额 |
| | | computeFeeSMOImpl.computeEveryOweFee(feeDto); |
| | | |