jiangping
2024-12-05 7fc504b2def4655c00d844833901ade562b27db8
开发更新
已修改1个文件
33 ■■■■■ 文件已修改
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractServiceImpl.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractServiceImpl.java
@@ -307,8 +307,8 @@
                .replace("{param3}",DateUtil.getDateLongSlash(model.getBtDate()))
                .replace("{param4}",fee.compareTo(new BigDecimal(0)) >=0?"收":"付")
                .replace("{param5}",(fee.compareTo(new BigDecimal(0)) >=0?
                        Constants.formatBigdecimal(model.getBtFee()).intValue()
                        :(Constants.formatBigdecimal(model.getBtFee()).intValue() * -1))+"" );
                        Constants.formatBigdecimal2Float(model.getBtFee()).intValue()
                        :(Constants.formatBigdecimal2Float(model.getBtFee()).intValue() * -1))+"" );
        return  str;
    }
    private String getbackRentLogByParam(YwContract model) {
@@ -410,7 +410,7 @@
                }
                if(Constants.equalsInteger(bill.getPayStatus(),Constants.ZERO)
                        ||Constants.equalsInteger(bill.getPayStatus(),Constants.THREE)){
                    if(bill.getStartDate().getTime()<param.getBtDate().getTime()){
                    if(bill.getStartDate().getTime()<=param.getBtDate().getTime()){
                        canBills.add(bill);
                    }else{
                        //如果还没开始,账单直接关闭
@@ -450,14 +450,14 @@
        BigDecimal totalBackFee = new BigDecimal(0);
        if(canBills.size()>0){
            //直接关闭关闭账单
            //
            for(YwContractBill b : canBills){
                BigDecimal fee = new BigDecimal(0);
                YwContractBill editBill = getEditBillFromListByParam(b,param.getCanBackRentBills());
                if(editBill != null){
                    //付款状态:0=待收款;1=已结清;2=部分结清;3=待付款;4=待退款;5=已关闭
                    //如果账单信息做了编辑,金额计算 实收金额 和 修改后应收金额作对比,判断是否应该退款
                    fee = Constants.formatBigdecimal(b.getActReceivableFee()).subtract(editBill.getReceivableFee());
                    fee = editBill.getReceivableFee().subtract(Constants.formatBigdecimal(b.getActReceivableFee()));
                    if(fee.compareTo(new BigDecimal(0))== 0){
                        //如果费用正好,则修改账单信息为已结清
                        b.setPayStatus(Constants.ONE);
@@ -495,13 +495,13 @@
                }
                if(Constants.equalsInteger(addBill.getBillType(),Constants.ZERO)){
                    //如果是收款
                    totalBackFee = totalBackFee.add(Constants.formatBigdecimal(addBill.getActReceivableFee()));
//                    totalBackFee = totalBackFee.add(Constants.formatBigdecimal(addBill.getActReceivableFee()));
                    addBill.setPayStatus(Constants.ZERO);
                    addBill.setBtFee(Constants.formatBigdecimal(addBill.getActReceivableFee()));
                    addBill.setBtFee(Constants.formatBigdecimal(addBill.getReceivableFee()));
                }else{
                    //如果是付款
                    addBill.setPayStatus(Constants.THREE);
                    addBill.setBtFee(Constants.formatBigdecimal(addBill.getActReceivableFee()).multiply(new BigDecimal(-1)));
                    addBill.setBtFee(Constants.formatBigdecimal(addBill.getReceivableFee()).multiply(new BigDecimal(-1)));
                }
                totalBackFee = totalBackFee.add(Constants.formatBigdecimal(addBill.getBtFee()));
                addBill.setEditDate(param.getEditDate());
@@ -530,12 +530,20 @@
                        yjBill.setEditDate(param.getEditDate());
                        yjBill.setEditor(param.getEditor());
                        yjBill.setReceivableFee(BigDecimal.ZERO);
                        if(Constants.formatBigdecimal(canBill.getActReceivableFee()).compareTo(new BigDecimal(0)) == 0){
                            //未支付的押金,直接关闭
                            yjBill.setStatus(Constants.ONE);
                            closeBills.add(yjBill);
                        }else{
                            yjBill.setBtFee(Constants.formatBigdecimal(canBill.getActReceivableFee()).multiply(new BigDecimal(-1)));
                        yjBill.setPayStatus(Constants.FOUR);
                        yjBill.setPlanPayDate(canBill.getPlanPayDate());
                            totalBackFee = totalBackFee.add(Constants.formatBigdecimal(yjBill.getBtFee()));
                            yjNoBills ++;
                        }
                        ywContractBillMapper.updateById(yjBill);
                    }
                }
                yjNoBills ++;
            }
        }
        param.setBtWaitBill(canBills.size() + newBills.size()+yjNoBills);//未清算的账单数量
@@ -1307,7 +1315,7 @@
        }
        model.setCanBackRentBills(new ArrayList<>());
        long nowStart = Utils.Date.getStart(date).getTime();
        long nowEnd = Utils.Date.getEnd(date).getTime();
        long nowEnd = Utils.Date.getDayEnd(date).getTime();
        if(model.getBillList()!=null && model.getBillList().size()>0){
            for(YwContractBill bill: model.getBillList()){
                //付款状态:0=待收款;1=已结清;2=部分结清;3=待付款;4=待退款;5=已关闭
@@ -1490,6 +1498,11 @@
            queryWrapper.ge(YwContract::getWyFreeEndDate, Utils.Date.getStart(pageWrap.getModel().getWyFreeEndDate()));
            queryWrapper.le(YwContract::getWyFreeEndDate, Utils.Date.getEnd(pageWrap.getModel().getWyFreeEndDate()));
        }
        if (pageWrap.getModel().getZlTotalFee() != null) {
            queryWrapper.eq(YwContract::getZlTotalFee, pageWrap.getModel().getZlTotalFee());
        }