java110
2020-11-12 e81b2fb247612f5e2c7ef0c768bd70377f8c541c
优化代码
5个文件已修改
70 ■■■■■ 已修改文件
java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-front/src/main/java/com/java110/front/smo/payment/impl/GoodsToPaySMOImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/dao/IReportFeeMonthStatisticsServiceDao.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/dao/impl/ReportFeeMonthStatisticsServiceDaoImpl.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeMonthStatisticsInnerServiceSMOImpl.java 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml
@@ -1085,4 +1085,14 @@
        order by objCount desc
    </select>
    <select id="queryFinishOweFee" parameterType="Map" resultType="Map">
        select t.config_id configId, t.fee_id feeId,t.statistics_id statisticsId,t.fee_year feeYear,fee_month feeMonth
        from report_fee_month_statistics t
        inner join pay_fee pf on t.fee_id = pf.fee_id and pf.state = '2009001' and pf.community_id = #{communityId} and pf.status_cd = '0'
        where t.owe_amount > 0
        and t.status_cd = '0'
        and t.community_id = #{communityId}
    </select>
</mapper>
service-front/src/main/java/com/java110/front/smo/payment/impl/GoodsToPaySMOImpl.java
@@ -13,6 +13,7 @@
import com.java110.utils.constant.ServiceConstant;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.vo.ResultVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -77,6 +78,9 @@
            return responseEntity;
        }
        JSONObject orderInfo = JSONObject.parseObject(responseEntity.getBody().toString());
        if(orderInfo.getInteger("code") != ResultVo.CODE_OK){
            throw new IllegalArgumentException("下单失败:"+orderInfo.getString("msg"));
        }
        String orderId = orderInfo.getString("orderId");
        double money = Double.parseDouble(orderInfo.getString("payPrice"));
        String appType = OwnerAppUserDto.APP_TYPE_WECHAT_MINA;
service-report/src/main/java/com/java110/report/dao/IReportFeeMonthStatisticsServiceDao.java
@@ -202,4 +202,15 @@
    List<Map> queryOwePaymentCount(Map info) throws DAOException;
    /**
     * 查询 缴费已经结束 报表表还有欠费的数据
     * 根据bId 查询费用月统计信息
     *
     * @param info bId 信息
     * @return 费用月统计信息
     * @throws DAOException DAO异常
     */
    List<Map> queryFinishOweFee(Map info) throws DAOException;
}
service-report/src/main/java/com/java110/report/dao/impl/ReportFeeMonthStatisticsServiceDaoImpl.java
@@ -303,5 +303,13 @@
        return businessReportFeeMonthStatisticsInfos;
    }
    @Override
    public List<Map> queryFinishOweFee(Map info) throws DAOException {
        logger.debug("查询费用月统计信息 入参 info : {}", info);
        List<Map> businessReportFeeMonthStatisticsInfos = sqlSessionTemplate.selectList("reportFeeMonthStatisticsServiceDaoImpl.queryFinishOweFee", info);
        return businessReportFeeMonthStatisticsInfos;    }
}
service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeMonthStatisticsInnerServiceSMOImpl.java
@@ -24,10 +24,7 @@
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
 * @ClassName GeneratorFeeMonthStatisticsInnerServiceSMOImpl
@@ -74,6 +71,38 @@
        //处理车位费用
        dealCarFee(reportFeeMonthStatisticsPo);
        //处理缴费结束的情况
        dealFinishFee(communityId);
    }
    private void dealFinishFee(String communityId) {
        Map reportFeeDto = new HashMap();
        reportFeeDto.put("communityId", communityId);
        List<Map> feeDtos = reportFeeMonthStatisticsServiceDaoImpl.queryFinishOweFee(reportFeeDto);
        ReportFeeMonthStatisticsPo reportFeeMonthStatisticsPo = null;
        for (Map info : feeDtos) {
            try {
                Date tmpTime = DateUtil.getDateFromString(info.get("feeYear").toString() + "-" + info.get("feeMonth").toString() + "-01", DateUtil.DATE_FORMATE_STRING_B);
                Calendar c = Calendar.getInstance();
                c.setTime(tmpTime);
                c.add(Calendar.MONTH, 1);
                ReportFeeDetailDto feeDetailDto = new ReportFeeDetailDto();
                feeDetailDto.setStartTime(DateUtil.getFormatTimeString(tmpTime, DateUtil.DATE_FORMATE_STRING_A));
                feeDetailDto.setEndTime(DateUtil.getFormatTimeString(c.getTime(), DateUtil.DATE_FORMATE_STRING_A));
                feeDetailDto.setFeeId(info.get("feeId").toString());
                double receivedAmount = reportFeeServiceDaoImpl.getFeeReceivedAmount(feeDetailDto);
                reportFeeMonthStatisticsPo = new ReportFeeMonthStatisticsPo();
                reportFeeMonthStatisticsPo.setStatisticsId(info.get("statisticsId").toString());
                reportFeeMonthStatisticsPo.setReceivedAmount(receivedAmount + "");
                reportFeeMonthStatisticsPo.setOweAmount("0");
                reportFeeMonthStatisticsPo.setUpdateTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
                reportFeeMonthStatisticsServiceDaoImpl.updateReportFeeMonthStatisticsInfo(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsPo));
            } catch (Exception e) {
                logger.error("处理 缴费结束报表失败");
            }
        }
    }
    /**