| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.config.SmsProperties; |
| | | import com.ruoyi.common.constant.AmountConstant; |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.SmsUtil; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.TencentMailUtil; |
| | | import com.ruoyi.common.utils.*; |
| | | import com.ruoyi.common.utils.uuid.UUID; |
| | | import com.ruoyi.system.dto.*; |
| | | import com.ruoyi.system.mapper.TBillMapper; |
| | |
| | | throw new ServiceException("实付金额不能高于于流水可抵扣剩余金额"); |
| | | } |
| | | //如果实付金额大于欠费金额 |
| | | if (dto.getAmount().compareTo(bill.getOutstandingMoney())>=0){ |
| | | if (dto.getAmount().compareTo(bill.getOutstandingMoney())>0){ |
| | | throw new ServiceException("实付金额不能高于该账单欠费金额"); |
| | | } |
| | | |
| | |
| | | save.setPayType(3); |
| | | save.setPayer(dto.getPayer()); |
| | | save.setPayTime(bankflow.getPayTime()); |
| | | save.setSysSerialNumber(OrderNos.getDid(30)); |
| | | save.setBankSerialNumber(bankflow.getBankSerialNumber()); |
| | | save.setFlowType(2); |
| | | save.setPaymentBillId(back.getId()); |
| | |
| | | saveFlow.setPayType(1); |
| | | saveFlow.setPayer(order.getUserId()); |
| | | saveFlow.setPayTime(DateUtils.dateToLocalDateTime(save.getPayTime())); |
| | | saveFlow.setSysSerialNumber(OrderNos.getDid(30)); |
| | | saveFlow.setBankSerialNumber(save.getPayNo()); |
| | | saveFlow.setFlowType(2); |
| | | saveFlow.setPaymentBillId(bill.getId()); |
| | |
| | | int failNum = 0; |
| | | for (String billId : dto.getBillIds()) { |
| | | TBillDto bill = getDetailByBillId(billId); |
| | | if (bill.getSmsLastTime()!=null |
| | | if (bill.getSmsLastTime()!=null && bill.getSmsStatus()==1 |
| | | && (System.currentTimeMillis()-bill.getSmsLastTime().getTime()<smsUtil.getPro().getBillSmsDelayPeriod()*60*1000L)){ |
| | | throw new ServiceException("有账单最近一次发送的时间是:"+DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,bill.getSmsLastTime())); |
| | | } |
| | |
| | | int failNum = 0; |
| | | for (String billId : dto.getBillIds()) { |
| | | TBillDto bill = getDetailByBillId(billId); |
| | | if (bill.getMailLastTime()!=null |
| | | if (bill.getMailLastTime()!=null && bill.getMailStatus()==1 |
| | | && (System.currentTimeMillis()-bill.getMailLastTime().getTime()<mailUtil.getPro().getBillMailDelayPeriod()*60*1000L)){ |
| | | throw new ServiceException("有账单最近一次发送的时间是:"+DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,bill.getMailLastTime())); |
| | | } |
| | |
| | | throw new ServiceException("实付金额不能高于于流水可抵扣剩余金额"); |
| | | } |
| | | //如果实付金额大于欠费金额 |
| | | if (dto.getAmount().compareTo(bill.getOutstandingMoney())>=0){ |
| | | if (dto.getAmount().compareTo(bill.getOutstandingMoney())>0){ |
| | | throw new ServiceException("实付金额不能高于该账单欠费金额"); |
| | | } |
| | | } |
| | |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public BillStatisticsDto statistics() { |
| | | BillStatisticsDto dto = new BillStatisticsDto(); |
| | | dto.setRent(getBaseMapper().statisticsAllRent()); |
| | | dto.setNopay(getBaseMapper().statisticsNoPay()); |
| | | dto.setPayed(getBaseMapper().statisticsPayed()); |
| | | dto.setOverdue(getBaseMapper().statisticsOverdue()); |
| | | return dto; |
| | | } |
| | | |
| | | |
| | | } |