| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.math.BigDecimal; |
| | |
| | | public Integer sendSmsByBillIds(SmsByBillDto dto) { |
| | | int failNum = 0; |
| | | for (String billId : dto.getBillIds()) { |
| | | TBillDto bill = getTenentByBillId(billId); |
| | | TBillDto bill = getDetailByBillId(billId); |
| | | if (bill.getSmsLastTime()!=null |
| | | && (System.currentTimeMillis()-bill.getSmsLastTime().getTime()<smsUtil.getPro().getBillSmsDelayPeriod()*60*1000L)){ |
| | | throw new ServiceException("有账单最近一次发送的时间是:"+DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,bill.getSmsLastTime())); |
| | |
| | | public Integer sendMailBatchByBillIds(SmsByBillDto dto) { |
| | | int failNum = 0; |
| | | for (String billId : dto.getBillIds()) { |
| | | TBillDto bill = getTenentByBillId(billId); |
| | | TBillDto bill = getDetailByBillId(billId); |
| | | if (bill.getSmsLastTime()!=null |
| | | && (System.currentTimeMillis()-bill.getSmsLastTime().getTime()<smsUtil.getPro().getBillMailDelayPeriod()*60*1000L)){ |
| | | throw new ServiceException("有账单最近一次发送的时间是:"+DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,bill.getSmsLastTime())); |
| | |
| | | return failNum; |
| | | } |
| | | |
| | | private TBillDto getTenentByBillId(String billId) { |
| | | return getBaseMapper().selectTenentByBillId(billId); |
| | | public TBillDto getDetailByBillId(@NotEmpty String billId) { |
| | | return getBaseMapper().selectDetailByBillId(billId); |
| | | } |
| | | |
| | | |