| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.constant.AmountConstant; |
| | |
| | | import com.ruoyi.system.mapper.TBillMapper; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.TBillQuery; |
| | | import com.ruoyi.system.query.TInvoiceToBillQuery; |
| | | import com.ruoyi.system.service.*; |
| | | import com.taxi591.bankapi.dto.ChargeBillRequest; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.util.Collections; |
| | | import java.util.Comparator; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.function.Consumer; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Autowired |
| | | TOrderBillService orderBillService; |
| | | |
| | | @Autowired |
| | | TInvoiceToBillService tInvoiceToBillService; |
| | | |
| | | public PageInfo<TBillDto> queryPage(TBillQuery query){ |
| | | PageInfo<TBill> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | PageInfo<TBillDto> info = tBillMapper.page(pageInfo, query); |
| | | return info; |
| | | } |
| | | |
| | | @Override |
| | | public List<String> getBillIds(TBillQuery query) { |
| | | List<TBillDto> billDtos = tBillMapper.getBillList(query); |
| | | return billDtos.stream().map(TBillDto::getId).collect(Collectors.toList()); |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<TBillDto> invoiceList(TBillQuery query) { |
| | | PageInfo<TBillDto> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TBillDto> list = tBillMapper.invoiceList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | private static final String[] ignorePro = {"payableFeesMoney","payableFeesPenalty","payFeesMoney","outstandingMoney"}; |
| | | |
| | |
| | | TFlowManagement save = new TFlowManagement(); |
| | | save.setPayType(3); |
| | | save.setPayer(dto.getPayer()); |
| | | save.setPayTime(dto.getPayTime()==null?confirm.getPayTime():dto.getPayTime()); |
| | | save.setPayTime(dto.getPayTime()==null?DateUtils.dateToLocalDateTime(confirm.getPayTime()):dto.getPayTime()); |
| | | save.setBankSerialNumber(dto.getBankSerilNum()); |
| | | save.setFlowType(2); |
| | | save.setPaymentBillId(bill.getId()); |
| | |
| | | TBankFlow bankFlow = new TBankFlow(); |
| | | bankFlow.setPayType(3); |
| | | bankFlow.setPayer(dto.getPayer()); |
| | | bankFlow.setPayTime(dto.getPayTime()==null?confirm.getPayTime():dto.getPayTime()); |
| | | bankFlow.setPayTime(dto.getPayTime()==null?DateUtils.dateToLocalDateTime(confirm.getPayTime()):dto.getPayTime()); |
| | | bankFlow.setBankSerialNumber(dto.getBankSerilNum()); |
| | | bankFlow.setFlowMoney(dto.getAmount()); |
| | | bankFlow.setFlowStatus(1); |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 根据发票编号查询账单列表 |
| | | * @param invoiceId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageInfo<TBill> getBillByInvoiceId(String invoiceId){ |
| | | invoiceId = "1889552849671061505"; |
| | | PageInfo<TBill> pageInfo = new PageInfo<>(); |
| | | ArrayList<TBill> bills = new ArrayList<>(); |
| | | TInvoiceToBillQuery query = new TInvoiceToBillQuery(); |
| | | query.setInvoiceId(invoiceId); |
| | | List<TInvoiceToBill> tInvoiceToBills = tInvoiceToBillService.makeQuery(query); |
| | | for (TInvoiceToBill tInvoiceToBill : tInvoiceToBills) { |
| | | TBill byId = getById(tInvoiceToBill.getBillId()); |
| | | bills.add(byId); |
| | | } |
| | | pageInfo.setRecords(bills); |
| | | return pageInfo; |
| | | } |
| | | |
| | | |
| | | } |